Skip to main content

Module draw_scope_text

Module draw_scope_text 

Source
Expand description

Bridge between DrawScope text and the framework text stack.

cranpose-ui-graphics sits below fonts, so a draw scope describes text with the flat DrawTextStyle value and delegates measurement back up here. This module owns the single translation from that value into the full TextStyle the measurer and the rasterizer both consume — so a string measured through DrawScope::measure_text and the same string rasterized by the renderer are described identically, down to the cache key.

Structs§

AppContextTextMeasurer
Measures draw-scope text against the app’s fonts.

Functions§

draw_style_line_box
The line box a draw-scope style resolves to against the app’s fonts: how tall one line is and where its baseline sits inside it.
text_style_for_draw_style
Builds the TextStyle that describes a draw-scope text run.