On 28-10-2010 7:48, Ulrike Fischer wrote:
Hm. I do have a bit the impression as if we have here a context and latex philosophy clash. I'm not asking you to provide a funktion
Huh? I'm not sure what philosophy refers to, as I'm not refering to context but to the otf loading code; so it would be a function in the lua code base (it would not even be interfaced to context as it would invalidate most of the characters in a font).
incorporated in the context code which does the job. _I_ want to write support files for the chess ttf-fonts. If I get something working I will perhaps add it to my package. And if something changes in luatex or the underlying luaotfload/context code, well then I will have to adjust my code.
Sure, but the first complaints would end up in khaleds, tacos or my mailbox unless your package is private and never ends up in tex distributions). The fact that it's custom in latex to overload code and thus create a maintaince depency does not mean that I want such a dependency on my code. The context philosophy is to provide hooks and ignore all compliants about other usage cq. don't care about usage of code that is not meant to be accesses directly. (Also, Khaled then provides the interface to the latex packages.)
Couldn't you give some examples how to manipulate a font after it has been defined with \font\test (if it is possible) and then let me play around?
I have no clue about the lualatex interface i.e. at what point you can hook in code. Keep in mind that messing around with a font before or during loading can influence other instances of that font as some data is shared. Also, once the font lives at the tex end, some data is frozen. Because some of the font's metadata is used in otf processing one cannot change that data without keeping that in mind. Anyhow, you can access some font data afterwards. In context form: \startluacode function Whatever(name) for k, v in pairs(fonts.ids[font.current()].descriptions) do if v.name == name then tex.sprint("\\char"..k.."\\relax") break end end end \stopluacode \font\test=file:pirat.ttf \def\MyChessChar#1{{\test\directlua{Whatever("#1")}}} \MyChessChar{c160} This is dead slow and inefficient but as you don't want a proper function for it I don't care too much. Interesting is that it does not work out (as wis to be expected as the normal glyph access function does something similar). Btw, a bit of testing at my end shows that there is something fishy with the font with respect to inclusion in the pdf so it can well be that the accessor is ok and something else is the problem. As taco mentioned in an earlier mail, we will look into it (even it makes not much sense). 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 -----------------------------------------------------------------