Commit 69b29fa0 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdi32: Use a better heuristics for tmWeight.

Marlett uses FW_MEDIUM (500) and current code allows only FW_REGULAR and FW_BOLD. New heuristics detects if flags and usWeightClass in the font match.
parent 16aa1369
......@@ -5585,7 +5585,19 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
TM.tmAveCharWidth = 1;
}
TM.tmMaxCharWidth = (pFT_MulFix(ft_face->bbox.xMax - ft_face->bbox.xMin, x_scale) + 32) >> 6;
TM.tmWeight = (font->fake_bold || (ft_face->style_flags & FT_STYLE_FLAG_BOLD)) ? FW_BOLD : FW_REGULAR;
TM.tmWeight = FW_REGULAR;
if (font->fake_bold)
TM.tmWeight = FW_BOLD;
else
{
if (ft_face->style_flags & FT_STYLE_FLAG_BOLD)
{
if (pOS2->usWeightClass > FW_MEDIUM)
TM.tmWeight = pOS2->usWeightClass;
}
else if (pOS2->usWeightClass <= FW_MEDIUM)
TM.tmWeight = pOS2->usWeightClass;
}
TM.tmOverhang = 0;
TM.tmDigitizedAspectX = 300;
TM.tmDigitizedAspectY = 300;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment