[1/6] gdi32/tests: Add tests for vertical font.

Kusanagi Kouichi slash at ac.auone-net.jp
Thu Dec 8 05:19:20 CST 2011


vertical.sfd and vertical.ttf were generated from
M+ 1p regular (http://mplus-fonts.sourceforge.jp/)
by the following fontforge script.

Open($1)
SetTTFName(0x409, 1, "@WineTestVertical")
SetFontHasVerticalMetrics(1)
SelectSingletons(0x2025, "twodotenleader.vert")
SelectInvert()
Clear()
Save("vertical.sfd")
Generate("vertical.ttf")
Close()

Signed-off-by: Kusanagi Kouichi <slash at ac.auone-net.jp>
---
 dlls/gdi32/tests/font.c       |   88 ++++++++++++++++++
 dlls/gdi32/tests/resource.rc  |    2 +
 dlls/gdi32/tests/vertical.sfd |  199 +++++++++++++++++++++++++++++++++++++++++
 dlls/gdi32/tests/vertical.ttf |  Bin 0 -> 2372 bytes
 4 files changed, 289 insertions(+), 0 deletions(-)
 create mode 100644 dlls/gdi32/tests/vertical.sfd
 create mode 100644 dlls/gdi32/tests/vertical.ttf

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 30296a5..501006c 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4042,6 +4042,93 @@ todo_wine
     DeleteFile(ttf_name);
 }
 
+static void check_vertical_font(const char * const name, BOOL * const installed, BOOL * const selected, GLYPHMETRICS * const gm)
+{
+    LOGFONTA lf;
+    HFONT hfont, hfont_prev;
+    HDC hdc;
+    char facename[100];
+    DWORD ret;
+
+    *installed = is_truetype_font_installed(name);
+
+    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, name);
+
+    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 = GetTextFaceA(hdc, sizeof facename, facename);
+    ok(ret, "GetTextFaceA failed\n");
+    *selected = !strcmp(facename, name);
+
+    ret = GetGlyphOutlineW(hdc, 0x2025, GGO_METRICS, gm, 0, NULL, &mat);
+    ok(ret != GDI_ERROR, "GetGlyphOutlineW failed\n");
+    if (!*selected)
+        memset(gm, 0, sizeof *gm);
+
+    SelectObject(hdc, hfont_prev);
+    DeleteObject(hfont);
+    ReleaseDC(NULL, hdc);
+}
+
+static void test_vertical_font(void)
+{
+    int num;
+    BOOL ret, installed, selected;
+    GLYPHMETRICS gm;
+
+    if (!pAddFontResourceExA || !pRemoveFontResourceExA)
+    {
+        win_skip("AddFontResourceExA is not available on this platform\n");
+        return;
+    }
+
+    num = pAddFontResourceExA("vertical.ttf", FR_PRIVATE, 0);
+    todo_wine
+    ok(num == 2, "AddFontResourceExA should add 2 fonts from vertical.ttf\n");
+
+    check_vertical_font("@WineTestVertical", &installed, &selected, &gm);
+    todo_wine
+    ok(installed, "@WineTestVertical is not installed\n");
+    todo_wine
+    ok(selected, "@WineTestVertical is not selected\n");
+    todo_wine
+    ok(gm.gmBlackBoxX > gm.gmBlackBoxY,
+       "gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal\n",
+       gm.gmBlackBoxX, gm.gmBlackBoxY);
+
+    check_vertical_font("@@WineTestVertical", &installed, &selected, &gm);
+    todo_wine
+    ok(installed, "@@WineTestVertical is not installed\n");
+    todo_wine
+    ok(selected, "@@WineTestVertical is not selected\n");
+    todo_wine
+    ok(gm.gmBlackBoxX < gm.gmBlackBoxY,
+       "gmBlackBoxX(%u) should be less than gmBlackBoxY(%u) if vertical\n",
+       gm.gmBlackBoxX, gm.gmBlackBoxY);
+
+    ret = pRemoveFontResourceExA("vertical.ttf", FR_PRIVATE, 0);
+    ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError());
+}
+
 START_TEST(font)
 {
     init();
@@ -4099,4 +4186,5 @@ START_TEST(font)
      * is properly implemented.
      */
     test_CreateScalableFontResource();
+    test_vertical_font();
 }
diff --git a/dlls/gdi32/tests/resource.rc b/dlls/gdi32/tests/resource.rc
index f172b80..92b24cc 100644
--- a/dlls/gdi32/tests/resource.rc
+++ b/dlls/gdi32/tests/resource.rc
@@ -22,3 +22,5 @@
 
 /* @makedep: wine_test.ttf */
 wine_test.ttf RCDATA wine_test.ttf
+/* @makedep: vertical.ttf */
+vertical.ttf RCDATA vertical.ttf
diff --git a/dlls/gdi32/tests/vertical.sfd b/dlls/gdi32/tests/vertical.sfd
new file mode 100644
index 0000000..9ec5f04
--- /dev/null
+++ b/dlls/gdi32/tests/vertical.sfd
@@ -0,0 +1,199 @@
+SplineFontDB: 3.0
+FontName: mplus-1p-regular
+FullName: M+ 1p regular
+FamilyName: M+ 1p regular
+Weight: Book
+Copyright: Copyright(c) 2011 M+ FONTS PROJECT
+Version: 1.044
+ItalicAngle: 0
+UnderlinePosition: -100
+UnderlineWidth: 50
+Ascent: 860
+Descent: 140
+sfntRevision: 0x00010b43
+LayerCount: 2
+Layer: 0 1 "Back"  1
+Layer: 1 1 "Fore"  0
+NeedsXUIDChange: 1
+XUID: [1021 311 1688707159 7641229]
+FSType: 0
+OS2Version: 1
+OS2_WeightWidthSlopeOnly: 0
+OS2_UseTypoMetrics: 1
+CreationTime: 1314095750
+ModificationTime: 1323339383
+PfmFamily: 17
+TTFWeight: 400
+TTFWidth: 5
+LineGap: 90
+VLineGap: 0
+Panose: 2 11 5 2 2 2 3 2 2 7
+OS2TypoAscent: 0
+OS2TypoAOffset: 1
+OS2TypoDescent: 0
+OS2TypoDOffset: 1
+OS2TypoLinegap: 90
+OS2WinAscent: 0
+OS2WinAOffset: 1
+OS2WinDescent: -23
+OS2WinDOffset: 1
+HheadAscent: 0
+HheadAOffset: 1
+HheadDescent: 23
+HheadDOffset: 1
+OS2SubXSize: 650
+OS2SubYSize: 700
+OS2SubXOff: 0
+OS2SubYOff: 140
+OS2SupXSize: 650
+OS2SupYSize: 700
+OS2SupXOff: 0
+OS2SupYOff: 480
+OS2StrikeYSize: 49
+OS2StrikeYPos: 258
+OS2FamilyClass: 2054
+OS2Vendor: 'M+  '
+OS2CodePages: 601201bf.dff70000
+OS2UnicodeRanges: e1000aff.4a47fdfb.02000012.00000000
+Lookup: 4 0 1 "kana semi-voiced lookup"  {"kana semi-voiced table"  } ['ccmp' ('kana' <'dflt' > ) 'liga' ('kana' <'dflt' > ) ]
+Lookup: 1 0 0 "gsubvert"  {"j-vert"  } ['vert' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 4 0 1 "ligalookup01"  {"ligalookup01 subtable"  } ['liga' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 4 0 0 "ccmplookup01"  {"ccmplookup01 subtable"  } ['ccmp' ('hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 4 0 0 "ccmplookup02"  {"ccmplookup02 subtable"  } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 1 0 0 "SingleSubstitutionlookupDotless"  {"SingleSubstitutionlookupDotless subtable"  } []
+Lookup: 6 0 0 "ccmplookup03"  {"ccmplookup03 contextual 0"  "ccmplookup03 contextual 1"  "ccmplookup03 contextual 2"  } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 258 0 0 "kerning pairs"  {"kp"  } ['kern' ('latn' <'dflt' > ) ]
+Lookup: 262 4 0 "mkmklookup1"  {"mkmklookup1 subtable"  } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 260 4 0 "marklookup2"  {"marklookup2 subtable"  } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 260 4 0 "marklookup1"  {"marklookup1 subtable"  } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
+Lookup: 262 4 0 "mkmklookup2"  {"mkmklookup2 subtable"  } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
+DEI: 91125
+ChainSub2: coverage "ccmplookup03 contextual 2"  0 0 0 1
+ 1 0 3
+  Coverage: 19 i j uni0249 uni03F3
+  FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
+  FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
+  FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
+ 1
+  SeqLookup: 0 "SingleSubstitutionlookupDotless" 
+EndFPST
+ChainSub2: coverage "ccmplookup03 contextual 1"  0 0 0 1
+ 1 0 2
+  Coverage: 19 i j uni0249 uni03F3
+  FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
+  FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
+ 1
+  SeqLookup: 0 "SingleSubstitutionlookupDotless" 
+EndFPST
+ChainSub2: coverage "ccmplookup03 contextual 0"  0 0 0 1
+ 1 0 1
+  Coverage: 19 i j uni0249 uni03F3
+  FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
+ 1
+  SeqLookup: 0 "SingleSubstitutionlookupDotless" 
+EndFPST
+MacFeat: 0 0 0
+MacName: 0 0 24 "All Typographic Features"
+MacName: 0 1 24 "Fonctions typographiques"
+MacName: 0 2 33 "Alle typografischen M\232glichkeiten"
+MacName: 0 3 21 "Funzioni Tipografiche"
+MacName: 0 4 28 "Alle typografische kenmerken"
+MacSetting: 0
+MacName: 0 0 17 "All Type Features"
+MacName: 0 1 31 "Toutes fonctions typographiques"
+MacName: 0 2 23 "Alle Auszeichnungsarten"
+MacName: 0 3 17 "Tutte le Funzioni"
+MacName: 0 4 18 "Alle typekenmerken"
+MacFeat: 1 0 0
+MacName: 0 0 9 "Ligatures"
+MacName: 0 1 9 "Ligatures"
+MacName: 0 2 9 "Ligaturen"
+MacName: 0 3 8 "Legature"
+MacName: 0 4 9 "Ligaturen"
+MacSetting: 2
+MacName: 0 0 16 "Common Ligatures"
+MacName: 0 1 18 "Ligatures Usuelles"
+MacName: 0 2 17 "Normale Ligaturen"
+MacName: 0 3 19 "Legature pi\235 Comuni"
+MacName: 0 4 28 "Gemeenschappelijke Ligaturen"
+EndMacFeatures
+TtTable: prep
+PUSHW_2
+ 511
+ 0
+SCANTYPE
+SCANCTRL
+EndTTInstrs
+ShortTable: maxp 16
+  1
+  0
+  6439
+  216
+  18
+  0
+  0
+  2
+  0
+  0
+  0
+  0
+  4
+  0
+  0
+  0
+EndShort
+LangName: 1033 "" "@WineTestVertical" "Regular" "FontForge 2.0 : M+- 1p regular : 2-11-2011" "" "" "" "" "" "" "" "http://mplus-fonts.sourceforge.jp" "" "" "" "" "M+- 1p" "regular" 
+GaspTable: 1 65535 2
+Encoding: UnicodeFull
+UnicodeInterp: none
+NameList: Adobe Glyph List
+DisplaySize: -24
+AntiAlias: 1
+FitToEm: 1
+AnchorClass2: "TopMark"  "mkmklookup1 subtable" "Bottom"  "marklookup2 subtable" "Top"  "marklookup1 subtable" "BottomMark"  "mkmklookup2 subtable" 
+BeginChars: 1114185 2
+
+StartChar: twodotenleader
+Encoding: 8229 8229 0
+Width: 1000
+GlyphClass: 2
+Flags: W
+LayerCount: 2
+Fore
+SplineSet
+703 290 m 1,0,-1
+ 703 430 l 1,1,-1
+ 797 430 l 1,2,-1
+ 797 290 l 1,3,-1
+ 703 290 l 1,0,-1
+203 290 m 1,4,-1
+ 203 430 l 1,5,-1
+ 297 430 l 1,6,-1
+ 297 290 l 1,7,-1
+ 203 290 l 1,4,-1
+EndSplineSet
+Substitution2: "j-vert" twodotenleader.vert
+EndChar
+
+StartChar: twodotenleader.vert
+Encoding: 1114131 -1 1
+Width: 1000
+GlyphClass: 2
+Flags: W
+LayerCount: 2
+Fore
+SplineSet
+453 540 m 1,0,-1
+ 453 680 l 1,1,-1
+ 547 680 l 1,2,-1
+ 547 540 l 1,3,-1
+ 453 540 l 1,0,-1
+453 40 m 1,4,-1
+ 453 180 l 1,5,-1
+ 547 180 l 1,6,-1
+ 547 40 l 1,7,-1
+ 453 40 l 1,4,-1
+EndSplineSet
+EndChar
+EndChars
+EndSplineFont
diff --git a/dlls/gdi32/tests/vertical.ttf b/dlls/gdi32/tests/vertical.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..c48b3c1580732f4f512fc2724f9e8f7285ec0f1f
GIT binary patch
literal 2372
zcmds2T~8cU7=F%~-G%a1*n&0<m?<p=L>6{S)eu4u%0f^+1f&hA3zKEo-F82wvjY~B
zUR4t{H1;1D?|OxowTTJwq8Ex6{sL<?G4;-yVvK3=IcJ82Hch<uOlHpedEV!J&zbW=
z0EqGvf|*P%Of6SG>;<a-q_lPX!dMasYEYFWZ;sE-%-6Sc{z3h1 at +;%>?~f!_FB#N-
z3W&(ed~ag8W$!K0cc@=X7c2+I&-?_)X39n~R at vF#hq7OxzB-fNT>Euz;vK-qlYcjB
zTdRL3e*B%buakcxOF_g8F}_$Oe>Pk2uGindF4rTAXug!T5XGzXUm;&tu&z6(Lk;bT
z2WHVK*k6tAUZegSzGF_Q?EUumqbTE3jSn2xcJ6)gF-hYRKUEuy7g{_){Kx9ZpWR@*
z=!DoN-$y<QRVz_DI^<ltxqN)^F}jUMlwdb9^jBrxMW at jwRsPjJOj7it<Yg at R_C}jt
zNx2-1kd}liJ~~0IWcGRp<B_<HFjx9qeoM)gKZ{=w7qU7cYr|4XL&~a$sM((!fASBP
zV5Y!Sw`pS7>@Yiw%ljUd<emNRR-$6(fyV43Vg;B9-(7KEN8=u;eL`!1bda3NzEzzQ
z&LKYJ%?|FT{yz9w>!}hEoiHiRDv!flwCupnXa29>dxC|z^~qs+>YPf}x7}#ti89m?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