summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@src.gnome.org>2001-03-21 04:39:26 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2001-03-21 04:39:26 +0000
commit88b3ea09abf74b84d0fba4591c0f02bf6dc1a1a2 (patch)
tree1953bfd3188ff657549eac4b5e779c1ace01b8b7 /test
parent84c103172ec0b3ce0a5b274b91579c53cdf9e9a6 (diff)
downloadnautilus-88b3ea09abf74b84d0fba4591c0f02bf6dc1a1a2.tar.gz
reviewed by: Pavel Cisler <pavel@eazel.com>
Fix a bunch of font bugs that dropped of the 1.0 plate. 7371 - Fonts in font pickers are in no particular order 7387 - Font selection defaults to bold for some fonts 7421 - Font option menu in "Appearances" too long for screen 7473 - Switching off "smooth graphics" leaves font family grouping 7486 - Font style menu disabled when it shouldn't be 7487 - Would be nice if font styles were submenus 7718 - 'cursor' font doesn't display * libnautilus-extensions/nautilus-art-gtk-extensions.h: * libnautilus-extensions/nautilus-art-gtk-extensions.c: (nautilus_screen_get_dimensions): Fix a really silly typo. (nautilus_gtk_widget_get_dimensions): Make the documentation a little better. (nautilus_gtk_widget_get_preferred_dimensions): New function to get a widget's preferred dimensions. * libnautilus-extensions/nautilus-font-manager.c: (font_description_new): Use consistent variable names. Set a 'is_ignored' flag if the font is ignored. (font_description_free): Use consistent variable names. (font_description_table_find): Ignore black listed fonts. (font_description_table_for_each): Ignore black listed fonts. (font_directory_is_ignored): Put constants on top of file. (font_foundry_is_ignored), (font_family_is_ignored): New functions to check for specific black listed font foundries and/or families. (ensure_local_font_table): Rename to 'local' from 'global' - this is something i need for a future change where the font manager will be able to handle both 'local' and 'server' fonts. Move the font ignoring code from nautilus-font-picker.c here so that it is in one place. * libnautilus-extensions/nautilus-font-picker.h: Subclass it from GtkHBox instead of GtkVBox now that it is not as wide. * libnautilus-extensions/nautilus-font-picker.c: (option_menu_button_press_event), (menu_deactivate), (nautilus_font_picker_initialize), (nautilus_font_picker_destroy), (style_menu_item_activate_callback), (style_menu_item_button_release_event), (font_picker_add_item), (font_picker_populate), (font_make_name), (font_make_style_name), (font_slant_string_to_enum), (font_set_width_string_to_enum), (font_style_entry_new), (font_style_entry_free), (compare_font_entry), (global_font_list_get), (compare_int), (compare_style), (global_font_list_populate_callback), (nautilus_gtk_menu_shell_get_num_items), (font_picker_get_selected_style_entry), (font_picker_find_entries_for_font), (font_picker_get_index_for_entry), (nautilus_font_picker_new), (nautilus_font_picker_get_selected_font), (nautilus_font_picker_set_selected_font): Move the black listed font code into the font manager. Use option menus directly instead of NautilusStringPickers. Put the style choices in cascading submenus. Deal with the case when too many choices dont fit on the screen. * test/test-nautilus-font-manager.c: * test/test-nautilus-font-picker.c: Update for font picker changes.
Diffstat (limited to 'test')
-rw-r--r--test/test-nautilus-font-manager.c9
-rw-r--r--test/test-nautilus-font-picker.c33
2 files changed, 39 insertions, 3 deletions
diff --git a/test/test-nautilus-font-manager.c b/test/test-nautilus-font-manager.c
index 7b237a544..64ef76e59 100644
--- a/test/test-nautilus-font-manager.c
+++ b/test/test-nautilus-font-manager.c
@@ -12,7 +12,11 @@ font_type_to_string (NautilusFontType font_type)
return "postscript";
}
- return "truetype";
+ if (font_type == NAUTILUS_FONT_TRUE_TYPE) {
+ return "truetype";
+ }
+
+ return "unknown";
}
// microsoft Webdings
@@ -129,7 +133,8 @@ main (int argc, char* argv[])
font_table = g_hash_table_new (g_str_hash, g_str_equal);
- nautilus_font_manager_for_each_font (font_iterator_callback, font_table);
+ nautilus_font_manager_for_each_font (font_iterator_callback,
+ font_table);
g_hash_table_foreach (font_table, font_table_for_each_callback, NULL);
diff --git a/test/test-nautilus-font-picker.c b/test/test-nautilus-font-picker.c
index 81e7ed72c..868fb5dc9 100644
--- a/test/test-nautilus-font-picker.c
+++ b/test/test-nautilus-font-picker.c
@@ -106,6 +106,22 @@ use_defalt_bold_font_update_picker_callback (GtkWidget *button,
g_free (default_bold_font);
}
+static void
+print_selected_font_callback (GtkWidget *button,
+ gpointer callback_data)
+{
+ char *selected_font;
+
+ g_return_if_fail (GTK_IS_BUTTON (button));
+ g_return_if_fail (NAUTILUS_IS_FONT_PICKER (callback_data));
+
+ selected_font = nautilus_font_picker_get_selected_font (NAUTILUS_FONT_PICKER (callback_data));
+
+ g_print ("selected_font = '%s'\n", selected_font);
+
+ g_free (selected_font);
+}
+
int
main (int argc, char * argv[])
{
@@ -121,6 +137,7 @@ main (int argc, char * argv[])
GtkWidget *use_defailt_bold_button;
GtkWidget *default_hbox;
GtkWidget *default_bold_hbox;
+ GtkWidget *print_selected_font_button;
char *current_font;
char *default_font;
char *default_bold_font;
@@ -206,10 +223,24 @@ main (int argc, char * argv[])
gtk_box_pack_start (GTK_BOX (vbox), default_hbox, TRUE, TRUE, 10);
gtk_box_pack_start (GTK_BOX (vbox), default_bold_hbox, TRUE, TRUE, 10);
+ print_selected_font_button = gtk_button_new_with_label ("Print selected font");
+ gtk_signal_connect (GTK_OBJECT (print_selected_font_button),
+ "clicked",
+ GTK_SIGNAL_FUNC (print_selected_font_callback),
+ font_picker);
+ gtk_box_pack_start (GTK_BOX (vbox), print_selected_font_button, FALSE, FALSE, 10);
+
g_free (current_font);
g_free (default_font);
- gtk_widget_show_all (window);
+ gtk_widget_show (font_picker);
+ gtk_widget_show (label);
+ gtk_widget_show (file_name_caption);
+ gtk_widget_show (print_selected_font_button);
+ gtk_widget_show_all (default_hbox);
+ gtk_widget_show_all (default_bold_hbox);
+ gtk_widget_show (vbox);
+ gtk_widget_show (window);
gtk_main ();
return test_quit (EXIT_SUCCESS);