Documentation
¶
Overview ¶
Package richtext implements a PDF component for paragraphs with mixed inline styling.
Index ¶
- func NewAutoRow(runs []props.RichRun, ps ...props.RichText) core.Row
- func NewCol(size int, runs []props.RichRun, ps ...props.RichText) core.Col
- func NewRow(height float64, runs []props.RichRun, ps ...props.RichText) core.Row
- type RichText
- func (r *RichText) GetHeight(provider core.Provider, cell *entity.Cell) float64
- func (r *RichText) GetStructure() *node.Node[core.Structure]
- func (r *RichText) Render(provider core.Provider, cell *entity.Cell)
- func (r *RichText) SetConfig(config *entity.Config)
- func (r *RichText) WithAnchorRegistry(reg anchorResolverIface) *RichText
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAutoRow ¶
NewAutoRow wraps a RichText in an auto-height Row.
Types ¶
type RichText ¶
type RichText struct {
// contains filtered or unexported fields
}
RichText is a paragraph component that renders inline runs with mixed styles. It implements core.Component and can be placed inside Col/Row like any other component.
func (*RichText) GetHeight ¶
GetHeight returns the height the component will occupy in the cell. The result is memoised by cell width so Paper's two-call pattern (addRow + Render) doesn't drift even when SetConfig is called between invocations.
func (*RichText) GetStructure ¶
GetStructure returns the component tree node for debugging/snapshot tests.
func (*RichText) Render ¶
Render draws the component. If the provider implements core.RichTextProvider, it delegates to AddRichText for accurate per-run styling. Otherwise it falls back to AddText with the first run's style.
func (*RichText) WithAnchorRegistry ¶
WithAnchorRegistry attaches an anchor registry so that runs with LocalAnchor produce precise per-run PDF link rectangles at render time.