2

EDIT: I misread the output of fontforge. xelatex was correct. The glyph doesn't exist.

I have the following sample tex:

\documentclass[12pt]{article}

\usepackage{fontspec}
\usepackage[english]{babel}

\setmainfont{Times_New_Roman.ttf}[
                Path = {/path/to/local/font/files},
        BoldFont = Times_New_Roman_Bold.ttf,
        ItalicFont = Times_New_Roman_Italic.ttf,
        BoldItalicFont = Times_New_Roman_Bold_Italic.ttf
]

\begin{document}

\symbol{9745}

\end{document}

I know for a fact that the font I'm using contains a glyph for U+2611 (decimal 9745) because I opened it in fontforge.

Now, when I process this with xelatex, I get a missing character placeholder in the resulting PDF, along with the following error in the log:

Missing character: There is no ☑ in font [/path/to/local/font/files/Times_New_Roman]/OT:mapping=tex-text;!

I don't know if there's a magic option I missed somewhere, but I thought this was supposed to work, and all the Googling that I've done has involved people thinking characters existed in their fonts when they actually didn't.

I've tried pasting the character directly into the tex, as well as using \symbol which you see in the above example.

I can see in the log that it's loaded the font successfully. Here's what the log says about it, just in case it contains useful information:

.................................................
. fontspec info: "no-scripts"
.
. Font Times_New_Roman.ttf does not contain any OpenType `Script' information.
.................................................
\g__fontspec_family_Times_New_Roman.ttf_int=\count121
.................................................
. fontspec info: "defining-font"
.
. Font family 'Times_New_Roman.ttf(0)' created for font 'Times_New_Roman.ttf'
. with options [Ligatures=TeX,Path =
. {/path/to/local/font/files/},BoldFont =
. Times_New_Roman_Bold.ttf,ItalicFont =
. Times_New_Roman_Italic.ttf,BoldItalicFont =
. Times_New_Roman_Bold_Italic.ttf].
.
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.:
. <->"[/path/to/local/font/filesTimes_New_Roman]/OT:mapping=tex-text;"
. - 'small caps'  (m/sc) with NFSS spec.: - 'bold' (bx/n) with NFSS spec.:
. <->"[/path/to/local/font/files/Times_New_Roman_Bold]/OT:mapping=tex-text;"
. - 'bold small caps'  (bx/sc) with NFSS spec.: - 'italic' (m/it) with NFSS
. spec.:
. <->"[/path/to/local/font/files/Times_New_Roman_Italic]/OT:mapping=tex-text;"
. - 'italic small caps'  (m/itsc) with NFSS spec.: - 'bold italic' (bx/it)
. with NFSS spec.:
. <->"[/path/to/local/font/files/Times_New_Roman_Bold_Italic]/OT:mapping=tex-text;"
. - 'bold italic small caps'  (bx/itsc) with NFSS spec.:
.................................................

Any help with this would be greatly appreciated :)

EDIT: I've added the output of xelatex -output-driver="xdvipdfmx -vv" test2.tex

This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016/Debian) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./test2.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/share/texlive/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/share/texmf/tex/latex/tipa/t3enc.def
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def))))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
(/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def
(/usr/share/texlive/texmf-dist/tex/generic/babel/xebabel.def)))) (./test2.aux)
(/usr/share/texmf/tex/latex/tipa/t3cmr.fd) [1] (./test2.aux) )
<FONTMAP:/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map><FONTMAP:/var/lib/texmf/fonts/map/dvipdfmx/updmap/kanjix.map><FONTMAP:/usr/share/texlive/texmf-dist/fonts/map/dvipdfmx/ckx.map>No dvi filename specified, reading standard input.
stdin -> test2.pdf
DVI Comment:  XeTeX output 2016.12.13:2311
<AGL:texglyphlist.txt><AGL:pdfglyphlist.txt><AGL:glyphlist.txt>[1</home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf@11.96pt<NATIVE-FONTMAP:/home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf/0/H/65536/0/0>
fontmap: /home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf/0/H/65536/0/0 -> /home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf(Identity-H)

pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
pdf_font>> The -m <00> option will be assumed for "/home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf".
(CID:TimesNewRomanPSMT)
pdf_font>> Type0 font "/home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf" cmap_id=<Identity-H,0> opened at font_id=</home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf/0/H/65536/0/0,0>.
>]
otf_cmap>> Creating ToUnicode CMap for "/home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf"...
(CID:/home/james/git/seismicat_www/application/../data/templates/Times_New_Roman.ttf[SXNPZL+TimesNewRomanPSMT][CIDFontType2][2 glyphs (Max CID: 20)][15460 bytes])
Compression saved 7242 bytes
10249 bytes written
(see the transcript file for additional information)
Output written on test2.pdf (1 page).
Transcript written on test2.log.
  • 2
    Welcome to TeX.SX! Maybe xdvipdfmx loads a different font; can you check running xelatex -output-driver="xdvipdfmx -vv" sample (substitute the real file name instead of sample)? – egreg Dec 14 '16 at 21:25
  • @egreg The missing character message is from xetex so it can't be xdvipdfmx. Beside this, I would put some trust in xetex, if it says the symbol is not there it is probably right (it isn't in my Times version.) – Ulrike Fischer Dec 14 '16 at 22:04
  • Hi Ulrike, I would tend to agree with you, except that I've opened the font in fontforge and verified that the character does indeed exist. – Crankycyclops Dec 14 '16 at 22:45
  • Did you really use '/path/to/local/font/files/' as the path to the files or are you paraphrasing? – Herb Schulz Dec 14 '16 at 22:46
  • Hi, Herb. No, I just didn't want to include the true path name because it was extremely long :) – Crankycyclops Dec 14 '16 at 22:47
5

The image you posted

enter image description here

tells us the font has no glyph at slot 9745, where you can see a red cross. The top part is just a way to mark the slot with a possible visual representation.

You can import the glyph from another font:

\newfontface{\mysymbols}{FreeSerif}
\newcommand{\ballotboxwithcheck}{{\mysymbols\symbol{9745}}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.