Open bennlich opened 11 months ago
Type 7 format 1 support has been added with #486, but there hasn't been a new release since then. Please try with the state of the current master.
Aha. Using master, I get a different error. This time it's Type 5 format 1:
Uncaught (in promise) Error: lookupType: 5 - substFormat: 1 is not yet supported
at FeatureQuery.getLookupMethod (opentype.js:11871:15)
at FeatureQuery.lookupFeature (opentype.js:11898:25)
at Bidi.arabicRequiredLigatures (opentype.js:12194:38)
at Bidi.applyArabicRequireLigatures (opentype.js:12510:39)
at Bidi.applyFeaturesToContexts (opentype.js:12549:35)
at Bidi.processText (opentype.js:12571:12)
at Bidi.getTextGlyphs (opentype.js:12579:10)
at Font.stringToGlyphIndexes (opentype.js:12688:17)
at Font.stringToGlyphs (opentype.js:12691:26)
at Font.forEachGlyph (opentype.js:12744:25)
Congratulations, you found another not yet supported feature. 😉
If I wanted to work on adding support for this, how would I start? Can you outline the path?
More helping hands would be great! In your case the message stems from src/features/featureQuery.js
All in all it's "just" a matter of reading the OpenType specification and handling the binary font data and the information within according to it. Mind you though that font feature implementation is probably the most complicated place to get your hands dirty.
I would take a look at how other features are implemented, comparing that to the specification in parallel. Sometimes it's also helpful to write the test cases first and work your way back from that.
Thank you! I've been poking around today on a long train ride. Keeping track here of what I've learned so far.
The substitution spec is here: https://learn.microsoft.com/en-us/typography/opentype/spec/gsub
I need to implement lookup type 5.1 Contextual Substitution Format 1
I think the steps are something like:
contextSubstitutionFormat1
to featureQuery.js
. This piece is responsible for determining which glyphs in which positions get substituted or deleted51
to getLookupMethod()
(referencing the contextSubstitutionFormat1
above)51
to lookupFeature()
(seems to be mostly boilerplate)51
to applySubstitution.js
for actually executing the substitutionThis substitution uses a Sequence Context Format 1. I don't think this format has been implemented anywhere else yet (I haven't come across it anywhere in the code). It is the same format used in GPOS 7.1, but I don't think that's implemented either.
I'm going to look into what the tests look like next.
So great seeing someone new getting involved! You could also have a look at the outstanding PRs, some things might already have been implemented. Let us know if you have any questions.
I'm trying to generate a font path with Noto Nastaliq Urdu for some Urdu text: اردو
But I get the following error:
I'd be happy to try to contribute to fix this, but I'm not sure what this means / where to begin :)
Your Environment