Module: wine Branch: master Commit: 286854fb06aaf68ab43cc175555d927df96bc6ec URL: http://source.winehq.org/git/wine.git/?a=commit;h=286854fb06aaf68ab43cc17555...
Author: Akihiro Sagawa sagawa.aki@gmail.com Date: Thu Feb 9 01:33:00 2012 +0900
gdi32: Consider whether the logical font face is vertical when selecting.
---
dlls/gdi32/freetype.c | 9 ++++++--- dlls/gdi32/tests/font.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 55c82ba..5e6a952 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 52a1873..307493b 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));