mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
A font string with no height of its own is as tall as its text, and that height (0x5C2070) is a product, n * fontHeight + (n - 1) * gap. FitText's count of what fits (0x5C21C0) adds the lines up as a running float sum and stops at the first line where blockHeight + 2^-20 < sum + fontHeight. Over many lines the sum drifts from the product by more than 2^-20 at most UI scales, the last line "does not fit", and FitText cuts the text to its first 4092 bytes plus "...", with the rest of the box blank. A multi-line edit box hit this once its text passed 4 KB (ScrollingEditBoxTemplate, pfUI chat copy). 4.3.4 keeps the product and grows the margin per line: blockHeight + numLines * 2^-20 (GxuFontGetMaxCharsWithinWidthAndHeight). Text::FitHeight replaces the loop's fadd of the engine's 2^-20 with a thunk that adds numLines times it. The first line keeps 1.12's margin; each further line adds a millionth of the screen height, so real overflow is still cut. A float32 model of the chain lost the last line in 1276 of 3000 multi-line fits before and in none after; in game a 30783-byte copy box draws all of its text.