On 9-2-2011 12:23, Ulrike Fischer wrote:
Am Tue, 08 Feb 2011 17:07:39 +0100 schrieb Hans Hagen:
Does some interface exists in contex/mkiv which allows to use such virtual fonts together with the normal font loading code? E.g. could I move the code for the font to some file ("cmr10-red.vflua") so that a request \font\mytest="cmr10-red" will simply find this file and use the code like vf, tfm or otf-files are found and used when needed?
It's relatively easy to add support for that. However, when I've done that Khaled has to make sure that it also works in his wrapper code as I don't know to what extend he overloads code. I can only test in the plain variant and context.
You only need to load one extra file:
loadmodule('font-lua.lua')
Then, if
\font\mine=file:luatex-fonts-demo-vf-1.lua at 12pt
What are the search pathes for such virtual lua fonts? I suggested the file extension ".vflua" because I thought it would be senseful if not the search path for general .lua files is used. I wanted to put this virtual fonts in a dedicated location e.g. fonts/vflua/....
I'm not going to hard code something like that as it's a macro specific issue. You can try (untested): fonts.formats.vflua = "lua" Paths and lookups are also a macro package issue and as khaled probably has specific file lookup code for latex, I suppose that the lookup can be handled there. If not, we can make the remapper extensible. Anyhow, "tex" with "other text files" sounds good enough for me. Also, I suppose that names should be unique and the files that you make in some latex specific (sub)path in order not to clash. As this is not that generic, maybe something: tex/latex/fonts/vflua is best. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------