From 9203dacfac5f84bfe8fd1fac704b59c8802fe150 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Thu, 17 Aug 2006 20:31:24 +0000 Subject: Added font selection to nsgtk choices window. Still not used for plotting. svn path=/trunk/netsurf/; revision=2862 --- gtk/gtk_options.c | 13 +++++++++++++ gtk/netsurf.glade | 5 ----- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'gtk') diff --git a/gtk/gtk_options.c b/gtk/gtk_options.c index 033d18115..4f236ee6f 100644 --- a/gtk/gtk_options.c +++ b/gtk/gtk_options.c @@ -106,6 +106,7 @@ void nsgtk_options_init(void) { #define SET_SPIN(x, y) gtk_spin_button_set_value(GTK_SPIN_BUTTON((x)), (y)) #define SET_CHECK(x, y) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON((x)), (y)) #define SET_COMBO(x, y) gtk_combo_box_set_active(GTK_COMBO_BOX((x)), (y)) +#define SET_FONT(x, y) gtk_font_button_set_font_name(GTK_FONT_BUTTON((x)), (y)) void nsgtk_options_load(void) { char b[20]; @@ -131,6 +132,11 @@ void nsgtk_options_load(void) { SET_CHECK(checkDisableAnimations, !option_animate_images); /* TODO: set all font name widgets here */ + SET_FONT(fontSansSerif, option_font_sans); + SET_FONT(fontSerif, option_font_serif); + SET_FONT(fontMonospace, option_font_mono); + SET_FONT(fontCursive, option_font_cursive); + SET_FONT(fontFantasy, option_font_fantasy); SET_COMBO(comboDefault, option_font_default - 1); SET_SPIN(spinDefaultSize, option_font_size / 10); SET_SPIN(spinMinimumSize, option_font_min_size / 10); @@ -144,6 +150,8 @@ void nsgtk_options_load(void) { #define GET_CHECK(x, y) (y) = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON((x))) #define GET_SPIN(x, y) (y) = gtk_spin_button_get_value(GTK_SPIN_BUTTON((x))) #define GET_COMBO(x, y) (y) = gtk_combo_box_get_active(GTK_COMBO_BOX((x))) +#define GET_FONT(x, y) if ((y)) free((y)); \ + (y) = strdup(gtk_font_button_get_font_name(GTK_FONT_BUTTON((x)))) void nsgtk_options_save(void) { GET_ENTRY(entryHomePageURL, option_homepage_url); @@ -152,6 +160,11 @@ void nsgtk_options_save(void) { GET_CHECK(checkUseCairo, option_render_cairo); GET_CHECK(checkResampleImages, option_render_resample); + GET_FONT(fontSansSerif, option_font_sans); + GET_FONT(fontSerif, option_font_serif); + GET_FONT(fontMonospace, option_font_mono); + GET_FONT(fontCursive, option_font_cursive); + GET_FONT(fontFantasy, option_font_fantasy); GET_COMBO(comboDefault, option_font_default); option_font_default++; diff --git a/gtk/netsurf.glade b/gtk/netsurf.glade index 952413132..1fb0fa0a7 100644 --- a/gtk/netsurf.glade +++ b/gtk/netsurf.glade @@ -3466,7 +3466,6 @@ NTML authentication True - False True False False @@ -3487,7 +3486,6 @@ NTML authentication True - False True False False @@ -3508,7 +3506,6 @@ NTML authentication True - False True False False @@ -3529,7 +3526,6 @@ NTML authentication True - False True False False @@ -3571,7 +3567,6 @@ Fantasy True - False True False False -- cgit v1.2.3