# HG changeset patch # User Nathan Walp # Date 1064952802 0 # Node ID 5a45833dd253e81c936595b7e2efed2f3816cf5e # Parent acd2a66e59edcf2ea1056b05785eeb463b2f5c1c [gaim-migrate @ 7644] close 772082 committer: Tailor Script diff -r acd2a66e59ed -r 5a45833dd253 src/dialogs.c --- a/src/dialogs.c Tue Sep 30 18:41:28 2003 +0000 +++ b/src/dialogs.c Tue Sep 30 20:13:22 2003 +0000 @@ -1760,33 +1760,21 @@ { /* this could be expanded to include font size, weight, etc. but for now only works with font face */ - int i = 0; char *fontname; + char *space; GaimConversation *c = g_object_get_data(G_OBJECT(fontsel), "gaim_conversation"); + if(!c) + return; + fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel)); - if (c) { - while(fontname[i] && !isdigit(fontname[i])) { - i++; - } - fontname[i] = 0; - gaim_gtk_set_font_face(GAIM_GTK_CONVERSATION(c), fontname); - } else { - char *c; - - fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel)); - - for (c = fontname; *c != '\0'; c++) { - if (isdigit(*c)) { - *(--c) = '\0'; - break; - } - } - - gaim_prefs_set_string("/gaim/gtk/conversations/font_face", fontname); - } + space = strrchr(fontname, ' '); + if(space && isdigit(*(space+1))) + *space = '\0'; + + gaim_gtk_set_font_face(GAIM_GTK_CONVERSATION(c), fontname); g_free(fontname); diff -r acd2a66e59ed -r 5a45833dd253 src/gtkprefs.c --- a/src/gtkprefs.c Tue Sep 30 18:41:28 2003 +0000 +++ b/src/gtkprefs.c Tue Sep 30 20:13:22 2003 +0000 @@ -2662,19 +2662,16 @@ void apply_font_dlg(GtkWidget *w, GtkWidget *f) { - char *fontname, *c; + char *fontname, *space; fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f)); destroy_fontsel(0, 0); - for (c = fontname; *c != '\0'; c++) { - if (isdigit(*c)) { - *(--c) = '\0'; - break; - } - } + space = strrchr(fontname, ' '); + if(space && isdigit(*(space+1))) + *space = '\0'; gaim_prefs_set_string("/gaim/gtk/conversations/font_face", fontname);