OfficeRichTextRun
OfficeIMO.Drawing
Describes one styled text run for shared rich text layout and rendering.
Inheritance
- object
- OfficeRichTextRun
Usage
Explore 15 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 7
Accepted by parameters 8
- Method OfficeDrawing.AddRichText
- Method OfficeDrawing.AddRichTextBehindContent
- Constructor OfficeDrawingRichText.OfficeDrawingRichText
- Constructor OfficeRichTextParagraph.OfficeRichTextParagraph
- Method OfficeTextLayoutEngine.LayoutRichTextBlock
- Method OfficeTextLayoutEngine.LayoutStackedRichTextBlock
- Method OfficeTextParagraphLabel.AtPosition
- Method OfficeTextParagraphLabel.InBox
Constructors
public OfficeRichTextRun(string? text, double fontSize, OfficeColor color, bool bold, bool italic, bool underline, string? fontFamily, bool strikethrough, OfficeColor? backgroundColor) #Creates a styled text run using the pre-typography constructor signature.
Parameters
- text string?
- fontSize double
- color OfficeIMO.OfficeColor
- bold bool
- italic bool
- underline bool
- fontFamily string?
- strikethrough bool
- backgroundColor OfficeIMO.OfficeColor?
public OfficeRichTextRun(string? text, double fontSize, OfficeColor color, bool bold = false, bool italic = false, bool underline = false, string? fontFamily = null, bool strikethrough = false, OfficeColor? backgroundColor = null, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikethroughStyle = None, OfficeTextBaseline baseline = Normal) #Creates a styled text run.
Parameters
- text string?
- Run text.
- fontSize double
- Font size used for measurement and rendering.
- color OfficeIMO.OfficeColor
- Text color.
- bold bool = false
- Whether the run should render as bold.
- italic bool = false
- Whether the run should render as italic.
- underline bool = false
- Whether the run should render with underline.
- fontFamily string? = null
- Preferred font family for SVG or future font-aware renderers.
- strikethrough bool = false
- Whether the run should render with strikethrough.
- backgroundColor OfficeIMO.OfficeColor? = null
- Optional run background/highlight color.
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- Underline pattern. A non-none value takes precedence over underline.
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None
- Strikethrough pattern. A non-none value takes precedence over strikethrough.
- baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal
- Vertical baseline placement.
public OfficeRichTextRun(string? text, double fontSize, OfficeColor color, bool bold, bool italic, bool underline, string? fontFamily, bool strikethrough, OfficeColor? backgroundColor, OfficeTextDecorationStyle underlineStyle, OfficeTextDecorationStyle strikethroughStyle, OfficeTextBaseline baseline, OfficeTextParagraphIndent? paragraphIndent) #Creates a styled text run with an optional per-paragraph indentation override.
Parameters
- text string?
- Run text.
- fontSize double
- Font size used for measurement and rendering.
- color OfficeIMO.OfficeColor
- Text color.
- bold bool
- Whether the run should render as bold.
- italic bool
- Whether the run should render as italic.
- underline bool
- Whether the run should render with underline.
- fontFamily string?
- Preferred font family.
- strikethrough bool
- Whether the run should render with strikethrough.
- backgroundColor OfficeIMO.OfficeColor?
- Optional run background color.
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
- Underline pattern.
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
- Strikethrough pattern.
- baseline OfficeIMO.Drawing.OfficeTextBaseline
- Vertical baseline placement.
- paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent?
- Indentation for a paragraph beginning at this run or after its line break.
Methods
public OfficeRichTextRun WithAutomaticPairKerningThreshold(double? thresholdPoints) #Returns an independent run with a native pair-kerning threshold. Null leaves the setting unspecified; zero explicitly disables it.
Parameters
- thresholdPoints double?
- A finite, nonnegative point size, or null. A native writer may impose a narrower representable range.
Returns
OfficeRichTextRunpublic OfficeRichTextRun WithLanguageId(uint? languageId) #Creates a copy with an explicit 16-bit language identifier, or an unspecified language when null. All text, styling and annotations are retained.
Parameters
- languageId uint?
Returns
OfficeRichTextRunpublic OfficeRichTextRun WithParagraphIndent(OfficeTextParagraphIndent paragraphIndent) #Creates a styled copy that starts a paragraph with its own indentation.
Parameters
- paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent
Returns
OfficeRichTextRunpublic OfficeRichTextRun WithTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #Creates a copy with transformed text casing while preserving all drawing styles.
Parameters
- textCase OfficeIMO.Drawing.OfficeTextCase
- culture System.Globalization.CultureInfo? = null
Returns
OfficeRichTextRunInherited Methods
Properties
public double? AutomaticPairKerningThreshold { get; internal set; } #Native automatic pair-kerning threshold, in points. Zero disables pair kerning; null leaves the native setting unspecified.
public bool Underline { get; } #Gets whether the run should render with underline.
public OfficeTextDecorationStyle UnderlineStyle { get; } #Gets the underline line pattern.
public bool Strikethrough { get; } #Gets whether the run should render with strikethrough.
public OfficeTextDecorationStyle StrikethroughStyle { get; } #Gets the strikethrough line pattern.
public OfficeTextBaseline Baseline { get; } #Gets the vertical baseline placement.
public double EffectiveFontSize { get; } #Gets the effective font size used for measuring and rendering this run.
public string FontFamily { get; } #Gets the preferred font family for SVG or future font-aware renderers.
public OfficeColor? BackgroundColor { get; } #Gets the optional run background/highlight color.
public OfficeTextParagraphIndent? ParagraphIndent { get; } #Optional first-line and continuation offsets for the paragraph beginning at this run.
public uint? LanguageId { get; internal set; } #Optional Windows language identifier for native document adapters. Null leaves language unspecified; it does not request removal of an imported override. When an adapter enables automatic hyphenation, supported language identifiers select the shared versioned pattern resources.