[luatex] Font not appearing in font.fonts table

Yannis Haralambous yannis.haralambous at telecom-bretagne.eu
Wed Sep 28 18:21:59 CEST 2011


Vielen Dank Ulrike,

so if I understand this correctly, the entries starting with file: are not necessary, after all the entries starting with name: have an attribute "filename" which gives the file name which is afterwards loaded by luatex?

My next questions: 

I need to add a hook to the define font callback register so that whenever a font from the Latin Modern Roman font family is loaded, I immediately create a virtual font (using a second real font, found on disk) and provide that virtual font to luatex.

1) can I do this? In other words: can my new virtual font be used by luatex exactly as if it were lmroman10-roman.otf?

2) what is the name of the define font callback register in fontspec? (in plain luatex it is "define_font" but I guess fontspec uses a different one)

3) how do I read the second opentype font? (the font name is no problem, I can it in a table, but is there some procedure to read all info provided in an OpenType font? Or do I need to write that from scratch?)

thanks in advance und einen schönen Gruß

Yannis


Le 28 sept. 2011 à 14:32, Ulrike Fischer a écrit :

> 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 
> 

-- 
-------------------------------------------------------
Yannis Haralambous
Directeur d'études
Institut Télécom, Télécom Bretagne
Département Informatique
UMR CNRS 3192 Lab-STICC
Technopôle Brest Iroise
CS 83818, 29238 Brest Cedex 3, France
Tel: +33 2 29 00 14 27
Fax: +33 2 29 00 12 82
Email: yannis.haralambous at telecom-bretagne.eu
Internet: http://omega.enstb.org/yannis
ICBM address: 48°21'31.57"N 4°34'16.76"W
Twitter: y_haralambous
-------------------------------------------------------
...pour distinguer l'extérieur d'un aquarium,
mieux vaut n'être pas poisson

...the ball I threw while playing in the park
has not yet reached the ground

Es gab eine Zeit, wo ich nur ungern über Schubert sprechen,
nur Nächtens den Bäumen und Sternen von ihm vorerzählen mögen.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Yannis Haralambous.vcf
Type: text/directory
Size: 508 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20110928/88f02ba8/attachment-0001.bin>
-------------- next part --------------



More information about the luatex mailing list