From a2d1e136d044f5fca135a1a1dd6268cb0b187667 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Sun, 2 Aug 2026 21:04:06 +0100 Subject: [PATCH] WASM hooks for setting variation deltas --- src/hb-wasm-api-buffer.hh | 13 ++++++++++++- src/hb-wasm-api-list.hh | 1 + src/hb-wasm-api.h | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/hb-wasm-api-buffer.hh b/src/hb-wasm-api-buffer.hh index 64217a041..575baa9f7 100644 --- a/src/hb-wasm-api-buffer.hh +++ b/src/hb-wasm-api-buffer.hh @@ -205,13 +205,24 @@ HB_WASM_API (void, buffer_reverse) (HB_WASM_EXEC_ENV } HB_WASM_API (void, buffer_reverse_clusters) (HB_WASM_EXEC_ENV - ptr_d(buffer_t, buffer)) + ptr_d(buffer_t, buffer)) { HB_REF2OBJ (buffer); hb_buffer_reverse_clusters (buffer); } +HB_WASM_API (void, buffer_set_glyph_variation_delta) (HB_WASM_EXEC_ENV + ptr_d(buffer_t, buffer), + uint32_t glyph_index, + uint32_t axis_index, + int32_t delta) +{ + HB_REF2OBJ (buffer); + + hb_buffer_set_glyph_variation_delta (buffer, glyph_index, axis_index, delta); +} + }} #endif /* HB_WASM_API_BUFFER_HH */ diff --git a/src/hb-wasm-api-list.hh b/src/hb-wasm-api-list.hh index 5db45c74c..1799937db 100644 --- a/src/hb-wasm-api-list.hh +++ b/src/hb-wasm-api-list.hh @@ -68,6 +68,7 @@ static NativeSymbol _hb_wasm_native_symbols[] = NATIVE_SYMBOL ("(i)i", buffer_get_script), NATIVE_SYMBOL ("(i)", buffer_reverse), NATIVE_SYMBOL ("(i)", buffer_reverse_clusters), + NATIVE_SYMBOL ("(iiii)", buffer_set_glyph_variation_delta), /* face */ NATIVE_SYMBOL ("(ii)i", face_create), diff --git a/src/hb-wasm-api.h b/src/hb-wasm-api.h index bb977eeb1..49452d148 100644 --- a/src/hb-wasm-api.h +++ b/src/hb-wasm-api.h @@ -173,6 +173,12 @@ HB_WASM_API (void, buffer_reverse) (HB_WASM_EXEC_ENV HB_WASM_API (void, buffer_reverse_clusters) (HB_WASM_EXEC_ENV ptr_d(buffer_t, buffer)); +HB_WASM_API (void, buffer_set_glyph_variation_delta) (HB_WASM_EXEC_ENV + ptr_d(buffer_t, buffer), + uint32_t glyph_index, + uint32_t axis_index, + int32_t delta); + /* face */ typedef struct face_t face_t;