Closed simoncozens closed 1 year ago
The default shaper is sufficient for Tifinagh, but if you do want to use USE, which might be a requirement for pyftmerge, you can just do all the U+200D and U+2D7F ligatures in 'rlig'.
The “Very Strange Things” are happening because HarfBuzz does not include Tifinagh in its list of scripts that can go in either direction (https://github.com/harfbuzz/harfbuzz/issues/1000). There is no standard for which scripts get that treatment: they are only added to HarfBuzz when someone finds a problem in a particular font.
For U+200D in tfng, it doesn’t seem to work in ccmp on Windows with Uniscribe with Ebrima either.
Using rlig instead of ccmp seems to work! Thanks @dscorbett
266263e will fix this if that Harfbuzz PR gets merged.
That PR Is merged and the fix is in, so this should be fixed going forward.
Older versions of this font did not have a
languagesystem tfng dflt
declaration, and went through the standard shaper. We've added one, meaning that the font now goes through the USE.The font has a lookup in
ccmp
to form ligatures and it looks like this:With no
tfng
script declaration:With
tfng
:Oops,
ccmp
is scoped to the cluster and U+200D is in a different cluster, so no ligature. (I think I remember @dscorbett suggesting that this behaviour with a bug, but it certainly is the current behaviour so we've got to work with it.)What to do, I wonder? Remove the
tfng
declaration and go through the standard shaper?Another issue is that when the direction is set to RTL, Very Strange Things happen with reordering, regardless of whether there is a
tfng
languagesystem or not:Notice that even before Harfbuzz starts reordering, things have moved around. The buffer has been reversed, which I would not have expected, but the U+200D and U+2D7F joiner glyphs have stuck to their cluster, meaning that you have to write rules like:
for anything to work.
This just seems wrong to me, and perhaps for that reason, RTL ligatures have never worked in this font particularly well (unless I completely don't understand how they should work):
Coupled with #8, I wonder if the RTL version of this font is actually functional. I don't have enough expertise with Tifinagh to know.
So things we need to decide:
tfng
declaration and go through the standard shaper to make ZWJ work as a joiner, or not?