Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408513 - =app-text/ghostscript-gpl-9.04-r4 =media-libs/freetype-2.4.9 produce Error: Font Renderer Plugin ( FreeType ) return code = -1 when converting PS to PDF
Summary: =app-text/ghostscript-gpl-9.04-r4 =media-libs/freetype-2.4.9 produce Error: F...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on: 410983
Blocks:
  Show dependency tree
 
Reported: 2012-03-16 18:07 UTC by Adam Randall
Modified: 2012-05-18 22:02 UTC (History)
5 users (show)

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


Attachments
test.ps referenced in examples (test.ps,22.59 KB, application/postscript)
2012-03-16 18:11 UTC, Adam Randall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Randall 2012-03-16 18:07:33 UTC
I don't know if this is a problem with ghostscript-gpl or freetype, however as of version 2.4.9 of freetype, whenever I convert a PS file to PDF, or more specifically when I'm using a2ps with the --printer set to pdf, I get a number of these messages:

GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1

Forcing freetype back to 2.4.8 produces none of these errors.

Digging as far as I could figure out how to dig into this, it seems that when ghostscript is requesting the freetype load a font it's erring out with -1, where in 2.4.8 it did not do this. See my steps to reproduce for examples.

I have tested this on amd64/multilib, amd64/no-multilib and x86 servers, all with the same results.


Reproducible: Always

Steps to Reproduce:
1. a2ps -q -1 -r -f9 -B --border=no /var/log/emerge/emerge.20120316.log > test.ps
2. gs -dNOPAUSE -sDEVICE=nullpage test.ps
Actual Results:  
With freetype 2.4.9 installed:

# gs -dNOPAUSE -sDEVICE=nullpage test.ps
GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/9.04/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/9.04/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Querying operating system for font files...
Loading NimbusMonL-Regu font from /usr/share/fonts/default/ghostscript/n022003l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusMonL-Regu with FAPI, will do with native GS renderer.
3487200 2147573 3110384 1129723 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Courier with FAPI, will do with native GS renderer.
Can't render Font fCourier ( aliased from Courier ) with FAPI, will do with native GS renderer.
Loading NimbusMonL-Bold font from /usr/share/fonts/urw-fonts/n022004l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusMonL-Bold with FAPI, will do with native GS renderer.
3651296 2298509 3110384 1135562 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Courier-Bold with FAPI, will do with native GS renderer.
Can't render Font fCourier-Bold ( aliased from Courier-Bold ) with FAPI, will do with native GS renderer.
Loading NimbusMonL-BoldObli font from /usr/share/fonts/urw-fonts/n022024l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusMonL-BoldObli with FAPI, will do with native GS renderer.
3770576 2430475 3110384 1140969 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Courier-BoldOblique with FAPI, will do with native GS renderer.
Can't render Font fCourier-BoldOblique ( aliased from Courier-BoldOblique ) with FAPI, will do with native GS renderer.
Loading NimbusMonL-ReguObli font from /usr/share/fonts/urw-fonts/n022023l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusMonL-ReguObli with FAPI, will do with native GS renderer.
3911736 2565590 3110384 1146376 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Courier-Oblique with FAPI, will do with native GS renderer.
Can't render Font fCourier-Oblique ( aliased from Courier-Oblique ) with FAPI, will do with native GS renderer.
Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusSanL-Regu with FAPI, will do with native GS renderer.
4055392 2701268 3110384 1152453 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Helvetica with FAPI, will do with native GS renderer.
Can't render Font fHelvetica ( aliased from Helvetica ) with FAPI, will do with native GS renderer.
Loading NimbusSanL-Bold font from /usr/share/fonts/urw-fonts/n019004l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusSanL-Bold with FAPI, will do with native GS renderer.
4177120 2814885 3110384 1157860 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Helvetica-Bold with FAPI, will do with native GS renderer.
Can't render Font fHelvetica-Bold ( aliased from Helvetica-Bold ) with FAPI, will do with native GS renderer.
Loading NimbusRomNo9L-Medi font from /usr/share/fonts/urw-fonts/n021004l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusRomNo9L-Medi with FAPI, will do with native GS renderer.
4324440 2972017 3110384 1163281 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Times-Bold with FAPI, will do with native GS renderer.
Can't render Font fTimes-Bold ( aliased from Times-Bold ) with FAPI, will do with native GS renderer.
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/ghostscript/n021003l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font NimbusRomNo9L-Regu with FAPI, will do with native GS renderer.
4471872 3001054 3110384 1136091 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Times-Roman with FAPI, will do with native GS renderer.
Can't render Font fTimes-Roman ( aliased from Times-Roman ) with FAPI, will do with native GS renderer.
Loading StandardSymL font from /usr/share/fonts/urw-fonts/s050000l.pfb... GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font StandardSymL with FAPI, will do with native GS renderer.
4471872 3044713 3110384 1141618 1 done.
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
Can't render Font Symbol with FAPI, will do with native GS renderer.
GS>


Expected Results:  
With freetype 2.4.8 installed:

# gs -dNOPAUSE -sDEVICE=nullpage test.ps
GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/9.04/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/9.04/Resource/Font/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Querying operating system for font files...
Loading NimbusMonL-Regu font from /usr/share/fonts/default/ghostscript/n022003l.pfb... 3507384 2158788 3110384 1129723 1 done.
Loading NimbusMonL-Bold font from /usr/share/fonts/urw-fonts/n022004l.pfb... 3651296 2307680 3110384 1136112 1 done.
Loading NimbusMonL-BoldObli font from /usr/share/fonts/urw-fonts/n022024l.pfb... 3790760 2444450 3110384 1142069 1 done.
Loading NimbusMonL-ReguObli font from /usr/share/fonts/urw-fonts/n022023l.pfb... 3931920 2580865 3110384 1148026 1 done.
Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb... 4075576 2718019 3110384 1154653 1 done.
Loading NimbusSanL-Bold font from /usr/share/fonts/urw-fonts/n019004l.pfb... 4177120 2829520 3110384 1160610 1 done.
Loading NimbusRomNo9L-Medi font from /usr/share/fonts/urw-fonts/n021004l.pfb... 4344624 2991456 3110384 1166581 1 done.
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/ghostscript/n021003l.pfb... 4471872 3017500 3110384 1140515 1 done.
Loading StandardSymL font from /usr/share/fonts/urw-fonts/s050000l.pfb... 4492056 3071673 3110384 1147832 1 done.
GS>

# emerge -qpv media-libs/freetype
[ebuild   R   ] media-libs/freetype-2.4.9  USE="bzip2 -X -auto-hinter -bindist -debug -doc -fontforge -static-libs -utils"

Note: I have tried freetype with the auto-hinter, bindist and fontforge USE flags as well, with no change in results.

# emerge --info
Portage 2.1.10.44 (default/linux/amd64/10.0/no-multilib, gcc-4.5.3, glibc-2.13-r4, 3.2.1-gentoo-r2 x86_64)
=================================================================
System uname: Linux-3.2.1-gentoo-r2-x86_64-Intel-R-_Xeon-R-_CPU_E5430_@_2.66GHz-with-gentoo-2.0.3
Timestamp of tree: Fri, 16 Mar 2012 04:15:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fail-clean fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.cs.uni.edu/ http://mirror.usu.edu/mirrors/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://192.168.0.157/gentoo-portage"
USE="acl amd64 apache2 bash-completion berkdb bzip2 cli corefonts cracklib crypt ctype cups curl cxx djvu dri fontconfig fortran fpx ftp gcj gd gdbm gif gpm graphviz gs hash hdri iconv imagemagick ipv6 jbig jpeg jpeg2k lcms lzma mmx modules mudflap ncurses nls nptl nptlonly openexr openmp pam pcntl pcre pdf png posix pppd readline samba sasl session simplexml smtp snmp soap sockets sse sse2 ssl svg sysfs tcpd threads tiff truetype unicode vim-syntax webp wmf xml xorg zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Adam Randall 2012-03-16 18:11:02 UTC
Created attachment 305641 [details]
test.ps referenced in examples

This is a postscript file that was created using a2ps. It's an output log of my server update script, and it includes color codes. If you convert this to PDF, expect to see the color codes printed instead of colorized.
Comment 2 Xavier Rival 2012-03-18 16:15:05 UTC
Same issue for me, on several machines.
I downgraded one to 2.4.8, with the same success. Cannot easily do the same to the other one, as the 2.4.8 version is not in the tree anymore. I think a good measure would be to put it back in there, and flag 2.4.9 as unstable, unless the problem can really be fixed.
Comment 3 Adam Randall 2012-03-18 19:01:22 UTC
(In reply to comment #2)
> Same issue for me, on several machines.
> I downgraded one to 2.4.8, with the same success. Cannot easily do the same
> to the other one, as the 2.4.8 version is not in the tree anymore. I think a
> good measure would be to put it back in there, and flag 2.4.9 as unstable,
> unless the problem can really be fixed.

I doubt we'll see 2.4.8 back as it seems that it has a bunch of security related issues, at least from this:

https://bugs.gentoo.org/show_bug.cgi?id=407257

Maybe ghostscript needs an update to work better with 2.4.9? I don't know.

Adam.
Comment 4 Xavier Rival 2012-03-19 08:29:42 UTC
(In reply to comment #3)

> I doubt we'll see 2.4.8 back as it seems that it has a bunch of security
> related issues, at least from this:
> 
> https://bugs.gentoo.org/show_bug.cgi?id=407257
> 
> Maybe ghostscript needs an update to work better with 2.4.9? I don't know.
> 
> Adam.

Indeed, I was not aware of that.
I tried to upgrade ghostscript-9.05, with no joy.
Comment 5 Matthias Nagel 2012-03-19 10:15:31 UTC
Same issue here. But I first noticed the problem after I uninstalled the corefont package and added the symlinks under /etc/font/cond.d in order to use the liberation font package instead.

I am very sure that I had a working installation with freetype-2.4.9, ghostscript-9.04 and corefonts before.

But after undoing these changes, the error remained.

I executed 
equery d 'media-libs/freetype:2' 
and re-compiled everything that depends on freetype except the KDE stuff (kdelibs, okular, etc.), mplayer and libreoffice. No improvement.
Comment 6 Rafał Mużyło 2012-03-19 18:32:33 UTC
ghostscript upstream says this problem is caused by following bugs in freetype 2.4.9:
 https://savannah.nongnu.org/bugs/index.php?35847
 https://savannah.nongnu.org/bugs/index.php?35833

The fixes are already in the freetype repo.
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2012-03-21 04:24:26 UTC
Thanks Rafał.  Fixed in 2.4.9-r1.  I'll leave this open until it goes stable.
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2012-05-18 22:02:35 UTC
(In reply to comment #7)
> Thanks Rafał.  Fixed in 2.4.9-r1.  I'll leave this open until it goes stable.

Stable on many arches now. Thanks everyone.