Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aat] Mac OS 10.12 Apple Chancery feature activation issues #1331

Closed
drott opened this issue Oct 30, 2018 · 7 comments
Closed

[aat] Mac OS 10.12 Apple Chancery feature activation issues #1331

drott opened this issue Oct 30, 2018 · 7 comments
Labels
Chrome Chrome/Chromium project related issues and requests

Comments

@drott
Copy link
Collaborator

drott commented Oct 30, 2018

HarfBuzz fails to activate the following features listed below on a specific older version of Apple Chancery.

$ ttx -t name -o-  "Apple Chancery.ttf" |grep -A2 ' nameID="3" platformID="1" platEncID="0" langID="0x0" unicode="True"'
Dumping "Apple Chancery.ttf" to "-"...
Dumping 'name' table...
    <namerecord nameID="3" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Apple Chancery; 8.0d1e1; 2013-02-06
    </namerecord>
$ shasum -a256 "Apple Chancery.ttf"
5c2c395db1530579e282895f08f087f30bfba3951f3ebf7f7faaa7497596be47  Apple_Chancery_10_12.ttf

Ligatures

Coretext forms T_h and t_h ligatures. Other example ligatures in this font: ll te to tr fr fu fj

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=coretext --font-funcs=ot "Th th"
[T_h=0+2308|space=2+569|t_h=3+1687]

HarfBuzz' native AAT shaper does not form the ligatures:

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=ot --font-funcs=ot "Th th"
[T=0+1560|h=1+1090|space=2+569|t=3+725|h=4+1090]

Smart Quotes

Where CoreText forms smart quotes:

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=coretext  "\"quotes\""
[quote.double.left=0+779|q=1+993|u=2+1148|o=3+878|t_e=4+1408|s=6+728|quote.double.right=7+779]

HarfBuzz ignores this feature:

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=ot --font-funcs=ot "\"quotes\""
[quote.double=0+712|q=1+993|u=2+1148|o=3+878|t=4+725|e=5+761|s=6+728|quote.double=7+712]

Tabular Numbers

CoreText:

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=coretext  --features=tnum "0123"
[zero.lining=0+1138|one.lining=1+1138|two.lining=2+1138|three.lining=3+1138]

HarfBuzz:

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=ot --font-funcs=ot --features=tnum "0123"
[zero=0+1056|one=1+882|two=2+1144|three=3+944]

Superiors

CoreText:

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=coretext --features=+sups "01234"
[zero.superior=0+750|one.superior=1+750|two.superior=2+750|three.superior=3+750|four.superior=4+750]

HarfBuzz:

$ ./hb-shape Apple_Chancery_10_12.ttf --shaper=ot --font-funcs=ot  --features=+sups "01234"
[zero=0+1056|one=1+882|two=2+1144|three=3+944|four=4+1266]
@drott drott added the Chrome Chrome/Chromium project related issues and requests label Oct 30, 2018
@drott
Copy link
Collaborator Author

drott commented Oct 30, 2018

For comparison, on Mac OS 10.13, the font version is

Dumping "/Library/Fonts/Apple Chancery.ttf" to "-"...
Dumping 'name' table...
    <namerecord nameID="3" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Apple Chancery; 13.0d1e4; 2017-06-08
    </namerecord>

@khaledhosny
Copy link
Collaborator

Is the old font with a morx or mort table?

@drott
Copy link
Collaborator Author

drott commented Oct 30, 2018

Good point, it does have a mort table. The reason we use it is that the generic web font name cursive is mapped to Apple Chancery on Mac OS.

$ ttx -l -o- Apple_Chancery_10_12.ttf 
Listing table info for "Apple_Chancery_10_12.ttf":
    tag     checksum   length   offset
    ----  ----------  -------  -------
    OS/2  0xD7D2DE9C       96      780
    Zapf  0xC32B3597    26072    39368
    bsln  0x1206FC01       72      616
    cmap  0xC14F6847     1494     3836
    cvt   0xA16CF44B      278     1464
    fdsc  0x41822B3E       48      512
    feat  0xAE209A80      204     1020
    fmtx  0x010A0804       16      428
    fond  0xC2F1C0AC     2288     5332
    fpgm  0xFB93B170      144      876
    glyf  0x90849F5F   175106   160464
    head  0xCED23692       54      560
    hhea  0x1F05780C       36      476
    hmtx  0xD0095106     4230    11084
    just  0xD6C252DB     3462     7620
    kern  0xA58DD143     7230    19552
    lcar  0x51F7B071      744     2292
    loca  0xE3B3DA00     4236    15316
    maxp  0x6701F404       32      444
    mort  0xEF35FEC7    61228    99236
    name  0x863961BD    33796    65440
    opbd  0x6889B138      800     3036
    post  0xC12F8372    12582    26784
    prep  0x9FC74693      240     1224
    prop  0x88906CD4      548     1744
    trak  0x1F0188FD       92      688

whereas the newer one:

$ ttx -l -o- /Library/Fonts/Apple\ Chancery.ttf
Listing table info for "/Library/Fonts/Apple Chancery.ttf":
    tag     checksum   length   offset
    ----  ----------  -------  -------
    OS/2  0x9FE1D4D4       96      796
    Zapf  0x41310888    26072    43400
    bsln  0x01FC0712       72      632
    cmap  0xD54750A4     1494     3900
    cvt   0x6D236E91      278     1528
    fdsc  0x402B823F       48      528
    feat  0x80BE32AD      252     1276
    fmtx  0x04080B01       16      444
    fond  0xAFCD02E8     2288     5396
    fpgm  0x78B194F0      144      892
    glyf  0x186041A5   174642   161808
    head  0xEECBE5CA       54      576
    hhea  0x0D79051D       36      492
    hmtx  0x23F2A01D     4230    15116
    just  0xC7A1E149     3462     7684
    kern  0x47EF762D     7230    23584
    lcar  0xD1B0CA50      744     2356
    loca  0x05CD4938     4236    19348
    maxp  0x04F40267       32      460
    meta  0xFC2A9183     3966    11148
    morx  0xF18987B1    58540   103268
    name  0x65AEDEFA    33796    69472
    opbd  0x758C6A67      800     3100
    post  0x528C2321    12582    30816
    prep  0xA044C990      240     1036
    prop  0x056D9286      548     1808
    trak  0x0288001B       92      704

@khaledhosny
Copy link
Collaborator

khaledhosny commented Oct 30, 2018

Not sure what are the plans wrt. supporting mort natively, but I guess it should be possible to code using Core Text for fonts that has mort and no morx until such old systems are not supported.

@drott
Copy link
Collaborator Author

drott commented Oct 30, 2018

Let's hear Behdad's opinion. Personally, I'd prefer not having to switch shaper and remove CoreText AAT altogether. 10.12 is not that old. We still support OS versions back down to 10.10 for Chrome.

@jfkthame
Copy link
Collaborator

Yeah, I think we need to support 'mort' in order to make this a sufficient replacement for the CoreText shaping path. The older 'mort' table occurs not just Apple's fonts from fairly recent OS versions (10.13, where Apple Chancery switched to 'morx', is only a year old), but also in third-party fonts such as Xenotype that users may continue to use.

behdad added a commit that referenced this issue Oct 31, 2018
 ./hb-shape Apple_Chancery_10_12.ttf  "Th th ll te to tr fr fu fj"
[T_h=0+2308|space=2+569|t_h=3+1687|space=5+569|l_l=6+1108|space=8+569|t_e=9+1408|space=11+569|t_o=12+1531|space=14+569|t_r=15+1385|space=17+569|f_r=18+1432|space=20+569|f_u=21+1733|space=23+569|f_j=24+1098]

Part of #1331
@behdad
Copy link
Member

behdad commented Oct 31, 2018

All your examples work now. I couldn't test Reordering and Insertion subtables as this font / examples didn't include those. We'll fix those as reports come in.

@behdad behdad closed this as completed Oct 31, 2018
ebraminio pushed a commit to ebraminio/harfbuzz that referenced this issue Nov 24, 2018
 ./hb-shape Apple_Chancery_10_12.ttf  "Th th ll te to tr fr fu fj"
[T_h=0+2308|space=2+569|t_h=3+1687|space=5+569|l_l=6+1108|space=8+569|t_e=9+1408|space=11+569|t_o=12+1531|space=14+569|t_r=15+1385|space=17+569|f_r=18+1432|space=20+569|f_u=21+1733|space=23+569|f_j=24+1098]

Part of harfbuzz#1331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chrome Chrome/Chromium project related issues and requests
Projects
None yet
Development

No branches or pull requests

4 participants