Opened 7 years ago

Last modified 6 years ago

#41895 new defect

ghostscript @9.10: missing font packages

Reported by: gdasnon@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: mojca (Mojca Miklavec), Ionic (Mihai Moldovan)
Port: ghostscript

Description (last modified by larryv (Lawrence Velázquez))

Hello,
macports 2.2.1 is installed on Mac OS X Lion (10.7.5) with all ports up to date :

MBPGD:~ gd$ gs -v

GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc.  All rights reserved.

MBPGD:~ gd$ freetype-config --version
17.1.11

The problem : when i convert a PDF file to JPEG, some characters are missing (french accents like "é" or "è"). I use this command :

/opt/local/bin/gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -r96 -sOutputFile=/Users/gd/Desktop/CHANTIERS_CARDINAL_05OUT.jpg /Users/gd/Desktop/CHANTIERS_CARDINAL_05.pdf 2>&1

Ghostscript official site (http://ghostscript.com/doc/current/Fonts.htm) indicates this :

System File name Contents Types
Unix ghostscript-fonts-std-#.##.tar.gz Basic .afm, .pfb, .pfm

But, unfortunately, it seems that this font package is missing when i type this command :

MBPGD:~ gd$ sudo find -x /opt/local/ -iname "*ghostscript-f*"
/opt/local//var/macports/distfiles/ghostscript/ghostscript-fonts-other-6.0.tar.gz
/opt/local//var/macports/software/ghostscript-fonts-hiragino
/opt/local//var/macports/software/ghostscript-fonts-hiragino/ghostscript-fonts-hiragino-9.10_1+alias.darwin_11.noarch.tbz2
/opt/local//var/macports/sources/rsync.macports.org/release/tarballs/ports/print/ghostscript-fonts-hiragino

My environment :

Mac OS X 10.7.5
MacPorts 2.2.1
XCode : 4.6.2
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00

Thanks for your help.
Best regards.

Guillaume Dasnon

Attachments (1)

CHANTIERS_CARDINAL_05.pdf (7.6 MB) - added by gdasnon@… 7 years ago.
PDF file which looses its accents with ghostscript conversion to JPEG

Change History (14)

Changed 7 years ago by gdasnon@…

Attachment: CHANTIERS_CARDINAL_05.pdf added

PDF file which looses its accents with ghostscript conversion to JPEG

comment:1 Changed 7 years ago by larryv (Lawrence Velázquez)

Description: modified (diff)
Keywords: ghostscript missing fonts removed
Owner: changed from macports-tickets@… to takanori@…
Port: ghostscript added
Summary: Problem with ghostscript and missing fontsghostscript @9.10: missing font packages

comment:2 Changed 6 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:3 Changed 6 years ago by mojca (Mojca Miklavec)

Even if I add ghostscript-fonts-std-8.11.tar.gz, that doesn't solve your problem.

I would be surprized if it did:

> pdffonts CHANTIERS_CARDINAL_05.pdf 
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
Courier                              Type 1C           Custom           yes no  no      28  0
MetaPlusBold-Roman                   Type 1C           Custom           yes no  no      24  0
Veljovic-Book                        Type 1C           Custom           yes no  no      14  0
MetaPlusMedium-Roman                 Type 1C           Custom           yes no  no      10  0
MetaPlusBook-Roman                   Type 1C           Custom           yes no  no      35  0

The document isn't using any standard fonts, so adding a set of standard fonts to MacPorts most likely won't help in any way. I would expect a problem to be elsewhere, but it would help to ask upstream. Does the conversion work properly on Linux or Windows?

comment:4 Changed 6 years ago by Ionic (Mihai Moldovan)

Doesn't this stuff support fallback to a common font family? Like, if the specific font is not installed, but at least a similar one in the same font family, the available one will be used?

comment:5 Changed 6 years ago by mojca (Mojca Miklavec)

In this particular case the fonts are embedded into the document, so all the characters are present in the PDF. There should be no need for any fallbacks. In fact, fallbacks would probably spoil the document.

While I totally agree that we could add ghostscript-fonts-std-8.11.tar.gz (not that I understand what it is used for and which fonts are present there), I would imagine that this might be a bug in GS. It would make sense to try what happens under Windows or Linux. If it fails on both platforms, one should file a bug report to GS and there's not much that any one of us can do.

comment:6 Changed 6 years ago by Ionic (Mihai Moldovan)

I can see the same behavior on a Gentoo Linux box. é-like characters are missing completely. But Gentoo is special, in that it does not ship the GS fonts at all (which causes problems with infinality and printing...)

So, testing on Debian, with packages ghostscript, ghostscript-x, gsfonts and gsfonts-x11 installed. This actually works fine.

I think the reporter has a point, although you're probably right that this is a bug in ghostscript. Very likely, it should be using the embedded Courier font. Adding the std fonts package is a valid workaround, though.

comment:7 Changed 6 years ago by mojca (Mojca Miklavec)

Did addition of those fonts solve the problem for you?

comment:8 Changed 6 years ago by Ionic (Mihai Moldovan)

  • Debian with gsfonts: working
  • Gentoo without gsfonts: not working

So I guess it would fix the problem.

I'll update ghostscript to include the std fonts, as soon as I can think of a proper fix for the "mappingresources changes its hashsums every other day" issue...

comment:9 Changed 6 years ago by Ionic (Mihai Moldovan)

Hm, so I have included the std fonts in what seems to be an okay fashion (such that they are picked up by fontcache as well), but it doesn't fix the user's problem. The accented characters are still not showing up.

I don't have any idea what is different NOW, though.

I'll commit the changes I have made hoping it wasn't a total waste of time. If you don't see them fit for prime time, feel free to remove them again (and revbump the port.)

Committed as r137290 (even though it doesn't fix this problem...)

comment:10 Changed 6 years ago by Ionic (Mihai Moldovan)

Cc: ionic@… added

comment:11 in reply to:  9 ; Changed 6 years ago by mojca (Mojca Miklavec)

Replying to ionic@…:

Hm, so I have included the std fonts in what seems to be an okay fashion (such that they are picked up by fontcache as well), but it doesn't fix the user's problem. The accented characters are still not showing up.

I don't have any idea what is different NOW, though.

What *I* don't know why installing those fonts should have any influence whatsoever.

I'll commit the changes I have made hoping it wasn't a total waste of time. If you don't see them fit for prime time, feel free to remove them again (and revbump the port.)

Committed as r137290 (even though it doesn't fix this problem...)

Thank you.

But why did you install the std fonts in a different way than ghostscript-fonts-other-6.0.tar.gz? Shouldn't the two be installed in some similar fashion?

comment:12 in reply to:  11 Changed 6 years ago by Ionic (Mihai Moldovan)

Replying to mojca@…:

What *I* don't know why installing those fonts should have any influence whatsoever.

I don't know. It's working on Debian, and Debian has those fonts, so... I assumed that would fix it. Must be $SOMETHING else and I have no idea what exactly, off-hand...

But why did you install the std fonts in a different way than ghostscript-fonts-other-6.0.tar.gz? Shouldn't the two be installed in some similar fashion?

Because Debian does so. They install the "other" fonts in a special directory only for ghostscript and the "std" fonts in a shared "fontcache" directory. Probably so that other programs can use the fonts, too. I don't know why the "other" fonts don't also get installed in the shared "fontcache" directory, though. Maybe I should take a look at other packagers, like FreeBSD ports, arch and Fedora to see how they do it.

comment:13 Changed 6 years ago by mf2k (Frank Schima)

Owner: changed from takanori@… to macports-tickets@…

takanori has retired. See #47537.

Note: See TracTickets for help on using tickets.