Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeRichTextRun

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

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.

Accepted by parameters 8

Constructors

OfficeRichTextRun 3 overloads
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? required
fontSize double required
color OfficeIMO.OfficeColor required
bold bool required
italic bool required
underline bool required
fontFamily string? required
strikethrough bool required
backgroundColor OfficeIMO.OfficeColor? required
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? required
Run text.
fontSize double required
Font size used for measurement and rendering.
color OfficeIMO.OfficeColor required
Text color.
bold bool = false optional
Whether the run should render as bold.
italic bool = false optional
Whether the run should render as italic.
underline bool = false optional
Whether the run should render with underline.
fontFamily string? = null optional
Preferred font family for SVG or future font-aware renderers.
strikethrough bool = false optional
Whether the run should render with strikethrough.
backgroundColor OfficeIMO.OfficeColor? = null optional
Optional run background/highlight color.
underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional
Underline pattern. A non-none value takes precedence over underline.
strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle = None optional
Strikethrough pattern. A non-none value takes precedence over strikethrough.
baseline OfficeIMO.Drawing.OfficeTextBaseline = Normal optional
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? required
Run text.
fontSize double required
Font size used for measurement and rendering.
color OfficeIMO.OfficeColor required
Text color.
bold bool required
Whether the run should render as bold.
italic bool required
Whether the run should render as italic.
underline bool required
Whether the run should render with underline.
fontFamily string? required
Preferred font family.
strikethrough bool required
Whether the run should render with strikethrough.
backgroundColor OfficeIMO.OfficeColor? required
Optional run background color.
underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required
Underline pattern.
strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required
Strikethrough pattern.
baseline OfficeIMO.Drawing.OfficeTextBaseline required
Vertical baseline placement.
paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent? required
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? required
A finite, nonnegative point size, or null. A native writer may impose a narrower representable range.
public 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? required
public OfficeRichTextRun WithParagraphIndent(OfficeTextParagraphIndent paragraphIndent) #

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

Parameters

paragraphIndent OfficeIMO.Drawing.OfficeTextParagraphIndent required
public OfficeRichTextRun WithTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #

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

Parameters

textCase OfficeIMO.Drawing.OfficeTextCase required
culture System.Globalization.CultureInfo? = null optional

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 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 bool Bold { get; } #

Gets whether the run should render as bold.

public bool Italic { get; } #

Gets whether the run should render as italic.

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.