Commit 40a2e53d authored by Morten Welinder's avatar Morten Welinder

gnm_font_find_closest_from_weight_slant is gone.

parent 8efcd5f0
2005-02-05 Morten Welinder <terra@gnome.org>
* src/style.c (gnm_font_find_closest_from_weight_slant): Delete.
2005-02-05 Morten Welinder <terra@gnome.org>
* src/print.c: Avoid going PangoFontDescription -> GnomeFont ->
......
2005-02-05 Morten Welinder <terra@gnome.org>
* src/style.c (gnm_font_find_closest_from_weight_slant): Delete.
2005-02-05 Morten Welinder <terra@gnome.org>
* src/print.c: Avoid going PangoFontDescription -> GnomeFont ->
......
......@@ -37,10 +37,6 @@ typedef struct {
} approx_width;
} GnmFontMetrics;
GnomeFont *gnm_font_find_closest_from_weight_slant (const guchar *family,
GnomeFontWeight weight,
gboolean italic,
gdouble size);
PangoContext *gnm_pango_context_get (void);
#endif /* GNUMERIC_STYLE_FONT_H */
......@@ -606,53 +606,3 @@ style_default_halign (GnmStyle const *mstyle, GnmCell const *c)
}
return HALIGN_RIGHT;
}
/**
* gnm_font_find_closest_from_weight_slant :
*
* A wrapper around gnome-print because it is stupid.
* At least this will warn us when it is stupid
**/
GnomeFont *
gnm_font_find_closest_from_weight_slant (const guchar *family,
GnomeFontWeight weight,
gboolean italic, gdouble size)
{
GnomeFont *font;
guchar const *fam;
guchar *name;
g_return_val_if_fail (family != NULL, NULL);
while (1) {
font = gnome_font_find_closest_from_weight_slant
(family, weight, italic, size);
fam = gnome_font_get_family_name (font);
if (fam != NULL && g_ascii_strcasecmp (family, fam) == 0)
return font;
name = gnome_font_get_full_name (font);
g_warning ("GnomePrint: Requested %s but using %s (%s)",
family, fam, name);
g_free (name);
/* put in some fallbacks */
if (!g_ascii_strcasecmp (family, "Sans"))
family = "Sans Regular";
else if (!g_ascii_strcasecmp (family, "Helvetica"))
family = "Sans";
else if (!g_ascii_strcasecmp (family, "Albany"))
family = "Arial";
/* one of the arials */
else if (!g_ascii_strncasecmp (family, "Arial ", 6))
family = "Arial";
else if (!g_ascii_strcasecmp (family, "Arial"))
family = "Sans";
else
return font;
g_warning ("Trying to fallback to '%s'", family);
}
/* notreached */
return font;
}
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