On 2-11-2010 4:16, Ulrike Fischer wrote:
and store it in a table. I need a way to reencode/reorder the font, so that the input "K" points to the glyph "c140". Pirat is not the only chessfont I have, I don't want to change the input if I change the font, so every chessfont should have the same internal order.
(1) you can write your own fontloader (which in the case of a symbol font is no big deal, i.e. just slots and dimensions and 1-to-1 mapping as no unicode is needed, and info about that can be found in the luatex manual) (2) you can intercept the table just before it is passed to tex (for which you need to look into the bit of code that latex i.e. just before font.define is called and the table passed is the one that needs to be tweaked, that table conforms to the luatex spec)
My main problem is that they are so few informations about the generic context font loader code. E.g. after the rereading of the luatex manual I came up with the following:
(3) some day I'll probably document the relevant (and public) part of the low level interface; till then the source is the documentation (probably of not much use outside context as we have a different font model)
1. Why is the spacing in \testb wrong if the chars have been already used after \test?
because the font is already loaded and frozen
2. Which values/tables in mytable should I reset/change too to get a "sane" font \testb?
whatever value you want, but before the font is passed to tex (so before font.define is called cq. the font define callback is finished in the latex code)
3. I can also use "mytable=fonts.ids[font.id('test')]". Is this better? What are the differences?
fonts.ids accessed the font info that lives at the tex end but changing values like widths won't have any effect on tex as they are frozen already (after all they end up in backend code as well) 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 -----------------------------------------------------------------