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

hb_input questionable output #500

Open
m4rc1e opened this issue Dec 12, 2019 · 0 comments · May be fixed by simoncozens/fontFeatures#29
Open

hb_input questionable output #500

m4rc1e opened this issue Dec 12, 2019 · 0 comments · May be fixed by simoncozens/fontFeatures#29

Comments

@m4rc1e
Copy link
Contributor

m4rc1e commented Dec 12, 2019

Users may not get the output they expect for each glyph. Here are some quick checks with Alegreya

>>> g.input_from_name('one.dnom')
(('aalt', 'frac'), '1')

dnom is desired

>>> g.input_from_name('aring.sc')
(('aalt',), 'Å')

smcp is desired


After skimming the code, I found HbInputGenerator uses memoization to find all the inputs for a given character.

>>> g.input_from_name('aring.sc')
[(('aalt',), 'Å'), (('aalt',), 'å'), (('c2sc',), 'Å'), (('smcp',), 'å')]

It will then use a min function to reduce it one input by minimising the found inputs.

>>> features, text = min(inputs) # inputs are in the previous code block.
(('aalt',), 'Å')

# aalt has been returned because:
>>> min(('aalt',), ('smcp',))
('aalt',)

I don't have an exact answer on how this should work but I should have a solution next quarter.

@m4rc1e m4rc1e changed the title hb_input output hb_input questionable output Dec 12, 2019
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

Successfully merging a pull request may close this issue.

1 participant