Maybe the kerning functions are not implemented yet?

The LuaHarfBuzz projects list the full api and there are many kerning related 
functions:

https://github.com/ufyTeX/luaharfbuzz/blob/abe15fef9f2bbf9e68bc54c7057056bcd73032bb/status/full_api.txt

In the file `done.txt` there are no kerning related function. 

https://github.com/ufyTeX/luaharfbuzz/blob/abe15fef9f2bbf9e68bc54c7057056bcd73032bb/status/done.txt

But I’m not an expert in this field ....

On 21.07.25 22:51, Keno Wehr via luatex wrote:
> For a LuaLaTeX package I need to read the kerning values of certain character 
> pairs as they are defined by the current font. If the Node renderer is used, 
> I can use the following code, where first_node and second_node are glyph 
> nodes:
> 
>     local current_font = font.getfont(first_node.font)
>     local kern = 0
>     if current_font and current_font.resources
>     and current_font.resources.sequences then
>       for _, t in ipairs(current_font.resources.sequences) do
>         if t.features and t.features.kern and t.steps and t.steps[1]
>         and t.steps[1].coverage and t.steps[1].coverage[first_node.char]
>         and t.steps[1].coverage[first_node.char][second_node.char] then
>           kern = t.steps[1].coverage[first_node.char][second_node.char]
>         end
>       end
>     end
> 
> However, I cannot be sure that the Node renderer is used, it may be the case 
> that HarfBuzz is used. But with HarfBuzz the font structure is different and 
> the above code does not return the kerning value needed. HarfBuzz defines a C 
> function hb_font_glyph_h_kerning(), but this function does not have a Lua 
> equivalent (unlike others listed in section 13.1 of the LuaTeX manual).
> 
> Could anyone tell me how to get the kerning values with HarfBuzz?

Josef

Reply via email to