Discussion:
[tex-k] xdvipdfmx bug: Fonts from mpost generated files are not translated properly
Ramón Casares
2018-09-28 08:15:48 UTC
Permalink
Hi list,

I have found a strange behaviour in xdvipdfmx:
some fonts from mpost generated EPS files are
not translated properly to the PDF files.

I detected this anomaly running an updated
Debian Stretch system with TeX Live installed.
If this was already solved in newer versions,
please tell me. But in case it wasn't,
I have prepared a minimal test case that
only uses plain formats.

Minimal test case:

$ mpost -s prologues=3 -s 'outputtemplate="test-p3-%c.eps"' test.mp
$ mpost -s prologues=2 -s 'outputtemplate="test-p2-%c.eps"' test.mp
$ xdvipdfmx -M test-p2-0.eps
$ xdvipdfmx -M test-p2-1.eps
$ xdvipdfmx -M test-p2-2.eps

Now you can compare the PDF files with the originals in EPS format:

test-p2-0.eps.pdf vs test-p3-0.eps [rotated subscripts bad]
test-p2-1.eps.pdf vs test-p3-1.eps [equal]
test-p2-2.eps.pdf vs test-p3-2.eps [L in upper left corner bad]

And you can get a summary in a PDF document running:

$ tex test.tex
$ xdvipdfmx test.dvi

Now in test.pdf you should see the problems,
if they were not already solved in the version you are using.

Best regards,
Ramon Casares


Versions

xdvipdfmx version 20160307 by the DVIPDFMx project team, modified for TeX Live.
mpost version 1.9991 (TeX Live 2016/Debian) (kpathsea version 6.2.2)
tex version 3.14159265 (TeX Live 2016/Debian) (preloaded format=tex)


Files

test.mp
-----------------------------------------------------------------------------------
% test.mp (RMCG20180927)

beginfig(0);
w := 4cm; h := 6cm;
label.urt(btex ${\cal L}_C$ etex rotated 0, (0,0)); % this line causes the error!
label(btex ${\cal L}_{T\setminus a}$ etex rotated 90, (w/2, h/2));
label.lrt(btex ${\cal L}_{T\setminus f}$ etex rotated 270, (0,h));
draw (0,0) -- (w,0) -- (w,h) -- (0,h) -- cycle;
endfig;

beginfig(1);
w := 4cm; h := 6cm;
label.urt(btex ${\cal L}_C$ etex rotated 0, (0,0)); % this line causes the error!
label.ulft(btex $a$ etex, (w,0)); % this line restores everything!
label(btex ${\cal L}_{T\setminus a}$ etex rotated 90, (w/2, h/2));
label.lrt(btex ${\cal L}_{T\setminus f}$ etex rotated 270, (0,h));
draw (0,0) -- (w,0) -- (w,h) -- (0,h) -- cycle;
endfig;

beginfig(2);
w := 4cm; h := 6cm;
label.urt(btex ${\cal L}_C$ etex rotated 0, (0,0)); % this line causes the error!
label.ulft(btex ${\cal L}$ etex, (w,0)); % this line restores nearly everything!
label(btex ${\cal L}_{T\setminus a}$ etex rotated 90, (w/2, h/2));
label.lrt(btex ${\cal L}_{T\setminus f}$ etex rotated 270, (0,h));
draw (0,0) -- (w,0) -- (w,h) -- (0,h) -- cycle;
endfig;

end.
-----------------------------------------------------------------------------------


test.tex
-----------------------------------------------------------------------------------
% text.tex (RMCG20180927)

\parindent=0pt
\beginsection Xdvipdfmx bug illustration

\vskip6cm
\indent\special{psfile=test-p3-0.eps}\kern4cm
\kern1cm\vbox{\advance\hsize-5cm
Figure 0: all rotated subscripts are in font {\tt cmsy}
while some of them should be in font {\tt cmmi}.
Compare word `Tfa6' in roman with
the same in {\tt cmmi} `{\teni Tfa6}', and
in {\tt cmsy} `{\tensy Tfa6}\kern7bp'.}

\vskip6cm
\indent\special{psfile=test-p3-1.eps}\kern4cm
\kern1cm\vbox{\advance\hsize-5cm
Figure 1: It is as it should be.}

\vskip6cm
\indent\special{psfile=test-p3-2.eps}\kern4cm
\kern1cm\vbox{\advance\hsize-5cm
Figure 2: The letter `L' in the upper left side is in
font {\tt cmmi}, {\teni L}, while it should be
in {\tt cmsy}, {\tensy L}.}

\bye
-----------------------------------------------------------------------------------
Ramón Casares
2018-09-27 16:15:15 UTC
Permalink
Hi list,

I have found a strange behaviour in xdvipdfmx:
some fonts from mpost generated EPS files are
not translated properly to the PDF files.

I detected this anomaly running an updated
Debian Stretch system with TeX Live installed.
If this was already solved in newer versions,
please tell me. But in case it wasn't,
I have prepared a minimal test case that
only uses plain formats.

Minimal test case:

$ mpost -s prologues=3 -s 'outputtemplate="test-p3-%c.eps"' test.mp
$ mpost -s prologues=2 -s 'outputtemplate="test-p2-%c.eps"' test.mp
$ xdvipdfmx -M test-p2-0.eps
$ xdvipdfmx -M test-p2-1.eps
$ xdvipdfmx -M test-p2-2.eps

Now you can compare the PDF files with the originals in EPS format:

test-p2-0.eps.pdf vs test-p3-0.eps [rotated subscripts bad]
test-p2-1.eps.pdf vs test-p3-1.eps [equal]
test-p2-2.eps.pdf vs test-p3-2.eps [L in upper left corner bad]

And you can get a summary in a PDF document running:

$ tex test.tex
$ xdvipdfmx test.dvi

Now in test.pdf you should see the problems,
if they were not already solved in the version you are using.

Best regards,
Ramon Casares


Versions

xdvipdfmx version 20160307 by the DVIPDFMx project team, modified for TeX Live.
mpost version 1.9991 (TeX Live 2016/Debian) (kpathsea version 6.2.2)
tex version 3.14159265 (TeX Live 2016/Debian) (preloaded format=tex)


Files

test.mp
-----------------------------------------------------------------------------------
% test.mp (RMCG20180927)

beginfig(0);
w := 4cm; h := 6cm;
label.urt(btex ${\cal L}_C$ etex rotated 0, (0,0)); % this line causes the error!
label(btex ${\cal L}_{T\setminus a}$ etex rotated 90, (w/2, h/2));
label.lrt(btex ${\cal L}_{T\setminus f}$ etex rotated 270, (0,h));
draw (0,0) -- (w,0) -- (w,h) -- (0,h) -- cycle;
endfig;

beginfig(1);
w := 4cm; h := 6cm;
label.urt(btex ${\cal L}_C$ etex rotated 0, (0,0)); % this line causes the error!
label.ulft(btex $a$ etex, (w,0)); % this line restores everything!
label(btex ${\cal L}_{T\setminus a}$ etex rotated 90, (w/2, h/2));
label.lrt(btex ${\cal L}_{T\setminus f}$ etex rotated 270, (0,h));
draw (0,0) -- (w,0) -- (w,h) -- (0,h) -- cycle;
endfig;

beginfig(2);
w := 4cm; h := 6cm;
label.urt(btex ${\cal L}_C$ etex rotated 0, (0,0)); % this line causes the error!
label.ulft(btex ${\cal L}$ etex, (w,0)); % this line restores nearly everything!
label(btex ${\cal L}_{T\setminus a}$ etex rotated 90, (w/2, h/2));
label.lrt(btex ${\cal L}_{T\setminus f}$ etex rotated 270, (0,h));
draw (0,0) -- (w,0) -- (w,h) -- (0,h) -- cycle;
endfig;

end.
-----------------------------------------------------------------------------------


test.tex
-----------------------------------------------------------------------------------
% text.tex (RMCG20180927)

\parindent=0pt
\beginsection Xdvipdfmx bug illustration

\vskip6cm
\indent\special{psfile=test-p3-0.eps}\kern4cm
\kern1cm\vbox{\advance\hsize-5cm
Figure 0: all rotated subscripts are in font {\tt cmsy}
while some of them should be in font {\tt cmmi}.
Compare word `Tfa6' in roman with
the same in {\tt cmmi} `{\teni Tfa6}', and
in {\tt cmsy} `{\tensy Tfa6}\kern7bp'.}

\vskip6cm
\indent\special{psfile=test-p3-1.eps}\kern4cm
\kern1cm\vbox{\advance\hsize-5cm
Figure 1: It is as it should be.}

\vskip6cm
\indent\special{psfile=test-p3-2.eps}\kern4cm
\kern1cm\vbox{\advance\hsize-5cm
Figure 2: The letter `L' in the upper left side is in
font {\tt cmmi}, {\teni L}, while it should be
in {\tt cmsy}, {\tensy L}.}

\bye
-----------------------------------------------------------------------------------
Akira Kakuto
2018-09-28 22:07:03 UTC
Permalink
Post by Ramón Casares
test-p2-0.eps.pdf vs test-p3-0.eps [rotated subscripts bad]
test-p2-1.eps.pdf vs test-p3-1.eps [equal]
test-p2-2.eps.pdf vs test-p3-2.eps [L in upper left corner bad]
Thanks for the reports.
Confirmed in TeX Live 2018:
This is xdvipdfmx Version 20180916 by the DVIPDFMx project team,
and reported to the implementor.

Best,
Akira
Akira Kakuto
2018-09-28 22:17:38 UTC
Permalink
Post by Akira Kakuto
This is xdvipdfmx Version 20180916 by the DVIPDFMx project team,
--->
This is xdvipdfmx Version 20180506 by the DVIPDFMx project team,

Best,
Akira
Akira Kakuto
2018-10-01 21:14:54 UTC
Permalink
Post by Ramón Casares
test-p2-0.eps.pdf vs test-p3-0.eps [rotated subscripts bad]
test-p2-1.eps.pdf vs test-p3-1.eps [equal]
test-p2-2.eps.pdf vs test-p3-2.eps [L in upper left corner bad]
The author fixed the bug in r48797 in the latest TeX Live SVN,
which will be built in TeX Live 2019.

Best,
Akira

Loading...