googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

"Indic" glyph separation breaks mkmk #566

Closed simoncozens closed 2 years ago

simoncozens commented 2 years ago

In the mark feature writer, marks belonging to Indic glyphs are placed in abvm/blwm features and other marks are positioned using mark/mkmk.

However... the Sharada script (which goes through the USE and is not considered "Indic" by ufo2ft) uses the Devanagari udatta (U+0951). When a Sharada font is compiled with ufo2ft, all the Sharada mark positioning rules go into mark/mkmk and the "Indic" rules (containing udatta) go into abvm. The glyphs are separated out into Indic/non-Indic before creating these rules, and this means there is no interaction between Sharada marks and Devanagari marks; i.e. there is no way to place a udatta on a Sharada mark such as a Candrabindu.

I don't know if that's linguistically something that you might want to do, but e.g. Noto Sans Sharada allows it, positioning all marks in the mkmk feature.

I don't know how best to fix this:

anthrotype commented 2 years ago

thanks for reporting this.

Add USE scripts to the indicScripts list?

that'd be ok provided that all USE scripts are supposed to use abvm/blwm, which I honestly have no idea.

Provide a way of opting out of the abvm/blwm writer?

Maybe MarkFeatureWriter could have an option indicScripts (or abvmBlwmScripts?) that defaults to the current set, and one could set it to empty to skip the abvm/blwm generation

These are somewhat related: https://github.com/googlefonts/ufo2ft/pull/565 and https://github.com/googlefonts/ufo2ft/pull/565

simoncozens commented 2 years ago

USE uses both abvm/blwm and mark/mkmk; you can choose. (See https://docs.microsoft.com/en-us/typography/script-development/use#opentype-feature-application-ii)

simoncozens commented 2 years ago

I think you mean #522, and yes. Behdad suggests adding all the USE scripts in there. I think it's the obvious way to do it. If a script is either USE or Indic then we know abvm/blwm will be applied.

anthrotype commented 2 years ago

yes that one. Let's add them all then

simoncozens commented 2 years ago

I'll do a PR in a minute.