From 02de9ff8db9da733807323a9c392311956b3385c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 27 Feb 2009 09:56:02 +0000 Subject: Improve freetype build integration (from hiyuh) Improve error checking on font initialization svn path=/trunk/netsurf/; revision=6655 --- framebuffer/fb_font_freetype.c | 3 ++- framebuffer/fb_gui.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'framebuffer') diff --git a/framebuffer/fb_font_freetype.c b/framebuffer/fb_font_freetype.c index 64c76c172..8c3ae76b3 100644 --- a/framebuffer/fb_font_freetype.c +++ b/framebuffer/fb_font_freetype.c @@ -99,7 +99,7 @@ fb_new_face(const char *fontfile) FT_Face aface; newf = calloc(1, sizeof(fb_faceid_t)); - newf->fontfile=strdup(fontfile); + newf->fontfile = strdup(fontfile); error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, &aface); if (error) { @@ -149,6 +149,7 @@ bool fb_font_init(void) fb_face_sans_serif = fb_new_face("/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf"); if (fb_face_sans_serif == NULL) { LOG(("Could not find default font (code %d)\n", error)); + FTC_Manager_Done(ft_cmanager ); FT_Done_FreeType(library); return false; } diff --git a/framebuffer/fb_gui.c b/framebuffer/fb_gui.c index cb88a7b7f..276aba62d 100644 --- a/framebuffer/fb_gui.c +++ b/framebuffer/fb_gui.c @@ -260,12 +260,13 @@ void gui_init(int argc, char** argv) default: LOG(("Unsupported bit depth (%d)", framebuffer->bpp)); - exit(1); + die("Unsupported bit depth"); } framebuffer->cursor = fb_cursor_init(framebuffer, &pointer_image); - fb_font_init(); + if (fb_font_init() == false) + die("Unable to initialise the font system"); } -- cgit v1.2.3