There is probably a really simple answer to this, but what is the current method for loading OpenType/TrueType fonts in luatex? I've tried a few things that do not appear to work, and I haven't been able to find any complete examples of how to do so. \pdfoutput=1 \font\myfont={Vera.ttf} % This doesn't work %\font\myfont={cmr10} % This does work {\myfont Testing} \end % luatex --fmt=plain foo.tex This is luaTeX, Version 3.141592-snapshot-2007040613 (Web2C 7.5.6) (foo.tex ! Font \myfont=Vera.ttf not loadable: Metric (TFM/OFM) file not found or bad. <to be read again> \par l.4 Where Vera.ttf is in current directory. My impression from the manual (page 38) was that luatex could construct metrics directly from the font without needing something like otftotfm. I also tried registering a define_font callback that called the font.read_ttf function, but that gave similar results. I'm using luatex build from the subversion repository (currently at revision 386). -- [Geoff Washburn|geoffw@cis.upenn.edu|http://www.cis.upenn.edu/~geoffw/]
Geoffrey Alan Washburn wrote:
There is probably a really simple answer to this, but what is the current method for loading OpenType/TrueType fonts in luatex? I've tried a few things that do not appear to work, and I haven't been able to find any complete examples of how to do so.
\pdfoutput=1 \font\myfont={Vera.ttf} % This doesn't work %\font\myfont={cmr10} % This does work
{\myfont Testing} \end
% luatex --fmt=plain foo.tex This is luaTeX, Version 3.141592-snapshot-2007040613 (Web2C 7.5.6) (foo.tex ! Font \myfont=Vera.ttf not loadable: Metric (TFM/OFM) file not found or bad. <to be read again> \par l.4
you need to define a callback (define_font) that (1) loads the open type font (2) create a tfm-line table using this data (3) returns this table the manual mentions this but the mapping is upto yourself. Open type support is somewhat experimental. We have plans to provide a few helper functions that will make this mapping easy and convenient. Luatex will provide the means, but the support for open type and esp features will be up to the macro package. The main reason for this is that each macro package does things different, users may want to have control, etc. etc. and there hardly any common ground. Hardcoding open type support is not on the agenda because this contradicts the luatex way. Luatex only provide the machinery. XeTeX on the other hand uses libraries and supports open type out of the box but does not provide the detailed control that LuaTeX will give. Somewhere next year we expect macro packages to have support for luatex and open type. Hans Ps. When there is enough interest in this, I can provide lua code for the basic mapping. I have plans to write some code for plain tex but will do that once we're sure that the things work as we expect (derived from code used in ConTeXt) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Geoffrey Alan Washburn
-
Hans Hagen