diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-21 10:59:53 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-21 10:59:53 +0000 |
commit | 2565a37a52a5c714e7c6bbd1808db0d6d37c6ea3 (patch) | |
tree | f3fe5f224c9e0e4089aca2d9012dfe1a74cf9c90 /framebuffer/fbtk.c | |
parent | 1930989f8ccdd574472ed72990b6a82fdcf9d5f4 (diff) | |
download | netsurf-2565a37a52a5c714e7c6bbd1808db0d6d37c6ea3.tar.gz netsurf-2565a37a52a5c714e7c6bbd1808db0d6d37c6ea3.tar.bz2 |
Refactor text plotter and other font functions to remove dependency on CSS.
svn path=/trunk/netsurf/; revision=8641
Diffstat (limited to 'framebuffer/fbtk.c')
-rw-r--r-- | framebuffer/fbtk.c | 17 |
1 files changed, 10 insertions, 7 deletions
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; } |