gdi32: GetGlyphIndices doesn't substitute glyph incorrect
Aric Stewart
aric at codeweavers.com
Fri May 10 09:23:17 CDT 2013
Hi there,
I know I am a year late to the party here but I am digging deep into tategaki for a few Japanese programs that are having serious rendering issues and I believe that this patch is incorrect.
I am attaching the test patch that proves it to me. Kusanagi-san, we should try to make sure that this does not break what it was that you where trying to fix with your original patch.
-aric
-------------- next part --------------
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 876b312..9daacfd 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4804,7 +4804,12 @@ static void test_vertical_font(void)
int num;
BOOL ret, installed, selected;
GLYPHMETRICS gm;
- WORD hgi, vgi;
+ WORD bgi, hgi, vgi;
+
+ LOGFONTA lf;
+ HFONT hfont, hfont_prev;
+ HDC hdc;
+ static const WCHAR str[] = { 0x2025 };
if (!pAddFontResourceExA || !pRemoveFontResourceExA || !pGetGlyphIndicesW)
{
@@ -4821,6 +4826,36 @@ static void test_vertical_font(void)
num = pAddFontResourceExA(ttf_name, FR_PRIVATE, 0);
ok(num == 2, "AddFontResourceExA should add 2 fonts from vertical.ttf\n");
+ lf.lfHeight = -18;
+ lf.lfWidth = 0;
+ lf.lfEscapement = 0;
+ lf.lfOrientation = 0;
+ lf.lfWeight = FW_DONTCARE;
+ lf.lfItalic = 0;
+ lf.lfUnderline = 0;
+ lf.lfStrikeOut = 0;
+ lf.lfCharSet = DEFAULT_CHARSET;
+ lf.lfOutPrecision = OUT_TT_ONLY_PRECIS;
+ lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ lf.lfQuality = DEFAULT_QUALITY;
+ lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+ strcpy(lf.lfFaceName, "WineTestVertical");
+
+ hfont = CreateFontIndirectA(&lf);
+ ok(hfont != NULL, "CreateFontIndirectA failed\n");
+
+ hdc = GetDC(NULL);
+
+ hfont_prev = SelectObject(hdc, hfont);
+ ok(hfont_prev != NULL, "SelectObject failed\n");
+
+ ret = pGetGlyphIndicesW(hdc, str, 1, &bgi, 0);
+ ok(ret != GDI_ERROR, "GetGlyphIndicesW failed\n");
+
+ SelectObject(hdc, hfont_prev);
+ DeleteObject(hfont);
+ ReleaseDC(NULL, hdc);
+
check_vertical_font("@WineTestVertical", &installed, &selected, &gm, &hgi);
ok(installed, "@WineTestVertical is not installed\n");
ok(selected, "@WineTestVertical is not selected\n");
@@ -4828,6 +4863,8 @@ static void test_vertical_font(void)
"gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal\n",
gm.gmBlackBoxX, gm.gmBlackBoxY);
+ ok(hgi != bgi, "same glyph h:%u v:%u\n", hgi, bgi);
+
check_vertical_font("@@WineTestVertical", &installed, &selected, &gm, &vgi);
ok(installed, "@@WineTestVertical is not installed\n");
ok(selected, "@@WineTestVertical is not selected\n");
More information about the wine-devel
mailing list