From 761a121452b724f5e48f28379cfe086f07489b56 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 31 Dec 2015 15:41:49 -0800 Subject: [PATCH] Fix the weight of fonts that use 1-10 --- src/font_file_lister_coretext.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/font_file_lister_coretext.mm b/src/font_file_lister_coretext.mm index f41c01798..8f33eda4b 100644 --- a/src/font_file_lister_coretext.mm +++ b/src/font_file_lister_coretext.mm @@ -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];