API Reference
OfficeRichTextRun
Describes one styled text run for shared rich text layout and rendering.
Inheritance
- Object
- OfficeRichTextRun
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Property OfficeCallout.RichTextRuns
- Property OfficeDrawingRichText.Runs
- Method OfficeRichTextRun.WithParagraphIndent
- Method OfficeRichTextRun.WithTextCase
Accepted by parameters
- Constructor OfficeCallout.OfficeCallout
- Method OfficeDrawing.AddRichText
- Method OfficeDrawing.AddRichTextBehindContent
- Constructor OfficeDrawingRichText.OfficeDrawingRichText
- Method OfficeTextLayoutEngine.LayoutRichTextBlock
- Method OfficeTextLayoutEngine.LayoutRichTextBlock
- Method OfficeTextLayoutEngine.LayoutRichTextBlock
- Method OfficeTextLayoutEngine.LayoutRichTextBlock
- Method OfficeTextLayoutEngine.LayoutRichTextBlock
- Method OfficeTextLayoutEngine.LayoutStackedRichTextBlock
- Method OfficeTextLayoutEngine.LayoutStackedRichTextBlock
Constructors
public OfficeRichTextRun(String text, Double fontSize, OfficeColor color, Boolean bold, Boolean italic, Boolean underline, String fontFamily, Boolean strikethrough, Nullable<OfficeColor> backgroundColor) #Creates a styled text run using the pre-typography constructor signature.
Parameters
- text System.String
- fontSize System.Double
- color OfficeIMO.Drawing.OfficeColor
- bold System.Boolean
- italic System.Boolean
- underline System.Boolean
- fontFamily System.String
- strikethrough System.Boolean
- backgroundColor System.Nullable{OfficeIMO.Drawing.OfficeColor}
public OfficeRichTextRun(String text, Double fontSize, OfficeColor color, Boolean bold = false, Boolean italic = false, Boolean underline = false, String fontFamily = null, Boolean strikethrough = false, Nullable<OfficeColor> backgroundColor = null, OfficeTextDecorationStyle underlineStyle = None, OfficeTextDecorationStyle strikethroughStyle = None, OfficeTextBaseline baseline = Normal) #Creates a styled text run.
Parameters
- text System.String
- Run text.
- fontSize System.Double
- Font size used for measurement and rendering.
- color OfficeIMO.Drawing.OfficeColor
- Text color.
- bold System.Boolean = false
- Whether the run should render as bold.
- italic System.Boolean = false
- Whether the run should render as italic.
- underline System.Boolean = false
- Whether the run should render with underline.
- fontFamily System.String = null
- Preferred font family for SVG or future font-aware renderers.
- strikethrough System.Boolean = false
- Whether the run should render with strikethrough.
- backgroundColor System.Nullable{OfficeIMO.Drawing.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, Boolean bold, Boolean italic, Boolean underline, String fontFamily, Boolean strikethrough, Nullable<OfficeColor> backgroundColor, OfficeTextDecorationStyle underlineStyle, OfficeTextDecorationStyle strikethroughStyle, OfficeTextBaseline baseline, Nullable<OfficeTextParagraphIndent> paragraphIndent) #Creates a styled text run with an optional per-paragraph indentation override.
Parameters
- text System.String
- Run text.
- fontSize System.Double
- Font size used for measurement and rendering.
- color OfficeIMO.Drawing.OfficeColor
- Text color.
- bold System.Boolean
- Whether the run should render as bold.
- italic System.Boolean
- Whether the run should render as italic.
- underline System.Boolean
- Whether the run should render with underline.
- fontFamily System.String
- Preferred font family.
- strikethrough System.Boolean
- Whether the run should render with strikethrough.
- backgroundColor System.Nullable{OfficeIMO.Drawing.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 System.Nullable{OfficeIMO.Drawing.OfficeTextParagraphIndent}
- Indentation for a paragraph beginning at this run or after its line break.
Methods
public OfficeRichTextRun WithParagraphIndent(OfficeTextParagraphIndent paragraphIndent) #OfficeRichTextRunCreates a styled copy that starts a paragraph with its own indentation.
Parameters
- paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent
public OfficeRichTextRun WithTextCase(OfficeTextCase textCase, CultureInfo culture = null) #OfficeRichTextRunCreates a copy with transformed text casing while preserving all drawing styles.
Parameters
- textCase OfficeIMO.Drawing.OfficeTextCase
- culture System.Globalization.CultureInfo = null
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public Double FontSize { get; } #Gets the run font size.
public OfficeColor Color { get; } #Gets the run text color.
public Boolean Bold { get; } #Gets whether the run should render as bold.
public Boolean Italic { get; } #Gets whether the run should render as italic.
public Boolean Underline { get; } #Gets whether the run should render with underline.
public OfficeTextDecorationStyle UnderlineStyle { get; } #Gets the underline line pattern.
public Boolean 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 Nullable<OfficeColor> BackgroundColor { get; } #Gets the optional run background/highlight color.
public Nullable<OfficeTextParagraphIndent> ParagraphIndent { get; } #Optional first-line and continuation offsets for the paragraph beginning at this run.