[XeTeX] Problem with the courier font pcrr8a.pfb
Jonathan Kew
jonathan_kew at sil.org
Mon Mar 3 18:15:06 CET 2008
On 3 Mar 2008, at 4:30 pm, Ulrike Fischer wrote:
> Hello
>
> the following document
>
> \documentclass{scrreprt}
> \usepackage{fontspec}
> \setmainfont{Courier}
> \begin{document}
> ö
> \end{document}
>
> fails to compile in miktex 2.7. because xdvipdfmx don't like the
> courier
> font:
>
> [1<Courier(Courier:Regular)@10.91pt<NATIVE-FONTMAP:Courier/H/65536/0>
> pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
> pdf_font>> The -m <00> option will be assumed for
> "C:/Programme/MiKTeX2.7/fonts/type1/adobe/courier/pcrr8a.pfb".
> (CID:Courier)
> pdf_font>> Type0 font
> "C:/Programme/MiKTeX2.7/fonts/type1/adobe/courier/pcrr8a.p
> fb" cmap_id=<Identity-H,0> opened at font_id=<Courier/H/65536/0,0>.
>> ](CID:C:/Programme/MiKTeX2.7/fonts/type1/adobe/courier/pcrr8a.pfb
>> [CIDFontType0]
>
> ** WARNING ** Obsolete four arguments of "endchar" will be used for
> Type
> 1 "seac" operator.
> ** ERROR ** This font using the "seac" command for accented
> characters...
>
> Output file removed.
>
>
>
> Is this a bug of the font or of xdvipdfmx?
It seems that the font is using an "obsolete" Type 1 construction;
this may not strictly speaking be a bug, but it's not a good idea.
>
> dvipdfmx seems to able to handle the font:
>
> C:\UlleDoku\test>dvipdfmx -v test-utf-tex
> test-utf-tex.dvi -> test-utf-tex.pdf
> DVI Comment: TeX output 2008.03.03:1726
> <AGL:glyphlist.txt>[1<pcrr8t at 9.96pt(TFM:pcrr8t)(VF:pcrr8t
> (TFM:pcrr8r)<pcrr8r at 9.9
> 6pt(Encoding:8r)
> pdf_font>> Simple font "pcrr8a" enc_id=<8r,3> opened at
> font_id=<pcrr8r,0>.
>> )(VF)>](pcrr8a[Type1]
> ** WARNING ** Obsolete four arguments of "endchar" will be used for
> Type
> 1 "seac" operator.
> )
> Compression saved 128 bytes. Try "-V 5" for better compression
> 4070 bytes written
I suspect the key difference is that with LaTeX+dvipdfmx, you're
using a TFM file and an encoding vector, and dvipdfmx ends up
embedding the font directly as re-encoded Type 1 data. This works
despite the obsolete form of Type 1 character program.
With xelatex + fontspec + xdvipdfmx, you're asking for it to be used
as a Unicode font, potentially accessing more than 256 characters and
addressing them by 16-bit indexes; to do this, xdvipdfmx has to
convert the font to CID Type 0, and it can't do that conversion with
this obsolete type of font program.
Possible solutions:
(a) Patch xdvipdfmx so that it can convert such a font; that would be
nice, but I don't know much about this area so I'm unlikely to do it
any time soon. (Contributions welcome!)
(b) Use Courier via TFM files, etc, just as you do with LaTeX. I have
not tested this but suspect it would probably work fine. Of course,
you lose the (potential) extended Unicode support, but the chances
are that such an old Courier font doesn't have a very rich character
set anyway.
(c) Get a more modern Courier font, e.g., in OpenType format.
(d) Use "Courier New", which I think is the Windows version of
Courier and is in TrueType or OpenType format.
One last remark: I'm a bit surprised that xelatex + fontspec locates
and uses pfb fonts like this; I'm not sure it's really appropriate
for it to do so. But that may depend on how things are configured in
MikTeX. Perhaps it's too "eager" to include the texmf/fonts
directories as though they were system-level fonts.
JK
More information about the XeTeX
mailing list