diff options
Diffstat (limited to 'content/handlers')
-rw-r--r-- | content/handlers/html/box_textarea.c | 2 | ||||
-rw-r--r-- | content/handlers/html/font.c | 7 | ||||
-rw-r--r-- | content/handlers/html/form.c | 2 | ||||
-rw-r--r-- | content/handlers/html/html_redraw_border.c | 2 | ||||
-rw-r--r-- | content/handlers/image/svg.c | 13 | ||||
-rw-r--r-- | content/handlers/text/textplain.c | 6 |
6 files changed, 17 insertions, 15 deletions
diff --git a/content/handlers/html/box_textarea.c b/content/handlers/html/box_textarea.c index 858de5039..c19afbb77 100644 --- a/content/handlers/html/box_textarea.c +++ b/content/handlers/html/box_textarea.c @@ -244,7 +244,7 @@ bool box_textarea_create_textarea(html_content *html, textarea_flags ta_flags; plot_font_style_t fstyle = { .family = PLOT_FONT_FAMILY_SANS_SERIF, - .size = 10 * FONT_SIZE_SCALE, + .size = 10 * PLOT_STYLE_SCALE, .weight = 400, .flags = FONTF_NONE, .background = 0, diff --git a/content/handlers/html/font.c b/content/handlers/html/font.c index 9dbf5922b..7ebe16825 100644 --- a/content/handlers/html/font.c +++ b/content/handlers/html/font.c @@ -144,14 +144,15 @@ void font_plot_style_from_css( fstyle->family = plot_font_generic_family( css_computed_font_family(css, &families)); + fstyle->families = families; css_computed_font_size(css, &length, &unit); fstyle->size = FIXTOINT(FMUL(nscss_len2pt(len_ctx, length, unit), - INTTOFIX(FONT_SIZE_SCALE))); + INTTOFIX(PLOT_STYLE_SCALE))); /* Clamp font size to configured minimum */ - if (fstyle->size < (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10) - fstyle->size = (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10; + if (fstyle->size < (nsoption_int(font_min_size) * PLOT_STYLE_SCALE) / 10) + fstyle->size = (nsoption_int(font_min_size) * PLOT_STYLE_SCALE) / 10; fstyle->weight = plot_font_weight(css_computed_font_weight(css)); fstyle->flags = plot_font_flags(css_computed_font_style(css), diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c index 9fe2e771a..8ba99d4ab 100644 --- a/content/handlers/html/form.c +++ b/content/handlers/html/form.c @@ -1160,7 +1160,7 @@ bool form_open_select_menu(void *client_data, menu->line_height = FIXTOINT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, - INTTOFIX(fstyle.size / FONT_SIZE_SCALE)))), + INTTOFIX(fstyle.size / PLOT_STYLE_SCALE)))), F_72)); line_height_with_spacing = menu->line_height + diff --git a/content/handlers/html/html_redraw_border.c b/content/handlers/html/html_redraw_border.c index 2a849e853..0b3d858e6 100644 --- a/content/handlers/html/html_redraw_border.c +++ b/content/handlers/html/html_redraw_border.c @@ -111,7 +111,7 @@ html_redraw_border_plot(const int side, plot_style_bdr.stroke_type = PLOT_OP_TYPE_DASH; plot_style_bdr.stroke_colour = c; - plot_style_bdr.stroke_width = thickness; + plot_style_bdr.stroke_width = (thickness << PLOT_STYLE_RADIX); plot_style_fillbdr.fill_colour = c; plot_style_fillbdr_dark.fill_colour = darken_colour(c); plot_style_fillbdr_light.fill_colour = lighten_colour(c); diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c index 2edc7bd08..51260733d 100644 --- a/content/handlers/image/svg.c +++ b/content/handlers/image/svg.c @@ -188,14 +188,15 @@ svg_redraw_internal(struct content *c, for (i = 0; i != diagram->shape_count; i++) { if (diagram->shape[i].path) { + pstyle.stroke_width = plot_style_int_to_fixed( + diagram->shape[i].stroke); pstyle.stroke_colour = BGR(diagram->shape[i].stroke); pstyle.fill_colour = BGR(diagram->shape[i].fill); res = ctx->plot->path(ctx, - &pstyle, - diagram->shape[i].path, - diagram->shape[i].path_length, - diagram->shape[i].stroke_width, - transform); + &pstyle, + diagram->shape[i].path, + diagram->shape[i].path_length, + transform); if (res != NSERROR_OK) { return false; } @@ -210,7 +211,7 @@ svg_redraw_internal(struct content *c, fstyle.background = 0xffffff; fstyle.foreground = 0x000000; - fstyle.size = (8 * FONT_SIZE_SCALE) * scale; + fstyle.size = (8 * PLOT_STYLE_SCALE) * scale; res = ctx->plot->text(ctx, &fstyle, diff --git a/content/handlers/text/textplain.c b/content/handlers/text/textplain.c index e6d167bc2..af990d1d7 100644 --- a/content/handlers/text/textplain.c +++ b/content/handlers/text/textplain.c @@ -86,7 +86,7 @@ typedef struct textplain_content { #define MARGIN 4 #define TAB_WIDTH 8 /* must be power of 2 currently */ -#define TEXT_SIZE 10 * FONT_SIZE_SCALE /* Unscaled text size in pt */ +#define TEXT_SIZE 10 * PLOT_STYLE_SCALE /* Unscaled text size in pt */ static plot_font_style_t textplain_style = { .family = PLOT_FONT_FAMILY_MONOSPACE, @@ -149,7 +149,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding) parserutils_inputstream *stream; parserutils_error error; - textplain_style.size = (nsoption_int(font_size) * FONT_SIZE_SCALE) / 10; + textplain_style.size = (nsoption_int(font_size) * PLOT_STYLE_SCALE) / 10; utf8_data = malloc(CHUNK); if (utf8_data == NULL) @@ -400,7 +400,7 @@ static float textplain_line_height(void) /* Size is in points, so convert to pixels. * Then use a constant line height of 1.2 x font size. */ - return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / FONT_SIZE_SCALE))))), F_72)); + return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / PLOT_STYLE_SCALE))))), F_72)); } |