GNOME Bugzilla – Bug 122738
Fix handling of truetype font with space in their name
Last modified: 2004-12-22 21:47:04 UTC
This patch is a follow-up of http://qa.mandrakesoft.com/show_bug.cgi?id=3931 bug. Summary : some TTF files contains a postscript font name with a space embedding, breaking libgnomeprint (as well as QT, OOo and others) PS generation.. Attached patch fixes this problem.
Created attachment 20098 [details] [review] Fix handling of TTF fonts with space embedded in their name
Good idea. Please commit this to HEAD and gnome-2-4
Jody: I agree with the commit to head part, however it seems a bit risky for a commit to 2.4, embededdname always comes from psname: embeddedname = pso->face->psname; Encodedname too: if (instance == 0) pso->encodedname = g_strdup_printf ("GnomeUni-%s", face->psname); else pso->encodedname = g_strdup_printf ("GnomeUni-%s_%03d", face->psname, instance); So if we fix psname to not contain spaces, we get rid of the problem in only a couple of lines, cleaning all of the occurence sounds like the right approach (which is why it makes sense for head) but I worry so close to a release doing a larger change. We could do something like: for (i = 0; (*ps_name)[i]; i++) if ((*ps_name)[i] <= ' ') (*ps_name)[i] = '-'; Inside gff_load / gnome-font-face.c and work arround the problem of fonts with spaces in their name from one central place. My worry is only about an unexpected sideeffect of changing the naming convention for the fonts since we have to do a number of tricks and some in code that is for corner cases. Your call, of course.
Waiting for jody before committing anything :)
Modifying the name at the source would have been preferable. Unfortunately as soon as we start escaping or modifying the name, we open ourselves to collisions. This seems like the safest choice. It seems reasonable to get it into 2.4 and head.
Frederic, I believe I applied your patch in response to a different bug report, at least trying to apply your patch now fails (and patch believes that it may be reversed.) I ma closing this report. Please check cvs to make sure that I am not mistaken. If I am mistaken please reopen this report and attach a new patch.