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

UnicodeDecodeError while converting name table entries with record.toUnicode() #46

Open
typemytype opened this issue Dec 10, 2021 · 0 comments

Comments

@typemytype
Copy link
Member

reproducible with standaard Helvetica.ttc

proposal: fallback to the record.toUnicode("backslashreplace")

a PR is coming

from fontTools.ttLib import TTFont

path = '/System/Library/Fonts/Helvetica.ttc'
source = TTFont(path, fontNumber=1)

for record in source["name"].names:
    print(record.nameID, record.platformID, record.platEncID, record.langID, str(record))
    print(record.toUnicode("backslashreplace"))    # proposal fallback to a backslashreplace version
    print(record.toUnicode())    # <---- UnicodeDecodeError
typemytype added a commit that referenced this issue Dec 10, 2021
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