benilla-re systems structs docs

CSimpleFontString::FitText

function · ui · primitive

Address
0x771ec0 · 575 bytes, up to 0x7720fe
Meaning
Fits a FontString's text to a box, appending ... while backing off one character at a time
Confidence
verified, proof one
Finding
ui/fontstring#size-and-fitting
Test
ui::textglue_add_reload, ui::textglue_linecount_scale, ui::textglue_scale_mul, ui::textglue_settled_poseps

Finding: Size and fitting in ui: FontString and Font

A string draws at its font's pixel size one to one while bit 0x200 is set; SetTextHeight with a height that differs clears the bit and draws at that height. To fit its rectangle, a string with a width and either a line limit or a height measures how much text fits, with the height raised to one line, or set to the limit times a line. When the text does not fit, it backs off one character at a time from the end, appending ..., until the shortened text fits or nothing is left. The result is built once per change, in one 4,096-byte buffer.

The derivation is in the doc.

Callers 3

Callees 7

Calls and jumps by a bare address, from tables/calls.tsv.