From 734cf791efe792c42dca1c000c7fae633197312b Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 24 Jan 2012 20:23:10 +0000 Subject: Fix font-face defaults (credit: James Montgomerie) svn path=/trunk/libcss/; revision=13406 --- src/select/font_face.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/select/font_face.c b/src/select/font_face.c index ae24827..cd6556a 100644 --- a/src/select/font_face.c +++ b/src/select/font_face.c @@ -25,6 +25,15 @@ static void font_faces_srcs_destroy(css_font_face *font_face) font_face->srcs = NULL; } +static const css_font_face default_font_face = { + NULL, + NULL, + 0, + { (CSS_FONT_WEIGHT_NORMAL << 2) | CSS_FONT_STYLE_NORMAL }, + NULL, + NULL +}; + /** * Create a font-face * @@ -47,7 +56,7 @@ css_error css__font_face_create(css_allocator_fn alloc, void *pw, if (f == NULL) return CSS_NOMEM; - memset(f, 0, sizeof(css_font_face)); + memcpy(f, &default_font_face, sizeof(css_font_face)); f->alloc = alloc; f->pw = pw; -- cgit v1.2.3