NanoXLSX.Formatting 3.0.0
Loading...
Searching...
No Matches
NanoXLSX.Extensions.FormattedTextBuilder Class Reference

Builder for creating formatted text entries with a fluent API. More...

Public Member Functions

FormattedTextBuilder AddRun (string text, Font font=null)
 Adds a text run with an optional style to the formatted text.
FormattedTextBuilder AddRun (string text, Action< InlineStyleBuilder > styleBuilder)
 Adds a text run with a style defined by a style builder action.
FormattedTextBuilder AddPhoneticRun (string text, uint startBase, uint endBase)
 Adds a phonetic run to the formatted text.
FormattedTextBuilder SetPhoneticProperties (Font fontReference, PhoneticRun.PhoneticType type=PhoneticRun.PhoneticType.FullwidthKatakana, PhoneticRun.PhoneticAlignment alignment=PhoneticRun.PhoneticAlignment.Left)
 Sets the phonetic properties for the formatted text.
FormattedText Build ()
 Method to build the formatted text instance.

Static Public Member Functions

static implicit operator FormattedText (FormattedTextBuilder builder)
 Implicit conversion operator to convert the builder to a FormattedText instance.

Detailed Description

Builder for creating formatted text entries with a fluent API.

Definition at line 16 of file FormattedTextBuilder.cs.

Member Function Documentation

◆ AddPhoneticRun()

FormattedTextBuilder NanoXLSX.Extensions.FormattedTextBuilder.AddPhoneticRun ( string text,
uint startBase,
uint endBase )

Adds a phonetic run to the formatted text.

Parameters
textThe phonetic text to be displayed (Ruby text,like Furigana, Pinyin or Zhuyin)
startBaseThe start index of the base text (character where the Ruby text starts)
endBaseThe end index of the base text (character where the Ruby text ends)
Returns
The current builder instance

Definition at line 51 of file FormattedTextBuilder.cs.

◆ AddRun() [1/2]

FormattedTextBuilder NanoXLSX.Extensions.FormattedTextBuilder.AddRun ( string text,
Action< InlineStyleBuilder > styleBuilder )

Adds a text run with a style defined by a style builder action.

Parameters
textPlain text of the run
styleBuilderAction to build the inline style
Returns
The current builder instance

Definition at line 38 of file FormattedTextBuilder.cs.

◆ AddRun() [2/2]

FormattedTextBuilder NanoXLSX.Extensions.FormattedTextBuilder.AddRun ( string text,
Font font = null )

Adds a text run with an optional style to the formatted text.

Parameters
textPlain text of the run
fontFont style
Returns
The current builder instance

Definition at line 26 of file FormattedTextBuilder.cs.

◆ Build()

FormattedText NanoXLSX.Extensions.FormattedTextBuilder.Build ( )

Method to build the formatted text instance.

Returns
The constructed FormattedText instance

Definition at line 74 of file FormattedTextBuilder.cs.

◆ operator FormattedText()

implicit NanoXLSX.Extensions.FormattedTextBuilder.operator FormattedText ( FormattedTextBuilder builder)
static

Implicit conversion operator to convert the builder to a FormattedText instance.

Parameters
builderThe FormattedTextBuilder instance

Definition at line 83 of file FormattedTextBuilder.cs.

◆ SetPhoneticProperties()

FormattedTextBuilder NanoXLSX.Extensions.FormattedTextBuilder.SetPhoneticProperties ( Font fontReference,
PhoneticRun.PhoneticType type = PhoneticRun::PhoneticType::FullwidthKatakana,
PhoneticRun.PhoneticAlignment alignment = PhoneticRun::PhoneticAlignment::Left )

Sets the phonetic properties for the formatted text.

Parameters
fontReferenceFont reference that is used to render the Ruby text
typePhonetic type
alignmentPhonetic alignment
Returns
The current builder instance

Definition at line 64 of file FormattedTextBuilder.cs.


The documentation for this class was generated from the following file: