Skip to content

Commit

Permalink
fix error due to familyname in name space
Browse files Browse the repository at this point in the history
  • Loading branch information
benkiel committed Jan 16, 2025
1 parent 8372185 commit 1b17e42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Lib/fontbakery/checks/opentype/STAT/ital_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def segment_vf_collection(fonts):
if non_italic.file == suspected_roman:
found_roman = non_italic
break
if non_italic.familyname == italic.familyname:
if non_italic.family == italic.family:
found_roman = non_italic
break

Expand Down
34 changes: 17 additions & 17 deletions Lib/fontbakery/testable.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ def ttFont(self):
font.ensureDecompiled()
return font

@cached_property
def family(self):
from fontbakery.utils import get_name_entry_strings
from fontbakery.constants import NameID

ttFont = self.ttFont
familynames = get_name_entry_strings(ttFont, NameID.FONT_FAMILY_NAME)
typo_familynames = get_name_entry_strings(
ttFont, NameID.TYPOGRAPHIC_FAMILY_NAME
)
if not familynames:
return None

family = typo_familynames[0] if typo_familynames else familynames[0]

return family

@cached_property
def style(self):
"""Determine font style from canonical filename."""
Expand Down Expand Up @@ -245,23 +262,6 @@ def is_bold(self):
)
)

@cached_property
def familyname(self):
from fontbakery.utils import get_name_entry_strings
from fontbakery.constants import NameID

ttFont = self.ttFont
familynames = get_name_entry_strings(ttFont, NameID.FONT_FAMILY_NAME)
typo_familynames = get_name_entry_strings(
ttFont, NameID.TYPOGRAPHIC_FAMILY_NAME
)
if not familynames:
return None

familyname = typo_familynames[0] if typo_familynames else familynames[0]

return familyname


@dataclass
class TTCFont(Font):
Expand Down

0 comments on commit 1b17e42

Please sign in to comment.