Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OfficeRichTextRun

Namespace OfficeIMO.Drawing
Assembly OfficeIMO.Core
Modifiers sealed

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.

Constructors

OfficeRichTextRun 3 overloads
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 requiredposition: 0
fontSize System.Double requiredposition: 1
color OfficeIMO.Drawing.OfficeColor requiredposition: 2
bold System.Boolean requiredposition: 3
italic System.Boolean requiredposition: 4
underline System.Boolean requiredposition: 5
fontFamily System.String requiredposition: 6
strikethrough System.Boolean requiredposition: 7
backgroundColor System.Nullable{OfficeIMO.Drawing.OfficeColor} requiredposition: 8
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 requiredposition: 0
Run text.
fontSize System.Double requiredposition: 1
Font size used for measurement and rendering.
color OfficeIMO.Drawing.OfficeColor requiredposition: 2
Text color.
bold System.Boolean = false optionalposition: 3
Whether the run should render as bold.
italic System.Boolean = false optionalposition: 4
Whether the run should render as italic.
underline System.Boolean = false optionalposition: 5
Whether the run should render with underline.
fontFamily System.String = null optionalposition: 6
Preferred font family for SVG or future font-aware renderers.
strikethrough System.Boolean = false optionalposition: 7
Whether the run should render with strikethrough.
backgroundColor System.Nullable{OfficeIMO.Drawing.OfficeColor} = null optionalposition: 8
Optional run background/highlight color.
underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optionalposition: 9
Underline pattern. A non-none value takes precedence over underline.
strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optionalposition: 10
Strikethrough pattern. A non-none value takes precedence over strikethrough.
baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal optionalposition: 11
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 requiredposition: 0
Run text.
fontSize System.Double requiredposition: 1
Font size used for measurement and rendering.
color OfficeIMO.Drawing.OfficeColor requiredposition: 2
Text color.
bold System.Boolean requiredposition: 3
Whether the run should render as bold.
italic System.Boolean requiredposition: 4
Whether the run should render as italic.
underline System.Boolean requiredposition: 5
Whether the run should render with underline.
fontFamily System.String requiredposition: 6
Preferred font family.
strikethrough System.Boolean requiredposition: 7
Whether the run should render with strikethrough.
backgroundColor System.Nullable{OfficeIMO.Drawing.OfficeColor} requiredposition: 8
Optional run background color.
underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 9
Underline pattern.
strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle requiredposition: 10
Strikethrough pattern.
baseline OfficeIMO.Drawing.OfficeTextBaseline requiredposition: 11
Vertical baseline placement.
paragraphIndent System.Nullable{OfficeIMO.Drawing.OfficeTextParagraphIndent} requiredposition: 12
Indentation for a paragraph beginning at this run or after its line break.

Methods

public OfficeRichTextRun WithParagraphIndent(OfficeTextParagraphIndent paragraphIndent) #
Returns: OfficeRichTextRun

Creates a styled copy that starts a paragraph with its own indentation.

Parameters

paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent requiredposition: 0
public OfficeRichTextRun WithTextCase(OfficeTextCase textCase, CultureInfo culture = null) #
Returns: OfficeRichTextRun

Creates a copy with transformed text casing while preserving all drawing styles.

Parameters

textCase OfficeIMO.Drawing.OfficeTextCase requiredposition: 0
culture System.Globalization.CultureInfo = null optionalposition: 1

Properties

public String Text { get; } #

Gets the run text.

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.