8000 [feaLib] "Expected name id < 255" check · Issue #1003 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[feaLib] "Expected name id < 255" check #1003

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

Closed
miguelsousa opened this issue Jul 14, 2017 · 7 comments
Closed

[feaLib] "Expected name id < 255" check #1003

miguelsousa opened this issue Jul 14, 2017 · 7 comments
Assignees

Comments

@miguelsousa
Copy link
Collaborator

@brawer is it OK to remove this check from feaLib's parse_nameid_?

        if nameID > 255:
            raise FeatureLibError("Expected name id < 255",
                                  self.cur_token_location_)

I ran into it while working on a project that requires hardcoding some nameids, and I can't think of a reason for blocking them, specially since they're outside the reserved range.

@behdad
Copy link
Member
behdad commented Jul 14, 2017

Humm. That check looks clearly wrong to me.

@behdad
Copy link
Member
behdad commented Jul 14, 2017

CC @brawer

Miguel, I think you can remove it, yes.

@anthrotype
Copy link
Member
anthrotype commented Jul 14, 2017

I agree it is wrong, but still the Adobe Feature File Specification says about the nameid <id>:

An id is a number specifying the id of the name string to be added to the name table. This number must be in the registered id range 0, 7-255.

so perhaps the spec should be adjusted.

EDIT: The quote above is from section 9.e of http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html

@miguelsousa
Copy link
Collaborator Author
miguelsousa commented Jul 14, 2017

The spec is clearly wrong. makeotf has no problem with nameids above 255. I'll take care of the changes later today. Thanks.

@miguelsousa miguelsousa self-assigned this Jul 14, 2017
@miguelsousa
Copy link
Collaborator Author

FDK bug adobe-type-tools/afdko#189

@Arno-Enslin
Copy link

From the OT spec:

Name IDs 256 to 32767, inclusive, are reserved for font-specific names such as those referenced by a font's layout features.

Instead of removing the check, wouldn't it be better to check, whether the ID is < 32767 (or 32768)?

@miguelsousa
Copy link
Collaborator Author

@Arno-Enslin 12b7c60

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

4 participants
0