gdi32: Specify the suitable hinting flags explicitly.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41639
Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Byeongsik Jeon 2018-11-13 09:27:09 +00:00 committed by Alexandre Julliard
parent ce3e220c26
commit 7da7930a10
1 changed files with 33 additions and 5 deletions

View File

@ -6801,6 +6801,37 @@ static unsigned int get_bezier_glyph_outline(FT_Outline *outline, unsigned int b
return needed; return needed;
} }
static FT_Int get_load_flags( UINT format )
{
FT_Int load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
if (format & GGO_UNHINTED)
return load_flags | FT_LOAD_NO_HINTING;
switch (format & ~GGO_GLYPH_INDEX)
{
case GGO_BITMAP:
load_flags |= FT_LOAD_TARGET_MONO;
break;
case GGO_GRAY2_BITMAP:
case GGO_GRAY4_BITMAP:
case GGO_GRAY8_BITMAP:
case WINE_GGO_GRAY16_BITMAP:
load_flags |= FT_LOAD_TARGET_NORMAL;
break;
case WINE_GGO_HRGB_BITMAP:
case WINE_GGO_HBGR_BITMAP:
load_flags |= FT_LOAD_TARGET_LCD;
break;
case WINE_GGO_VRGB_BITMAP:
case WINE_GGO_VBGR_BITMAP:
load_flags |= FT_LOAD_TARGET_LCD_V;
break;
}
return load_flags;
}
static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
@ -6820,7 +6851,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
FT_Vector adv; FT_Vector adv;
INT origin_x = 0, origin_y = 0; INT origin_x = 0, origin_y = 0;
FT_Angle angle = 0; FT_Angle angle = 0;
FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; FT_Int load_flags = get_load_flags(format);
double widthRatio = 1.0; double widthRatio = 1.0;
FT_Matrix transMat = identityMat; FT_Matrix transMat = identityMat;
FT_Matrix transMatUnrotated; FT_Matrix transMatUnrotated;
@ -6859,10 +6890,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
tategaki = check_unicode_tategaki(glyph); tategaki = check_unicode_tategaki(glyph);
} }
if(format & GGO_UNHINTED) {
load_flags |= FT_LOAD_NO_HINTING;
format &= ~GGO_UNHINTED; format &= ~GGO_UNHINTED;
}
if(original_index >= font->gmsize * GM_BLOCK_SIZE) { if(original_index >= font->gmsize * GM_BLOCK_SIZE) {
font->gmsize = (original_index / GM_BLOCK_SIZE + 1); font->gmsize = (original_index / GM_BLOCK_SIZE + 1);