![fontspec com LuaLaTeX usando Arial Narrow, enquanto XeLaTeX está correto](https://rvso.com/image/335500/fontspec%20com%20LuaLaTeX%20usando%20Arial%20Narrow%2C%20enquanto%20XeLaTeX%20est%C3%A1%20correto.png)
Atualmente estou trabalhando em um documento que edito em várias máquinas, ambas executando Windows 10. Em ambos os casos estou usando Miktex (x64). No entanto, há um problema em uma máquina quando tento compilar o seguinte MWE:
\documentclass{book}
\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{lipsum}
\begin{document}
\lipsum[1-5]
\end{document}
Usando o XeLaTeX, o PDF tem a aparência esperada e Arial aparece como fonte incorporada. No entanto, quando tento usar Lualatex, o PDF está, na verdade, usando a variante estreita da fonte.
A saída do Xelatex é a seguinte:
.................................................
. 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;"
.................................................
A saída do Lualatex é:
.................................................
. 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.:
.................................................
Suspeitei que Lualatex estivesse na verdade padronizando a variante estreita em vez da fonte normal. A execução luaotfload-tool --find="Arial"
fornece a seguinte saída
luaotfload | resolve : Font "Arial" found!
luaotfload | resolve : Resolved file name "c:/windows/fonts/arialn.ttf
Parece-me que a pesquisa está realmente errada. Tentei usar as cache=purge
opções force
e flush-lookup
, mas sem sucesso. Existe uma maneira de modificar a pesquisa manualmente para apontar para o arquivo correto?
Responder1
Isso pode ajudar até que o problema seja corrigido e carregado nas distribuições.
\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}
A ideia pode ser usada para fontes afetadas. Pode-se verificar
luaotfload-tool --find="Arial"
aponta para arialn.ttf
o qual é Arial Narrow e
luaotfload-tool --find="DejaVuSerif"
aponta para dejavuserifcondensed.ttf
o qual é DejaVuSerifCondensed.
O problema é pelo menosum mês de idade.