switch (logfont->lfQuality)
{
case ANTIALIASED_QUALITY:
+ break;
case NONANTIALIASED_QUALITY:
return FT_RENDER_MODE_MONO;
case DRAFT_QUALITY:
FT_Face Face,
INT GlyphIndex,
INT Height,
+ FT_Render_Mode RenderMode,
PMATRIX pmx)
{
PLIST_ENTRY CurrentEntry;
if ((FontEntry->Face == Face) &&
(FontEntry->GlyphIndex == GlyphIndex) &&
(FontEntry->Height == Height) &&
+ (FontEntry->RenderMode == RenderMode) &&
(SameScaleMatrix(&FontEntry->mxWorldToDevice, pmx)))
break;
CurrentEntry = CurrentEntry->Flink;
NewEntry->Face = Face;
NewEntry->BitmapGlyph = BitmapGlyph;
NewEntry->Height = Height;
+ NewEntry->RenderMode = RenderMode;
NewEntry->mxWorldToDevice = *pmx;
InsertHeadList(&FontCacheListHead, &NewEntry->ListEntry);
else
RenderMode = FT_RENDER_MODE_MONO;
-
/* Get the DC's world-to-device transformation matrix */
pmxWorldToDevice = DC_pmxWorldToDevice(dc);
FtSetCoordinateTransform(face, pmxWorldToDevice);
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)
{
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);
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);
* Copyright 2003 Andrew Greenwood
* Copyright 2003 Filip Navara
* Copyright 2009 Matthias Kupfer
+ * Copyright 2017 Katayama Hirofumi MZ
*
* Based on Wine code.
*
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 */
{
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)
{
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,
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 */