diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 55c82bae3ab..5e6a9529fa4 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3982,7 +3982,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont ) INT height, width = 0; unsigned int score = 0, new_score; signed int diff = 0, newdiff; - BOOL bd, it, can_use_bitmap; + BOOL bd, it, can_use_bitmap, want_vertical; LOGFONTW lf; CHARSETINFO csi; HFONTLIST *hflist; @@ -4163,6 +4163,8 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont ) lf.lfCharSet = csi.ciCharset; } + want_vertical = (lf.lfFaceName[0] == '@'); + /* Face families are in the top 4 bits of lfPitchAndFamily, so mask with 0xF0 before testing */ @@ -4192,7 +4194,8 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont ) family = LIST_ENTRY(family_elem_ptr, Family, entry); LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if(csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) { + if(face->vertical == want_vertical && + (csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0]))) { if(face->scalable) goto found; if(can_use_bitmap && !last_resort_family) @@ -4211,7 +4214,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont ) family = LIST_ENTRY(family_elem_ptr, Family, entry); LIST_FOR_EACH(face_elem_ptr, &family->faces) { face = LIST_ENTRY(face_elem_ptr, Face, entry); - if(face->scalable) { + if(face->scalable && face->vertical == want_vertical) { csi.fs.fsCsb[0] = 0; WARN("just using first face for now\n"); goto found; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 52a18730d75..307493b8e6a 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -4205,7 +4205,7 @@ static void test_east_asian_font_selection(void) hfont = SelectObject(hdc, hfont); memset(face_name, 0, sizeof face_name); ret = GetTextFaceA(hdc, sizeof face_name, face_name); - todo_wine ok(ret && face_name[0] != '@', + ok(ret && face_name[0] != '@', "expected non-vertical face for charset %u, got %s\n", charset[i], face_name); DeleteObject(SelectObject(hdc, hfont));