[font] Fix failure with bitmap fonts (#7691)

This commit is contained in:
Clyde Stubbs 2024-10-29 13:56:32 +11:00 committed by GitHub
parent 88627095fb
commit 63e4d4b493
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -344,7 +344,7 @@ class TrueTypeFontWrapper:
return offset_x, offset_y return offset_x, offset_y
def getmask(self, glyph, **kwargs): def getmask(self, glyph, **kwargs):
return self.font.getmask(glyph, **kwargs) return self.font.getmask(str(glyph), **kwargs)
def getmetrics(self, glyphs): def getmetrics(self, glyphs):
return self.font.getmetrics() return self.font.getmetrics()
@ -359,7 +359,7 @@ class BitmapFontWrapper:
return 0, 0 return 0, 0
def getmask(self, glyph, **kwargs): def getmask(self, glyph, **kwargs):
return self.font.getmask(glyph, **kwargs) return self.font.getmask(str(glyph), **kwargs)
def getmetrics(self, glyphs): def getmetrics(self, glyphs):
max_height = 0 max_height = 0