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 --- desktop/selection.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'desktop/selection.c') diff --git a/desktop/selection.c b/desktop/selection.c index 014c44659..623caf414 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -609,6 +609,9 @@ bool redraw_handler(const char *text, size_t length, struct box *box, struct rdw_info *r = (struct rdw_info*)handle; int width, height, space_width; int x, y; + plot_font_style_t fstyle; + + font_plot_style_from_css(box->style, &fstyle); /* \todo - it should be possible to reduce the redrawn area by * considering the 'text', 'length' and 'space' parameters */ @@ -618,7 +621,7 @@ bool redraw_handler(const char *text, size_t length, struct box *box, height = box->padding[TOP] + box->height + box->padding[BOTTOM]; if (box->type == BOX_TEXT && box->space && - nsfont.font_width(box->style, " ", 1, &space_width)) + nsfont.font_width(&fstyle, " ", 1, &space_width)) width += space_width; if (r->inited) { -- cgit v1.2.3