Menu

#105 Bug of embolden

v0.99992
pending
5
2018-08-20
2015-01-05
Ch'enMeng
No

I got a weird problem with the fontspec package and the graphicx package. Let's see the MWE first.

%!TEX program = xelatex
\documentclass{article}
\usepackage{graphicx}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\test[AutoFakeBold = 5]{Times New Roman}
\begin{document}
\test
Test
\textbf{Bold Test}

\includegraphics[scale = 0.1]{photo}

Words that shouldn't be bolded. Even if \textmd{textmd-ed}.
\end{document}

In the preamble, I loaded the graphicx package and the fontspec package, then I set Times New Roman as the default font of the text as well as the font of the test command. In the definition of \test, I enabled AutoFakeBold. In the document body, between the two chains of text, I inserted a photo with the \includegraphics command.

It's a normal manuscript, except that AutoFakeBold was set to 5 to make the abnormal output more remarkable. After the compilation, however, the later line of text presented an unexpected output. That is, this line of text shouldn't be bolded.

Even more surprising is that, if one

  • cancel the option passed to \includegraphics,
  • or put some more text after \textbf{},

the problem will go away.

After some deep analyses by qingkuan@bbs.ctex.org, it seems to be a bug of XeTeX. See the new MWE.

% !TeX program = xetex

\font\x="[cmunrm.otf]"
\font\bx="[cmunrm.otf]:embolden=5;"

\x Test
{\bx Bold Test}
\XeTeXpicfile "example-image.png"  width 1cm\relax
Words that shouldn't be bolded.


\tracingoutput=1
\showboxbreadth=\maxdimen
\showboxdepth=\maxdimen

\bye

Discussion

  • Khaled Hosny

    Khaled Hosny - 2015-01-06
    • labels: embolden --> embolden, xdvipdfmx
    • status: open --> pending
    • assigned_to: Khaled Hosny
    • Group: Future --> v0.99992
     
  • Khaled Hosny

    Khaled Hosny - 2015-01-06

    This turned out to be a dvipdfmx bug and should be fixed in the next TeX Live release.

     
  • Alan Munn

    Alan Munn - 2018-08-20

    Khaled, did this actually get fixed? It seems to still be around: https://tex.stackexchange.com/q/446622/2693

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.