From e34ed32685a8d5cda7e31942cfa091db62643b2e Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 16 Dec 2008 12:26:52 +0000 Subject: [PATCH] Fix css_len2pt conversion from px and use it in the RO front end code. svn path=/trunk/netsurf/; revision=5914 --- css/css.c | 2 +- riscos/font.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/css/css.c b/css/css.c index 701000da0..26acc1aa0 100644 --- a/css/css.c +++ b/css/css.c @@ -3222,7 +3222,7 @@ float css_len2pt(const struct css_length *length, css_len2pt(&style->font_size.value.length, 0) * 0.6; /* We assume the screen and any other output has the same dpi */ - case CSS_UNIT_PX: return length->value * css_screen_dpi / 72; + case CSS_UNIT_PX: return length->value * 72 / css_screen_dpi; /* 1pt = 1in/72 */ case CSS_UNIT_IN: return length->value * 72; case CSS_UNIT_CM: return length->value * 28.452756; diff --git a/riscos/font.c b/riscos/font.c index 54a985ae0..46693e3cd 100644 --- a/riscos/font.c +++ b/riscos/font.c @@ -421,8 +421,7 @@ void nsfont_read_style(const struct css_style *style, rufl_style *font_style) { assert(style->font_size.size == CSS_FONT_SIZE_LENGTH); - *font_size = css_len2px(&style->font_size.value.length, style) * - 72.0 / 90.0 * 16.; + *font_size = css_len2pt(&style->font_size.value.length, style) * 16.; if (*font_size < option_font_min_size * 1.6) *font_size = option_font_min_size * 1.6; if (1600 < *font_size)