Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TextSpan ¶
type TextSpan struct {
Text string
Source *sg.FontFamily // nil = inherit from RichText
Bold bool
Italic bool
Color sg.Color // used when ColorSet == true
ColorSet bool // false = inherit
Outline *Outline // nil = inherit; &Outline{} = explicitly none
Underline bool
Strikethrough bool
SizeOverride float64 // 0 = inherit displaySize
LinkURL string // non-empty = clickable
Indent float64 // left indent for this line and wrapped continuations
}
TextSpan represents a styled segment of text within a RichText component. Fields left at their zero values inherit from the parent RichText.
func ParseMarkup ¶
func ParseMarkup(input string, source *sg.FontFamily, baseSize float64, headingScale [3]float64) ([]TextSpan, error)
ParseMarkup parses XML-like markup into TextSpan slices. Supported tags: b, i, u, strike, color, size, outline, span, link, br, h1, h2, h3, ul, ol, li. The source parameter is accepted but not used during parsing; font resolution is deferred to render time via the RichText source.
Click to show internal directories.
Click to hide internal directories.