pyboxbuilder.lid.label.text_height_for

pyboxbuilder.lid.label.text_height_for(width: float, length: float, text: str, border_margin_mm: float = 10.0, diagonal: bool = False, label_mode: LabelMode = LabelMode.FRAMED, label_border_mm: float = 1.5, label_text_gap_mm: float = 1.5, max_text_height_mm: float | None = 16.0, label_shape: LabelShape = LabelShape.RECT, font: str | None = None, text_spacing: float | None = None) → float[source]

Cap height the label text will be set at, in mm.

Measured rather than estimated. Guessing the width from the character count is off by enough to matter — “Cards” at the guessed size came out 102mm wide on a 100mm lid — because the advance per glyph depends on the font and on which letters they are.