Skip to content

Kiva fonttool weight constants don't match OpenType and CSS specs #908

@corranwebster

Description

@corranwebster

The names of the weights are defined here: https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass

But these don't match the names defined here in all cases:

weight_dict = {
"ultralight": 100,
"light": 200,
"normal": 400,
"regular": 400,
"book": 400,
"medium": 500,
"roman": 500,
"semibold": 600,
"demibold": 600,
"demi": 600,
"bold": 700,
"heavy": 800,
"extra bold": 800,
"black": 900,
}

For example "light" is 300 in both specs, but 200 in the constants file.

This is likely to result in mis-matches in font queries because FontEntry objects have the wrong value.

Fixing this may require bumping the font database version and re-generating the font database.

There is a potential tension here because the constants are used for scoring closeness of match, but are also used for interpreting the contents of font files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions