fonts: Allow deallocation and clear face cache.
So fonts can be reloaded when required. Fixes #6153.
This commit is contained in:
@@ -761,6 +761,7 @@ def free_memory():
|
||||
|
||||
scaled_image_fonts.clear()
|
||||
font_cache.clear()
|
||||
face_cache.clear()
|
||||
|
||||
|
||||
def load_fonts():
|
||||
|
||||
@@ -188,6 +188,10 @@ cdef class FTFace:
|
||||
|
||||
public object fn
|
||||
|
||||
def __dealloc__(self):
|
||||
if self.face != NULL:
|
||||
FT_Done_Face(self.face)
|
||||
|
||||
def __init__(self, f, index, fn):
|
||||
|
||||
cdef int error
|
||||
|
||||
@@ -369,6 +369,8 @@ cdef class HBFace:
|
||||
if self.mm_var:
|
||||
FT_Done_MM_Var(library, self.mm_var)
|
||||
|
||||
FT_Done_Face(self.face)
|
||||
|
||||
def __init__(self, f, index, fn):
|
||||
|
||||
cdef int error
|
||||
|
||||
Reference in New Issue
Block a user