notofonts / noto-fonts

Noto fonts, except for CJK and emoji
http://fonts.google.com/noto
SIL Open Font License 1.1
2.45k stars 200 forks source link

U+A9BF JAVANESE CONSONANT SIGN CAKRA blocks ligatures of above-base marks #2332

Closed dscorbett closed 2 years ago

dscorbett commented 2 years ago

Font

NotoSansJavanese-Regular.otf

Where the fonts came from, and when

Site: https://github.com/googlefonts/noto-fonts/blob/c8729a9e61b2a54a9d2b4c61a82d4d93213bd6e3/unhinted/otf/NotoSansJavanese/NotoSansJavanese-Regular.otf Date: 2022-04-20

Font version

Version 2.002

Issue

U+A9BF JAVANESE CONSONANT SIGN CAKRA, when ligated with the base, blocks ligatures between U+A9B3 JAVANESE SIGN CECAK TELU and above-base marks.

Character data

ꦥ꦳ꦿꦁ U+A9A5 JAVANESE LETTER PA U+A9B3 JAVANESE SIGN CECAK TELU U+A9BF JAVANESE CONSONANT SIGN CAKRA U+A981 JAVANESE SIGN CECAK

Screenshot

ꦥ꦳ꦿꦁ

simoncozens commented 2 years ago

I don't understand this. Why would one ligate but not the other?

Screenshot 2022-04-21 at 08 46 04

They're right next to each other, so there's no mark filtering issues. It's in abvs, which is whole run, so it's not a cluster scoping problem. Beats me.

dscorbett commented 2 years ago

HarfBuzz has some complex rules about which glyphs may ligate:

   * - Ligatures cannot be formed across glyphs attached to different components
   *   of previous ligatures.  Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and
   *   LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother.
   *   However, it would be wrong to ligate that SHADDA,FATHA sequence.
   *   There are a couple of exceptions to this:
   *
   *   o If a ligature tries ligating with marks that belong to it itself, go ahead,
   *     assuming that the font designer knows what they are doing (otherwise it can
   *     break Indic stuff when a matra wants to ligate with a conjunct,
   *
   *   o If two marks want to ligate and they belong to different components of the
   *     same ligature glyph, and said ligature glyph is to be ignored according to
   *     mark-filtering rules, then allow.
   *     https://github.com/harfbuzz/harfbuzz/issues/545

It seems like this case should work too. Maybe this is a deficiency of HarfBuzz, not Noto. What do you think?

simoncozens commented 2 years ago

From the sound of that, I should check the GDEF classes. The first paragraph would apply: I’m trying to ligate glyphs “left over” from “inside” a previous ligature, which that paragraph suggests is not allowed.

simoncozens commented 2 years ago

pa_cakra is coming out as a base glyph in GDEF, not a ligature. Stranger and stranger.

simoncozens commented 2 years ago

Ah! But if I force it to be a ligature and add IgnoreLigatures to the substitution, the ligature works. (But then mark attachment fails because in ufo2ft you can't do mark-to-base on a ligature glyph, only mark-to-lig, so I need to rename all the anchors to top_1 etc. sigh)