Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40808 - Add ghostscript support in font packages
Summary: Add ghostscript support in font packages
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-08 00:47 UTC by Craig Lawson
Modified: 2004-08-11 01:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patches corefonts-1-r1.ebuild (corefonts.r2.patch,338 bytes, patch)
2004-02-08 00:52 UTC, Craig Lawson
Details | Diff
Patches freefonts-0.10-r2.ebuild (freefonts.r3.patch,849 bytes, patch)
2004-02-08 00:54 UTC, Craig Lawson
Details | Diff
Patches urw-fonts-2.0-r1.ebuild (urw-fonts.r2.patch,1.14 KB, patch)
2004-02-08 00:56 UTC, Craig Lawson
Details | Diff
Patches env-update (portage.py.patch,604 bytes, patch)
2004-02-08 00:58 UTC, Craig Lawson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Lawson 2004-02-08 00:47:40 UTC
Ghostscript relies on the GS_FONTPATH environment variable to locate its fonts. However, some font packages (perhaps most) do not configure GS_FONTPATH and so installed fonts are not found by ghostscript without manual configuration by the user.

The attached patches configure GS_FONTPATH for three font packages:
  media-fonts/corefonts
  media-fonts/freefonts
  media-fonts/urw-fonts

(I don't have anything against the other font packages. It's just that these are the ones I currently use.)

Additionally, a patch is required to env-update in /usr/lib/portage/pym/portage.py to recognize GS_FONTPATH as a "special" that may accumulate colon-separated paths. (Without env-update patched, GS_FONTPATH will merely take the last assigned value.)

Reproducible: Always
Steps to Reproduce:
Comment 1 Craig Lawson 2004-02-08 00:52:32 UTC
Created attachment 25165 [details, diff]
Patches corefonts-1-r1.ebuild

Patches corefonts-1-r1.ebuild to assign GS_FONTPATH in
/etc/env.d/40gs-corefonts
Comment 2 Craig Lawson 2004-02-08 00:54:35 UTC
Created attachment 25166 [details, diff]
Patches freefonts-0.10-r2.ebuild

Patches freefonts-0.10-r2.ebuild to assign GS_FONTPATH in
/etc/env.d/40gs-freefonts
Comment 3 Craig Lawson 2004-02-08 00:56:14 UTC
Created attachment 25167 [details, diff]
Patches urw-fonts-2.0-r1.ebuild

Patches urw-fonts-2.0-r1.ebuild to assign GS_FONTPATH in
/etc/env.d/40gs-urw-fonts
Comment 4 Craig Lawson 2004-02-08 00:58:18 UTC
Created attachment 25168 [details, diff]
Patches env-update

Patches env-update in /usr/lib/portage/pym/portage.py by adding GS_FONTPATH to
the list of "special" environment variables which accumulate colon separated
paths.
Comment 5 Donnie Berkholz (RETIRED) gentoo-dev 2004-02-08 11:54:14 UTC
Ghostscript apparently isn't smart enough to use fontconfig?
Comment 6 Craig Lawson 2004-02-08 20:20:26 UTC
Apparently.

I'm no expert on either, but I did find mention in the FontConfig newsgroup as to the reason: the information FontConfig caches and provides does not include the font's PostScript name. Refer to http://www.xfree86.org/pipermail/forum/2003-April/001114.html

Now that you mention it, it would be nice if ghostscript used FontConfig. CUPS and OpenOffice, too. I'm using an inkjet printer with no built-in fonts, and it would simplify matters if OO, CUPS, and Ghostscript all agreed on which fonts I have built into my system.

I'm dreaming. I used to use a Mac. But maybe FontConfig could get us there.
Comment 7 assamite 2004-02-25 00:49:48 UTC
A solution that I've found after some hours of searching is adding the
FontConfig path (/etc/fonts) to the environment variable GS_LIB.
Now ghostscript seems to work together with fontconfig (although I'm 
no expert in these things) and recognizes fonts in the 
Fontmap file.
Comment 8 Craig Lawson 2004-03-05 15:10:57 UTC
The fix suggested in Comment #7 did not work for me.

This is what I did. Please tell me if I missed something.

$ unset GS_FONTPATH
$ export GS_LIB=/etc/fonts
$ cd /usr/share/ghostscript/7.07/lib
$ gs prfont.ps
GS>/Becker DoFont
  ("Becker" is a Type 1 font in /usr/share/fonts/freefont)

Result:
Can't find (or can't open) font file /usr/share/ghostscript/fonts/Becker.
Can't find (or can't open) font file Becker.
Substituting font Courier for Becker.

Ghostscript then displays the character map for Courier.


With /usr/share/fonts/freefont added to GS_FONTPATH, the prfont script correctly displays the character map for the Becker font.

I am using app-text/ghostscript-7.07.1-r1, compiled with USE Flags: X cups -cjk
Comment 9 Dylan Carlson (RETIRED) gentoo-dev 2004-06-25 09:40:10 UTC
Redhat patched ESP ghostscript 7.0.7 for fontconfig.  Take a look at:
http://cvs.sourceforge.net/viewcvs.py/kde-redhat/fedora/SOURCES/ghostscript-7.07-fontconfig-rh-2.patch?rev=1.3&view=auto

...I had to switch to AFPL because ESP was crashing during pstopdf conversions.  But I'm having the font problem as well.
Comment 10 Heinrich Wendel (RETIRED) gentoo-dev 2004-08-04 09:00:55 UTC
added the redhat patch to ghostscript-7.07.1-r4
Comment 11 foser (RETIRED) gentoo-dev 2004-08-09 03:42:47 UTC
you also need to add a pkgcongfig buildtime dep

I wonder why this is behind a truetype useflag btw ?
Comment 12 Heinrich Wendel (RETIRED) gentoo-dev 2004-08-09 04:28:55 UTC
added the pkgconfig dep. i used the truetype useflag because that's what fontconfig does, adds support for truetype fonts, doesn't it?

(next time please reopen the bug)
Comment 13 foser (RETIRED) gentoo-dev 2004-08-09 05:31:32 UTC
not really, fontconfig is just a way to easily select/handle fonts & it happens to depend on freetype which supports a whole range of font formats (not just ttf). In practice i believe this patch -if used- should be applied unconditionally to the ebuild, this would be better for the overall consistenty of how gentoo handles fonts (that is what comment #5 was about).

The ghostscript fonts should also be moved to the /usr/share/fonts location eventually.
Comment 14 Heinrich Wendel (RETIRED) gentoo-dev 2004-08-11 01:15:56 UTC
i added a new revision that applies the fontconfig patch by default and moves the fonts to /usr/share/fonts/ghostscript