Index: reactos/win32ss/gdi/ntgdi/font.h =================================================================== --- reactos/win32ss/gdi/ntgdi/font.h (revision 75391) +++ reactos/win32ss/gdi/ntgdi/font.h (working copy) @@ -29,6 +29,7 @@ FT_Face Face; FT_BitmapGlyph BitmapGlyph; int Height; + FT_Render_Mode RenderMode; MATRIX mxWorldToDevice; } FONT_CACHE_ENTRY, *PFONT_CACHE_ENTRY; Index: reactos/win32ss/gdi/ntgdi/freetype.c =================================================================== --- reactos/win32ss/gdi/ntgdi/freetype.c (revision 75391) +++ reactos/win32ss/gdi/ntgdi/freetype.c (working copy) @@ -1392,6 +1392,7 @@ switch (logfont->lfQuality) { case ANTIALIASED_QUALITY: + break; case NONANTIALIASED_QUALITY: return FT_RENDER_MODE_MONO; case DRAFT_QUALITY: @@ -2577,6 +2578,7 @@ FT_Face Face, INT GlyphIndex, INT Height, + FT_Render_Mode RenderMode, PMATRIX pmx) { PLIST_ENTRY CurrentEntry; @@ -2591,6 +2593,7 @@ if ((FontEntry->Face == Face) && (FontEntry->GlyphIndex == GlyphIndex) && (FontEntry->Height == Height) && + (FontEntry->RenderMode == RenderMode) && (SameScaleMatrix(&FontEntry->mxWorldToDevice, pmx))) break; CurrentEntry = CurrentEntry->Flink; @@ -2706,6 +2709,7 @@ NewEntry->Face = Face; NewEntry->BitmapGlyph = BitmapGlyph; NewEntry->Height = Height; + NewEntry->RenderMode = RenderMode; NewEntry->mxWorldToDevice = *pmx; InsertHeadList(&FontCacheListHead, &NewEntry->ListEntry); @@ -3558,7 +3562,6 @@ else RenderMode = FT_RENDER_MODE_MONO; - /* Get the DC's world-to-device transformation matrix */ pmxWorldToDevice = DC_pmxWorldToDevice(dc); FtSetCoordinateTransform(face, pmxWorldToDevice); @@ -3576,8 +3579,8 @@ if (EmuBold || EmuItalic) realglyph = NULL; else - realglyph = ftGdiGlyphCacheGet(face, glyph_index, - plf->lfHeight, pmxWorldToDevice); + realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight, + RenderMode, pmxWorldToDevice); if (EmuBold || EmuItalic || !realglyph) { @@ -5285,8 +5288,8 @@ if (EmuBold || EmuItalic) realglyph = NULL; else - realglyph = ftGdiGlyphCacheGet(face, glyph_index, - plf->lfHeight, pmxWorldToDevice); + realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight, + RenderMode, pmxWorldToDevice); if (!realglyph) { error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); @@ -5510,8 +5513,8 @@ if (EmuBold || EmuItalic) realglyph = NULL; else - realglyph = ftGdiGlyphCacheGet(face, glyph_index, - plf->lfHeight, pmxWorldToDevice); + realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight, + RenderMode, pmxWorldToDevice); if (!realglyph) { error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); Index: reactos/win32ss/user/user32/windows/draw.c =================================================================== --- reactos/win32ss/user/user32/windows/draw.c (revision 75391) +++ reactos/win32ss/user/user32/windows/draw.c (working copy) @@ -6,6 +6,7 @@ * Copyright 2003 Andrew Greenwood * Copyright 2003 Filip Navara * Copyright 2009 Matthias Kupfer + * Copyright 2017 Katayama Hirofumi MZ * * Based on Wine code. * @@ -1242,6 +1243,8 @@ UINT opcode = flags & 0xf; INT len = wp; BOOL retval, tmp; + LOGFONTW lf; + HFONT hFontOriginal, hNaaFont = NULL; if((opcode == DST_TEXT || opcode == DST_PREFIXTEXT) && !len) /* The string is '\0' terminated */ { @@ -1251,6 +1254,15 @@ len = lstrlenA((LPSTR)lp); } + hFontOriginal = GetCurrentObject(hdc, OBJ_FONT); + if (flags & (DSS_MONO | DSS_DISABLED)) + { + /* Create a non-antialiased font */ + GetObjectW(hFontOriginal, sizeof(lf), &lf); + lf.lfQuality = NONANTIALIASED_QUALITY; + hNaaFont = CreateFontIndirectW(&lf); + } + /* Find out what size the image has if not given by caller */ if(!cx || !cy) { @@ -1332,7 +1344,10 @@ if(!FillRect(memdc, &rc, (HBRUSH)GetStockObject(WHITE_BRUSH))) goto cleanup; SetBkColor(memdc, RGB(255, 255, 255)); SetTextColor(memdc, RGB(0, 0, 0)); - hfsave = (HFONT)SelectObject(memdc, GetCurrentObject(hdc, OBJ_FONT)); + if (hNaaFont) + hfsave = (HFONT)SelectObject(memdc, hNaaFont); + else + hfsave = (HFONT)SelectObject(memdc, hFontOriginal); SetLayout( memdc, GetLayout( hdc )); /* DST_COMPLEX may draw text as well, @@ -1341,6 +1356,7 @@ if(!hfsave && (opcode <= DST_PREFIXTEXT)) goto cleanup; tmp = PAINTING_DrawStateJam(memdc, opcode, func, lp, len, &rc, dtflags, unicode); if(hfsave) SelectObject(memdc, hfsave); + if (hNaaFont) DeleteObject(hNaaFont); if(!tmp) goto cleanup; /* This state cause the image to be dithered */