2

Bold/Italic/BoldItalic fonts with \XeLaTeX's \setmainfont does not work correctly. For example (below), the \textbf{English} and \textit{English} looks like normalfont. With \LuaLaTex it is works fine.

\documentclass[twoside]{article}
    \usepackage{fontspec}
    \usepackage{polyglossia}
    \setmainlanguage{english}
    \setmainfont{CMU Serif}                 
    \setsansfont{CMU Sans Serif}            
    \setmonofont{CMU Typewriter Text}

\begin{document}

\noindent
\textbf{English}\\
\texttt{English}\\
\textit{English}\\

\end{document}

With certain other definition

\setmainfont[
  Ligatures=TeX,
  Extension=.otf,
  BoldFont=cmunbx,
  ItalicFont=cmunti,
  BoldItalicFont=cmunbi,
]{cmunrm}

Both, \XeLaTeX and \LuaTeX displays fonts correctly.

I'm using WinXP SP3, Miktex 2.9 (updated)

Some additions

I found temporary solution of the problem. I notice with the \setmainfont{Times New Roman} \XeLaTeX works well. Then I install fonts from \MikTex\fonts\opentype\public\cm-unicode\ to the Windows\Fonts folder.

It turns out that only MiKTeX's xelatex.exe can see fonts from system folder, not from own folder despite the that LaTeX\MikTex\fontconfig\config\*fonts*.conf are included the path to own font folders.

Another additions

As I noticed, the xelatex.exe understand many Human fontfamily names from \MikTex\fonts\opentype\public\cm-unicode\ except only CMU Serif family.

\setmainfont{CMU Bright}    

displays Bold/Italic/BoldItalic fonts.

It seems, the problem localized not in the xelatex.exe but possible in the package fontspec for xelatex, or more probably, in the font files cmun*.otf. May be inside cmun*.otf there are no relations between other files, which is belong to the same family. But it is strange, the LuaLaTeX displays CMU Serif family correct.

  • It depends on several factors; if you've made known the fonts to your system, then the first form will work. Otherwise it won't and the second form will be necessary. What operating system are you using and what TeX distribution? – egreg Jan 9 '15 at 20:42
  • @egreg I'm using WinXP SP3, Miktex 2.9 (updated) "if you've made known the fonts to your system" - how can I do this? And possible fonts is known for system because \LuaLaTex works – sergiokapone Jan 9 '15 at 20:44
  • 1
    That's unfortunate, as I know nothing about MiKTeX and Windows. Maybe others will help you in sorting out the issue, that's just as I said: make the fonts known to the system. – egreg Jan 9 '15 at 20:46
  • Maybe this can help: tex.stackexchange.com/questions/45478/… – egreg Jan 9 '15 at 21:13
  • @egreg By the way, I notice the log-file string Font shape EU1/CMUSerif(0)/bx/n' undefined(Font) using EU1/CMUSerif(0)/m/n' instead – sergiokapone Jan 9 '15 at 21:49
2

With -up-to-date TL 2014 and xelatex and lualatex

enter image description here

*File List*
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
fontspec.sty 2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
expl3.sty 2014/11/25 v5471 L3 programming layer (loader)
expl3-code.tex 2014/11/25 v5471 L3 programming layer
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
l3unicode-data.def 2014/11/23 v5465 L3 Unicode data
l3xdvipdfmx.def
xparse.sty 2014/11/25 v5471 L3 Experimental document command parser
fontspec-patches.sty 2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTe
X
fontspec-xetex.sty 2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
[ ... ]

You should update your system.

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.