![]() |
NanoXLSX.Formatting 3.0.0
|
Represents a formatted text entry in Excel shared strings, supporting rich text with multiple runs and inline styles. More...
Public Member Functions | |
| FormattedText | AddRun (string text, Font fontStyle=null) |
| Adds a text run with the specified style. | |
| FormattedText | AddRun (string text, Action< InlineStyleBuilder > styleBuilder) |
| Adds a text run using a style builder for inline configuration. | |
| void | AddLineBreak (bool useStyleFromLastRun=true) |
| Adds a line break to the formatted text. By default, the last run's style is used. | |
| FormattedText | AddPhoneticRun (string text, uint startBase, uint endBase) |
| Adds a phonetic run for pronunciation guidance (Ruby text, like Furigana, Pinyin or Zhuyin). | |
| FormattedText | SetPhoneticProperties (Font fontReference, PhoneticRun.PhoneticType type=PhoneticRun.PhoneticType.FullwidthKatakana, PhoneticRun.PhoneticAlignment alignment=PhoneticRun.PhoneticAlignment.Left) |
| Sets the phonetic properties for this formatted text, applied to the phonetic run (Ruby text). | |
| void | Clear () |
| Clears all runs from this formatted text. | |
| FormattedText | Copy () |
| Creates a deep copy of this FormattedText instance. | |
| override string | ToString () |
| Gets the string representation of the formatted text without formatting (plain text). The method is synonymous to the PlainText property. | |
| override bool | Equals (object obj) |
| Equals method override for comparing two FormattedText instances. | |
| override int | GetHashCode () |
| GetHashCode method override for FormattedText. | |
Static Public Attributes | |
| static readonly Style | LineBreakStyle |
| Style to be used for line breaks in formatted text. | |
Properties | |
| bool | WrapText [get, set] |
| Gets or sets whether the runs should be rendered with text wrapping, if there are line breaks present. | |
| IReadOnlyList< TextRun > | Runs [get] |
| The list of text runs in this formatted text. | |
| IReadOnlyList< PhoneticRun > | PhoneticRuns [get] |
| The list of phonetic runs (Ruby text) in this formatted text. | |
| PhoneticProperties | PhoneticProperties [get, set] |
| Phonetic properties for the formatted text (Phonetic run / Ruby text). | |
| string | PlainText [get] |
| Gets the plain text content by concatenating all runs. | |
Represents a formatted text entry in Excel shared strings, supporting rich text with multiple runs and inline styles.
Definition at line 25 of file FormattedText.cs.
| void NanoXLSX.FormattedText.AddLineBreak | ( | bool | useStyleFromLastRun = true | ) |
Adds a line break to the formatted text. By default, the last run's style is used.
| useStyleFromLastRun | If set to false, a new run without style will be created for the line break |
Definition at line 127 of file FormattedText.cs.
| FormattedText NanoXLSX.FormattedText.AddPhoneticRun | ( | string | text, |
| uint | startBase, | ||
| uint | endBase ) |
Adds a phonetic run for pronunciation guidance (Ruby text, like Furigana, Pinyin or Zhuyin).
| text | The phonetic text (Ruby text) |
| startBase | The start index of the base text (character where the Ruby text starts) |
| endBase | The end index of the base text (character where the Ruby text ends) |
Definition at line 147 of file FormattedText.cs.
| FormattedText NanoXLSX.FormattedText.AddRun | ( | string | text, |
| Action< InlineStyleBuilder > | styleBuilder ) |
Adds a text run using a style builder for inline configuration.
| text | The text content of the run |
| styleBuilder | An action to configure the inline style using an InlineStyleBuilder |
Definition at line 110 of file FormattedText.cs.
| FormattedText NanoXLSX.FormattedText.AddRun | ( | string | text, |
| Font | fontStyle = null ) |
Adds a text run with the specified style.
| text | The text content of the run |
| fontStyle | The font style to apply to the run (optional) |
Definition at line 93 of file FormattedText.cs.
| void NanoXLSX.FormattedText.Clear | ( | ) |
Clears all runs from this formatted text.
Definition at line 173 of file FormattedText.cs.
| FormattedText NanoXLSX.FormattedText.Copy | ( | ) |
Creates a deep copy of this FormattedText instance.
Definition at line 185 of file FormattedText.cs.
| override bool NanoXLSX.FormattedText.Equals | ( | object | obj | ) |
Equals method override for comparing two FormattedText instances.
| obj | Other object to compare |
Definition at line 512 of file FormattedText.cs.
| override int NanoXLSX.FormattedText.GetHashCode | ( | ) |
GetHashCode method override for FormattedText.
Definition at line 528 of file FormattedText.cs.
| FormattedText NanoXLSX.FormattedText.SetPhoneticProperties | ( | Font | fontReference, |
| PhoneticRun.PhoneticType | type = PhoneticRun::PhoneticType::FullwidthKatakana, | ||
| PhoneticRun.PhoneticAlignment | alignment = PhoneticRun::PhoneticAlignment::Left ) |
Sets the phonetic properties for this formatted text, applied to the phonetic run (Ruby text).
| fontReference | The font reference that is used to render the phonetic run (Ruby text) |
| type | The phonetic type |
| alignment | The phonetic alignment |
Definition at line 160 of file FormattedText.cs.
| override string NanoXLSX.FormattedText.ToString | ( | ) |
Gets the string representation of the formatted text without formatting (plain text). The method is synonymous to the PlainText property.
Definition at line 208 of file FormattedText.cs.
|
static |
Style to be used for line breaks in formatted text.
Definition at line 44 of file FormattedText.cs.
|
getset |
Phonetic properties for the formatted text (Phonetic run / Ruby text).
Definition at line 77 of file FormattedText.cs.
|
get |
The list of phonetic runs (Ruby text) in this formatted text.
Definition at line 73 of file FormattedText.cs.
|
get |
Gets the plain text content by concatenating all runs.
Definition at line 82 of file FormattedText.cs.
|
get |
The list of text runs in this formatted text.
Definition at line 69 of file FormattedText.cs.
|
getset |
Gets or sets whether the runs should be rendered with text wrapping, if there are line breaks present.
Definition at line 64 of file FormattedText.cs.