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

Not sure from documentation how to apply cv features to individual numbers? #38

Open
debianivanov opened this issue Dec 16, 2024 · 1 comment

Comments

@debianivanov
Copy link

I am using Iosevka font, but because of bug of harfbuzz (link) on Linux I cannot use more than 10 opentype feature substitutions (there is a limit).
That is why I want to freeze as many features I want in advance with pyftfeatfreeze and generate the font. The tools works perfect for features like 'locl' and 'onum' to enable bulgarian cyrillic characters and old style numbers.
But I want to substitute individual characters with a corresponding glyph, for example I want cv17=11, cv32=7, cv81=2, cv82=2, cv95=3, etc.
Is this possible with pyftfeatfreeze? How can I achieve this, because it is not clear from the documentation?

Thank you in advance and sorry if this is not a bug. The tool is great!

@debianivanov
Copy link
Author

I think I found the answer in the source code of __init__.py:

                # Always take the first alternate.
                for sub_in, sub_out_class in alternates.items():
                    sub_out_first = sub_out_class[0]
                    for i in range(len(self.subs1)):
                        if self.subs1[i] == sub_in:
                            self.subs1[i] = sub_out_first

It takes every time only the first alternate. Ok, this is not a bug, but maybe will be good to be pointed out in the documentation that the feature always takes the first alternate.

If you want, you can add it to the docs and add it for future development if you think is worth it. I will try to help, but I am a system administrator and I am not the best at coding.

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

1 participant