From c21f54bb232a60b3e0e3812d03c28a8cff1a9f94 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 13 May 2007 02:31:00 +0000 Subject: [PATCH] handle FW_DONTCARE in GetFontScore. Fixes gray/thin display of dialogbox elements' text. svn path=/trunk/; revision=26743 --- reactos/subsystems/win32/win32k/objects/text.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index d82ea360fb2..c5901d697d8 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -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);