Formatting
Formatting:
{}Defines text formatting properties that can be applied to document content.
Remarks
Section titled “Remarks”The Formatting type specifies visual styling properties for text. All properties
use null to represent “inherited from style”.
When applying formatting via e.g. TextView.setFormatting, you typically use
Partial<Formatting> to specify only the properties you want to change.
Example
Section titled “Example”Apply bold and color to text:
textView.setFormatting({ bold: true, color: "#ff0000"});Properties
Section titled “Properties”Font family name (e.g., “Arial”, “Times New Roman”).
Remarks
Section titled “Remarks”Specifies the typeface for the text.
null means no explicit font is set (inherits from style).
fontSize
Section titled “fontSize”Font size in points (e.g., 12, 14, 18).
Remarks
Section titled “Remarks”Specifies the size of the text in typographic points (1 point = 1/72 inch).
Common sizes are 10-12 for body text, 14-18 for headings. null means no
explicit size is set (inherits from style).
Bold text weight.
Remarks
Section titled “Remarks”When true, text is rendered in bold weight. false or null means normal weight.
italic
Section titled “italic”Italic text style.
Remarks
Section titled “Remarks”When true, text is rendered in italic style. false or null means normal (upright) style.
Text foreground color.
Remarks
Section titled “Remarks”Specifies the color of the text characters. Accepts hex color codes (e.g., “#ff0000” for red,
“#0000ff” for blue). null means no explicit color is set (inherits from style).
highlight
Section titled “highlight”Text background highlight color.
Remarks
Section titled “Remarks”Specifies the background color behind the text (like a highlighter pen). Accepts hex color
codes (e.g., “#ffff00” for yellow, “#00ff00” for green). null means no highlight.
strikeout
Section titled “strikeout”Strikethrough text decoration.
Remarks
Section titled “Remarks”When true, text is rendered with a horizontal line through the middle.
underline
Section titled “underline”Underline text decoration.
Remarks
Section titled “Remarks”When true, text is rendered with a line underneath.