changeset 10380:bed8d9a7bb88

[gaim-migrate @ 11605] Evan Schoenberg writes: This small patch makes _font_tags_fix_size() both include a size="#" tag (as before) and an absz="#" tag (new). Yahoo sends the absolute size as a size="" tag. We currently convert it to an HTML size so a standard HTML widget can understand it. However, HTML size is not as exact as point size; if the widget supports absz tags, it can get a more accurate size determination from that. If it doesn't, no harm in including it. I wonder if we should make gtkimhtml support this.. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Wed, 15 Dec 2004 16:27:07 +0000
parents cf7b1970039e
children 9f50c31a41f9
files src/protocols/yahoo/util.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/util.c	Wed Dec 15 05:02:31 2004 +0000
+++ b/src/protocols/yahoo/util.c	Wed Dec 15 16:27:07 2004 +0000
@@ -220,6 +220,8 @@
 		return 6;
 	return 7;
 }
+
+/* The Yahoo size tag is actually an absz tag; convert it to an HTML size, and include both tags */
 static void _font_tags_fix_size(GString *tag, GString *dest)
 {
 	char *x, *end;
@@ -229,10 +231,13 @@
 		while (*x && !g_ascii_isdigit(*x))
 			x++;
 		if (*x) {
+			int htmlsize;
+
 			size = strtol(x, &end, 10);
-			size = point_to_html(size);
+			htmlsize = point_to_html(size);
 			g_string_append_len(dest, tag->str, x - tag->str);
-			g_string_append_printf(dest, "%d", size);
+			g_string_append_printf(dest, "%d", htmlsize);
+			g_string_append_printf(dest, "\" absz=\"%d", size);
 			g_string_append(dest, end);
 		} else {
 			g_string_append(dest, tag->str);
@@ -250,7 +255,6 @@
 	int i, j, xs, nomoreendtags = 0; /* s/endtags/closinganglebrackets */
 	char *match, *ret;
 
-
 	s = g_string_sized_new(strlen(x));
 
 	for (i = 0, xs = strlen(x); i < xs; i++) {