]> Pileus Git - ~andy/gtk/commitdiff
handle "(nil)" foundries, patch from Grigorios Magklis.
authorTim Janik <timj@gtk.org>
Fri, 19 May 2000 05:50:46 +0000 (05:50 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 19 May 2000 05:50:46 +0000 (05:50 +0000)
Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
        "(nil)" foundries, patch from Grigorios Magklis.

        * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
        on non-available fonts, based on a patch by Grigorios Magklis
        <maglis@cs.rochester.edu>.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfontsel.c

index dab755fc81fc8317a6c03e3617b96e5bf9d968df..aa0ad980d444925ecedd8fb0f08104f78572e407 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
+       "(nil)" foundries, patch from Grigorios Magklis.
+
+       * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
+       on non-available fonts, based on a patch by Grigorios Magklis
+       <maglis@cs.rochester.edu>.
+
 2000-05-18  Elliot Lee  <sopwith@redhat.com>
 
        * gdk/x11/gdkregion-generic.c: If a region does not have any
index dab755fc81fc8317a6c03e3617b96e5bf9d968df..aa0ad980d444925ecedd8fb0f08104f78572e407 100644 (file)
@@ -1,3 +1,12 @@
+Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
+       "(nil)" foundries, patch from Grigorios Magklis.
+
+       * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
+       on non-available fonts, based on a patch by Grigorios Magklis
+       <maglis@cs.rochester.edu>.
+
 2000-05-18  Elliot Lee  <sopwith@redhat.com>
 
        * gdk/x11/gdkregion-generic.c: If a region does not have any
index dab755fc81fc8317a6c03e3617b96e5bf9d968df..aa0ad980d444925ecedd8fb0f08104f78572e407 100644 (file)
@@ -1,3 +1,12 @@
+Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
+       "(nil)" foundries, patch from Grigorios Magklis.
+
+       * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
+       on non-available fonts, based on a patch by Grigorios Magklis
+       <maglis@cs.rochester.edu>.
+
 2000-05-18  Elliot Lee  <sopwith@redhat.com>
 
        * gdk/x11/gdkregion-generic.c: If a region does not have any
index dab755fc81fc8317a6c03e3617b96e5bf9d968df..aa0ad980d444925ecedd8fb0f08104f78572e407 100644 (file)
@@ -1,3 +1,12 @@
+Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
+       "(nil)" foundries, patch from Grigorios Magklis.
+
+       * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
+       on non-available fonts, based on a patch by Grigorios Magklis
+       <maglis@cs.rochester.edu>.
+
 2000-05-18  Elliot Lee  <sopwith@redhat.com>
 
        * gdk/x11/gdkregion-generic.c: If a region does not have any
index dab755fc81fc8317a6c03e3617b96e5bf9d968df..aa0ad980d444925ecedd8fb0f08104f78572e407 100644 (file)
@@ -1,3 +1,12 @@
+Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
+       "(nil)" foundries, patch from Grigorios Magklis.
+
+       * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
+       on non-available fonts, based on a patch by Grigorios Magklis
+       <maglis@cs.rochester.edu>.
+
 2000-05-18  Elliot Lee  <sopwith@redhat.com>
 
        * gdk/x11/gdkregion-generic.c: If a region does not have any
index dab755fc81fc8317a6c03e3617b96e5bf9d968df..aa0ad980d444925ecedd8fb0f08104f78572e407 100644 (file)
@@ -1,3 +1,12 @@
+Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
+       "(nil)" foundries, patch from Grigorios Magklis.
+
+       * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
+       on non-available fonts, based on a patch by Grigorios Magklis
+       <maglis@cs.rochester.edu>.
+
 2000-05-18  Elliot Lee  <sopwith@redhat.com>
 
        * gdk/x11/gdkregion-generic.c: If a region does not have any
index dab755fc81fc8317a6c03e3617b96e5bf9d968df..aa0ad980d444925ecedd8fb0f08104f78572e407 100644 (file)
@@ -1,3 +1,12 @@
+Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
+       "(nil)" foundries, patch from Grigorios Magklis.
+
+       * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
+       on non-available fonts, based on a patch by Grigorios Magklis
+       <maglis@cs.rochester.edu>.
+
 2000-05-18  Elliot Lee  <sopwith@redhat.com>
 
        * gdk/x11/gdkregion-generic.c: If a region does not have any
index 4c2318c2c0f1e70366b81dda0a23f8eee003211d..c71206a6e9e65c5929e43972a9843d5e2aad93f2 100644 (file)
@@ -1778,21 +1778,21 @@ gtk_font_selection_load_font (GtkFontSelection *fontsel)
 #endif
 #ifndef GDK_WINDOWING_WIN32
       font = gdk_font_load (fontname);
-      xfs = GDK_FONT_XFONT(font);
-      if (xfs->min_byte1 != 0 || xfs->max_byte1 != 0)
+      xfs = font ? GDK_FONT_XFONT (font) : NULL;
+      if (xfs && (xfs->min_byte1 != 0 || xfs->max_byte1 != 0))
        {
          gchar *tmp_name;
          
          gdk_font_unref (font);
          tmp_name = g_strconcat (fontname, ",*", NULL);
          font = gdk_fontset_load (tmp_name);
-         g_free(tmp_name);
+         g_free (tmp_name);
        }
 #else
       /* Load as a fontset so that gtkentry uses wide chars for it */
       font = gdk_fontset_load (fontname);
 #endif
-      g_free(fontname);
+      g_free (fontname);
       
       if (font)
        {
@@ -3371,10 +3371,13 @@ gtk_font_selection_get_font_name (GtkFontSelection *fontsel)
   family_str = font->family;
   foundry_str = fontsel_info->properties[FOUNDRY][font->foundry];
   
+  /* some fonts have a (nil) foundry */
+  if (strcmp (foundry_str, "(nil)") == 0)
+    foundry_str = "";
+  
   for (prop = 0; prop < GTK_NUM_STYLE_PROPERTIES; prop++)
     {
-      property_str[prop]
-       = fontsel_info->properties[prop][fontsel->property_values[prop]];
+      property_str[prop] = fontsel_info->properties[prop][fontsel->property_values[prop]];
       if (strcmp (property_str[prop], "(nil)") == 0)
        property_str[prop] = "";
     }