From 2d7c94eafcf53850981207b14152c4a069e1a92a Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Thu, 5 Jan 2023 15:12:15 +0200 Subject: [PATCH] chore(shapers): Set otal axis based on style option --- src/hb-utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hb-utils.c b/src/hb-utils.c index adab39142..06fb7ea5c 100644 --- a/src/hb-utils.c +++ b/src/hb-utils.c @@ -1,5 +1,6 @@ #include "hb-utils.h" +#include #include #include @@ -102,6 +103,14 @@ hb_font_t* get_hb_font(lua_State *L, int index) { lua_getfield(L, index, "weight"); if (lua_isnumber(L, -1)) { newCoords[i] = lua_tonumber(L, -1); } break; + case HB_TAG('i', 't', 'a', 'l'): + lua_getfield(L, index, "style"); + if (lua_isstring(L, -1)) { + const char* style = lua_tostring(L, -1); + if (strcasestr(style, "italic")) + newCoords[i] = 1; + } + break; default: break; } }