summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2006-03-09 19:05:29 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2006-03-09 19:05:29 +0000
commita197ee3b280f270cf4c0b17818d72d702249dbcd (patch)
treecde0f2ca87734225253b8c52163368045346ece4 /gtk
parent05b214a5d5f8ce4a3058f178e3cf9a5a9b56c770 (diff)
downloadnetsurf-a197ee3b280f270cf4c0b17818d72d702249dbcd.tar.gz
netsurf-a197ee3b280f270cf4c0b17818d72d702249dbcd.tar.bz2
[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
Diffstat (limited to 'gtk')
-rw-r--r--gtk/font_pango.c10
1 files 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);