lualatex / luaotfload

OpenType font loader for LuaTeX
Other
26 stars 8 forks source link

wrong fonts picked up by LuaTeX 0.95 + luaotfload 2.7-fix-2 but was ok in TL2015 #356

Closed jfbu closed 6 years ago

jfbu commented 8 years ago

Consider this LaTeX file:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{DejaVuSerif}
\setsansfont{DejaVuSans}
\setmonofont{DejaVuSansMono}

\begin{document}

\rmfamily A

\sffamily B

\ttfamily C
\end{document}

With TL2016 pretest (manually updated to use luaotfload 2.7-fix-2 which is on CTAN but not yet in the pretest, but it was the same with fix-1) I get (long line left as is):

</usr/local/texlive/2016/texmf-dist/fonts/truetype/public/dejavu/DejaVuSansMono.ttf></usr/local/texlive/2016/texmf-dist/fonts/truetype/public/dejavu/DejaVuSansCondensed.ttf></usr/local/texlive/2016/texmf-dist/fonts/truetype/public/dejavu
/DejaVuSerifCondensed.ttf>
Output written on test.pdf (1 page, 30368 bytes).
Transcript written on test.log.

which wrongly uses Condensed version, but with TL2015 I get (hard wraps there in original):

</usr/local/texlive/2015/texmf-dist/fonts/truetype/public/dejavu/DejaVuSansMono.
ttf></usr/local/texlive/2015/texmf-dist/fonts/truetype/public/dejavu/DejaVuSans.
ttf></usr/local/texlive/2015/texmf-dist/fonts/truetype/public/dejavu/DejaVuSerif
.ttf>
Output written on test.pdf (1 page, 30659 bytes).
Transcript written on test.log.

The ouput does change, and checking in Adobe Reader, the fonts are confirmed.

The font repertory has not changed it is:

  /usr/local/texlive/2016/texmf-dist/fonts/truetype/public/dejavu:
  total used in directory 18520 available 7457209
  drwx------  23 XXX  YYY     782 Apr 11 14:53 .
  drwx------  19 XXX  YYY     646 Apr 11 15:01 ..
  -rw-------   1 XXX  YYY  693876 Sep 26  2013 DejaVuSans-Bold.ttf
  -rw-------   1 XXX  YYY  632168 Sep 26  2013 DejaVuSans-BoldOblique.ttf
  -rw-------   1 XXX  YYY  352492 Sep 26  2013 DejaVuSans-ExtraLight.ttf
  -rw-------   1 XXX  YYY  632416 Sep 26  2013 DejaVuSans-Oblique.ttf
  -rw-------   1 XXX  YYY  741536 Sep 26  2013 DejaVuSans.ttf
  -rw-------   1 XXX  YYY  653336 Sep 26  2013 DejaVuSansCondensed-Bold.ttf
  -rw-------   1 XXX  YYY  600936 Sep 26  2013 DejaVuSansCondensed-BoldOblique.ttf
  -rw-------   1 XXX  YYY  596596 Sep 26  2013 DejaVuSansCondensed-Oblique.ttf
  -rw-------   1 XXX  YYY  664972 Sep 26  2013 DejaVuSansCondensed.ttf
  -rw-------   1 XXX  YYY  318392 Sep 26  2013 DejaVuSansMono-Bold.ttf
  -rw-------   1 XXX  YYY  239876 Sep 26  2013 DejaVuSansMono-BoldOblique.ttf
  -rw-------   1 XXX  YYY  245948 Sep 26  2013 DejaVuSansMono-Oblique.ttf
  -rw-------   1 XXX  YYY  335068 Sep 26  2013 DejaVuSansMono.ttf
  -rw-------   1 XXX  YYY  345364 Sep 26  2013 DejaVuSerif-Bold.ttf
  -rw-------   1 XXX  YYY  336884 Sep 26  2013 DejaVuSerif-BoldItalic.ttf
  -rw-------   1 XXX  YYY  343388 Sep 26  2013 DejaVuSerif-Italic.ttf
  -rw-------   1 XXX  YYY  367260 Sep 26  2013 DejaVuSerif.ttf
  -rw-------   1 XXX  YYY  320720 Sep 26  2013 DejaVuSerifCondensed-Bold.ttf
  -rw-------   1 XXX  YYY  335940 Sep 26  2013 DejaVuSerifCondensed-BoldItalic.ttf
  -rw-------   1 XXX  YYY  342736 Sep 26  2013 DejaVuSerifCondensed-Italic.ttf
  -rw-------   1 XXX  YYY  334040 Sep 26  2013 DejaVuSerifCondensed.ttf

and same ls for 2015 version.

I have also DejaVu installed in my ~/Library/Fonts (perhaps I installed it not knowing it came with TeXLive, or that was some years ago and it was not yet in TeXLive, but anyway I don't think this interferes here).

jfbu commented 8 years ago

With LuaTeX 0.95 + luaotfload 2.7-fix-2, as in TL2016 pretest as of 2016/05/12:

capture d ecran 2016-05-12 a 09 01 20

With XeLaTeX:

capture d ecran 2016-05-12 a 09 02 43

\documentclass{article}
\usepackage{fontspec}
\setmainfont{DejaVuSerif}
\setsansfont{DejaVuSans}
\setmonofont{DejaVuSansMono}

\begin{document}

\count255 1
\def\y{\the\count255 \global\advance\count255 by 1 }
\def\x{\rule{1cm}{1pt}%
       \raisebox{3mm}{\makebox[0pt]\y}%
       \makebox[0pt]{\rule{1pt}{2mm}}%
}%

\x\x\x\x\x\x\x\x\x

\rmfamily abcdefghijklmnopqrstuvwxyz0123456789

\sffamily abcdefghijklmnopqrstuvwxyz0123456789

\ttfamily abcdefghijklmnopqrstuvwxyz0123456789
\end{document}

For XeLaTeX compilation I used \setmainfont[ExternalLocation]{DejaVuSerif} etc, because I am on mac os x, and I removed to be extra sure the DejaVu fonts from my ~/Library/Fonts to force use of the files of the TeXLive tree.

For LuaLaTeX I did first

$ luaotfload-tool --cache=erase

$ luaotfload-tool -u -f -vvv
jfbu commented 8 years ago

Plain LuaTeX example:

\input luaotfload.sty

\font\foo="DejaVuSerif:mode=node;script=latn;language=DFLT;+tlig;"

\foo

\count255 1
\def\y{\the\count255 \global\advance\count255 by 1 }
\def\x{\noindent\vbox{\hrule width 1cm height 1pt }%
       \hbox to 0pt {\raise 3mm \hbox to 0pt{\hss\y\hss}}%
       \hbox to 0pt {\hss\vbox{\hrule width 1pt height 2mm}\hss}%
}%

\x\x\x\x\x\x\x\x\x

\noindent abcdefghijklmnopqrstuvwxyz0123456789

\nopagenumbers
\bye
% Local Variables:
% TeX-engine: luatex
% End:

capture d ecran 2016-05-12 a 09 48 51

with context:

\starttext
\setuppagenumbering[state=stop]

\font\foo="DejaVuSerif:mode=node;script=latn;language=DFLT;+tlig;"

\foo

\count255 1
\def\y{\the\count255 \global\advance\count255 by 1 }
\def\x{\noindent\vbox{\hrule width 1cm height 1pt }%
       \hbox to 0pt {\raise 3mm \hbox to 0pt{\hss\y\hss}}%
       \hbox to 0pt {\hss\vbox{\hrule width 1pt height 2mm}\hss}%
}%

\x\x\x\x\x\x\x\x\x

abcdefghijklmnopqrstuvwxyz0123456789

\stoptext

produces capture d ecran 2016-05-12 a 09 43 17

jfbu commented 8 years ago

Hi, do you think the commit would solve the issues raised at:

*. http://tex.stackexchange.com/questions/313766/fontspec-with-lualatex-using-arial-narrow-while-xelatex-is-correct

*. http://tex.stackexchange.com/questions/313786/texlive-2016-strangely-cronospro-boldcaptit-is-loaded-instead-of-cronospro-bol

? (I have not tested the commit as I can't experiment now)

phi-gamma commented 8 years ago

Please test the new release, it should appear on CTAN any day.

jfbu commented 8 years ago

I have tested now the new release (with LaTeX): problem fixed, thanks !

side question: when the new luaotfload did first the database rebuilt there was a message (I didn't keep a copy) like "expected 2.900; got 2.700". I was surprised by the "2.900", expected something like "2.730". I see from luatotfload-tool --version output at bottom

Index: version="2.9" created="2016-06-18 08:53:44" modified="2016-06-18 08:53:44"

thus I guess it is all quite intentional ;-) (of course ...)

jfbu commented 8 years ago

also with plain LuaTeX, no more issue here.

phi-gamma commented 8 years ago

···<date: 2016-06-18, Saturday>···<from: Jean-François B.>···

I have tested now the new release (with LaTeX): problem fixed, thanks !

side question: when the new luaotfload did first the database rebuilt there was a message (I didn't keep a copy) like "expected 2.900; got 2.700". I was surprised by the "2.900", expected something like "2.730". I see from luatotfload-tool --version output at bottom

Index: version="2.9" created="2016-06-18 08:53:44" modified="2016-06-18 08:53:44"

thus I guess it is all quite intentional ;-) (of course ...)

Yes, it is. This value is the database version. The number is incremented whenever a change affects the layout of the font index or how it is assembled. There is no relation to the Luaotfload version number and besides providing a monotonic counter that value has no meaning.

Best, Philipp

u-fischer commented 6 years ago

Sound as if it has been resolved ...