[luatex] Font not appearing in font.fonts table
Ulrike Fischer
luatex at nililand.de
Wed Sep 28 14:32:13 CEST 2011
Am Wed, 28 Sep 2011 12:12:44 +0200 schrieb Yannis Haralambous:
> Hello everybody,
> I'm trying to find out how font loading works, so that I can implement the zebrackets package into luatex.
> The following code:
>
> \documentclass{article}
> \usepackage{fontspec}
> \defaultfontfeatures{Ligatures=TeX}
> \setmainfont{Latin Modern Roman}
> \begin{document}
>
> \fontsize{7}{7}\selectfont\emph{blabla}
> \directlua{for i=1,1000,1 do
> if font.fonts[i] == nil then
> %texio.write_nl("XXX ERROR")
> else
> if (font.fonts[i].name == nil) then
> texio.write_nl(tostring(i) .. ": " .. tostring(font.fonts[i]))
> else
> texio.write_nl(tostring(i) .. ": " .. font.fonts[i].name)
> end
> end
> end
> }
> \end{document}
>
> produces a list of all elements of table font.fonts. Here is what I get:
>
> 1: cmex10
> 2: line10
> 3: linew10
> 4: lcircle10
> 5: lcirclew10
> 6: cmr5
> 7: cmr7
> 8: cmr10
> 9: cmmi5
> 10: cmmi7
> 11: cmmi10
> 12: cmsy5
> 13: cmsy7
> 14: cmsy10
> 15: cmr10
> 16: file:lmroman10-regular:script=latn;+trep;+tlig;
> 17: file:lmromanslant10-regular:script=latn;+trep;+tlig;
> 18: file:lmroman10-italic:script=latn;+trep;+tlig;
> 19: file:lmroman10-bold:script=latn;+trep;+tlig;
> 20: file:lmsans10-regular:script=latn;+trep;+tlig;
> 21: name:LatinModernRoman
> 22: name:LatinModernRoman/B
> 23: name:LatinModernRoman/I
> 24: name:LatinModernRoman/BI
> 25: name:LatinModernRoman:mode=node;script=latn;language=DFLT;+tlig;+trep;
> 26: name:LatinModernRoman:mode=node;script=latn;language=DFLT;+tlig;+trep;
> 27: name:LatinModernRoman/I:mode=node;script=latn;language=DFLT;+tlig;+trep;
> [1{/hom/yannis/texmf/config/pdftex.map}] (./luatex-test2.aux) )
> 285 words of node memory still in use:
> 3 hlist, 1 vlist, 1 rule, 2 glue, 3 attribute, 40 glue_spec, 3 attribute_lis
> t, 1 write nodes
> avail lists: 2:40,3:2,4:27,5:1,6:14,7:1,9:8
> </usr/local/texlive/2011/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.
> otf></usr/local/texlive/2011/texmf-dist/fonts/opentype/public/lm/lmroman7-itali
> c.otf>
>
>
> Fonts 1-15 are the preloaded ones (by lualatex), fonts 16-20 are the files and 21-27 the names of fonts loaded by the
> fontspec package for the font family Latin Modern Roman.
>
> What I don't understand (and maybe you can enlighten me) is why the font lmroman7-italic does not appear
> in the font.fonts table?
Well if you add informations about the designsize you can see that
the font is there:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
\begin{document}
\fontsize{7}{7}\selectfont\emph{blabla}
\fontsize{20}{20}\selectfont\emph{blabla}
\directlua{
for i,v in font.each() do
texio.write_nl(tostring(i) .. ": " .. font.fonts[i].name .. ": " ..
font.fonts[i].designsize)
end
}
\end{document}
The small italic is:
27: name:LatinModernRoman/I:mode=node;script=latn;language=DFLT;:
458752
The "file:..." entries are from the default settings of microtype.
You would see file:lmroman7-italic if you would remove the
\setmainfont command.
--
Ulrike Fischer
More information about the luatex
mailing list