[lltx] [luatex] Patching fonts with the luaotfload callback "luaotfload.patch_font"

Ulrike Fischer news3 at nililand.de
Tue Mar 15 09:59:52 CET 2011


Am Mon, 14 Mar 2011 11:53:16 +0100 schrieb Ulrike Fischer:


>> It does not work because the _real_ font needs tounicode values. As I
>> wrote earlier: tounicode works on actual glyphs, not virtual glyphs:

[...}

> Thanks for your code, I will test it later. 

I tested it. It works but as you said it affects the "real" font.
This means that if the original font was already loaded the
tounicode setting has no effect, and if the original font is loaded
after the virtual font than it gets the new tounicode too. 

As my real font will be used in at least two different virtual fonts
(figurines and board symbols) that would make things a bit
complicated. So I think I will set /ActualText. 


> I also found another
> possibility: I can set a /ActualText in the pdf:
> 
>            chars[u].commands = {
>             {'special', 'pdf:literal BT /Span
> <</ActualText<FEFF'..tounicodes[u]..'>>> BDC'},
>             { 'char', v },
>             {'special','pdf:literal  EMC ET'}}
> 
> This works fine, allows more freedom for the replacement text (and
> seems even to work in right-to-left text).
> 
> (I'm not quite sure yet if the ":literal" and the BT-ET pair is
> actually needed.)

The "literal" and the BT/ET pair gives an error if the font is used
on the second page of document. Everything works fine if I remove
them. 


-- 
Ulrike Fischer 



More information about the lualatex-dev mailing list