Mercurial > pidgin
diff src/gtkimhtml.c @ 2761:367d19133917
[gaim-migrate @ 2774]
decklin's patch
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 19 Nov 2001 11:14:55 +0000 |
parents | 9fc65bb80596 |
children | 6fab04e257a5 |
line wrap: on
line diff
--- a/src/gtkimhtml.c Mon Nov 19 10:06:59 2001 +0000 +++ b/src/gtkimhtml.c Mon Nov 19 11:14:55 2001 +0000 @@ -59,9 +59,12 @@ #include "pixmaps/wink.xpm" #include "pixmaps/yell.xpm" -#define MAX_SIZE 7 - -gint font_sizes [] = { 80, 100, 120, 140, 200, 300, 400 }; +#define MAX_FONT_SIZE 7 +#define DEFAULT_FONT_SIZE 3 + +gint _point_sizes [] = { 80, 100, 120, 140, 200, 300, 400 }; + +#define DEFAULT_PRE_FACE "courier" #define BORDER_SIZE 2 #define TOP_BORDER 10 @@ -1927,7 +1930,7 @@ if (italics) newvals [SLANT] = "i"; if (fontsize) { - g_snprintf (fs, sizeof (fs), "%d", font_sizes [MIN (fontsize, MAX_SIZE) - 1]); + g_snprintf (fs, sizeof (fs), "%d", _point_sizes [MIN (fontsize, MAX_FONT_SIZE) - 1]); newvals [PXLSZ] = "*"; newvals [PTSZ] = fs; } @@ -1958,7 +1961,7 @@ newvals [FMLY] = names [i]; g_snprintf (fs, sizeof (fs), "%d", - font_sizes [MIN (fontsize, MAX_SIZE) - 1] / 10); + _point_sizes [MIN (fontsize, MAX_FONT_SIZE) - 1] / 10); newvals [PXLSZ] = fs; newvals [PTSZ] = "*"; @@ -2501,13 +2504,13 @@ if ((font != NULL) || bold || italics || pre) { if (font && (bold || italics || font->size || font->face || pre)) { if (pre) { - bit->font = gtk_imhtml_font_load (imhtml, "courier", bold, italics, font->size); + bit->font = gtk_imhtml_font_load (imhtml, DEFAULT_PRE_FACE, bold, italics, font->size); } else { bit->font = gtk_imhtml_font_load (imhtml, font->face, bold, italics, font->size); } } else if (bold || italics || pre) { if (pre) { - bit->font = gtk_imhtml_font_load (imhtml, "courier", bold, italics, 0); + bit->font = gtk_imhtml_font_load (imhtml, DEFAULT_PRE_FACE, bold, italics, 0); } else { bit->font = gtk_imhtml_font_load (imhtml, NULL, bold, italics, 0); } @@ -2992,7 +2995,7 @@ break; sscanf (value + 1, "%hd", &font->size); - font->size += 3; + font->size += DEFAULT_FONT_SIZE; break; } @@ -3005,7 +3008,7 @@ sscanf (value + 1, "%hd", &font->size); font->size = MIN (font->size, 2); - font->size = 3 - font->size; + font->size = DEFAULT_FONT_SIZE - font->size; break; } @@ -3036,7 +3039,7 @@ font->back = gdk_color_copy (oldfont->back); } else { if (!font->size) - font->size = 3; + font->size = DEFAULT_FONT_SIZE; } fonts = g_slist_prepend (fonts, font);