Skip to content

Picking Family and Style names with WWS #870

Open
@bungeman

Description

OpenType fonts have at least three family names (1, 16, 21) and three style names (2, 17, 22). The general way to pick these is to prefer the higher numbered ones, unless OS2::fsSelection bit 8 exists and is set in which case 21 and 22 should be ignored by newer interpreters (unless of course the lower numbered ones don't exist).

These rules are non-trivial and non-obvious so it would be nice if the library handled this instead of users needing to know about these interesting rules (which may change again in the future). Since retrieving the family and style names are a common use, it may be best to provide a FontRef::family_name() -> StringId (or FontRef::family_name() -> LocalizedStrings) and a similar FontRef::style_name() which works in a similar way.

This idea was first discussed at on Skia change [fontations] Modernize family name, though note that this change does not include a fallback to the nameid 21 when it would normally be ignored but 16 and 1 aren't available.

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