Skip to content

Treat empty guideline names as no name - #414

Merged
cmyr merged 1 commit into
linebender:mainfrom
tomconroy:empty-guideline-names
Jul 13, 2026
Merged

Treat empty guideline names as no name#414
cmyr merged 1 commit into
linebender:mainfrom
tomconroy:empty-guideline-names

Conversation

@tomconroy

Copy link
Copy Markdown
Contributor

Norad failed to parse a real-world UFO that has a guideline with an empty name. This patch allows empty guideline names.

See: https://github.com/googlefonts/roboto-serif/blob/8346c2b0ecec6bf539be222ea84de5906ef1ade8/sources/Roboto_Serif_Micro_Cond-Super.ufo/fontinfo.plist#L22-L23

The UFO spec marks a guideline's name as optional, and some real-world
fonts write it as an explicit empty string (e.g. five UFOs in Google's
Roboto Serif sources). Name validation rejected these, failing the
whole fontinfo.plist (or .glif) load. Treat an empty name as an absent
one when reading, matching fontTools; writing is unchanged and cannot
produce an empty name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomconroy
tomconroy force-pushed the empty-guideline-names branch from a0e65b7 to 8a8e63f Compare July 13, 2026 09:09

@RickyDaMa RickyDaMa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a sensible workaround to me, although the current implementation is spec-compliant:

name: An arbitrary name for the guideline. This attribute is optional. It must be at least one character long.

^ https://unifiedfontobject.org/versions/ufo3/glyphs/glif/#guideline

Which basically says that if the field is going to be specified it should be non-empty.

No strong opinion from me either way.

@cmyr cmyr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! given that the name field is explicitly optional I'm happy to skip empty strings.

@cmyr
cmyr merged commit 1c8ac19 into linebender:main Jul 13, 2026
5 checks passed
@tomconroy
tomconroy deleted the empty-guideline-names branch July 13, 2026 20:30
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.

3 participants