Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation question: availableFeatures #314

Open
borriglione opened this issue Jul 3, 2023 · 1 comment
Open

Implementation question: availableFeatures #314

borriglione opened this issue Jul 3, 2023 · 1 comment

Comments

@borriglione
Copy link

Hello,

thanks for this great engine/tool.

With:

  console.log('font.availableFeatures', font.availableFeatures)
  font.availableFeatures [
    'aalt', 'c2sc', 'case', 'dnom',
    'frac', 'lnum', 'mgrk', 'numr',
    'onum', 'ordn', 'pnum', 'rlig',
    'sinf', 'smcp', 'ss01', 'ss02',
    'ss03', 'ss04', 'ss05', 'ss10',
    'ss11', 'ss12', 'ss14', 'ss15',
    'ss16', 'ss17', 'ss18', 'ss19',
    'ss20', 'subs', 'sups', 'tnum',
    'cpsp', 'kern', 'mark', 'mkmk'
  ]

I get all available features for this font. Is there a way to determine which feature has which kind of unicode characters = alternative/available glyhps?

I would like to have an output:

[
  aalt: [['U+0040', 'U+0042'],
...
  ss11: ['U+0111'],
...
]
@devongovett
Copy link
Member

Not really. These things map to complicated state machines that may highly depend on context of the surrounding glyphs. Mapping this backward to generate all of the possible unicode characters that might be involved in a given feature would be quite complicated. I haven't thought deeply enough about it to say whether it's impossible, but it would definitely be hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants