[luatex] How to query fonts.handlers
Henri Menke
henrimenke at gmail.com
Tue Feb 5 22:41:44 CET 2019
On 6/02/19 10:36 AM, Ulrike Fischer wrote:
> Am Mon, 4 Feb 2019 15:00:12 +1300 schrieb Henri Menke:
>
>> Dear list,
>>
>> I am trying to access extra kerning that I have defined using
>> fonts.handlers.otf.addfeature. Even though I query the kerning from
>> within a paragraph where the kerning is evidently applied I can't seem
>> to get the value stored earlier, see the comment in the MWE. What am I
>> doing wrong?
>
> Your value is in the ktest lookup, so you need to read this:
Great! That's a step in the right direction. However it requires me to
know which lookup to query. Is there a way to query the lookups?
Cheers, Henri
>
> \input luaotfload.sty
>
>
> \directlua{
> fonts.handlers.otf.addfeature {
> name = "ktest",
> type = "kern",
> data = {
> ["t"] = { ["e"] = 500 },
> }
> }
> }
>
> \font\1="file:lmroman10-regular.otf:mode=node;+ktest;" at 10pt
> \1
>
> test%
> \directlua{
> local fnt = font.current()
> local tfmdata = font.getfont(fnt)
> local t = string.byte("t")
> local e = string.byte("e")
> local kern = fonts.handlers.otf.getkern(tfmdata,t,e,"ktest")
> local kern = kern / tfmdata.parameters.factor
> tex.sprint(kern) % 500
> }
> \bye
>
>
More information about the luatex
mailing list