Skip to content

Fix trailing space in nameID=4 when styleName is empty#977

Merged
anthrotype merged 1 commit into
googlefonts:mainfrom
cmyr:name-record-whitespace
Apr 27, 2026
Merged

Fix trailing space in nameID=4 when styleName is empty#977
anthrotype merged 1 commit into
googlefonts:mainfrom
cmyr:name-record-whitespace

Conversation

@cmyr
Copy link
Copy Markdown
Member

@cmyr cmyr commented Apr 25, 2026

A little issue I noticed in some of the itfoundry fonts; some of these have an explicitly empty styleName, which introduced trailing whitespace in the name records.

When a UFO has styleName set to an empty string, the full font name (nameID=4) was constructed as f"{family} {subfamily}" producing a trailing space. Add .strip() to match the pattern used elsewhere (e.g. styleMapFamilyNameFallback, in fontInfoData.py).

When a UFO has styleName set to an empty string, the full font name
(nameID=4) was constructed as f"{family} {subfamily}" producing a
trailing space. Add .strip() to match the pattern used elsewhere
(e.g. styleMapFamilyNameFallback, in fontInfoData.py).
@anthrotype anthrotype merged commit bd16616 into googlefonts:main Apr 27, 2026
7 checks passed
@cmyr cmyr deleted the name-record-whitespace branch April 29, 2026 00:06
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

Successfully merging this pull request may close these issues.

2 participants