summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--css/css.c2
-rw-r--r--riscos/font.c3
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)