[Tex/LaTex] xdvipdfmx error

dvipdfmxxetex

The error message is:

xdvipdfmx:fatal: CID count > 65535

I am a newbie at TeX. I tried looking at the .log, .out and .aux files but nothing seemed to click. I'm on a Mac with MacTex 2014 just freshly installed. The error showed up in both TeXstudio and TeXShop when trying to compile with XeLaTex.

[Update] I managed to reduce the source code to the following snippet, which triggers the error on my Mac:

\documentclass[10pt,a4paper]{article}

\usepackage{amsmath, amsfonts, amssymb}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=Rare} 
\setmainfont{Hoefler Text}

\begin{document}

  $\mathbf{\Sigma}$

\end{document}

Best Answer

I can reproduce the issue with Hoefler Text, Palatino and Optima; I suspect that such fonts have some problems for limiting cases such as this one.

However, the problem is caused by \mathbf{\Sigma}. What happens is that \mathbf sets the math group to 5 (with the example file, the number is not fixed) and the correspondent font is

\EU1/HoeflerText(0)/bx/n/10=select font "Hoefler Text Black/AAT:mapping=tex-text;"

Such a font has nothing in slot "06 that's the target of \Sigma, which is defined as the math character "7406 ("7 means variable family, "4 means the default math group, "06 the slot). While this seems innocuous for some fonts, it creates problems with the fonts listed above. Here's the log from xdvipdfmx:

DVI Comment:  XeTeX output 2014.12.30:1141
<AGL:texglyphlist.txt><AGL:pdfglyphlist.txt><AGL:glyphlist.txt>[1<[/Library/Fonts/Hoefler Text.ttc:1]@9.93pt<NATIVE-FONTMAP:[/Library/Fonts/Hoefler Text.ttc:1]/H/65536/0/0>
fontmap: [/Library/Fonts/Hoefler Text.ttc:1]/H/65536/0/0 -> /Library/Fonts/Hoefler Text.ttc(Identity-H)[index:1]

pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
pdf_font>> The -m <00> option will be assumed for "/Library/Fonts/Hoefler Text.ttc".
(CID:HoeflerText-Black)
pdf_font>> Type0 font "/Library/Fonts/Hoefler Text.ttc" cmap_id=<Identity-H,0> opened at font_id=<[/Library/Fonts/Hoefler Text.ttc:1]/H/65536/0/0,0>.
><[/Library/Fonts/Hoefler Text.ttc]@9.93pt<NATIVE-FONTMAP:[/Library/Fonts/Hoefler Text.ttc]/H/65536/0/0>
fontmap: [/Library/Fonts/Hoefler Text.ttc]/H/65536/0/0 -> /Library/Fonts/Hoefler Text.ttc(Identity-H)

pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
pdf_font>> The -m <00> option will be assumed for "/Library/Fonts/Hoefler Text.ttc".
(CID:HoeflerText-Regular)
pdf_font>> Type0 font "/Library/Fonts/Hoefler Text.ttc" cmap_id=<Identity-H,0> opened at font_id=<[/Library/Fonts/Hoefler Text.ttc]/H/65536/0/0,1>.
>][2]
otf_cmap>> Creating ToUnicode CMap for "/Library/Fonts/Hoefler Text.ttc"...
No Unicode mapping available: GID=65535, name=

otf_cmap>> Creating ToUnicode CMap for "/Library/Fonts/Hoefler Text.ttc"...
(CID:/Library/Fonts/Hoefler Text.ttc[XUAFQG+HoeflerText-Black][CIDFontType2]
xdvipdfmx:fatal: CID count > 65535

Maybe somebody else can find a meaning to this. But this just hides the main problem: nothing at all will be printed for \mathbf{\Sigma} with whatever font you use as main document font, because OpenType and TrueType fonts have nothing in slot "06.

Solution:

\usepackage[no-math]{fontspec}
Related Question