summaryrefslogtreecommitdiff
path: root/desktop/knockout.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-21 10:59:53 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-21 10:59:53 +0000
commit2565a37a52a5c714e7c6bbd1808db0d6d37c6ea3 (patch)
treef3fe5f224c9e0e4089aca2d9012dfe1a74cf9c90 /desktop/knockout.c
parent1930989f8ccdd574472ed72990b6a82fdcf9d5f4 (diff)
downloadnetsurf-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 'desktop/knockout.c')
-rw-r--r--desktop/knockout.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/desktop/knockout.c b/desktop/knockout.c
index b9a6862e5..680257b0f 100644
--- a/desktop/knockout.c
+++ b/desktop/knockout.c
@@ -90,8 +90,8 @@ static bool knockout_plot_polygon(const int *p, unsigned int n, const plot_style
static bool knockout_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *plot_style);
static bool knockout_plot_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1);
-static bool knockout_plot_text(int x, int y, const struct css_style *style,
- const char *text, size_t length, colour bg, colour c);
+static bool knockout_plot_text(int x, int y, const char *text, size_t length,
+ const plot_font_style_t *fstyle);
static bool knockout_plot_disc(int x, int y, int radius, const plot_style_t *pstyle);
static bool knockout_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *pstyle);
static bool knockout_plot_bitmap(int x, int y, int width, int height,
@@ -188,11 +188,9 @@ struct knockout_entry {
struct {
int x;
int y;
- const struct css_style *style;
const char *text;
size_t length;
- colour bg;
- colour c;
+ plot_font_style_t font_style;
} text;
struct {
int x;
@@ -350,11 +348,9 @@ bool knockout_plot_flush(void)
success &= plot.text(
knockout_entries[i].data.text.x,
knockout_entries[i].data.text.y,
- knockout_entries[i].data.text.style,
knockout_entries[i].data.text.text,
knockout_entries[i].data.text.length,
- knockout_entries[i].data.text.bg,
- knockout_entries[i].data.text.c);
+ &knockout_entries[i].data.text.font_style);
break;
case KNOCKOUT_PLOT_DISC:
success &= plot.disc(
@@ -737,16 +733,14 @@ bool knockout_plot_clip(int clip_x0, int clip_y0,
}
-bool knockout_plot_text(int x, int y, const struct css_style *style,
- const char *text, size_t length, colour bg, colour c)
+bool knockout_plot_text(int x, int y, const char *text, size_t length,
+ const plot_font_style_t *fstyle)
{
knockout_entries[knockout_entry_cur].data.text.x = x;
knockout_entries[knockout_entry_cur].data.text.y = y;
- knockout_entries[knockout_entry_cur].data.text.style = style;
knockout_entries[knockout_entry_cur].data.text.text = text;
knockout_entries[knockout_entry_cur].data.text.length = length;
- knockout_entries[knockout_entry_cur].data.text.bg = bg;
- knockout_entries[knockout_entry_cur].data.text.c = c;
+ knockout_entries[knockout_entry_cur].data.text.font_style = *fstyle;
knockout_entries[knockout_entry_cur].type = KNOCKOUT_PLOT_TEXT;
if (++knockout_entry_cur >= KNOCKOUT_ENTRIES)
knockout_plot_flush();