Skip to content

Commit

Permalink
Add validate kwarg to RGlyph._loadFromGLIF (#623)
Browse files Browse the repository at this point in the history
I needed to be able to use this, it's part of the underlying `readGlyphFromString` API.

I also would not oppose letting `_loadFromGLIF` take `**kwargs` which it can pass down to `readGlyphFromString` at maintainer's (@benkiel's?) option, but I do need something like this please. 🥺
  • Loading branch information
ctrlcctrlv committed Jan 5, 2022
1 parent 78af2ab commit 451a1ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/fontParts/fontshell/glyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,13 @@ def _get_tempLib(self):
# API
# ---

def _loadFromGLIF(self, glifData):
def _loadFromGLIF(self, glifData, validate=True):
try:
readGlyphFromString(
aString=glifData,
glyphObject=self.naked(),
pointPen=self.getPointPen()
pointPen=self.getPointPen(),
validate=validate
)
except GlifLibError:
raise FontPartsError("Not valid glif data")
Expand Down

0 comments on commit 451a1ab

Please sign in to comment.