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

Chop up GSUB subtables into their own set of files #124

Closed RoelN closed 3 years ago

RoelN commented 3 years ago

Fixes #101, if this is you had this directory/naming in mind :-)

Pomax commented 3 years ago

This is great! But while both GSUB and GPOS have lookup types, they're wildly different, they're not really "shared", so let's create the lookups dir inside the advanced dir instead of under shared, with dedicated dirs for gsub and gpos:

--src
 |--opentype
 | |--advanced
 | | |--shared
 | | |--lookups
 | | | |--gsub
 | | | | |--gsub-lookup.js
 | | | | |--lookup-type-1.js
 | | | | |--lookup-type-2.js
 | | | | |--...
 | | | |--gpos
 | | | | |--gpos-lookup.js
 | | | | |--lookup-type-1.js
 | | | | |--lookup-type-2.js
 | | | |
Pomax commented 3 years ago

It also looks like gsub.js contains the SubstLookupRecord class required by both lookup types 5 and 6, but both modules forget to import that class.

RoelN commented 3 years ago

Thanks for the review. Good catch on SubstLookupRecord! All things should've been addressed with the last few commits.

RoelN commented 3 years ago

In preparation of https://github.com/Pomax/lib-font/issues/45#issuecomment-879967258, I set up placeholder code for GPOS as well, so we don't have that in the old format.