Skip to content

appendSFNTName doesn't always replace existing 'Family' value #2635

@eugenesvk

Description

@eugenesvk

If you have a font that has a style component in it's 'Family' SFNT variable (e.g. ('English (US)', 'Family', 'Source Code Pro Medium')), then trying to shorten this name by removing the style component fails:
Font.appendSFNTName('English (US)', 'Family', "Source Code Pro") doesn't overwrite the existing 'Family' variable.
However, if you change the new variable slightly, even add one space or anything, e.g. Font.appendSFNTName('English (US)', 'Family', "Source Code Pro ") or
sourceFont.appendSFNTName('English (US)', 'Family', "Source Code P")
then it will overwrite existing value

The only solution so far seems to be to clear this value with
Font.appendSFNTName('English (US)', 'Family', '') and then doing what you originally wanted to
Font.appendSFNTName('English (US)', 'Family', "Source Code Pro")

System: OS X 10.11.3
FontForge (installed via Homebrew): stable 20150824

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions