Pomax / lib-font

This library adds a new Font() object to the JavaScript toolbox, similar to new Image() for images
MIT License
728 stars 72 forks source link

implement extension substitution for gsub lookuptype 7 #113

Open Pomax opened 3 years ago

Pomax commented 3 years ago

As per https://docs.microsoft.com/en-us/typography/opentype/spec/gsub#lookuptype-7-extension-substitution the lookup type 7 table is "actually not this, but a different lookup table", where the extensionLookupType field tells us the class we'll need to parse the table data as, and extensionOffset tells us where that table data starts.

This means calling buildSubtable(extensionLookupType, p where p is our parser, already pegged to the start of the substitution's byte offset.