Lookup flags in fonts with no GDEF table
- Dominant language
- C++
- Stars
- 6.1k
- Forks
- 779
- Avg merge
- 14h 26m
- Merged PRs (30d)
- 76
Description
Someone reports [an issue](https://bugs.documentfoundation.org/show_bug.cgi?id=135778) in LibreOffice about some Iranian fonts like B Nazanin (fonts attached in the LIbreOffice issue).
Basically the font has mark ligatures for shadda and the lookups has ignore base and ignore ligatures set (which makes no sense), which causes HarfBuzz to correctly skip bases and make ligature between shadda and fathatan in strings like:
```
$ hb-view "B Nazanin.TTF" اتّفاقاً
```

Oddly enough, both Uniscribe and Core Text ignore the lookup flags and don’t for the ligatures.
```
$ hb-view "B Nazanin.TTF" اتّفاقاً --shaper=coretext
```

As it turns out, the font has no `GDEF` table, so HarfBuzz synthesizes one and use it here.
It is a rather odd font, and I HarfBuzz synthesis of a GDEF table actually matches what [the spec](https://docs.microsoft.com/en-us/typography/opentype/spec/gdef#glyph-class-definition-table-overview) is saying (emphasis mine):
> In addition, a client uses class definitions to apply GSUB and GPOS LookupFlag data correctly. For example, a LookupFlag may specify ignoring ligatures and marks during a glyph operation. **If the font does not include a GlyphClassDef table, the client must define and maintain this information when using the GSUB and GPOS tables**.
But it might be an interoperability issue that we might want to consider (my 2¢ is to 🤷🏽 and declare it working as designed).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.