Mercurial > pidgin.yaz
comparison pidgin/gtkimhtml.c @ 24688:dce57ce0b860
Change the way we handle <span style='font-size: whatever;'> tags slightly.
We really only support a few specific values for that css attribute--we
don't support things like "12pt" for example. But this code was setting
<font size="3"> for any unknown font-size css value. So if someone
specified a css font-size of 72px we set the font size to 3, which is
basically the default font size, which is clearly wrong.
So change this to just do nothing if we don't understand the value.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 15 Dec 2008 01:13:17 +0000 |
parents | 9ea84135db24 |
children | 01bd85f65fa1 ca01403251f1 a959b17ffc57 |
comparison
equal
deleted
inserted
replaced
24685:bca23aa61d0f | 24688:dce57ce0b860 |
---|---|
3124 font->size = 5; | 3124 font->size = 5; |
3125 else if (g_ascii_strcasecmp(size, "x-large") == 0) | 3125 else if (g_ascii_strcasecmp(size, "x-large") == 0) |
3126 font->size = 6; | 3126 font->size = 6; |
3127 else if (g_ascii_strcasecmp(size, "xx-large") == 0) | 3127 else if (g_ascii_strcasecmp(size, "xx-large") == 0) |
3128 font->size = 7; | 3128 font->size = 7; |
3129 else | 3129 |
3130 font->size = 3; | 3130 /* |
3131 gtk_imhtml_font_set_size(imhtml, font->size); | 3131 * TODO: Handle other values, like percentages, or |
3132 * lengths specified as em, ex, px, in, cm, mm, pt | |
3133 * or pc. Or even better, use an actual HTML | |
3134 * renderer like webkit. | |
3135 */ | |
3136 if (font->size > 0) | |
3137 gtk_imhtml_font_set_size(imhtml, font->size); | |
3132 } | 3138 } |
3133 else if (oldfont) | 3139 else if (oldfont) |
3134 { | 3140 { |
3135 font->size = oldfont->size; | 3141 font->size = oldfont->size; |
3136 } | 3142 } |