GNOME Bugzilla – Bug 83098
Freetype doesn't find fonts on RH7.3
Last modified: 2006-07-15 17:19:47 UTC
XFree86 will remove paths from its font path list which do not contain fonts that it understands. On RH7.3 XFree86 default install uses a font server which has its own configuration file and does not obtain font paths from X. XFree86 therefore is not configured to use the modules which load truetype and other 'freetype' fonts. As a result of all this, calling XGetFontPath returns only a path to the fonts that X understands. On RH7.3 this means that dia cannot locate any fonts to use with freetype. This will stop all RH7.3 users from using freetype, unless they wish to reconfigure their XFree86. It will stop a .rpm for 7.3 being made available with freetype support. Without a solution to this, dia is guaranteed to segfault on RH7.3 with freetype enabled. I have attached a patch which looks for an xfs (X font server) configuration file if it appears that an X font server is being used. The benefit of this is that for RH and debian users, dia will discover the standard installed fonts without user intervention. I do not necessarily consider this to be a good patch, and would appreciate comments on improving it.
Created attachment 8737 [details] [review] Patch for above - interogates xfs config file for more font paths
> From: Zhang Lin-bo [mailto:zlb@lsec.cc.ac.cn] > Sent: Wednesday, 29 May 2002 12:24 AM > To: dia-list@gnome.org > Subject: Re: printing on the Simpl. Chinese and other > non-latin1 locales With freetype support enabled, the fonts listed in 'font_data' are ignored (see the '#ifdef' line at font.c:904, and I don't know if this is a bug or a feature). Since rh7.3 uses xfs, no fontpath will be found through the 'XGetFontPath' function. The patch of Robert Young did not work because there was a bug in his code in parsing the fs/config file: most path names (in my system) were skipped because they have a trailing comma (and also I think the code needs to be rewritten to correctly retrieve fontpaths from the 'catalogue = ...' entry of the fs/config file (or one can borrow some lines from xfs, or simply run the 'chkfontpath' program?)).
New patch against 0.90RC2. Has been tested with commas, joined lines, only parses catalogue line until end of that section (no comma after last path). Comments please! or apply patch to CVS.
Created attachment 8834 [details] [review] New patch against 0.90RC2
Patch applied, thanks !
New patch to follow, sorry. The previous patch would generate a situation where the same font face is listed multiple times. New patch improves this by only scanning each directory once by generating a list of unique path names. Also, checks each face for duplicates before adding face.
Created attachment 8840 [details] [review] Patch 3 to fix multiple face issue.
I applied patch3 before releasing RC3
moving away form 0.90.RC1 to delete that label afterwards