# xdvipdfmx error

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}

• CID entries are an extended type1 format for multibyte fonts. So your document access some font in an incorrect way but hard to say what is wrong without an example document and information about which fonts you are using. – David Carlisle Dec 30 '14 at 2:14
• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – cfr Dec 30 '14 at 3:06
• Let me try to reproduce in very small to see if I can pinpoint which fonts would be causing that. – Frank Dec 30 '14 at 3:13
• I have no problem with an up-to-date TeXLive 2014 – user2478 Dec 30 '14 at 8:12
• I can reproduce the issue, but only if \mathbf{\Sigma} is used; if I pass the [no-math] option to fontspec, the problem disappears. – egreg Dec 30 '14 at 10:24

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}


For the record, I was having the same problem with Baskerville (.ttc packed with macOS Sierra, 2016), and I narrowed it down to the invisible presence of this character in my file: zero width space (U+200B)

Tricky to spot! but as soon as I deleted it from the source, the problem disappeared.