Skip to content

Commit

Permalink
Check ttFont["GDEF"].table.GlyphClassDef before accessing its members
Browse files Browse the repository at this point in the history
It can be None.
  • Loading branch information
khaledhosny committed Dec 7, 2023
1 parent 31e9498 commit 104b615
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/fontbakery/profiles/universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ def com_google_fonts_check_legacy_accents(ttFont):
# Check whether legacy accents appear in GDEF as marks.
# Not being marks in GDEF also typically means that they don't have anchors,
# as font compilers would have otherwise classified them as marks in GDEF.
if "GDEF" in ttFont:
if "GDEF" in ttFont and ttFont["GDEF"].table.GlyphClassDef:
class_def = ttFont["GDEF"].table.GlyphClassDef.classDefs
for glyph in font.glyphs:
if set(glyph.codepoints).intersection(LEGACY_ACCENTS):
Expand Down Expand Up @@ -804,7 +804,7 @@ def com_google_fonts_check_arabic_spacing_symbols(ttFont):
passed = True
font = babelfont.load(ttFont.reader.file.name)

if "GDEF" in ttFont:
if "GDEF" in ttFont and ttFont["GDEF"].table.GlyphClassDef:
class_def = ttFont["GDEF"].table.GlyphClassDef.classDefs
for glyph in font.glyphs:
if set(glyph.codepoints).intersection(ARABIC_SPACING_SYMBOLS):
Expand Down Expand Up @@ -856,7 +856,7 @@ def com_google_fonts_check_arabic_high_hamza(ttFont):
passed = True
font = babelfont.load(ttFont.reader.file.name)

if "GDEF" in ttFont:
if "GDEF" in ttFont and ttFont["GDEF"].table.GlyphClassDef:
class_def = ttFont["GDEF"].table.GlyphClassDef.classDefs
for glyph in font.glyphs:
if ARABIC_LETTER_HIGH_HAMZA in set(glyph.codepoints):
Expand Down

0 comments on commit 104b615

Please sign in to comment.