mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Two changes to the inline-|T pipeline, both anchored in the engine's own conventions. 1) Post-icon text rendered on half-pixel positions. Native glyphs always sit on INTEGER pen pixels -- the origin finalize rounds (FUN_005cdf70) and every glyph advance is truncated (the emitter's __ftol when node bit-7 is clear) -- but IconAdvancePen added a fractional advance (w + 1.5 x fontH x 0.18 + ...), shifting every glyph AFTER an icon onto half-pixel positions: bilinear-filtered, fuzzy or ghosted post-icon text, with visibility depending on the machine's filtering config (the "artifacting only on the text after the icon" report). IconAdvancePen now truncates when the node snaps, the centre/right justify pre-shift snaps the same way, and the wrap stepper's shrink probes carry the real snap flag so the budget matches the render advance exactly. 2) The fs-level GetStringWidth / GetStringHeight hooks now compute the icon contribution in TRUE PEN PX -- the exact numbers the emitter reserves, outline ink and snap truncation included -- and bridge it into the getter's return space via the font height known in both spaces (sumPen x fontHInt / fontHPen). ResolveFsPenFont replicates the render chain hop for hop: nodeFontSize = internal x fs+0x7C / [0x832A48] (the rebuild feeds internal x 0x7C to FUN_0044d420, which normalizes it through FUN_0041ae50 -- a hop whose omission on first flight undersized fontHPen ~40%, growing icon-bearing chat lines with phantom tall-icon overflow and pushing money-tooltip coins off their right anchor), floored at [0x801628]/rasterY = 2 pen px (the node ctor), realized by the emitter's own height helper. The outline ink resolves through face = [[fs+0xE0]+0x20] -- verified stored verbatim at node+0x44 by FUN_005c1c30 -> FUN_005cd6d0. fs-built nodes are always in snap mode (no fs-flag maps to node bit 7 in FUN_0044d420), so the snapped sums are exact for every fontstring. Replaces the old SetPoint-push-factor bridge, whose units cancelled for :0 icons but could not express the truncation or the ink. New Offsets: OFF_FONTSTRING_FONT_HANDLE (0xE0), OFF_FONT_HANDLE_FACE (0x20), FUN_TEXT_NODE_INVALIDATE derivation notes extended; the 2.0 outline constant's double duty as the minimum font size is documented. Remaining measure residual: only the engine's own trailing-icon ink-vs-advance <=1px.