Skip to content

[name] Instances should only reuse name ID 2 or 17 if they are at the default location across all axes #3825

@madig

Description

@madig

Currently, the code tries to reuse name ID 2 or 17 for the "Regular" variable font instance here:

inst.subfamilyNameID = nameTable.addMultilingualName(
localisedStyleName, mac=macNames
)

The OT spec says this, though, emphasis mine:

The subfamilyNameID field provides a name ID that can be used to obtain strings from the 'name' table that can be treated as equivalent to name ID 17 (typographic subfamily) strings for the given instance. Values of 2 or 17 can be used; otherwise, values must be greater than 255 and less than 32768. The values 2 or 17 should only be used if the named instance corresponds to the font’s default instance.

Imagine a Designspace where the default weight is a Medium (wght=500) and there is a Regular instance at wght=400. The Regular instance should not use name ID 2 or 17 but something >= 255.

This is probably an irrelevant violation of the spec, but there are tools out there that check for it...

(Thanks to @Hoolean for identifying the issue internally.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions