Skip to main content

Module bridge

Module bridge 

Source
Expand description

Bridge between text-document snapshot types and text-typeset layout params.

Converts FlowSnapshot, BlockSnapshot, TextFormat, etc. into BlockLayoutParams, FragmentParams, TableLayoutParams, etc.

Structs§

BridgeOptions
Per-call knobs threaded through the conversion functions so that a host widget can override defaults driven by its active theme.
FlowElements
Converted flow elements, ordered by their position in the flow.

Functions§

collect_paint_spans
Walk a whole FlowSnapshot (top-level blocks, table cells, and frames recursively) and collect the paint-only overlay for every block that has one, keyed by block_id. Blocks without paint highlights are omitted (the engine resets those to their base colors).
convert_block
convert_block_with
Same as convert_block but with theme-driven BridgeOptions for code-block colour overrides.
convert_flow
Convert a FlowSnapshot into layout params that can be fed to a DocumentFlow.
convert_flow_with
Same as convert_flow but accepts host-supplied BridgeOptions for theme-driven colour overrides.
convert_frame
convert_frame_with
convert_paint_spans
Convert a block snapshot’s paint-only highlight overlay into the typesetter’s PaintSpans. Char offsets pass through unchanged (both sides are block-relative char offsets — the space post-layout glyph clusters live in). Underline is expressed through underline_style: an explicit underline_style wins, else font_underline maps to Single / None.
convert_table
convert_table_with