Re: Familiy name in Alias and alias brokeness.
- From: Akira TAGOH <tagoh redhat com>
- To: Chema Celorio <chema ximian com>
- Cc: Radek Doulik <rodo ximian com>, gnome-print-list gnome org
- Subject: Re: Familiy name in Alias and alias brokeness.
- Date: Tue Feb 4 04:11:05 2003
>>>>> On 03 Feb 2003 10:31:28 -0500,
>>>>> "CC" == Chema Celorio <chema ximian com> wrote:
CC> We no longer have a .fontmap file, we moved from using our own fontmap
CC> to loading the fonts from fontconfig. I think we do need the fontmap, it
CC> makes the implementation cleaner, we have to scan the fonts known to
CC> fontconfig and filter out the ones we don't care about or know how to
CC> handle. Also, we need to populate the font dialog so we have to load the
CC> fontmap file then.
Well, why does gnome-print need to know whether the font is
the alias font or not? I think fontconfig can handles
properly. as you pointed out, GP_FONT_ENTRY_ALIAS is no
longer used in gnome-print. if whether checking is_alias on
gnome_font_family_style_list() is disabled, isn't the font
dialog issue solved?
Probably attached patch should works.
Regards,
--
Akira TAGOH
diff -ruN libgnomeprint-2.2.1.1.orig/libgnomeprint/gnome-font-family.c libgnomeprint-2.2.1.1/libgnomeprint/gnome-font-family.c
--- libgnomeprint-2.2.1.1.orig/libgnomeprint/gnome-font-family.c 2003-02-03 19:49:27.000000000 +0900
+++ libgnomeprint-2.2.1.1/libgnomeprint/gnome-font-family.c 2003-02-04 17:58:50.000000000 +0900
@@ -147,9 +147,6 @@
GPFontEntry *e = l->data;
const gchar *style = e->speciesname;
- if (e->is_alias)
- continue;
-
if (!g_hash_table_lookup (styles, style)) {
g_hash_table_insert (styles, (gchar *) style, (gpointer) 1);
list = g_list_prepend (list, g_strdup (e->speciesname));
diff -ruN libgnomeprint-2.2.1.1.orig/libgnomeprint/gnome-fontmap.c libgnomeprint-2.2.1.1/libgnomeprint/gnome-fontmap.c
--- libgnomeprint-2.2.1.1.orig/libgnomeprint/gnome-fontmap.c 2003-02-04 17:45:14.000000000 +0900
+++ libgnomeprint-2.2.1.1/libgnomeprint/gnome-fontmap.c 2003-02-04 18:04:10.000000000 +0900
@@ -225,26 +225,27 @@
fcpattern_to_gp_font_entry_alias (FcPattern *font, const gchar *name)
{
GPFontEntry *e;
-#if 0
+ gchar *ptr;
gint len;
-#endif
e = fcpattern_to_gp_font_entry (font);
if (e == NULL)
return NULL;
g_free (e->name);
-#if 0
g_free (e->familyname);
- len = strchr (name, ' ') - (char *) name;
-
-#endif
+ ptr = strchr (name, ' ');
+ /* validate a font name */
+ if (!ptr) {
+ g_warning ("font name '%s' is invalid format.", name);
+ } else {
+ len = ptr - name;
+ e->familyname = g_strndup (name, len);
+ e->speciesname = g_strdup (name + len + 1);
+ }
e->is_alias = TRUE;
e->name = g_strdup (name);
-#if 0
- e->familyname = g_strndup (name, len);
-#endif
return e;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]