Fix the weight of fonts that use 1-10

This commit is contained in:
Thomas Goyne 2015-12-31 15:41:49 -08:00
parent 596332763b
commit 761a121452
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,10 @@ FontMatch process_descriptor(NSFontDescriptor *desc, NSString *name) {
ret.width = get_16(bytes, 6);
}
// Some font designers appear to be under the impression that weights are 1-10
if (ret.weight < 10)
ret.weight *= 100;
ret.family_match = [font.familyName isEqualToString:name];
ret.codepoints = [desc objectForKey:NSFontCharacterSetAttribute];