File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ def segment_vf_collection(fonts):
9797 for font in fonts :
9898 if "-Italic[" in font .file :
9999 italics .append (font )
100+ elif font .is_italic :
101+ italics .append (font )
100102 else :
101103 non_italics .append (font )
102104
@@ -109,6 +111,9 @@ def segment_vf_collection(fonts):
109111 if non_italic .file == suspected_roman :
110112 found_roman = non_italic
111113 break
114+ if non_italic .family == italic .family :
115+ found_roman = non_italic
116+ break
112117
113118 if found_roman :
114119 non_italics .remove (found_roman )
Original file line number Diff line number Diff line change @@ -86,6 +86,23 @@ def ttFont(self):
8686 font .ensureDecompiled ()
8787 return font
8888
89+ @cached_property
90+ def family (self ):
91+ from fontbakery .utils import get_name_entry_strings
92+ from fontbakery .constants import NameID
93+
94+ ttFont = self .ttFont
95+ familynames = get_name_entry_strings (ttFont , NameID .FONT_FAMILY_NAME )
96+ typo_familynames = get_name_entry_strings (
97+ ttFont , NameID .TYPOGRAPHIC_FAMILY_NAME
98+ )
99+ if not familynames :
100+ return None
101+
102+ family = typo_familynames [0 ] if typo_familynames else familynames [0 ]
103+
104+ return family
105+
89106 @cached_property
90107 def style (self ):
91108 """Determine font style from canonical filename."""
You can’t perform that action at this time.
0 commit comments