[NTG-pdftex] [pdftex-Bugs][4014] Drops characters from included pdf figure

pdftex-bugs at sarovar.org pdftex-bugs at sarovar.org
Thu Apr 9 23:28:13 CEST 2009


Bugs item #4014, was opened at 2009-04-08 17:24
Status: Closed
Priority: 3
Submitted By: Andrey Paramonov (pent)
Assigned to: Nobody (None)
Summary: Drops characters from included pdf figure 
Category: PDF inclusion
Group: None
Resolution: Wont Fix


Initial Comment:
To reproduce:

1) Download attached file. It is a pdf figure containing some non-latin characters. Note that the used font subset is embedded.

2) Create the following minimal LaTeX document:

\documentclass{article}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}

\usepackage{graphicx}

\begin{document}
\includegraphics{fig}
\end{document}

3) pdflatex it. Open the resulting pdf file and note that all non-latin characters have disappeared.

My pdflatex says:

--------- 
Running `LaTeX' on `test' with ``pdflatex  "\nonstopmode\input
{test.tex}"''
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&-line parsing enabled.
entering extended mode
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax,
dumylang, noh
yphenation, ukrainian, russian, bulgarian, loaded.

(./test.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/latex/cyrillic/t2aenc.def)
(/usr/share/texmf-texlive/tex/latex/cyrillic/t2acmr.fd))
(/usr/share/texmf-texlive/tex/latex/base/inputenc.sty
(/usr/share/texmf-texlive/tex/latex/base/utf8.def
(/usr/share/texmf-texlive/tex/latex/base/t1enc.dfu)
(/usr/share/texmf-texlive/tex/latex/base/ot1enc.dfu)
(/usr/share/texmf-texlive/tex/latex/base/omsenc.dfu)
(/usr/share/texmf-texlive/tex/latex/base/t2aenc.dfu)))
(/usr/share/texmf-texlive/tex/generic/babel/babel.sty
(/usr/share/texmf-texlive/tex/generic/babel/russianb.ldf
(/usr/share/texmf-texlive/tex/generic/babel/babel.def)))
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf-texlive/tex/latex/pdftex-def/pdftex.def))) (./
test.aux)
<fig.pdf, id=1, 578.16pt x 289.08pt> <use fig.pdf>
Overfull \hbox (248.15858pt too wide) in paragraph at lines 10--11
[][]
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <./fig.pdf>] (./
test.aux)
 )
(see the transcript file for additional information){/usr/share/texmf/
fonts/enc
/dvips/cm-super/cm-super-t2a.enc}</usr/share/texmf/fonts/type1/public/
cm-super/
sfrm1000.pfb></usr/share/texmf-texlive/fonts/type1/urw/times/
utmr8a.pfb

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10019' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10021' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10026' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10028' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10030' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10031' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10032' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10033' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10035' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10049' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10065' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10067' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10070' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10075' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10077' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10079' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10080' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10082' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10084' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10096' undefined

pdfTeX warning: pdflatex (file /usr/share/texmf-texlive/fonts/type1/
urw/times/u
tmr8a.pfb): glyph `afii10097' undefined

Output written on test.pdf (1 page, 19327 bytes).
Transcript written on test.log.

LaTeX finished at Wed Apr  8 00:01:45
--------- 

My pdftex --version says:

--------- 
pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)
kpathsea version 3.5.6
Copyright 2007 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Kpathsea is copyright 2007 Karl Berry and Olaf Weber.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX using libpoppler copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX using libpoppler source.
Primary author of pdfTeX using libpoppler: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Kpathsea written by Karl Berry, Olaf Weber, and others.

Compiled with libpng 1.2.35; using libpng 1.2.35
Compiled with zlib 1.2.3.3; using zlib 1.2.3.3
Compiled with libpoppler version 0.10.4
--------- 

I'm ready to provide any additional info,
Andrey Paramonov


----------------------------------------------------------------------

>Comment By: The Thanh Han (hanthethanh)
Date: 2009-04-09 21:28

Message:
I think it's useful to have a summary of the problem for further reference:

- fig.pdf contains a font named NimbusRomNo9L-Regu
- pdftex sees that it has the same font on disk and tries to use the font on disk instead of copying the font from fig.pdf. (Reason: if we have eg fig.pdf & fig2.pdf, the font would be included once instead of twice)
- however these 2 fonts are different: the one embedded in fig.pdf has extra glyphs that the font on disk doesn't have. pdftex cannot know this, since the font names are the same.
- hence the output pdf doesn't have those glyphs, too.

workarounds/solutions:
- if you are in hurry, just say: \pdfinclusioncopyfonts=1 
- for more detailed info, see bug report #2092
- the proper solution IMO is to change the font name to denote that it differ from the original NimbusRomNo9L-Regu

It's questionable whether pdftex should use the font on disk instead of copying the font from fig.pdf by default. There are 2 main arguments for this behavior:

- that behavior was the default since the beginning, and it's not wise to change it; it can break pdf inclusion in existing documents
- if this behavior is not desired, it can be changed easily (\pdfinclusioncopyfonts=1)

btw, if you think this is a bug, please describe what should be the correct behavior in your opinion.

----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2009-04-09 05:41

Message:
if the font has been changed, the font name should have be changed too.

----------------------------------------------------------------------

Comment By: Andrey Paramonov (pent)
Date: 2009-04-09 04:13

Message:
Yes, probably a different version of the font was used to create the figure. I don't see however why it is forbidden.

The font embedding feature has been *designed* to resolve the problems with different version of the fonts. If pdftex ignores the feature, and does so consciously, I see the problem is in pdftex.

The discussion and workarounds mentioned in #2092 suggest that by default, pdftex tries to be clever and drops embedded fonts that would later be included anyway. In this case however pdftex becomes overconfident and drops fonts it cannot later restore. To me, this is a clear optimization bug.

Andrey Paramonov


----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2009-04-08 19:05

Message:
update: the link was wrong again; somehow a ';' was automatically inserted to the link. 

Please see bug #2092 for a similar problem and workaround.

----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2009-04-08 19:02

Message:
update: the previous link was broken, correction:
http://sarovar.org/tracker/index.php?func=detail&aid=2092&group_id=106&atid=493

----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2009-04-08 18:59

Message:
I guess the figure was created with a modified version of utmr8a.pfb (NimbusRomNo9L-Regu), since the original utmr8a.pfb doesn't have non-latin glyphs. This is not a bug of pdftex. For a workaround, please see
http://sarovar.org/tracker/index.php?func=detail&aid=2092&group_id=106&atid=493

----------------------------------------------------------------------

You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=493&aid=4014&group_id=106


More information about the ntg-pdftex mailing list