Bug 690564 - fontconfig/CMap combination doesn't work
fontconfig/CMap combination doesn't work
Status: RESOLVED INVALID
Product: Ghostscript
Classification: Unclassified
Component: General
8.64
PC Linux
: P4 normal
Assigned To: Ken Sharp
Bug traffic
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-24 04:08 PDT by Takanori MATSUURA
Modified: 2009-10-26 07:46 PDT (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takanori MATSUURA 2009-06-24 04:08:40 PDT
fontconfig/CMap combination doesn't work.

(IPAGothic is the font name only available from fontconfig.)
$ gs
GPL Ghostscript 8.64 (2009-02-03)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>/IPAGothic-UniJIS-UTF8-H findfont
Can't find (or can't open) font file
/usr/share/ghostscript/8.64/Resource/Font/IPAGothic-UniJIS-UTF8-H.
Can't find (or can't open) font file IPAGothic-UniJIS-UTF8-H.
Querying operating system for font files...
Can't find (or can't open) font file
/usr/share/ghostscript/8.64/Resource/Font/IPAGothic-UniJIS-UTF8-H.
Can't find (or can't open) font file IPAGothic-UniJIS-UTF8-H.
Didn't find this font on the system!
Substituting font Courier for IPAGothic-UniJIS-UTF8-H.
Loading NimbusMonL-Regu font from /usr/share/fonts/default/Type1/n022003l.pfb...
3934816 2096243 6692428 5344192 1 done.
GS<1>clear
GS>/IPAGothic findfont
Loading IPAGothic font from /usr/share/fonts/ipa-gothic/ipag.otf... 4227664
2375655 12802932 10975135 1 done.
Comment 1 Ray Johnston 2009-06-25 10:13:53 PDT
Please attach the font file so we can readily reproduce the problem.
Comment 2 Takanori MATSUURA 2009-06-25 17:25:49 PDT
IPA fonts are available from
http://ossipedia.ipa.go.jp/ipafont/

The page is provided in both Japanese and English in one page.  If you push
"Accept" button, Download page appears.
Comment 3 Ken Sharp 2009-10-26 07:46:36 PDT
This looks like a confusion between 'Fonts' and 'CIDFonts'. You can't compose a
Font with a CMap, you can only compose a CIDFont with a CMap, in order to
produce a CID-Keyed instance.

In general the PostScript programmer is responsible for composing the CIDFont
and CMap to produce the CID-Keyed instance. However, if you request a font which
looks like a CIDFont + CMap combination, Ghostscript will try to find a CIDFont
with a name matching the initial of the instance name, and a CMap with a name
matching the terminal part of the instance name.

If GS finds both it will compose the CIDFont and CMap for you, automatically
creating the CID-Keyed instance.

So, if you try to find IPAGothic-UniJIS-UTF8-H Ghostscript will first look for
an existing font of that name. If it can't find one it will look for a CMap
called UniJIS-UTF8-H and a CIDFont called IPAGothic. If it finds both then it
will create a CIDKeyed instance. 

Failing that it falls back to Courier.

Your IPAGothic font is not a CIDFont, it is an OpenType font (possibly with
PostScript outlines). If you want to use this as a CIDFont, then you must define
it as such. For a PostScript CIDFont all that is required is to create a
directory under gs/Resource called CIDFont and place the file there. For a
TrueType (or OpenType) font this is not sufficient.

In the case of TrueType GhostScript needs more information regarding the
Ordering and Registry of the CIDFont it is trying to emulate with the TrueType
font. This information is supplied in the cidfmap file in gs/Resource/Init.

To use these fonts as CIDFonts you must edit that file and add the fonts there.

See gs/doc/Use.htm Section 8.4 CIDFont substitution for more information on
using cidfmap and substituting TrueType or CIDFonts.