Skip to main content

Module label

Module label 

Source

Structs§

PlotLabel
Text

Constants§

TEXT_GAP
TEXT_HEIGHT
TEXT_SIZE

Functions§

measure_text_width
Returns the rendered width of text at font_size using the window’s current text style. Used for layout calculations that need to reserve space for labels before the scale ranges are fixed.
truncate_text_to_width
Truncate text with a trailing ellipsis so it fits within max_width at font_size. Returns text unchanged when it already fits; returns just the ellipsis when not even one character fits. max_width <= 0 is treated as “no budget” and returns text unchanged (the caller has no room to reason about).