Class OdfTextRun
Represents a text run (span) within a paragraph. 表示段落中的文字片段(Span)。
public class OdfTextRun
- Inheritance
-
OdfTextRun
- Inherited Members
Properties
BackgroundColor
Gets or sets the text run's background color. 取得或設定文字片段的背景色。
public string? BackgroundColor { get; set; }
Property Value
Color
Gets or sets the text run's font color. 取得或設定文字片段的字色。
public string? Color { get; set; }
Property Value
FontName
Gets or sets the text run's Western font name. 取得或設定文字片段的西文字型名稱。
public string? FontName { get; set; }
Property Value
FontNameAsian
Gets or sets the text run's East Asian (CJK) font name. 取得或設定文字片段的東亞(中日韓)字型名稱。
public string? FontNameAsian { get; set; }
Property Value
FontNameComplex
Gets or sets the text run's complex script font name. 取得或設定文字片段的複雜文字字型名稱。
public string? FontNameComplex { get; set; }
Property Value
FontSize
Gets or sets the text run's Western font size. 取得或設定文字片段的西文字型大小。
public string? FontSize { get; set; }
Property Value
FontSizeAsian
Gets or sets the text run's East Asian (CJK) font size. 取得或設定文字片段的東亞(中日韓)字型大小。
public string? FontSizeAsian { get; set; }
Property Value
FontSizeComplex
Gets or sets the text run's complex script font size. 取得或設定文字片段的複雜文字字型大小。
public string? FontSizeComplex { get; set; }
Property Value
FontVariant
Gets or sets the font variant, e.g. small-caps.
取得或設定字型變體,例如 small-caps。
public string? FontVariant { get; set; }
Property Value
IsBold
Gets or sets a value indicating whether the text run is bold. 取得或設定一個值,指出文字片段是否為粗體。
public bool IsBold { get; set; }
Property Value
IsItalic
Gets or sets a value indicating whether the text run is italic. 取得或設定一個值,指出文字片段是否為斜體。
public bool IsItalic { get; set; }
Property Value
IsStrikethrough
Gets or sets a value indicating whether the text run has strikethrough. 取得或設定一個值,指出文字片段是否加上刪除線。
public bool IsStrikethrough { get; set; }
Property Value
IsSubscript
Gets or sets a value indicating whether the text run is subscript. 取得或設定一個值,指出文字片段是否為下標。
public bool IsSubscript { get; set; }
Property Value
IsSuperscript
Gets or sets a value indicating whether the text run is superscript. 取得或設定一個值,指出文字片段是否為上標。
public bool IsSuperscript { get; set; }
Property Value
IsUnderline
Gets or sets a value indicating whether the text run is underlined. 取得或設定一個值,指出文字片段是否加上底線。
public bool IsUnderline { get; set; }
Property Value
StyleName
Gets or sets the text run's style name. 取得或設定文字片段的樣式名稱。
public string? StyleName { get; set; }
Property Value
Text
Gets or sets the text run's content. 取得或設定文字片段的內文。
public string Text { get; set; }
Property Value
TextPosition
Gets or sets the text run's position, e.g. baseline, super, or sub.
取得或設定文字片段的位置,例如 baseline、super 或 sub。
public string? TextPosition { get; set; }
Property Value
TextTransform
Gets or sets the text case transform, e.g. uppercase.
取得或設定文字大小寫轉換,例如 uppercase。
public string? TextTransform { get; set; }
Property Value
Methods
Delete()
Deletes this text run. 刪除此文字片段。
public void Delete()
SetFont(string)
Short overload of SetFont that accepts westernFont; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 westernFont;其餘可選參數使用預設值並轉呼叫最長 SetFont 多載。
public void SetFont(string westernFont)
Parameters
westernFontstring
SetFont(string, string?)
Short overload of SetFont that accepts westernFont and asianFont; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 westernFont 與 asianFont;其餘可選參數使用預設值並轉呼叫最長 SetFont 多載。
public void SetFont(string westernFont, string? asianFont)
Parameters
SetFont(string, string?, string?)
Sets the text run's font names. 設定文字片段的字型名稱。
public void SetFont(string westernFont, string? asianFont, string? complexFont)
Parameters
westernFontstringThe Western font name. / 西文字型名稱。
asianFontstringThe East Asian (CJK) font name. / 東亞(中日韓)字型名稱。
complexFontstringThe complex script font name. / 複雜文字字型名稱。
SetFontSize(string)
Short overload of SetFontSize that accepts westernSize; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 westernSize;其餘可選參數使用預設值並轉呼叫最長 SetFontSize 多載。
public void SetFontSize(string westernSize)
Parameters
westernSizestring
SetFontSize(string, string?)
Short overload of SetFontSize that accepts westernSize and asianSize; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 westernSize 與 asianSize;其餘可選參數使用預設值並轉呼叫最長 SetFontSize 多載。
public void SetFontSize(string westernSize, string? asianSize)
Parameters
SetFontSize(string, string?, string?)
Sets the text run's font sizes. 設定文字片段的字型大小。
public void SetFontSize(string westernSize, string? asianSize, string? complexSize)
Parameters
westernSizestringThe Western font size. / 西文字型大小。
asianSizestringThe East Asian font size. / 東亞字型大小。
complexSizestringThe complex script font size. / 複雜文字字型大小。
WithBackgroundColor(string)
Sets this text run's background color. 設定此文字片段的背景色。
public OdfTextRun WithBackgroundColor(string hexColor)
Parameters
hexColorstringThe hexadecimal color string, e.g.
#FFFF00. / 十六進位顏色字串,例如#FFFF00。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithBold()
Short overload of WithBold that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithBold 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfTextRun WithBold()
Returns
WithBold(bool)
Sets whether this text run is bold. 設定此文字片段是否為粗體。
public OdfTextRun WithBold(bool bold)
Parameters
boldboolWhether it is bold. / 是否粗體。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithColor(string)
Sets this text run's font color. 設定此文字片段的字色。
public OdfTextRun WithColor(string hexColor)
Parameters
hexColorstringThe hexadecimal color string, e.g.
#FF0000. / 十六進位顏色字串,例如#FF0000。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithFontName(string)
Short overload of WithFontName that accepts westernFont; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 westernFont;其餘可選參數使用預設值並轉呼叫最長 WithFontName 多載。
public OdfTextRun WithFontName(string westernFont)
Parameters
westernFontstring
Returns
WithFontName(string, string?)
Short overload of WithFontName that accepts westernFont and asianFont; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 westernFont 與 asianFont;其餘可選參數使用預設值並轉呼叫最長 WithFontName 多載。
public OdfTextRun WithFontName(string westernFont, string? asianFont)
Parameters
Returns
WithFontName(string, string?, string?)
Sets this text run's font names. 設定此文字片段的字型名稱。
public OdfTextRun WithFontName(string westernFont, string? asianFont, string? complexFont)
Parameters
westernFontstringThe Western font name. / 西文字型名稱。
asianFontstringThe East Asian (CJK) font name; defaults to
westernFontif not specified. / 東亞(中日韓)字型名稱;未指定時沿用westernFont。complexFontstringThe complex script font name; defaults to
westernFontif not specified. / 複雜文字字型名稱;未指定時沿用westernFont。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithFontSize(string)
Sets this text run's Western, East Asian, and complex script font sizes. 設定此文字片段的西文、東亞及複雜字型大小。
public OdfTextRun WithFontSize(string size)
Parameters
sizestringThe font size, e.g.
12pt. / 字型大小,例如12pt。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithFontVariant(string)
Sets this text run's font variant. 設定此文字片段的字型變體。
public OdfTextRun WithFontVariant(string variant)
Parameters
variantstringThe font variant value, e.g.
small-caps. / 字型變體值,例如small-caps。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithItalic()
Short overload of WithItalic that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithItalic 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfTextRun WithItalic()
Returns
WithItalic(bool)
Sets whether this text run is italic. 設定此文字片段是否為斜體。
public OdfTextRun WithItalic(bool italic)
Parameters
italicboolWhether it is italic. / 是否斜體。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithStrikethrough()
Short overload of WithStrikethrough that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithStrikethrough 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfTextRun WithStrikethrough()
Returns
WithStrikethrough(bool)
Sets whether this text run has strikethrough. 設定此文字片段是否加上刪除線。
public OdfTextRun WithStrikethrough(bool strikethrough)
Parameters
strikethroughboolWhether it has strikethrough. / 是否加上刪除線。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithSubscript()
Short overload of WithSubscript that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithSubscript 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfTextRun WithSubscript()
Returns
WithSubscript(bool)
Sets whether this text run is subscript. 設定此文字片段是否為下標。
public OdfTextRun WithSubscript(bool subscript)
Parameters
subscriptboolWhether it is subscript. / 是否為下標。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithSuperscript()
Short overload of WithSuperscript that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithSuperscript 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfTextRun WithSuperscript()
Returns
WithSuperscript(bool)
Sets whether this text run is superscript. 設定此文字片段是否為上標。
public OdfTextRun WithSuperscript(bool superscript)
Parameters
superscriptboolWhether it is superscript. / 是否為上標。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。
WithTextTransform(string)
Sets this text run's case transform. 設定此文字片段的大小寫轉換。
public OdfTextRun WithTextTransform(string transform)
Parameters
transformstringThe case transform value, e.g.
uppercase. / 大小寫轉換值,例如uppercase。
Returns
- OdfTextRun
This text run instance. / 文字片段本身。