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.
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:
enable/kiva/fonttools/_constants.py
Lines 90 to 105 in 718c863
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
FontEntryobjects 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.