https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9cd11eb1031152ea99630…
commit 9cd11eb1031152ea996309e1fceb9d5c1ec6e69b
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Aug 4 15:15:52 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Aug 4 15:15:52 2019 +0900
[WIN32SS][NTGDI] Fix condition of bold emulation (#1787)
- Define EMUBOLD_NEEDED macro to determine the condition of bold emuration necessity.
- Use this macro.
- Loose the condition.
---
win32ss/gdi/ntgdi/freetype.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index fb8741c8d8b..2578bc04e27 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -41,6 +41,10 @@
#define _TMPF_VARIABLE_PITCH TMPF_FIXED_PITCH
#endif
+/* Is bold emulation necessary? */
+#define EMUBOLD_NEEDED(original, request) \
+ ((request) != FW_DONTCARE) && ((request) - (original) >= FW_BOLD -
FW_MEDIUM)
+
extern const MATRIX gmxWorldToDeviceDefault;
extern const MATRIX gmxWorldToPageDefault;
static const FT_Matrix identityMat = {(1 << 16), 0, 0, (1 << 16)};
@@ -4100,7 +4104,7 @@ TextIntGetTextExtentPoint(PDC dc,
TextIntUpdateSize(dc, TextObj, FontGDI, FALSE);
plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
- EmuBold = (plf->lfWeight >= FW_BOLD && FontGDI->OriginalWeight <=
FW_NORMAL);
+ EmuBold = EMUBOLD_NEEDED(FontGDI->OriginalWeight, plf->lfWeight);
EmuItalic = (plf->lfItalic && !FontGDI->OriginalItalic);
Render = IntIsFontRenderingEnabled();
@@ -5885,7 +5889,7 @@ IntExtTextOutW(
face = FontGDI->SharedFace->Face;
plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
- EmuBold = (plf->lfWeight >= FW_BOLD && FontGDI->OriginalWeight <=
FW_NORMAL);
+ EmuBold = EMUBOLD_NEEDED(FontGDI->OriginalWeight, plf->lfWeight);
EmuItalic = (plf->lfItalic && !FontGDI->OriginalItalic);
if (Render)