Cursive Positioning handling in Uniscribe, CoreText and Harfbuzz
Simon Cozens
Posts: 741
I've found some interesting differences in the way cursive positioning is handled in the above shapers. Attached are two simple test fonts, with six glyphs - space, uni0628, uniFE91, uni06D2, uniFBAF and nukta. The isolated forms for glyphs uni0628 and uni06D2 are a cross situated on the baseline (Y=0). The nukta mark is situated below the baseline at around Y=-80. The feature code for the two fonts is as follows:
Additionally the "rtl" font has "lookupflag IgnoreMarks RightToLeft" in the curs feature. Notice that the nukta mark has no anchors. Here's how the character string "628,6d2,20,6d2" is drawn in each font and shaper:
I don't have access to a Windows box, but my experiments with WINE and Uniscribe suggest that Uniscribe agrees with Harfbuzz in both cases.
Analysis: in the RightToLeft case, I think Harfbuzz is obviously correct and CoreText is obviously wrong. The cursive attachment rule tells it to IgnoreMarks, but CoreText does not ignore them, and raises the mark up above the baseline. (But then I would say that, because Harfbuzz is giving me the answer I like.) In the normal case, I don't know what is going on.
Is there a CoreText bug here, and if so, how do I best report it?
languagesystem arab dflt; table GDEF { GlyphClassDef [uni0628 uni06D2 uniFE91 uniFBAF], , [nukta], ; } GDEF; feature init { sub uni0628 by uniFE91; } init; feature fina { sub uni06D2 by uniFBAF; } fina; feature ccmp { sub uni0628 by uni0628 nukta; } ccmp; feature curs { lookupflag IgnoreMarks; pos cursive uniFBAF <anchor 701 525> <anchor NULL> ; pos cursive uniFE91 <anchor NULL> <anchor 11 100> ; } curs;
Additionally the "rtl" font has "lookupflag IgnoreMarks RightToLeft" in the curs feature. Notice that the nukta mark has no anchors. Here's how the character string "628,6d2,20,6d2" is drawn in each font and shaper:
I don't have access to a Windows box, but my experiments with WINE and Uniscribe suggest that Uniscribe agrees with Harfbuzz in both cases.
Analysis: in the RightToLeft case, I think Harfbuzz is obviously correct and CoreText is obviously wrong. The cursive attachment rule tells it to IgnoreMarks, but CoreText does not ignore them, and raises the mark up above the baseline. (But then I would say that, because Harfbuzz is giving me the answer I like.) In the normal case, I don't know what is going on.
Is there a CoreText bug here, and if so, how do I best report it?
0
Comments
-
(Update: I reckon there is a CoreText bug, so I filed feedback ID FB7841236.)0
-
I'm pretty confident that CoreText doesn't have a bug in handling cursive attachment because it can handle Noto Nastaliq without any problems. Following is a simple test in Textedit of the text 0628, 06D2 set in both fonts (macOS 10.15.5 Catalina):
0 -
Thanks; I'm on 10.14, so maybe the bug is already fixed. Noto Nastaliq always attaches its mark glyphs, so is not really a test for this bug, which is about unattached mark handling.0
-
Yeah, confirmed that this is fixed in 10.15 and iOS 13. This is really good news as it suggests a very simple approach to out-of-line mark positioning.0
-
I agree. It shouldn't meddle with an unattached mark, as in this case when the initial form of 0628 is raised to attach to 06d2.0
-
Those kinds of glitching and confusion makes me want to use a renderer that does not handle directionality or combining, etc. whatsoever.0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 800 Font Technology
- 1K Technique and Theory
- 617 Type Business
- 444 Type Design Critiques
- 541 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 483 Typography
- 301 History of Typography
- 114 Education
- 68 Resources
- 498 Announcements
- 79 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports