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

axisregistry build_fvar_instances produces nonfunctional nameIDs #8754

Open
aaronbell opened this issue Dec 18, 2024 · 3 comments
Open

axisregistry build_fvar_instances produces nonfunctional nameIDs #8754

aaronbell opened this issue Dec 18, 2024 · 3 comments

Comments

@aaronbell
Copy link
Collaborator

aaronbell commented Dec 18, 2024

Describe the issue

I am using the builder on a font project that does not include a Regular instance (Light - Medium - ExtraBold). As part of the builder process, fonttools.axisregistry's build_fvar_instances tool is run on the font source. This script deletes all the fvar table data, and replaces it with data that specifically aligns with the axisregistry standard.

However, as part of this process, it also adds the postscript name of the font to name table entry. For example:

`Light` -> `ChironSungHK-Light`
`Regular` -> `ChironSungHK-Regular`

etc.

The end result is that certain instances are no longer accessible. In the case of Chiron Sung HK, the Regular and ExtraLight instances cannot be accessed. This is likely due to their use in name ID 1/2 and 16/17.

I've verified that removing the postscript name corrects this problem.

The specific fix that I did locally, which solves this problem, is to comment out the line here:

            # inst.postscriptNameID = name_table.addName(
            #     f"{family_name}-{name}".replace(" ", "")
            # )

To Reproduce
You can test the fonts here: https://github.com/aaronbell/chiron-sung-hk-gf/tree/ce456afcb95bc8c1d065338779fb0da7dc3a71dd/fonts/variable

Expected behavior
Style names should be preserved AS IS without the postscript name attached, like so:
Image

Additional context
Repros on MS Word for Mac 16.47

@aaronbell
Copy link
Collaborator Author

@m4rc1e It looks like you were the one who added the postscriptNameID to the instances, if you could comment.

@m4rc1e
Copy link
Collaborator

m4rc1e commented Dec 19, 2024

Thank you for the very comprehensive issue report!

We modelled our fvar instance names based on Adobe Source Sans. Do MS fonts even use them?

The end result is that certain instances are no longer accessible.

Which apps?

@aaronbell
Copy link
Collaborator Author

aaronbell commented Dec 19, 2024

@m4rc1e the big one is MS Word for Mac. For some reason that app uses a concatenation of the fvar and stat table information to enumerate the instances and it appears that adding the postscript name causes MS Word for Mac to be unable to locate certain instances.

In the case of Chiron Sung HK, I could not select the Light or Regular instances, it would switch to the Medium instead.

I suspect it has to do with the use of name ID 17 / 2 for those specific instances versus the 200+ names.

This was referenced Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants