Skip to content

Commit

Permalink
fix(fonts): Set otal axis based on style option
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Jan 5, 2023
1 parent a8cf8d7 commit 95a1ed2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/hb-utils.c
@@ -1,5 +1,6 @@
#include "hb-utils.h"

#include <string.h>
#include <stdlib.h>
#include <hb-ot.h>

Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 95a1ed2

Please sign in to comment.