summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2009-02-27 09:56:02 +0000
committerVincent Sanders <vince@netsurf-browser.org>2009-02-27 09:56:02 +0000
commit02de9ff8db9da733807323a9c392311956b3385c (patch)
treed87ac3ed26d3b787d2b0ec28ddff79d57813e804 /framebuffer
parent4cf1a9f36b81bd6e5f3040cd086033da06763ab6 (diff)
downloadnetsurf-02de9ff8db9da733807323a9c392311956b3385c.tar.gz
netsurf-02de9ff8db9da733807323a9c392311956b3385c.tar.bz2
Improve freetype build integration (from hiyuh)
Improve error checking on font initialization svn path=/trunk/netsurf/; revision=6655
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/fb_font_freetype.c3
-rw-r--r--framebuffer/fb_gui.c5
2 files changed, 5 insertions, 3 deletions
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");
}