pidgin: 0a45c969: Change the way we handle <span style='fo...

markdoliner at pidgin.im markdoliner at pidgin.im
Sun Dec 14 20:20:38 EST 2008


-----------------------------------------------------------------
Revision: 0a45c969cabb78cafbfaec83aaf5d274bf042109
Ancestor: b91b112c0b3cd2cc014285d5dad8b6cb8973a22b
Author: markdoliner at pidgin.im
Date: 2008-12-15T01:13:17
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0a45c969cabb78cafbfaec83aaf5d274bf042109

Modified files:
        pidgin/gtkimhtml.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c	e6d9c36f8a08f24eaac37d6d3f21885b40cc432a
+++ pidgin/gtkimhtml.c	53aa0f5b28f3406cde52e16267d277320da12b52
@@ -3126,9 +3126,15 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 								font->size = 6;
 							else if (g_ascii_strcasecmp(size, "xx-large") == 0)
 								font->size = 7;
-							else
-								font->size = 3;
-						    gtk_imhtml_font_set_size(imhtml, font->size);
+
+							/*
+							 * TODO: Handle other values, like percentages, or
+							 * lengths specified as em, ex, px, in, cm, mm, pt
+							 * or pc.  Or even better, use an actual HTML
+							 * renderer like webkit.
+							 */
+							if (font->size > 0)
+							    gtk_imhtml_font_set_size(imhtml, font->size);
 						}
 						else if (oldfont)
 						{


More information about the Commits mailing list