summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/fb_font_freetype.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/framebuffer/fb_font_freetype.c b/framebuffer/fb_font_freetype.c
index 3463b993a..64c76c172 100644
--- a/framebuffer/fb_font_freetype.c
+++ b/framebuffer/fb_font_freetype.c
@@ -115,6 +115,8 @@ fb_new_face(const char *fontfile)
bool fb_font_init(void)
{
FT_Error error;
+ FT_ULong max_cache_size;
+ FT_UInt max_faces = 6;
/* freetype library initialise */
error = FT_Init_FreeType( &library );
@@ -123,8 +125,16 @@ bool fb_font_init(void)
return false;
}
- /* cache manager initialise, six faces and defaults for other values */
- error = FTC_Manager_New(library, 6, 0, 0, ft_face_requester, NULL, &ft_cmanager);
+ max_cache_size = 2 * 1024 *1024; /* 2MB should be enough */
+
+ /* cache manager initialise */
+ error = FTC_Manager_New(library,
+ max_faces,
+ 0,
+ max_cache_size,
+ ft_face_requester,
+ NULL,
+ &ft_cmanager);
if (error) {
LOG(("Freetype could not initialise cache manager (code %d)\n", error));
FT_Done_FreeType(library);
@@ -162,6 +172,7 @@ bool fb_font_init(void)
bool fb_font_finalise(void)
{
+ FTC_Manager_Done(ft_cmanager );
FT_Done_FreeType(library);
return true;
}