From a197ee3b280f270cf4c0b17818d72d702249dbcd Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 9 Mar 2006 19:05:29 +0000 Subject: [project @ 2006-03-09 19:05:29 by dsilvers] gtk/font_pango.c: Use the new css_len2pt function if possible svn path=/import/netsurf/; revision=2115 --- gtk/font_pango.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gtk/font_pango.c b/gtk/font_pango.c index 5daf0da7a..176c634fd 100644 --- a/gtk/font_pango.c +++ b/gtk/font_pango.c @@ -227,7 +227,10 @@ PangoFontDescription *nsfont_style_to_description( PangoStyle styl = PANGO_STYLE_NORMAL; assert(style->font_size.size == CSS_FONT_SIZE_LENGTH); - size = css_len2px(&style->font_size.value.length, style) * PANGO_SCALE; + if (style->font_size.value.length.unit == CSS_UNIT_PX) + size = style->font_size.value.length.value * PANGO_SCALE; + else + size = css_len2pt(&style->font_size.value.length, style) * PANGO_SCALE; switch (style->font_style) { case CSS_FONT_STYLE_ITALIC: @@ -258,7 +261,10 @@ PangoFontDescription *nsfont_style_to_description( } desc = pango_font_description_new(); - pango_font_description_set_size(desc, size); + if (style->font_size.value.length.unit == CSS_UNIT_PX) + pango_font_description_set_absolute_size(desc, size); + else + pango_font_description_set_size(desc, size); pango_font_description_set_family_static(desc, "Sans"); pango_font_description_set_weight(desc, weight); pango_font_description_set_style(desc, styl); -- cgit v1.2.3