Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check ttFont["GDEF"].table.GlyphClassDef before accessing its members #4360

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lib/fontbakery/profiles/universal.py
Original file line number Diff line number Diff line change
@@ -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):
@@ -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):
@@ -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):