API Reference
OfficeRichTextRun
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 6
- Property OfficeCallout.RichTextRuns
- Property OfficeDrawingRichText.Runs
- Property OfficeRichTextParagraph.Runs
- Method OfficeRichTextRun.WithParagraphIndent
- Method OfficeRichTextRun.WithTextCase
- Property OfficeTextParagraphLabel.Run
Accepted by parameters 9
- Constructor OfficeCallout.OfficeCallout
- 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, Boolean bold, Boolean italic, Boolean underline, String? fontFamily, Boolean strikethrough, 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 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, 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 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, OfficeColor? backgroundColor, OfficeTextDecorationStyle underlineStyle, OfficeTextDecorationStyle strikethroughStyle, OfficeTextBaseline baseline, 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 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 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 virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
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 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.