handle FW_DONTCARE in GetFontScore. Fixes gray/thin display of dialogbox elements' text.

svn path=/trunk/; revision=26743
This commit is contained in:
Timo Kreuzer 2007-05-13 02:31:00 +00:00
parent 8e23820aa6
commit c21f54bb23

View file

@ -3923,15 +3923,22 @@ GetFontScore(LOGFONTW *LogFont, PUNICODE_STRING FaceName, PFONTGDI FontGDI)
{
Score += 25;
}
if (LogFont->lfWeight < Otm->otmTextMetrics.tmWeight)
if (LogFont->lfWeight != FW_DONTCARE)
{
if (LogFont->lfWeight < Otm->otmTextMetrics.tmWeight)
{
WeightDiff = Otm->otmTextMetrics.tmWeight - LogFont->lfWeight;
}
else
else
{
WeightDiff = LogFont->lfWeight - Otm->otmTextMetrics.tmWeight;
}
Score += (1000 - WeightDiff) / (1000 / 25);
Score += (1000 - WeightDiff) / (1000 / 25);
}
else
{
Score += 25;
}
ExFreePool(Otm);