Commit 263998e0 authored by Sven Neumann's avatar Sven Neumann

check if donts got loaded instaed os simply crashing


--Sven
parent f5009999
Sun Feb 13 20:34:15 CET 2000 Sven Neumann <sven@gimp.org>
* app/about_dialog.c
* app/app_procs.c
* app/install.c: check if fonts could be loaded instead of
simply crashing
Sun Feb 13 15:23:03 CET 2000 Sven Neumann <sven@gimp.org>
* app/channel_dialog.c
......
......@@ -175,11 +175,12 @@ static gint shuffle_array[ sizeof(scroll_text) / sizeof(scroll_text[0]) ];
void
about_dialog_create (gint timeout)
{
GtkStyle *style;
GtkWidget *vbox;
GtkWidget *aboutframe;
GtkWidget *label;
GtkWidget *alignment;
GtkStyle *style;
GdkFont *font;
gint max_width;
gint i;
gchar *label_text;
......@@ -238,13 +239,16 @@ about_dialog_create (gint timeout)
gtk_widget_realize (logo_area);
gdk_window_set_background (logo_area->window, &logo_area->style->black);
style = gtk_style_new ();
gdk_font_unref (style->font);
style->font =
gdk_font_load (_("-*-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"));
gtk_widget_push_style (style);
gtk_style_unref (style);
/* this is a font, provide only one single font definition */
font = gdk_font_load (_("-*-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"));
if (font)
{
style = gtk_style_new ();
gdk_font_unref (style->font);
style->font = font;
gtk_widget_push_style (style);
gtk_style_unref (style);
}
label_text = g_strdup_printf (_("Version %s brought to you by"),
GIMP_VERSION);
label = gtk_label_new (label_text);
......
......@@ -263,35 +263,40 @@ splash_text_draw (GtkWidget *widget)
{
GdkFont *font = NULL;
/* this is a font, provide only one single font definition */
font = gdk_font_load (_("-*-helvetica-bold-r-normal--*-140-*-*-*-*-*-*"));
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, _("The GIMP"))) / 2),
(0.25 * logo_area_height),
_("The GIMP"));
gdk_font_unref (font);
font = gdk_fontset_load (_("-*-helvetica-bold-r-normal--*-120-*-*-*-*-*-*,*"));
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, GIMP_VERSION)) / 2),
(0.45 * logo_area_height),
GIMP_VERSION);
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, _("brought to you by"))) / 2),
(0.65 * logo_area_height),
_("brought to you by"));
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, AUTHORS)) / 2),
(0.80 * logo_area_height),
AUTHORS);
gdk_font_unref (font);
if (font)
{
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, _("The GIMP"))) / 2),
(0.25 * logo_area_height),
_("The GIMP"));
gdk_font_unref (font);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load (_("-*-helvetica-bold-r-normal--*-120-*-*-*-*-*-*,*"));
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, GIMP_VERSION)) / 2),
(0.45 * logo_area_height),
GIMP_VERSION);
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, _("brought to you by"))) / 2),
(0.65 * logo_area_height),
_("brought to you by"));
gdk_draw_string (widget->window,
font,
widget->style->fg_gc[GTK_STATE_NORMAL],
((logo_area_width - gdk_string_width (font, AUTHORS)) / 2),
(0.80 * logo_area_height),
AUTHORS);
gdk_font_unref (font);
}
}
static void
......
......@@ -175,11 +175,12 @@ static gint shuffle_array[ sizeof(scroll_text) / sizeof(scroll_text[0]) ];
void
about_dialog_create (gint timeout)
{
GtkStyle *style;
GtkWidget *vbox;
GtkWidget *aboutframe;
GtkWidget *label;
GtkWidget *alignment;
GtkStyle *style;
GdkFont *font;
gint max_width;
gint i;
gchar *label_text;
......@@ -238,13 +239,16 @@ about_dialog_create (gint timeout)
gtk_widget_realize (logo_area);
gdk_window_set_background (logo_area->window, &logo_area->style->black);
style = gtk_style_new ();
gdk_font_unref (style->font);
style->font =
gdk_font_load (_("-*-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"));
gtk_widget_push_style (style);
gtk_style_unref (style);
/* this is a font, provide only one single font definition */
font = gdk_font_load (_("-*-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"));
if (font)
{
style = gtk_style_new ();
gdk_font_unref (style->font);
style->font = font;
gtk_widget_push_style (style);
gtk_style_unref (style);
}
label_text = g_strdup_printf (_("Version %s brought to you by"),
GIMP_VERSION);
label = gtk_label_new (label_text);
......
......@@ -291,9 +291,16 @@ install_help (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load (_("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a font, provide only one single font definition */
font_emphasis = gdk_font_load (_("-*-helvetica-medium-o-normal-*-*-100-*-*-*-*-*-*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load (_("-*-helvetica-medium-r-normal-*-*-100-*-*-*-*-*-*,*"));
if (!font_emphasis)
font_emphasis = font;
/* Realize the widget before allowing new text to be inserted */
gtk_widget_realize (text);
......@@ -316,6 +323,11 @@ install_help (InstallCallback callback)
/* scroll back to the top */
gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0);
gdk_font_unref (font_strong);
if (font_emphasis != font)
gdk_font_unref (font_emphasis);
gdk_font_unref (font);
gtk_widget_show (vsb);
gtk_widget_show (text);
gtk_widget_show (table);
......@@ -437,7 +449,10 @@ install_run (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load ( _("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load ( _("-*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* Realize the text widget before inserting text strings */
......
......@@ -175,11 +175,12 @@ static gint shuffle_array[ sizeof(scroll_text) / sizeof(scroll_text[0]) ];
void
about_dialog_create (gint timeout)
{
GtkStyle *style;
GtkWidget *vbox;
GtkWidget *aboutframe;
GtkWidget *label;
GtkWidget *alignment;
GtkStyle *style;
GdkFont *font;
gint max_width;
gint i;
gchar *label_text;
......@@ -238,13 +239,16 @@ about_dialog_create (gint timeout)
gtk_widget_realize (logo_area);
gdk_window_set_background (logo_area->window, &logo_area->style->black);
style = gtk_style_new ();
gdk_font_unref (style->font);
style->font =
gdk_font_load (_("-*-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"));
gtk_widget_push_style (style);
gtk_style_unref (style);
/* this is a font, provide only one single font definition */
font = gdk_font_load (_("-*-helvetica-medium-r-normal--*-140-*-*-*-*-*-*"));
if (font)
{
style = gtk_style_new ();
gdk_font_unref (style->font);
style->font = font;
gtk_widget_push_style (style);
gtk_style_unref (style);
}
label_text = g_strdup_printf (_("Version %s brought to you by"),
GIMP_VERSION);
label = gtk_label_new (label_text);
......
......@@ -291,9 +291,16 @@ install_help (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load (_("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a font, provide only one single font definition */
font_emphasis = gdk_font_load (_("-*-helvetica-medium-o-normal-*-*-100-*-*-*-*-*-*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load (_("-*-helvetica-medium-r-normal-*-*-100-*-*-*-*-*-*,*"));
if (!font_emphasis)
font_emphasis = font;
/* Realize the widget before allowing new text to be inserted */
gtk_widget_realize (text);
......@@ -316,6 +323,11 @@ install_help (InstallCallback callback)
/* scroll back to the top */
gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0);
gdk_font_unref (font_strong);
if (font_emphasis != font)
gdk_font_unref (font_emphasis);
gdk_font_unref (font);
gtk_widget_show (vsb);
gtk_widget_show (text);
gtk_widget_show (table);
......@@ -437,7 +449,10 @@ install_run (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load ( _("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load ( _("-*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* Realize the text widget before inserting text strings */
......
......@@ -291,9 +291,16 @@ install_help (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load (_("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a font, provide only one single font definition */
font_emphasis = gdk_font_load (_("-*-helvetica-medium-o-normal-*-*-100-*-*-*-*-*-*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load (_("-*-helvetica-medium-r-normal-*-*-100-*-*-*-*-*-*,*"));
if (!font_emphasis)
font_emphasis = font;
/* Realize the widget before allowing new text to be inserted */
gtk_widget_realize (text);
......@@ -316,6 +323,11 @@ install_help (InstallCallback callback)
/* scroll back to the top */
gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0);
gdk_font_unref (font_strong);
if (font_emphasis != font)
gdk_font_unref (font_emphasis);
gdk_font_unref (font);
gtk_widget_show (vsb);
gtk_widget_show (text);
gtk_widget_show (table);
......@@ -437,7 +449,10 @@ install_run (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load ( _("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load ( _("-*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* Realize the text widget before inserting text strings */
......
......@@ -291,9 +291,16 @@ install_help (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load (_("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a font, provide only one single font definition */
font_emphasis = gdk_font_load (_("-*-helvetica-medium-o-normal-*-*-100-*-*-*-*-*-*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load (_("-*-helvetica-medium-r-normal-*-*-100-*-*-*-*-*-*,*"));
if (!font_emphasis)
font_emphasis = font;
/* Realize the widget before allowing new text to be inserted */
gtk_widget_realize (text);
......@@ -316,6 +323,11 @@ install_help (InstallCallback callback)
/* scroll back to the top */
gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0);
gdk_font_unref (font_strong);
if (font_emphasis != font)
gdk_font_unref (font_emphasis);
gdk_font_unref (font);
gtk_widget_show (vsb);
gtk_widget_show (text);
gtk_widget_show (table);
......@@ -437,7 +449,10 @@ install_run (InstallCallback callback)
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
0, 0);
/* this is a fontset, e.g. multiple comma-separated font definitions */
font_strong = gdk_fontset_load ( _("-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* this is a fontset, e.g. multiple comma-separated font definitions */
font = gdk_fontset_load ( _("-*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*,*"));
/* Realize the text widget before inserting text strings */
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment