[XeTeX] CID-keyed font support?
gzjjgod at gmail.com
Sat Jul 19 00:00:59 CEST 2014
On Fri, Jul 18, 2014 at 10:52 AM, Dohyun Kim <nomosnomos at gmail.com> wrote:
> 2014-07-18 0:00 GMT+09:00 Jiang Jiang <gzjjgod at gmail.com>:
>> I wonder if this has been discussed before but I have been wondering
>> if CID-keyed fonts are supported by XeTeX/xdvipdfmx at all.
>> Recent release of Source Han Sans  brought up the question again.
>> If you install Source Han Sans CN Regular for instance, the following document:
>> \font\body="Source Han Sans CN" at 10pt \body
>> won't work:
>> (./test.tex 
>> ** WARNING ** Failed to load ToUnicode CMap for font "SourceHanSansCN-Regular"
>> ** WARNING ** Glyph for CID 16719 missing in font
>> The resulting PDF end up having the wrong glyphs.
> With SourceHanSansKR, I experienced the same thing. Let me share my guess.
> The number 16719 in the log above must be a GID. But xdvipdfmx
> considers it as CID as shown, so there is a discrepancy between xetex
> and xdvipdfmx. CID and GID may differ when a cid-keyed font includes
> a subset of the glyphs specified by ROS (Adobe-Identity-0 in our
> case). See http://blogs.adobe.com/CCJKType/2012/04/cid-vs-gid.html .
> So I instead tried the so-called "Pan-CJK" font,
> SourceHanSansOTF-1.000.zip downloadable at
> http://sourceforge.net/projects/source-han-sans.adobe/files/ . As
> this font has full 65535 glyphs under Adobe-Identity-0, CIDs are
> identical to GIDs. In this case, however, xdvipdfmx failed to make
> PDF with error message as follows:
> xdvipdfmx:warning: Failed to load ToUnicode CMap for font
> xdvipdfmx:fatal: sfnt: Freetype failure...
> Output file removed.
> Error 256 (driver return code) generating output;
> So it seems that we have to do something with xdvipdfmx and/or its
> freetype library. The SourceHanSans fonts are sure to have no problem
> as they work quite well on my mac OS.
In case you or anyone else are interested, I just posted two patches
to xdvipdfmx to fix this problem:
The first patch is to fix text displayed in PDF, the second one is for
correcting the ToUnicode map to make sure text copied out of PDF are
CCing Peter Breitenlohner, who is the current maintainer of dvipdfm-x.
More information about the XeTeX