[Tex/LaTex] Some normal letters from included PDF disappear in compiled document

floatsgraphicsillustratorpdf

I have made a figure in Adobe Illustrator, and saved the file as a PDF file. This PDF works fine when opened.

I want to include this figure in my LaTeX file as a picture, which is done with the following code:

\documentclass{report}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htb]
\centering
\includegraphics[width=.9\textwidth]{hparc}
\caption[Architecture of the simulation model]
{Architecture of the simulation model, connection between IDA~ICE and Matlab}
\label{fig:hparc}
\end{figure}
\end{document}

However, when the PDF is included in the compiled document, some f and l letters (not all) are missing. Why is this happening?! I've tried compling in both Texmaker and Sharelatex.

EDIT: The font used in Illustrator is Latin Modern Roman 12 Regular
EDIT 2: Link to PDF file

Image of compiled document

Best Answer

pdfTeX

File hparc.pdf has embeded the font LMRoman12-Regular as OpenType font as used in Adobe Illustrator:

$ pdffonts hparc.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
PJUQXT+LMRoman12-Regular             Type 1C           yes yes no       5  0

When pdfTeX embeds a figure, it first checks, if it knows the fonts in order to merge the used font glyphs to avoid adding more one font file for the same font. However, it does not know the specified glyph names for the ligatures (maybe a Unicode mapping in the PDF file would help, see no for column uni of the output of pdffonts) and generates warnings:

pdfTeX warning: pdflatex (file [...]/texmf-dist/font
s/type1/public/lm/lmr12.pfb): glyph `f_f' undefined

pdfTeX warning: pdflatex (file [...]/texmf-dist/font
s/type1/public/lm/lmr12.pfb): glyph `f_l' undefined

Remember, it cannot use the original OpenType version of the font. Therefore these glyphs are missing.

There is a workaround. If pdfTeX does not know the font, it merely copies the font found in the PDF file. The following line at the very beginning of the TeX file works here, the other fields of a map line seem not to be needed:

\pdfmapline{-dummy LMRoman12-Regular}

Full example:

\pdfmapline{-dummy LMRoman12-Regular}

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htb]
\centering
\includegraphics[width=.9\textwidth]{hparc}
\caption[Architecture of the simulation model]
{Architecture of the simulation model, connection between IDA~ICE and
Matlab}
\label{fig:hparc}
\end{figure}
\end{document}

Result

If the document also uses the same font, then the font file is embedded twice.

LuaTeX and XeTeX

LuaTeX and XeTeX both support OpenType fonts and show the ligatures without any workaround.

Hint

The width of the image is: 705.77806 pt. The embedded with of the image in the document is 0.9\textwidth = 350.99762 pt. That is a scaling factor of 0.94732 ≈ 0.5.

The design size is 12pt, but the actually used size is 6pt, which is pretty small. Therefore I recommend

  • using the full available space: full \textwidth to increase the scaling factor by approximately 10 percent to 0.55 (font size 6.6pt) and

  • using a smaller design size, Latin Modern 8 Regular instead of Latin Modern 12 Regular.

Related Question