After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 122738 - Fix handling of truetype font with space in their name
Fix handling of truetype font with space in their name
Status: RESOLVED FIXED
Product: gnome-print
Classification: Deprecated
Component: Postscript backend
CVS
Other Linux
: Normal normal
: ---
Assigned To: Chema Celorio
Chema Celorio
Depends on:
Blocks:
 
 
Reported: 2003-09-19 14:46 UTC by Frederic Crozat
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix handling of TTF fonts with space embedded in their name (8.38 KB, patch)
2003-09-19 14:48 UTC, Frederic Crozat
none Details | Review

Description Frederic Crozat 2003-09-19 14:46:09 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.
Comment 1 Frederic Crozat 2003-09-19 14:48:06 UTC
Created attachment 20098 [details] [review]
Fix handling of TTF fonts with space embedded in their name
Comment 2 Jody Goldberg 2003-10-06 23:13:34 UTC
Good idea.
Please commit this to HEAD and gnome-2-4
Comment 3 Chema Celorio 2003-10-06 23:46:59 UTC
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.
Comment 4 Frederic Crozat 2003-10-07 10:07:15 UTC
Waiting for jody before committing anything :)
Comment 5 Jody Goldberg 2003-10-16 16:07:19 UTC
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.
Comment 6 Andreas J. Guelzow 2003-11-13 23:07:48 UTC
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.