mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 09:56:17 +03:00
Buffer lifetime needs to be the same as the font lifetime
This commit is contained in:
parent
43d0aaac24
commit
39c62f76ab
|
@ -151,8 +151,8 @@ class FreeTypeFont:
|
|||
if isStringType(font):
|
||||
self.font = core.getfont(font, size, index, encoding)
|
||||
else:
|
||||
font_bytes = font.read()
|
||||
self.font = core.getfont("", size, index, encoding, font_bytes)
|
||||
self.font_bytes = font.read()
|
||||
self.font = core.getfont("", size, index, encoding, self.font_bytes)
|
||||
|
||||
def getname(self):
|
||||
return self.font.family, self.font.style
|
||||
|
|
Loading…
Reference in New Issue
Block a user