From: Ivan Lyugaev <valy@etersoft.ru> --- dlls/gdi32/tests/Makefile.in | 4 +- dlls/gdi32/tests/font.c | 66 ++++++++ dlls/gdi32/tests/resource.rc | 6 + .../tests/wine_test_typographic_subfamily.otf | Bin 0 -> 1952 bytes .../wine_test_typographic_subfamily.otf.sfd | 122 ++++++++++++++ .../tests/wine_test_typographic_subfamily.sfd | 154 ++++++++++++++++++ .../tests/wine_test_typographic_subfamily.ttf | Bin 0 -> 1848 bytes dlls/win32u/freetype.c | 10 +- dlls/win32u/ntgdi_private.h | 2 + dlls/win32u/opentype.c | 11 ++ 10 files changed, 373 insertions(+), 2 deletions(-) create mode 100644 dlls/gdi32/tests/wine_test_typographic_subfamily.otf create mode 100644 dlls/gdi32/tests/wine_test_typographic_subfamily.otf.sfd create mode 100644 dlls/gdi32/tests/wine_test_typographic_subfamily.sfd create mode 100644 dlls/gdi32/tests/wine_test_typographic_subfamily.ttf diff --git a/dlls/gdi32/tests/Makefile.in b/dlls/gdi32/tests/Makefile.in index 3ea3cdce957..96ed722f5ea 100644 --- a/dlls/gdi32/tests/Makefile.in +++ b/dlls/gdi32/tests/Makefile.in @@ -28,4 +28,6 @@ SOURCES = \ wine_test.sfd \ wine_ttfnames.sfd \ wine_ttfnames_bold.sfd \ - wine_vdmx.sfd + wine_vdmx.sfd \ + wine_test_typographic_subfamily.otf.sfd \ + wine_test_typographic_subfamily.sfd diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index c56180b1ce6..cba898334c8 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -5778,7 +5778,72 @@ static void test_fullname2(void) test_fullname2_helper("@Batang"); test_fullname2_helper("@UnBatang"); test_fullname2_helper("@UnDotum"); +} + +static int CALLBACK test_get_typographic_subfamily_helper(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) +{ + const char *ttf_family = "WineTestTypographicSubfamilyTTF", *otf_family = "WineTestTypographicSubfamilyOTF"; + const ENUMLOGFONTA *f = (const ENUMLOGFONTA *)lf; + const char *style = (const char *)f->elfStyle; + + if (!lstrcmpA(f->elfLogFont.lfFaceName, otf_family)) + ok(!lstrcmpA(style, "Base"), "%s: style names don't match: returned %s, expect Base\n", f->elfLogFont.lfFaceName, style); + else if (!lstrcmpA(f->elfLogFont.lfFaceName, ttf_family)) + ok(!lstrcmpA(style, "Regular"), "%s: style names don't match: returned %s, expect Regular\n", f->elfLogFont.lfFaceName, style); + else + ok(FALSE, "%s invalid FaceName, expected WineTestTypographicSubfamilyTTF or WineTypographicSubfamilyOTF\n", f->elfLogFont.lfFaceName); + return 1; +} + +static void test_get_typographic_subfamily(void) +{ + char ttf_name[MAX_PATH], otf_name[MAX_PATH]; + const char *ttf_family = "WineTestTypographicSubfamilyTTF", *otf_family = "WineTestTypographicSubfamilyOTF"; + int num; + BOOL ret; + HDC hdc; + LOGFONTA lf; + + if (!write_ttf_file("wine_test_typographic_subfamily.ttf", ttf_name)) + { + skip("Failed to create ttf file for testing\n"); + return; + } + + num = AddFontResourceExA(ttf_name, FR_PRIVATE, 0); + ok(num == 1, "AddFontResourceExA should add 1 font from wine_test_typographic_subfamily.ttf\n"); + + hdc = GetDC(0); + memset(&lf, 0, sizeof(lf)); + lf.lfCharSet = DEFAULT_CHARSET; + strcpy(lf.lfFaceName, ttf_family); + lf.lfPitchAndFamily = 0; + EnumFontFamiliesExA(hdc, &lf, test_get_typographic_subfamily_helper, 0, 0); + + ReleaseDC(0, hdc); + ret = RemoveFontResourceExA(ttf_name, FR_PRIVATE, 0); + ok(ret, "RemoveFontResourceEx(%s) error %ld\n", ttf_name, GetLastError()); + DeleteFileA(ttf_name); + if (!write_ttf_file("wine_test_typographic_subfamily.otf", otf_name)) + { + skip("Failed to create otf file for testing\n"); + return; + } + + num = AddFontResourceExA(otf_name, FR_PRIVATE, 0); + ok(num == 1, "AddFontResourceExA should add 1 font from wine_test_typographic_subfamily.otf\n"); + + hdc = GetDC(0); + lf.lfCharSet = DEFAULT_CHARSET; + strcpy(lf.lfFaceName, otf_family); + lf.lfPitchAndFamily = 0; + EnumFontFamiliesExA(hdc, &lf, test_get_typographic_subfamily_helper, 0, 0); + + ReleaseDC(0, hdc); + ret = RemoveFontResourceExA(otf_name, FR_PRIVATE, 0); + ok(ret, "RemoveFontResourceEx(%s) error %ld\n", otf_name, GetLastError()); + DeleteFileA(otf_name); } static void test_GetGlyphOutline_empty_contour(void) @@ -8098,6 +8163,7 @@ START_TEST(font) test_select_object(); test_font_weight(); test_add_font_path(); + test_get_typographic_subfamily(); /* These tests should be last test until RemoveFontResource * is properly implemented. diff --git a/dlls/gdi32/tests/resource.rc b/dlls/gdi32/tests/resource.rc index 2f1273d1e42..8f6f09759c1 100644 --- a/dlls/gdi32/tests/resource.rc +++ b/dlls/gdi32/tests/resource.rc @@ -55,3 +55,9 @@ wine_nul.ttf RCDATA wine_nul.ttf /* @makedep: wine_heavy.ttf */ wine_heavy.ttf RCDATA wine_heavy.ttf + +/* @makedep: wine_test_typographic_subfamily.ttf */ +wine_test_typographic_subfamily.ttf RCDATA wine_test_typographic_subfamily.ttf + +/* @makedep: wine_test_typographic_subfamily.otf */ +wine_test_typographic_subfamily.otf RCDATA wine_test_typographic_subfamily.otf diff --git a/dlls/gdi32/tests/wine_test_typographic_subfamily.otf b/dlls/gdi32/tests/wine_test_typographic_subfamily.otf new file mode 100644 index 0000000000000000000000000000000000000000..7faa74183fa9858e50bf25c68704b45da521265f GIT binary patch literal 1952 zcmeYd3Grv(W@unwW-xGeb5rQ-u{_Gaz^1{#z-Z;>7UH{6``a7_2KE{T1_l{-7gsk1 zRR#tI2KE#N1_lZLV11)dw?tb821W%228M*>+{6L~UZxWa3@k?&7#N*0QWI13xpPw) z7#Q|2Fff>9WTYmtO=fXqU|{&dz`&rAky}#1eu42Q0|WaE1_lO>+{B6k2BrW81_nk6 z1_lPUyu{qpfKy927#J8E7#NtH3i69f{_kKgW?*3BU|?WSU|<9(WnhqH*OH3oxB1Gz z&HMu7x@SyN>>%{i0}MtC49we@nn30=Fo8rNdYGCR!Wg0;>Y2BJO@c~-DJBMn00yvn z7Uma>6Bt+-7?`@4K)&dK(2Nfl3>ld~N?19;IzR--Js=v41JYbm7!EKfGAJ@D{I_6; zVru%o3Su`{8bm;RAi!`8ZodM96O_%!AkVNE%4T9<XSfVyGc#B)`a;<(4DyUHy{ruU zOl(kbHU=4{04Q6KfrY7@fti7k1>{Z#1_mgbk-?538Omm2;A1!pWivArFx-Z+Ss3gX z+n{V#206xOP&ONb1(O(*Ey%#Zl*{1Ekk3%SP{~llkjaqFkik&GpunKPkj$XTpuk|n zV8CF+V8)=spuphCP{xqRkjJ3F;KNYKP|A?bkjRkAP{zREoL^8`l$oAUqM(tisbFMa zWTvCwS(ccm;8R(eo|sz3z!1)m$&km8$`Hbk%23Qu!Vtnx$xy(M&ydbg#E{5Pz>vX^ z$&kzt%uvdZ#E{02$dJpB$&kZP$>7fr!r;ch5T2Qr8j@OE5>i=^pI($$kdc`jT$+@Y zn46hX=^x_8z!1cc%8<@b%8<j5$WX+<5R{r;nv+<>z~IJ^&ydGZ0;Y=?(iu|0UeaSQ zU{GMNVo)I4T@c-d48{z)3?>Y^@L*za%g-xu%P&e#RWQ;sP_R<K=W+!r1w&(96J1b% z(LRX67*ZLE7>XG(!9k+HV8CF&V8{Rp3J{ASEVZaOGe1wkz`#(?z`%ff_u!2z1_mdF zM22F9R0am8#9~n40#4JQbj`pZ15NcdpwtN}vlv(yKxGpP0}EJ2@&A7Y1_s6d|NlP# z^FbMsjRD34<w@)qC1+z-GQ>rhA@2Xb6;xtk1_&bq3kw4yBcm+7)X2cd#K6d)`-7k1 zhcx348Kxhy%s(VpdUzQ3cK`DFDaI<pu$Nzkfk8lq;eenFgNO{Hnh*msNQ)waEkh)s zA^@Mw_~bwyV`5-pWK>G*-uuIKFXP_5Key~<-YfP?;>XH=5^Q__l#Bjw{ki3jD?8uA z^Flw=zl&&}7GChf{X36n#mt(yb7#()H?MY9rCeogO@+Mhf$Z-)M1KpfP+7Nb#i#GW z--Yu&WyodZsr(j}=lfM7(k<G}!*!nPJP*%z5$@Bcd3ZrdjDdlHhk=1XfB{rtFfgz{ ZX=uWGs&-~B$dSnP7V`@RBjy*3lK~3dVaxyk literal 0 HcmV?d00001 diff --git a/dlls/gdi32/tests/wine_test_typographic_subfamily.otf.sfd b/dlls/gdi32/tests/wine_test_typographic_subfamily.otf.sfd new file mode 100644 index 00000000000..329d18b1a9c --- /dev/null +++ b/dlls/gdi32/tests/wine_test_typographic_subfamily.otf.sfd @@ -0,0 +1,122 @@ +SplineFontDB: 3.2 +FontName: WineTestTypographicSubfamily +FullName: WineTestTypographicSubfamily +FamilyName: WineTestTypographicSubfamily +Weight: Regular +Copyright: Copyright (c) 2026, Ivan Lyugaev +Version: 001.000 +ItalicAngle: 0 +UnderlinePosition: -100 +UnderlineWidth: 50 +Ascent: 800 +Descent: 200 +InvalidEm: 0 +sfntRevision: 0x00010000 +LayerCount: 2 +Layer: 0 0 "+BBcEMAQ0BD0EOAQ5 +BD8EOwQwBD0A" 1 +Layer: 1 0 "+BB8ENQRABDUENAQ9BDgEOQAA +BD8EOwQwBD0A" 0 +XUID: [1021 477 449912397 9628] +StyleMap: 0x0040 +FSType: 0 +OS2Version: 4 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +CreationTime: 1776083902 +ModificationTime: 1776084288 +PfmFamily: 17 +TTFWeight: 400 +TTFWidth: 5 +LineGap: 90 +VLineGap: 0 +Panose: 2 0 5 9 0 0 0 0 0 0 +OS2TypoAscent: 800 +OS2TypoAOffset: 0 +OS2TypoDescent: -200 +OS2TypoDOffset: 0 +OS2TypoLinegap: 90 +OS2WinAscent: 642 +OS2WinAOffset: 0 +OS2WinDescent: -86 +OS2WinDOffset: 0 +HheadAscent: 642 +HheadAOffset: 0 +HheadDescent: 86 +HheadDOffset: 0 +OS2SubXSize: 650 +OS2SubYSize: 700 +OS2SubXOff: 0 +OS2SubYOff: 140 +OS2SupXSize: 650 +OS2SupYSize: 700 +OS2SupXOff: 0 +OS2SupYOff: 480 +OS2StrikeYSize: 49 +OS2StrikeYPos: 258 +OS2Vendor: 'PfEd' +OS2CodePages: 00000001.00000000 +OS2UnicodeRanges: 00000001.00000000.00000000.00000000 +DEI: 91125 +LangName: 1033 "" "WineTestTypographicSubfamilyOTF" "" "FontForge 2.0 : WineTestTypographicSubfamily : 13-4-2026" "WineTestTypographicSubfamilyOTF" "Version 001.000" "" "" "" "" "" "" "" "" "" "" "" "Base" +Encoding: UnicodeBmp +UnicodeInterp: none +NameList: AGL For New Fonts +DisplaySize: -48 +AntiAlias: 1 +FitToEm: 0 +WinInfo: 0 38 15 +BeginPrivate: 5 +BlueShift 1 0 +StdHW 4 [68] +StdVW 5 [128] +StemSnapH 4 [68] +StemSnapV 8 [64 128] +EndPrivate +BeginChars: 65537 2 + +StartChar: .notdef +Encoding: 65536 -1 0 +Width: 1000 +GlyphClass: 1 +Flags: MW +HStem: 0 50<100 900 100 950> 483 50<100 900 100 100> +VStem: 50 50<50 50 50 483> 900 50<50 483 483 483> +LayerCount: 2 +Fore +SplineSet +50 0 m 1 + 50 533 l 1 + 950 533 l 1 + 950 0 l 1 + 50 0 l 1 +100 50 m 1 + 900 50 l 1 + 900 483 l 1 + 100 483 l 1 + 100 50 l 1 +EndSplineSet +EndChar + +StartChar: exclam +Encoding: 33 33 1 +Width: 1000 +GlyphClass: 1 +Flags: MW +HStem: 86 68<458 476> +VStem: 403 128<348.5 475.5> 435 64<110.5 129.5> +LayerCount: 2 +Fore +SplineSet +435 120 m 0xa0 + 435 139 449 154 467 154 c 0 + 485 154 499 139 499 120 c 0 + 499 101 485 86 467 86 c 0 + 449 86 435 101 435 120 c 0xa0 +403 412 m 0xc0 + 403 539 432 642 467 642 c 0 + 502 642 531 539 531 412 c 0 + 531 285 502 182 467 182 c 0 + 432 182 403 285 403 412 c 0xc0 +EndSplineSet +EndChar +EndChars +EndSplineFont diff --git a/dlls/gdi32/tests/wine_test_typographic_subfamily.sfd b/dlls/gdi32/tests/wine_test_typographic_subfamily.sfd new file mode 100644 index 00000000000..349ce78b21c --- /dev/null +++ b/dlls/gdi32/tests/wine_test_typographic_subfamily.sfd @@ -0,0 +1,154 @@ +SplineFontDB: 3.2 +FontName: WineTestTypographicSubfamilyTTF +FullName: WineTestTypographicSubfamilyTTF +FamilyName: WineTestTypographicSubfamilyTTF +Weight: Book +Copyright: Copyright (c) 2026, Ivan Lyugaev +Version: 001.000 +ItalicAngle: 0 +UnderlinePosition: -150 +UnderlineWidth: 50 +Ascent: 800 +Descent: 200 +InvalidEm: 0 +sfntRevision: 0x00010000 +LayerCount: 2 +Layer: 0 1 "+BBcEMAQ0BD0EOAQ5 +BD8EOwQwBD0A" 1 +Layer: 1 1 "+BB8ENQRABDUENAQ9BDgEOQAA +BD8EOwQwBD0A" 0 +XUID: [1021 477 449912397 8335] +StyleMap: 0x0040 +FSType: 0 +OS2Version: 4 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +CreationTime: 1776083902 +ModificationTime: 1776084288 +PfmFamily: 17 +TTFWeight: 400 +TTFWidth: 5 +LineGap: 90 +VLineGap: 0 +Panose: 2 0 5 9 0 0 0 0 0 0 +OS2TypoAscent: 800 +OS2TypoAOffset: 0 +OS2TypoDescent: -200 +OS2TypoDOffset: 0 +OS2TypoLinegap: 90 +OS2WinAscent: 642 +OS2WinAOffset: 0 +OS2WinDescent: -86 +OS2WinDOffset: 0 +HheadAscent: 642 +HheadAOffset: 0 +HheadDescent: 86 +HheadDOffset: 0 +OS2SubXSize: 650 +OS2SubYSize: 700 +OS2SubXOff: 0 +OS2SubYOff: 140 +OS2SupXSize: 650 +OS2SupYSize: 700 +OS2SupXOff: 0 +OS2SupYOff: 480 +OS2StrikeYSize: 49 +OS2StrikeYPos: 258 +OS2Vendor: 'PfEd' +OS2CodePages: 00000001.00000000 +OS2UnicodeRanges: 00000001.00000000.00000000.00000000 +DEI: 91125 +ShortTable: maxp 16 + 1 + 0 + 4 + 16 + 2 + 0 + 0 + 2 + 0 + 1 + 1 + 0 + 64 + 0 + 0 + 0 +EndShort +LangName: 1033 "" "" "Regular" "FontForge 2.0 : WineTestTypographicSubfamily : 13-4-2026" "" "Version 001.000" "" "" "" "" "" "" "" "" "" "" "" "Base" +GaspTable: 1 65535 2 0 +Encoding: UnicodeBmp +UnicodeInterp: none +NameList: AGL For New Fonts +DisplaySize: -48 +AntiAlias: 1 +FitToEm: 0 +WinInfo: 38 38 15 +BeginChars: 65539 4 + +StartChar: .notdef +Encoding: 65536 -1 0 +Width: 1000 +GlyphClass: 1 +Flags: W +LayerCount: 2 +Fore +SplineSet +50 0 m 1,0,-1 + 50 533 l 1,1,-1 + 950 533 l 1,2,-1 + 950 0 l 1,3,-1 + 50 0 l 1,0,-1 +100 50 m 1,4,-1 + 900 50 l 1,5,-1 + 900 483 l 1,6,-1 + 100 483 l 1,7,-1 + 100 50 l 1,4,-1 +EndSplineSet +EndChar + +StartChar: .null +Encoding: 65537 -1 1 +Width: 0 +GlyphClass: 1 +Flags: W +LayerCount: 2 +EndChar + +StartChar: nonmarkingreturn +Encoding: 65538 -1 2 +Width: 1000 +GlyphClass: 1 +Flags: W +LayerCount: 2 +EndChar + +StartChar: exclam +Encoding: 33 33 3 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +435 120 m 128,-1,1 + 435 134 435 134 444.5 144 c 128,-1,2 + 454 154 454 154 467 154 c 128,-1,3 + 480 154 480 154 489.5 144 c 128,-1,4 + 499 134 499 134 499 120 c 128,-1,5 + 499 106 499 106 489.5 96 c 128,-1,6 + 480 86 480 86 467 86 c 128,-1,7 + 454 86 454 86 444.5 96 c 128,-1,0 + 435 106 435 106 435 120 c 128,-1,1 +403 412 m 128,-1,9 + 403 507 403 507 422 574.5 c 128,-1,10 + 441 642 441 642 467 642 c 128,-1,11 + 493 642 493 642 512 574.5 c 128,-1,12 + 531 507 531 507 531 412 c 128,-1,13 + 531 317 531 317 512 249.5 c 128,-1,14 + 493 182 493 182 467 182 c 128,-1,15 + 441 182 441 182 422 249.5 c 128,-1,8 + 403 317 403 317 403 412 c 128,-1,9 +EndSplineSet +EndChar +EndChars +EndSplineFont diff --git a/dlls/gdi32/tests/wine_test_typographic_subfamily.ttf b/dlls/gdi32/tests/wine_test_typographic_subfamily.ttf new file mode 100644 index 0000000000000000000000000000000000000000..af819567294914edc6ae7c9073fdfda26202a868 GIT binary patch literal 1848 zcmZQzWME+6WoTevW(aU|3-R5k{cR2d1G@|Z1A~mai>n)hCIc4(1KS@41_n9*V11)d zw?tb82F3^m28M*>+{6L~e&+KG42&lj7#N+>6N?M}|7T!kU|{>gz`($fo>Q6T!BgYH zz`!iQz`&4_k(!vI&z+mfz`$^afq}s+BO^7DZ8D290|TQ70|SFfMs7(3_YTIR3=E7r z7#J7?a`KZC8Qd5&7#Ns&7#JA1auX{G7(5t+85kHX7#J87@)C1X&+c*(WME*fVPIhP zF32w~`QOK2%D}*Of`NfS3+y*W28J(B0#f7oZN4&aGrwS9U|@L0G{p`=Pd&h3#K6G3 zjj0LbUIr$RC<6mXA5#-U7(*09J@Yn@2viP2v4BNb7zChtKsp)0Vh#`m3@pqq7$-2W zGB7Z8G3{YsVCaF+j1L$L8JQRum>5_&p(?@l!PyJ}X|5>@2N)C?6qyzNTQEd1HT_=& zaT8pP0s|xS3y{kh7(gy$e!)1IfdLfmU@QZ62Lpo*12dQ<!@$Czz`(%3!T@o#;{X2) z3=E3@|NnmkmIoQmhHwPPbx>cyEd;A$MsSBMON0RgjTk@?1W6g949pDd3=GDCih`<& zf{I4WEq~TAEBtxDB>MNY5#vS%CdSDOVNAkIO$_V|{0s~#CT2!rB5X=(P?~YGu#~W{ zl(CwLnwm+LjEIPg$n$;e?fcpxK`6j*3>>x~o&tjtl+DN>)NEW@2DxxC~`8GgvVC zLfI?~@{BOOtPK22Y*2AF26?71C|i($g$b0i8CgJS4U{sO89;1C20MmiQ0ideWME?8 zV>k?DGcy!0+=jAQ80;9^plntKImTyDHXDN-lNgjO$iTr=#^B75&rrZn$xy_Q$&k*F z!BE1Wz@Wj9%%I7jz+l8+z+l8+#-PKXz~ISH#*oO6$DqLA!%)dk%8<^G$dJlV#=zj5 zUr<?;nVwOippmSpU}Ruqrla6lmYApDQ(2mxm|Dib5YCXvkjIe95W<kkP|Q%m5W-N& zP{5GSkj_xVkjPNLkin42kjxOwP|A?Rkj9Y6kjs$Cki$^P5W*0`;KslZo|%^#l3H96 zQdy9nUX)mnk(nG^nv|B9o0(G?65__d5X6wmkj_xbki(G3P{hCxl$u_elUT&S;Kq>8 zkjGF0ri&QT8B)Ps(qk}SP++iPP$1h~5Z#6h#tga)CJegpU}A8~&nt1uFG^2UFw!$n zuu{P1as?{|Lt|YNT~L70K8V5?QW=UEiWxG&L88E5z+k{&$N&lo5Q`x!wWv5VKTpBH zz);V?z<~DdabiehC}v1yU~oz-2GuB_5}1L3;eRu@Tm;o>pge`ZETCeJfr$Y`GcYjz m|Ife#&LyClMGTzZ85x*C=^Cs8Y8qGt!&9|0b3q0n*Bbx>BoPMy literal 0 HcmV?d00001 diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index a660b166a0f..e8222fc9869 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -937,8 +937,16 @@ static struct unix_face *unix_face_create( const char *unix_name, void *data_ptr memset( &style_name, 0, sizeof(style_name) ); style_name.primary_langid = primary_langid; - opentype_enum_style_names( tt_name_v0, search_face_name_callback, &style_name ); + opentype_enum_typographic_style_names( tt_name_v0, search_face_name_callback, &style_name ); This->style_name = decode_opentype_name( &style_name.face_name ); + if (!This->style_name || !This->style_name[0] || !(This->ntm_flags & NTM_PS_OPENTYPE)) + { + memset( &style_name, 0, sizeof(style_name) ); + style_name.primary_langid = primary_langid; + free(This->style_name); + opentype_enum_style_names( tt_name_v0, search_face_name_callback, &style_name ); + This->style_name = decode_opentype_name( &style_name.face_name ); + } memset( &full_name, 0, sizeof(full_name) ); full_name.primary_langid = primary_langid; diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h index fcfbce58fea..c6cef5c1e34 100644 --- a/dlls/win32u/ntgdi_private.h +++ b/dlls/win32u/ntgdi_private.h @@ -368,6 +368,8 @@ extern BOOL opentype_get_tt_name_v0( const void *data, size_t size, const struct typedef BOOL ( *opentype_enum_names_cb )( LANGID langid, struct opentype_name *name, void *user ); extern BOOL opentype_enum_family_names( const struct tt_name_v0 *tt_name_v0, opentype_enum_names_cb callback, void *user ); +extern BOOL opentype_enum_typographic_style_names( const struct tt_name_v0 *tt_name_v0, + opentype_enum_names_cb callback, void *user ); extern BOOL opentype_enum_style_names( const struct tt_name_v0 *tt_name_v0, opentype_enum_names_cb callback, void *user ); extern BOOL opentype_enum_full_names( const struct tt_name_v0 *tt_name_v0, diff --git a/dlls/win32u/opentype.c b/dlls/win32u/opentype.c index b841e07cd5f..65c2a3c12d4 100644 --- a/dlls/win32u/opentype.c +++ b/dlls/win32u/opentype.c @@ -701,6 +701,17 @@ BOOL opentype_enum_family_names( const struct tt_name_v0 *header, opentype_enum_ return FALSE; } +BOOL opentype_enum_typographic_style_names( const struct tt_name_v0 *header, opentype_enum_names_cb callback, void *user ) +{ + if (opentype_enum_font_names( header, OPENTYPE_PLATFORM_WIN, OPENTYPE_NAME_TYPOGRAPHIC_SUBFAMILY, callback, user )) + return TRUE; + if (opentype_enum_font_names( header, OPENTYPE_PLATFORM_MAC, OPENTYPE_NAME_TYPOGRAPHIC_SUBFAMILY, callback, user )) + return TRUE; + if (opentype_enum_font_names( header, OPENTYPE_PLATFORM_UNICODE, OPENTYPE_NAME_TYPOGRAPHIC_SUBFAMILY, callback, user )) + return TRUE; + return FALSE; +} + BOOL opentype_enum_style_names( const struct tt_name_v0 *header, opentype_enum_names_cb callback, void *user ) { if (opentype_enum_font_names( header, OPENTYPE_PLATFORM_WIN, OPENTYPE_NAME_SUBFAMILY, callback, user )) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10891