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

dump_otl.py fails if font contains size feature #521

Open
frankrolf opened this issue Oct 6, 2020 · 0 comments
Open

dump_otl.py fails if font contains size feature #521

frankrolf opened this issue Oct 6, 2020 · 0 comments

Comments

@frankrolf
Copy link

The size feature is uncommon, but exists in Adobe’s static fonts, such as http://github.com/adobe-fonts/source-serif-pro/releases/latest . I noticed that dump_otl.py fails if this feature is present.

To fix the problem, I locally changed these lines to include a try/except statement.

before:

def dump_feature_record(feature_record):
    """Prints out feature records."""
    for index in range(len(feature_record)):
        record = feature_record[index]
        tag = record.FeatureTag
        feature = record.Feature
        print(index, tag, feature.LookupListIndex)
        if feature.FeatureParams is not None:
            print_indented("# name <%s>;" % feature.FeatureParams.UINameID)

after:

def dump_feature_record(feature_record):
    """Prints out feature records."""
    for index in range(len(feature_record)):
        record = feature_record[index]
        tag = record.FeatureTag
        feature = record.Feature
        print(index, tag, feature.LookupListIndex)
        if feature.FeatureParams is not None:
            try:
                print_indented("# name <%s>;" % feature.FeatureParams.UINameID)
            except AttributeError:
                pass

Please let me know if I should submit a PR with this change.

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