[Dev-luatex] [PATCH] luaharfbuzz: Provide interface for variable fonts

Marcel Fabian Kr├╝ger tex at 2krueger.de
Wed Aug 4 14:11:45 CEST 2021


On Tue, Aug 03, 2021 at 11:51:16AM +0200, luigi scarso wrote:
> Patches applied, but I don't have variation.c, which is mentioned
> in luaharfbuzz.am.patch
> and  so variation.c.patch cannot be applied .
> 

Sadly I introduced a bug here: Named instances queried from face
objects use 1-based indices, while the related Font method to set the
current instance still uses a zero based index. 

I attached a patch to fix this issue.

Best regards,
Marcel
-------------- next part --------------
From b1c13f1aab58fc8ff4ed572a3bed38c957535170 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= <tex at 2krueger.de>
Date: Wed, 4 Aug 2021 14:02:28 +0200
Subject: [PATCH] Fix named instance inconsistency in luaharfbuzz

---
 source/texk/web2c/luatexdir/luaharfbuzz/src/luaharfbuzz/font.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/texk/web2c/luatexdir/luaharfbuzz/src/luaharfbuzz/font.c b/source/texk/web2c/luatexdir/luaharfbuzz/src/luaharfbuzz/font.c
index 2734534a2..d369f02f2 100644
--- a/source/texk/web2c/luatexdir/luaharfbuzz/src/luaharfbuzz/font.c
+++ b/source/texk/web2c/luatexdir/luaharfbuzz/src/luaharfbuzz/font.c
@@ -235,7 +235,7 @@ static int font_set_var_named_instance(lua_State *L) {
   Font *f = (Font *)luaL_checkudata(L, 1, "harfbuzz.Font");
   unsigned int instance = luaL_checkinteger(L, 2);
 
-  hb_font_set_var_named_instance(*f, instance);
+  hb_font_set_var_named_instance(*f, instance - 1);
   return 0;
 }
 
-- 
2.32.0



More information about the dev-luatex mailing list