• Zhiyi Zhang's avatar
    win32u: Choose a smaller ppem to avoid exceeding the requested font height. · 58b477d1
    Zhiyi Zhang authored
    When height > 0, CreateFontA/W() should not return a font face exceeding the requested height.
    For instance, Tahoma has 2049 units of ascent, 423 units of descent and its units per EM square is
    2048. When requesting a font 20 pixels in height, ppem = units_per_EM * requested_height / (ascent + descent)
    = 2048 * 20 / (2049 + 423) = 16.57 ~= 17. When getting the resulting height back from the ppem,
    resulting_height = (ascent + descent) * ppem / units_per_EM = (2049.0 + 423) * 17 / 2048 = 20.52
    ~=21. So it ends up getting a larger font than requested and violates the spec.
    
    Fix Nancy Drew: Legend of the Crystal Skull crash at start.
    Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com>
    58b477d1
Name
Last commit
Last update
..
Makefile.in Loading commit data...
bitmap.c Loading commit data...
brush.c Loading commit data...
clipping.c Loading commit data...
dc.c Loading commit data...
dib.c Loading commit data...
driver.c Loading commit data...
font.c Loading commit data...
gdiobj.c Loading commit data...
generated.c Loading commit data...
icm.c Loading commit data...
mapping.c Loading commit data...
metafile.c Loading commit data...
palette.c Loading commit data...
path.c Loading commit data...
pen.c Loading commit data...
resource.rc Loading commit data...
vertical.sfd Loading commit data...
vertical.ttf Loading commit data...
wine_langnames.sfd Loading commit data...
wine_langnames.ttf Loading commit data...
wine_langnames2.sfd Loading commit data...
wine_langnames2.ttf Loading commit data...
wine_langnames3.sfd Loading commit data...
wine_langnames3.ttf Loading commit data...
wine_longname.sfd Loading commit data...
wine_longname.ttf Loading commit data...
wine_nul.sfd Loading commit data...
wine_nul.ttf Loading commit data...
wine_test.sfd Loading commit data...
wine_test.ttf Loading commit data...
wine_ttfnames.sfd Loading commit data...
wine_ttfnames.ttf Loading commit data...
wine_ttfnames_bold.sfd Loading commit data...
wine_ttfnames_bold.ttf Loading commit data...
wine_vdmx.sfd Loading commit data...
wine_vdmx.ttf Loading commit data...