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");