3

I'm currently working on a document which I edit from multiple machines, both running Windows 10. In both cases I'm using Miktex (x64). There is however an issue on one machine, when I try to compile the following MWE:

\documentclass{book}  
\usepackage{fontspec}
\setmainfont{Arial}  
\usepackage{lipsum}   
\begin{document}
    \lipsum[1-5]
\end{document}

Using XeLaTeX, the PDF is looking as expected and Arial shows as embedded font. However, when I try to use Lualatex, the PDF is actually using the narrow variant of the font.

The output of Xelatex is the following:

.................................................
. fontspec info: "defining-font"
. 
. Font family 'Arial(0)' created for font 'Arial' with options
. [Ligatures=TeX].
. 
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.:
. <->"Arial/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'small caps'  (m/sc) with NFSS spec.:
. <->"Arial/OT:script=latn;language=DFLT;mapping=tex-text;+smcp;"- 'bold'
. (bx/n) with NFSS spec.:
. <->"Arial/B/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold small caps'  (bx/sc) with NFSS spec.:
. <->"Arial/B/OT:script=latn;language=DFLT;mapping=tex-text;+smcp;"- 'italic'
. (m/it) with NFSS spec.:
. <->"Arial/I/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'italic small caps'  (m/itsc) with NFSS spec.:
. <->"Arial/I/OT:script=latn;language=DFLT;mapping=tex-text;+smcp;"- 'bold
. italic' (bx/it) with NFSS spec.:
. <->"Arial/BI/OT:script=latn;language=DFLT;mapping=tex-text;"
. - 'bold italic small caps'  (bx/itsc) with NFSS spec.:
. <->"Arial/BI/OT:script=latn;language=DFLT;mapping=tex-text;+smcp;"
.................................................

The output of Lualatex is:

.................................................
. fontspec info: "defining-font"
. 
. Font family 'Arial(0)' created for font 'Arial' with options
. [Ligatures=TeX].
. 
. This font family consists of the following NFSS series/shapes:
. - 'normal' (m/n) with NFSS spec.: <->"Arial:mode=node;+tlig;"
. - 'small caps'  (m/sc) with NFSS spec.: - 'bold' (bx/n) with NFSS spec.:
. <->"Arial/B:mode=node;+tlig;"
. - 'bold small caps'  (bx/sc) with NFSS spec.: - 'italic' (m/it) with NFSS
. spec.: <->"Arial/I:mode=node;+tlig;"
. - 'italic small caps'  (m/itsc) with NFSS spec.: - 'bold italic' (bx/it)
. with NFSS spec.: <->"Arial/BI:mode=node;+tlig;"
. - 'bold italic small caps'  (bx/itsc) with NFSS spec.: 
.................................................

I suspected that Lualatex is actually defaulting to the narrow variant instead of the regular font. Running luaotfload-tool --find="Arial" gives the followig output

luaotfload | resolve : Font "Arial" found!
luaotfload | resolve : Resolved file name "c:/windows/fonts/arialn.ttf

It seems to me, that the lookup is actually wrong. I tried using the cache=purge, force and flush-lookup options, but to no avail. Is there a way I can modify the lookup manually to point to the correct file?

5
  • Hmmm, I can't reproduce the problem on a Mac running MacOSX 10.11.5, MacTeX2016, and LuaTeX0.95. Which version of LuaTeX is installed on your copy of MikTeX?
    – Mico
    Commented Jun 8, 2016 at 19:14
  • Hmm, I'm not sure myself how it ended up in this state... Reinstalling Miktex didn't work. The banner says This is LuaTeX, Version 0.95.0 (MiKTeX 2.9 64-bit) (format=lualatex 2016.6.8) 8 JUN 2016 21:13
    – ChrisK
    Commented Jun 8, 2016 at 19:15
  • I don't have arailn.ttf and so can't test if it confuse lualatex, but you can always load fonts by file name, see the documentation of fontspec. Commented Jun 8, 2016 at 19:21
  • Does the issue disappear if you rerun the MWE (under LuaLaTeX) first with \setmainfont{Arial}, then \setmainfont{Arial Narrow}, and finally again \setmainfont{Arial}?
    – Mico
    Commented Jun 8, 2016 at 19:23
  • @UlrikeFischer: that would be an option, but then I have to specify bold, italic, etc. myself. And I'm really wondering why the lookup isn't working... @Mico: the problem persists. Only using \setmainfont{Arial Narrow} results in the same document
    – ChrisK
    Commented Jun 8, 2016 at 19:26

1 Answer 1

2

This can help until issue will be fixed and uploaded to distributions.

\documentclass{book}  
\usepackage{fontspec}
\setmainfont{arial}[ %Need such long loading because of luaotfload issue
    Extension = .ttf,
    UprightFont = *,
    BoldFont = *bd,
    ItalicFont = *i,
    BoldItalicFont = *bi]
\newfontfamily\cyrillicfont{arial}[ %for Cyrillic users
    Extension = .ttf ,
    UprightFont = *,
    BoldFont = *bd,
    ItalicFont = *i,
    BoldItalicFont = *bi]
\usepackage{lipsum}   
\begin{document}
    \lipsum[1-5]
\end{document}

Idea can be used for affected fonts. One can check

luaotfload-tool --find="Arial"

points to arialn.ttf which is Arial Narrow and

luaotfload-tool --find="DejaVuSerif"

points to dejavuserifcondensed.ttf which is DejaVuSerifCondensed.

Issue is at least one month old.

2
  • It would be helpful if you stated which operating system, TeX distribution, and version of luaotfload-tool you employ. (On a MacOSX 10.11.5 system with MacTeX2016 and version 2.7 of luaotfload-tool, luaotfload-tool --find="Arial" points to the regular, i.e., non-condensed version of Arial.)
    – Mico
    Commented Jun 12, 2016 at 21:43
  • OS: Win7SP1 x64, TexLive2016 (updated 2016-06-12), luaotfload-tool version: "2.7" Luaotfload: "v2.7-fix-2" Revision: "0ba71246a7445204a457602806f9cc80c0cbe354" Lua interpreter: stock; version "Lua 5.2" Luatex version: 0.95
    – Leonid
    Commented Jun 12, 2016 at 22:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .