ScreenToPixelWidth
function · font · primitive
- Address
0x5c7010· 99 bytes, up to0x5c7072- Signature
float __fastcall (int raw, float fraction)- Meaning
- Converts a width fraction to rounded pixels
- Confidence
- verified, proof one
- Finding
- font/metrics#screen-and-pixel-units
- Test
font::screen_to_pixel_width_difftest
Finding: Screen and pixel units in font: scaling, advances and metrics
The layout measures in fractions of the screen height. 0xc2b9a0 holds the viewport height in
pixels and 0xc2b9a4 its width. 0x5c6fa0(raw, v) converts a height fraction to pixels (rounded half away
from zero), 0x5c7010 does the same against the width, 0x5c7080(pixels) converts back and 0x5c2540(font)
returns a font's natural height pixelSize / screenHeight.
The derivation is in the doc.
Callers 5
- MeasureTextExtent font
- InternalGetMaxCharsWithinWidth font
- MeasureRunProportional font
- CGxStringBatch::EmitGlyphQuads font
- CGxString::LayoutLines font
Callees 1
- __ftol crt
Calls and jumps by a bare address, from tables/calls.tsv.