diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 06d3b042deb..8c5f26547e7 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -6298,6 +6298,31 @@ static void test_vertical_font(void) ok(ret, "RemoveFontResourceEx() error %ld\n", GetLastError()); DeleteFileA(ttf_name); + + if (!write_ttf_file("vertical2.ttf", ttf_name)) + { + skip("Failed to create ttf file for testing\n"); + return; + } + + num = AddFontResourceExA(ttf_name, FR_PRIVATE, 0); + ok(num == 2, "AddFontResourceExA should add 2 fonts from vertical2.ttf\n"); + + check_vertical_font("WineTestVertical2", &installed, &selected, &gm, &hgi); + ok(installed, "WineTestVertical2 is not installed\n"); + ok(selected, "WineTestVertical2 is not selected\n"); + + check_vertical_font("@WineTestVertical2", &installed, &selected, &gm, &vgi); + ok(installed, "@WineTestVertical2 is not installed\n"); + ok(selected, "@WineTestVertical2 is not selected\n"); + + /* use the first vertical alternates table that doesn't replace U+2025 */ + todo_wine ok(hgi == vgi, "different glyph h:%u v:%u\n", hgi, vgi); + + ret = RemoveFontResourceExA(ttf_name, FR_PRIVATE, 0); + ok(ret, "RemoveFontResourceEx() error %ld\n", GetLastError()); + + DeleteFileA(ttf_name); } static INT CALLBACK has_vertical_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, diff --git a/dlls/gdi32/tests/resource.rc b/dlls/gdi32/tests/resource.rc index 477d07de45d..2f1273d1e42 100644 --- a/dlls/gdi32/tests/resource.rc +++ b/dlls/gdi32/tests/resource.rc @@ -29,6 +29,9 @@ wine_vdmx.ttf RCDATA wine_vdmx.ttf /* @makedep: vertical.ttf */ vertical.ttf RCDATA vertical.ttf +/* @makedep: vertical2.ttf */ +vertical2.ttf RCDATA vertical2.ttf + /* @makedep: wine_longname.ttf */ wine_longname.ttf RCDATA wine_longname.ttf diff --git a/dlls/gdi32/tests/vertical2.sfd b/dlls/gdi32/tests/vertical2.sfd new file mode 100644 index 00000000000..2b8db8deb95 --- /dev/null +++ b/dlls/gdi32/tests/vertical2.sfd @@ -0,0 +1,1059 @@ +SplineFontDB: 3.0 +FontName: WineTestVertical2 +FullName: WineTestVertical2 +FamilyName: WineTestVertical2 +Weight: Regular +Copyright: Copyright(c) 2013 Wine Project +Version: 1.055 +ItalicAngle: 0 +UnderlinePosition: -100 +UnderlineWidth: 50 +Ascent: 860 +Descent: 140 +sfntRevision: 0x00010e14 +LayerCount: 2 +Layer: 0 1 "Back" 1 +Layer: 1 1 "Fore" 0 +HasVMetrics: 1 +XUID: [1021 564 53499222 16482262] +FSType: 0 +OS2Version: 1 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +PfmFamily: 17 +TTFWeight: 400 +TTFWidth: 5 +LineGap: 90 +VLineGap: 0 +Panose: 2 11 5 9 2 2 3 2 2 7 +OS2TypoAscent: 860 +OS2TypoAOffset: 0 +OS2TypoDescent: -140 +OS2TypoDOffset: 0 +OS2TypoLinegap: 90 +OS2WinAscent: 1075 +OS2WinAOffset: 0 +OS2WinDescent: 320 +OS2WinDOffset: 0 +HheadAscent: 1075 +HheadAOffset: 0 +HheadDescent: -320 +HheadDOffset: 0 +OS2SubXSize: 650 +OS2SubYSize: 700 +OS2SubXOff: 0 +OS2SubYOff: 140 +OS2SupXSize: 650 +OS2SupYSize: 700 +OS2SupXOff: 0 +OS2SupYOff: 480 +OS2StrikeYSize: 49 +OS2StrikeYPos: 258 +OS2FamilyClass: 2057 +OS2Vendor: 'M+ ' +OS2CodePages: 4012019f.dfd70000 +OS2UnicodeRanges: e00002ff.4a47fdeb.00000012.00000000 +Lookup: 1 0 0 "fake-gsubvert" {"fake-vert" } ['vert' ('????' <'dflt' > ) ] +Lookup: 1 0 0 "gsubvert" {"j-vert" } ['vert' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ] +MarkAttachClasses: 1 +DEI: 91125 +TtTable: prep +PUSHW_1 + 511 +SCANCTRL +PUSHB_1 + 1 +SCANTYPE +SVTCA[y-axis] +MPPEM +PUSHB_1 + 8 +LT +IF +PUSHB_2 + 1 + 1 +INSTCTRL +EIF +PUSHB_2 + 70 + 6 +CALL +IF +POP +PUSHB_1 + 16 +EIF +MPPEM +PUSHB_1 + 20 +GT +IF +POP +PUSHB_1 + 128 +EIF +SCVTCI +PUSHB_1 + 6 +CALL +NOT +IF +EIF +PUSHB_1 + 20 +CALL +EndTTInstrs +TtTable: fpgm +PUSHB_1 + 0 +FDEF +PUSHB_1 + 0 +SZP0 +MPPEM +PUSHB_1 + 42 +LT +IF +PUSHB_1 + 74 +SROUND +EIF +PUSHB_1 + 0 +SWAP +MIAP[rnd] +RTG +PUSHB_1 + 6 +CALL +IF +RTDG +EIF +MPPEM +PUSHB_1 + 42 +LT +IF +RDTG +EIF +DUP +MDRP[rp0,rnd,grey] +PUSHB_1 + 1 +SZP0 +MDAP[no-rnd] +RTG +ENDF +PUSHB_1 + 1 +FDEF +DUP +MDRP[rp0,min,white] +PUSHB_1 + 12 +CALL +ENDF +PUSHB_1 + 2 +FDEF +MPPEM +GT +IF +RCVT +SWAP +EIF +POP +ENDF +PUSHB_1 + 3 +FDEF +ROUND[Black] +RTG +DUP +PUSHB_1 + 64 +LT +IF +POP +PUSHB_1 + 64 +EIF +ENDF +PUSHB_1 + 4 +FDEF +PUSHB_1 + 6 +CALL +IF +POP +SWAP +POP +ROFF +IF +MDRP[rp0,min,rnd,black] +ELSE +MDRP[min,rnd,black] +EIF +ELSE +MPPEM +GT +IF +IF +MIRP[rp0,min,rnd,black] +ELSE +MIRP[min,rnd,black] +EIF +ELSE +SWAP +POP +PUSHB_1 + 5 +CALL +IF +PUSHB_1 + 70 +SROUND +EIF +IF +MDRP[rp0,min,rnd,black] +ELSE +MDRP[min,rnd,black] +EIF +EIF +EIF +RTG +ENDF +PUSHB_1 + 5 +FDEF +GFV +NOT +AND +ENDF +PUSHB_1 + 6 +FDEF +PUSHB_2 + 34 + 1 +GETINFO +LT +IF +PUSHB_1 + 32 +GETINFO +NOT +NOT +ELSE +PUSHB_1 + 0 +EIF +ENDF +PUSHB_1 + 7 +FDEF +PUSHB_2 + 36 + 1 +GETINFO +LT +IF +PUSHB_1 + 64 +GETINFO +NOT +NOT +ELSE +PUSHB_1 + 0 +EIF +ENDF +PUSHB_1 + 8 +FDEF +SRP2 +SRP1 +DUP +IP +MDAP[rnd] +ENDF +PUSHB_1 + 9 +FDEF +DUP +RDTG +PUSHB_1 + 6 +CALL +IF +MDRP[rnd,grey] +ELSE +MDRP[min,rnd,black] +EIF +DUP +PUSHB_1 + 3 +CINDEX +MD[grid] +SWAP +DUP +PUSHB_1 + 4 +MINDEX +MD[orig] +PUSHB_1 + 0 +LT +IF +ROLL +NEG +ROLL +SUB +DUP +PUSHB_1 + 0 +LT +IF +SHPIX +ELSE +POP +POP +EIF +ELSE +ROLL +ROLL +SUB +DUP +PUSHB_1 + 0 +GT +IF +SHPIX +ELSE +POP +POP +EIF +EIF +RTG +ENDF +PUSHB_1 + 10 +FDEF +PUSHB_1 + 6 +CALL +IF +POP +SRP0 +ELSE +SRP0 +POP +EIF +ENDF +PUSHB_1 + 11 +FDEF +DUP +MDRP[rp0,white] +PUSHB_1 + 12 +CALL +ENDF +PUSHB_1 + 12 +FDEF +DUP +MDAP[rnd] +PUSHB_1 + 7 +CALL +NOT +IF +DUP +DUP +GC[orig] +SWAP +GC[cur] +SUB +ROUND[White] +DUP +IF +DUP +ABS +DIV +SHPIX +ELSE +POP +POP +EIF +ELSE +POP +EIF +ENDF +PUSHB_1 + 13 +FDEF +SRP2 +SRP1 +DUP +DUP +IP +MDAP[rnd] +DUP +ROLL +DUP +GC[orig] +ROLL +GC[cur] +SUB +SWAP +ROLL +DUP +ROLL +SWAP +MD[orig] +PUSHB_1 + 0 +LT +IF +SWAP +PUSHB_1 + 0 +GT +IF +PUSHB_1 + 64 +SHPIX +ELSE +POP +EIF +ELSE +SWAP +PUSHB_1 + 0 +LT +IF +PUSHB_1 + 64 +NEG +SHPIX +ELSE +POP +EIF +EIF +ENDF +PUSHB_1 + 14 +FDEF +PUSHB_1 + 6 +CALL +IF +RTDG +MDRP[rp0,rnd,white] +RTG +POP +POP +ELSE +DUP +MDRP[rp0,rnd,white] +ROLL +MPPEM +GT +IF +DUP +ROLL +SWAP +MD[grid] +DUP +PUSHB_1 + 0 +NEQ +IF +SHPIX +ELSE +POP +POP +EIF +ELSE +POP +POP +EIF +EIF +ENDF +PUSHB_1 + 15 +FDEF +SWAP +DUP +MDRP[rp0,rnd,white] +DUP +MDAP[rnd] +PUSHB_1 + 7 +CALL +NOT +IF +SWAP +DUP +IF +MPPEM +GTEQ +ELSE +POP +PUSHB_1 + 1 +EIF +IF +ROLL +PUSHB_1 + 4 +MINDEX +MD[grid] +SWAP +ROLL +SWAP +DUP +ROLL +MD[grid] +ROLL +SWAP +SUB +SHPIX +ELSE +POP +POP +POP +POP +EIF +ELSE +POP +POP +POP +POP +POP +EIF +ENDF +PUSHB_1 + 16 +FDEF +DUP +MDRP[rp0,min,white] +PUSHB_1 + 18 +CALL +ENDF +PUSHB_1 + 17 +FDEF +DUP +MDRP[rp0,white] +PUSHB_1 + 18 +CALL +ENDF +PUSHB_1 + 18 +FDEF +DUP +MDAP[rnd] +PUSHB_1 + 7 +CALL +NOT +IF +DUP +DUP +GC[orig] +SWAP +GC[cur] +SUB +ROUND[White] +ROLL +DUP +GC[orig] +SWAP +GC[cur] +SWAP +SUB +ROUND[White] +ADD +DUP +IF +DUP +ABS +DIV +SHPIX +ELSE +POP +POP +EIF +ELSE +POP +POP +EIF +ENDF +PUSHB_1 + 19 +FDEF +DUP +ROLL +DUP +ROLL +SDPVTL[orthog] +DUP +PUSHB_1 + 3 +CINDEX +MD[orig] +ABS +SWAP +ROLL +SPVTL[orthog] +PUSHB_1 + 32 +LT +IF +ALIGNRP +ELSE +MDRP[grey] +EIF +ENDF +PUSHB_1 + 20 +FDEF +PUSHB_4 + 0 + 64 + 1 + 64 +WS +WS +SVTCA[x-axis] +MPPEM +PUSHW_1 + 4096 +MUL +SVTCA[y-axis] +MPPEM +PUSHW_1 + 4096 +MUL +DUP +ROLL +DUP +ROLL +NEQ +IF +DUP +ROLL +DUP +ROLL +GT +IF +SWAP +DIV +DUP +PUSHB_1 + 0 +SWAP +WS +ELSE +DIV +DUP +PUSHB_1 + 1 +SWAP +WS +EIF +DUP +PUSHB_1 + 64 +GT +IF +PUSHB_3 + 0 + 32 + 0 +RS +MUL +WS +PUSHB_3 + 1 + 32 + 1 +RS +MUL +WS +PUSHB_1 + 32 +MUL +PUSHB_1 + 25 +NEG +JMPR +POP +EIF +ELSE +POP +POP +EIF +ENDF +PUSHB_1 + 21 +FDEF +PUSHB_1 + 1 +RS +MUL +SWAP +PUSHB_1 + 0 +RS +MUL +SWAP +ENDF +EndTTInstrs +ShortTable: cvt 6 + -220 + 0 + 520 + 730 + 33 + 633 +EndShort +ShortTable: maxp 16 + 1 + 0 + 7223 + 192 + 22 + 102 + 11 + 2 + 1 + 2 + 22 + 0 + 256 + 46 + 1 + 1 +EndShort +LangName: 1033 "" "" "" "FontForge 2.0 : WineTestVertical2: 11-3-2013" "" "Version 1.055" "" "" "" "" "" "http://www.winehq.com" "" "" "" "" "WineTestVertical2" "regular" +GaspTable: 1 65535 2 0 +Encoding: UnicodeFull +Compacted: 1 +UnicodeInterp: none +NameList: Adobe Glyph List +DisplaySize: -36 +AntiAlias: 1 +FitToEm: 1 +WinInfo: 0 23 9 +BeginPrivate: 0 +EndPrivate +TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 +BeginChars: 1114326 15 + +StartChar: .notdef +Encoding: 1114112 -1 0 +Width: 364 +Flags: W +TtInstrs: +PUSHB_2 + 1 + 0 +MDAP[rnd] +ALIGNRP +PUSHB_3 + 7 + 4 + 4 +MIRP[min,rnd,black] +SHP[rp2] +PUSHB_2 + 6 + 5 +MDRP[rp0,min,rnd,grey] +ALIGNRP +PUSHB_3 + 3 + 2 + 4 +MIRP[min,rnd,black] +SHP[rp2] +SVTCA[y-axis] +PUSHB_2 + 3 + 0 +MDAP[rnd] +ALIGNRP +PUSHB_3 + 5 + 4 + 4 +MIRP[min,rnd,black] +SHP[rp2] +PUSHB_3 + 7 + 6 + 5 +MIRP[rp0,min,rnd,grey] +ALIGNRP +PUSHB_3 + 1 + 2 + 4 +MIRP[min,rnd,black] +SHP[rp2] +EndTTInstrs +LayerCount: 2 +Fore +SplineSet +33 0 m 1,0,-1 + 33 666 l 1,1,-1 + 298 666 l 1,2,-1 + 298 0 l 1,3,-1 + 33 0 l 1,0,-1 +66 33 m 1,4,-1 + 265 33 l 1,5,-1 + 265 633 l 1,6,-1 + 66 633 l 1,7,-1 + 66 33 l 1,4,-1 +EndSplineSet +EndChar + +StartChar: glyph1 +Encoding: 1114113 -1 1 +Width: 0 +Flags: W +LayerCount: 2 +EndChar + +StartChar: glyph2 +Encoding: 1114114 -1 2 +Width: 333 +Flags: W +LayerCount: 2 +EndChar + +StartChar: W +Encoding: 87 87 3 +Width: 500 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +415 0 m 1,0,-1 + 257 725 l 1,1,-1 + 85 0 l 1,2,-1 + 415 0 l 1,0,-1 +EndSplineSet +EndChar + +StartChar: twodotenleader +Encoding: 8229 8229 4 +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: uni3042 +Encoding: 12354 12354 5 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +133 677 m 1,0,-1 + 133 613 l 1,1,-1 + 487 0 l 1,2,-1 + 867 613 l 1,3,-1 + 867 677 l 1,4,-1 + 133 677 l 1,0,-1 +EndSplineSet +EndChar + +StartChar: uni5EAD +Encoding: 24237 24237 6 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +21 -21 m 1,0,1 +876 741.3 m 1,2,-1 + 122 815.3 l 1,3,-1 + 122 683.3 l 1,4,-1 + 876 741.3 l 1,2,-1 +EndSplineSet +EndChar + +StartChar: uniFE30 +Encoding: 65072 65072 7 +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 + +StartChar: uniFF37 +Encoding: 65335 65335 8 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +945 641 m 17,0,-1 + 519 797 l 1,1,-1 + 97 637 l 9,2,-1 + 527 0 l 25,3,-1 + 945 641 l 17,0,-1 +EndSplineSet +EndChar + +StartChar: uniFF5B +Encoding: 65371 65371 9 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +892 755 m 17,0,-1 + 428 392 l 1,1,-1 + 428 328 l 1,2,-1 + 892 -35 l 9,3,-1 + 892 755 l 17,0,-1 +EndSplineSet +Substitution2: "fake-vert" uniFF5B.vert +Substitution2: "j-vert" uniFF5B.vert +EndChar + +StartChar: uniFF9D +Encoding: 65437 65437 10 +Width: 500 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +467 623 m 17,0,-1 + 397 637 l 1,1,-1 + 77 322.2 l 17,2,-1 + 100 -10 l 1,3,-1 + 467 623 l 17,0,-1 +EndSplineSet +EndChar + +StartChar: twodotenleader.vert +Encoding: 1114272 -1 11 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +453 40 m 1,0,-1 + 453 180 l 1,1,-1 + 547 180 l 1,2,-1 + 547 40 l 1,3,-1 + 453 40 l 1,0,-1 +453 540 m 1,4,-1 + 453 680 l 1,5,-1 + 547 680 l 1,6,-1 + 547 540 l 1,7,-1 + 453 540 l 1,4,-1 +EndSplineSet +EndChar + +StartChar: uni3041.vert +Encoding: 1114293 -1 12 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +522 557 m 1,0,-1 + 875 557 l 1,1,-1 + 875 617 l 1,2,-1 + 522 617 l 1,3,-1 + 522 715 l 1,4,-1 + 454 715 l 1,5,-1 + 454 617 l 1,6,-1 + 285 617 l 1,7,-1 + 285 557 l 1,8,-1 + 522 557 l 1,0,-1 +EndSplineSet +EndChar + +StartChar: uniFF5B.vert +Encoding: 1114321 -1 13 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +543 340 m 25,0,-1 + 29 -30 l 25,1,-1 + 971 -32 l 1,2,-1 + 521 112 l 1,3,-1 + 543 340 l 25,0,-1 +EndSplineSet +EndChar + +StartChar: uni3041 +Encoding: 12353 12353 14 +Width: 1000 +Flags: W +LayerCount: 2 +Fore +SplineSet +225 503 m 1,0,-1 + 225 455 l 1,1,-1 + 490 -5 l 1,2,-1 + 775 455 l 1,3,-1 + 775 503 l 1,4,-1 + 225 503 l 1,0,-1 +EndSplineSet +Substitution2: "fake-vert" uni3041.vert +EndChar +EndChars +EndSplineFont diff --git a/dlls/gdi32/tests/vertical2.ttf b/dlls/gdi32/tests/vertical2.ttf new file mode 100644 index 00000000000..f7b22386d29 Binary files /dev/null and b/dlls/gdi32/tests/vertical2.ttf differ