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 /desktop/save_pdf/pdf_plotters.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 'desktop/save_pdf/pdf_plotters.c')
-rw-r--r-- | desktop/save_pdf/pdf_plotters.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/desktop/save_pdf/pdf_plotters.c b/desktop/save_pdf/pdf_plotters.c index 84e0a5506..a29db2415 100644 --- a/desktop/save_pdf/pdf_plotters.c +++ b/desktop/save_pdf/pdf_plotters.c @@ -50,8 +50,8 @@ static bool pdf_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *ps static bool pdf_plot_polygon(const int *p, unsigned int n, const plot_style_t *style); static bool pdf_plot_clip(int clip_x0, int clip_y0, int clip_x1, int clip_y1); -static bool pdf_plot_text(int x, int y, const struct css_style *style, - const char *text, size_t length, colour bg, colour c); +static bool pdf_plot_text(int x, int y, const char *text, size_t length, + const plot_font_style_t *fstyle); static bool pdf_plot_disc(int x, int y, int radius, const plot_style_t *style); static bool pdf_plot_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style); @@ -285,8 +285,8 @@ bool pdf_plot_clip(int clip_x0, int clip_y0, int clip_x1, int clip_y1) return true; } -bool pdf_plot_text(int x, int y, const struct css_style *style, - const char *text, size_t length, colour bg, colour c) +bool pdf_plot_text(int x, int y, const char *text, size_t length, + const plot_font_style_t *fstyle) { #ifdef PDF_DEBUG LOG((". %d %d %.*s", x, y, (int)length, text)); @@ -298,9 +298,10 @@ bool pdf_plot_text(int x, int y, const struct css_style *style, if (length == 0) return true; - apply_clip_and_mode(true, c, NS_TRANSPARENT, 0., DashPattern_eNone); + apply_clip_and_mode(true, fstyle->foreground, NS_TRANSPARENT, 0., + DashPattern_eNone); - haru_nsfont_apply_style(style, pdf_doc, pdf_page, &pdf_font, &size); + haru_nsfont_apply_style(fstyle, pdf_doc, pdf_page, &pdf_font, &size); pdfw_gs_font(pdf_page, pdf_font, size); /* FIXME: UTF-8 to current font encoding needs to done. Or the font |