On 8-2-2011 3:41, Ulrike Fischer wrote:
Am Tue, 08 Feb 2011 15:13:11 +0100 schrieb Hans Hagen:

On 8-2-2011 10:40, Ulrike Fischer wrote:
Hello,

The luatex documentation contains in section "7.2.2 Example virtual
font" an example how to define a virtual font "cmr10-red". The font
is defined by adding the code to the define_font callback.

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.

That would be fine. There are quite often on various lists questions
about how to "correct" a font, e.g. adjust kerning, or add a missing
glyph etc and a interface for "virtual lua fonts" would make such
corrections much easier.

The example in the documentation uses as base font cmr10 and loads
it with f = font.read_tfm('cmr10',size). How should one load the
real font when it is an otf?

the lua file has to return a function that then gets a specification and has to return a tfmtable, something like

return myhackery(specification)
    local t = fonts.tfm.read(specification)
    -- mess around with t
    return t
end

but I didn't test that.

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to