From 2565a37a52a5c714e7c6bbd1808db0d6d37c6ea3 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 21 Jul 2009 10:59:53 +0000 Subject: Refactor text plotter and other font functions to remove dependency on CSS. svn path=/trunk/netsurf/; revision=8641 --- framebuffer/fbtk.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'framebuffer/fbtk.c') diff --git a/framebuffer/fbtk.c b/framebuffer/fbtk.c index 0284b19a1..c564a9117 100644 --- a/framebuffer/fbtk.c +++ b/framebuffer/fbtk.c @@ -39,7 +39,12 @@ #include "framebuffer/bitmap.h" #include "framebuffer/image_data.h" -static struct css_style root_style; +static plot_font_style_t root_style = { + .family = PLOT_FONT_FAMILY_SANS_SERIF, + .size = 11, + .weight = 400, + .flags = FONTF_NONE, +}; enum fbtk_widgettype_e { FB_WIDGET_TYPE_ROOT = 0, @@ -601,13 +606,14 @@ fb_redraw_text(fbtk_widget_t *root, fbtk_widget_t *widget, void *pw) } if (widget->u.text.text != NULL) { + root_style.background = widget->bg; + root_style.foreground = widget->fg; + plot.text(bbox.x0 + 3, bbox.y0 + 17, - &root_style, widget->u.text.text, strlen(widget->u.text.text), - widget->bg, - widget->fg); + &root_style); } nsfb_release(root->u.root.fb, &bbox); @@ -1301,9 +1307,6 @@ fbtk_init(nsfb_t *fb) root->y = 0; root->u.root.rootw = fbtk_create_window(root, 0, 0, 0, 0); - root_style.font_size.value.length.unit = CSS_UNIT_PX; - root_style.font_size.value.length.value = 14; - return root; } -- cgit v1.2.3