gdi32: Consider whether the logical font face is vertical when selecting.
This commit is contained in:
parent
c683ad72b2
commit
286854fb06
|
@ -3982,7 +3982,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont )
|
||||||
INT height, width = 0;
|
INT height, width = 0;
|
||||||
unsigned int score = 0, new_score;
|
unsigned int score = 0, new_score;
|
||||||
signed int diff = 0, newdiff;
|
signed int diff = 0, newdiff;
|
||||||
BOOL bd, it, can_use_bitmap;
|
BOOL bd, it, can_use_bitmap, want_vertical;
|
||||||
LOGFONTW lf;
|
LOGFONTW lf;
|
||||||
CHARSETINFO csi;
|
CHARSETINFO csi;
|
||||||
HFONTLIST *hflist;
|
HFONTLIST *hflist;
|
||||||
|
@ -4163,6 +4163,8 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont )
|
||||||
lf.lfCharSet = csi.ciCharset;
|
lf.lfCharSet = csi.ciCharset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
want_vertical = (lf.lfFaceName[0] == '@');
|
||||||
|
|
||||||
/* Face families are in the top 4 bits of lfPitchAndFamily,
|
/* Face families are in the top 4 bits of lfPitchAndFamily,
|
||||||
so mask with 0xF0 before testing */
|
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);
|
family = LIST_ENTRY(family_elem_ptr, Family, entry);
|
||||||
LIST_FOR_EACH(face_elem_ptr, &family->faces) {
|
LIST_FOR_EACH(face_elem_ptr, &family->faces) {
|
||||||
face = LIST_ENTRY(face_elem_ptr, Face, entry);
|
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)
|
if(face->scalable)
|
||||||
goto found;
|
goto found;
|
||||||
if(can_use_bitmap && !last_resort_family)
|
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);
|
family = LIST_ENTRY(family_elem_ptr, Family, entry);
|
||||||
LIST_FOR_EACH(face_elem_ptr, &family->faces) {
|
LIST_FOR_EACH(face_elem_ptr, &family->faces) {
|
||||||
face = LIST_ENTRY(face_elem_ptr, Face, entry);
|
face = LIST_ENTRY(face_elem_ptr, Face, entry);
|
||||||
if(face->scalable) {
|
if(face->scalable && face->vertical == want_vertical) {
|
||||||
csi.fs.fsCsb[0] = 0;
|
csi.fs.fsCsb[0] = 0;
|
||||||
WARN("just using first face for now\n");
|
WARN("just using first face for now\n");
|
||||||
goto found;
|
goto found;
|
||||||
|
|
|
@ -4205,7 +4205,7 @@ static void test_east_asian_font_selection(void)
|
||||||
hfont = SelectObject(hdc, hfont);
|
hfont = SelectObject(hdc, hfont);
|
||||||
memset(face_name, 0, sizeof face_name);
|
memset(face_name, 0, sizeof face_name);
|
||||||
ret = GetTextFaceA(hdc, sizeof face_name, 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);
|
"expected non-vertical face for charset %u, got %s\n", charset[i], face_name);
|
||||||
DeleteObject(SelectObject(hdc, hfont));
|
DeleteObject(SelectObject(hdc, hfont));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue