changeset 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 72272d43e265
children 8eb8db9a8449
files src/conversation.c src/dialogs.c src/gtkimhtml.c src/ui.h
diffstat 4 files changed, 22 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Mon Nov 19 10:06:59 2001 +0000
+++ b/src/conversation.c	Mon Nov 19 11:14:55 2001 +0000
@@ -509,10 +509,11 @@
 	if (!strcmp(pre_fontface, "<FONT FACE=\"\">")) {
 		g_free(pre_fontface);
 		alloc--;
-		pre_fontface = "<FONT FACE=\"Helvetica\">";
+		pre_fontface = "<FONT FACE=\"" DEFAULT_FONT_FACE "\">";
 	}
 
-	sprintf(c->fontface, "%s", newfont ? (newfont[0] ? newfont : "Helvetica") : "Helvetica");
+	sprintf(c->fontface, "%s", newfont ?
+		(newfont[0] ? newfont : DEFAULT_FONT_FACE) : DEFAULT_FONT_FACE);
 	c->hasfont = 1;
 	surround(c->entry, pre_fontface, "</FONT>");
 	gtk_widget_grab_focus(c->entry);
--- a/src/dialogs.c	Mon Nov 19 10:06:59 2001 +0000
+++ b/src/dialogs.c	Mon Nov 19 11:14:55 2001 +0000
@@ -76,8 +76,6 @@
 #include "pixmaps/admin_icon.xpm"
 #include "pixmaps/ab.xpm"
 
-#define DEFAULT_FONT_NAME "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1"
-
 #define PATHSIZE 1024
 
 int smiley_array[FACE_TOTAL];
@@ -2723,7 +2721,7 @@
 			return;
 		fontseld = gtk_font_selection_dialog_new(_("Select Font"));
 		gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld),
-							DEFAULT_FONT_NAME);
+							DEFAULT_FONT_XFLD);
 
 		gtk_object_set_user_data(GTK_OBJECT(fontseld), NULL);
 		gtk_signal_connect(GTK_OBJECT(fontseld), "delete_event",
@@ -2748,7 +2746,7 @@
 			gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), NULL);
 
 		gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *) c->font_dialog,
-							DEFAULT_FONT_NAME);
+							DEFAULT_FONT_XFLD);
 
 		gtk_signal_connect(GTK_OBJECT(c->font_dialog), "delete_event",
 				   GTK_SIGNAL_FUNC(delete_event_dialog), c);
@@ -2758,7 +2756,7 @@
 				   "clicked", GTK_SIGNAL_FUNC(cancel_font), c);
 
 		gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *) c->font_dialog,
-							DEFAULT_FONT_NAME);
+							DEFAULT_FONT_XFLD);
 
 		gtk_widget_realize(c->font_dialog);
 
--- 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);
--- a/src/ui.h	Mon Nov 19 10:06:59 2001 +0000
+++ b/src/ui.h	Mon Nov 19 11:14:55 2001 +0000
@@ -49,6 +49,9 @@
 #define gtk_style_set_font(s, f) (s)->font = f
 #endif
 
+#define DEFAULT_FONT_XFLD "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1"
+#define DEFAULT_FONT_FACE "helvetica"
+
 #define BROWSER_NETSCAPE              0
 #define BROWSER_KFM                   1
 #define BROWSER_MANUAL                2