From 28a7c1f93247d692475ded0ea4dd6d0b5dd94044 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 25 Feb 2023 08:16:31 -0700 Subject: [PATCH] [wasm-api] Rename face_reference_table to face_copy_table --- src/hb-wasm-api-face.hh | 6 +++--- src/hb-wasm-api-list.hh | 2 +- src/hb-wasm-api.h | 6 +++--- src/wasm/graphite/shape.cc | 2 +- src/wasm/rust/harfbuzz-wasm/src/lib.rs | 4 ++-- src/wasm/sample/c/shape-fallback.cc | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/hb-wasm-api-face.hh b/src/hb-wasm-api-face.hh index 1d891dadf..5f38710a8 100644 --- a/src/hb-wasm-api-face.hh +++ b/src/hb-wasm-api-face.hh @@ -31,9 +31,9 @@ namespace hb { namespace wasm { -HB_WASM_API_COMPOUND (blob_t, face_reference_table) (HB_WASM_EXEC_ENV_COMPOUND - ptr_d(face_t, face), - tag_t table_tag) +HB_WASM_API_COMPOUND (blob_t, face_copy_table) (HB_WASM_EXEC_ENV_COMPOUND + ptr_d(face_t, face), + tag_t table_tag) { HB_RETURN_STRUCT (blob_t, ret); HB_REF2OBJ (face); diff --git a/src/hb-wasm-api-list.hh b/src/hb-wasm-api-list.hh index bd267bec3..65b982ef2 100644 --- a/src/hb-wasm-api-list.hh +++ b/src/hb-wasm-api-list.hh @@ -67,7 +67,7 @@ static NativeSymbol _hb_wasm_native_symbols[] = NATIVE_SYMBOL ("(i)", buffer_reverse_clusters), /* face */ - NATIVE_SYMBOL ("(iii)", face_reference_table), + NATIVE_SYMBOL ("(iii)", face_copy_table), NATIVE_SYMBOL ("(i)i", face_get_upem), /* font */ diff --git a/src/hb-wasm-api.h b/src/hb-wasm-api.h index 4282d2cf0..8f0748938 100644 --- a/src/hb-wasm-api.h +++ b/src/hb-wasm-api.h @@ -173,9 +173,9 @@ HB_WASM_API (void, buffer_reverse_clusters) (HB_WASM_EXEC_ENV typedef struct face_t face_t; -HB_WASM_API_COMPOUND (blob_t, face_reference_table) (HB_WASM_EXEC_ENV_COMPOUND - ptr_d(face_t, face), - tag_t table_tag); +HB_WASM_API_COMPOUND (blob_t, face_copy_table) (HB_WASM_EXEC_ENV_COMPOUND + ptr_d(face_t, face), + tag_t table_tag); HB_WASM_API (unsigned, face_get_upem) (HB_WASM_EXEC_ENV ptr_d(face_t, face)); diff --git a/src/wasm/graphite/shape.cc b/src/wasm/graphite/shape.cc index a11ad672d..7a5ca71d9 100644 --- a/src/wasm/graphite/shape.cc +++ b/src/wasm/graphite/shape.cc @@ -21,7 +21,7 @@ uint32_t heap_size = 2 * 1024 * 1024; static const void *copy_table (const void *data, unsigned int tag, size_t *len) { face_t *face = (face_t *) data; - blob_t blob = face_reference_table (face, tag); + blob_t blob = face_copy_table (face, tag); *len = blob.length; return blob.data; diff --git a/src/wasm/rust/harfbuzz-wasm/src/lib.rs b/src/wasm/rust/harfbuzz-wasm/src/lib.rs index b65538c7f..4b34e1d2d 100644 --- a/src/wasm/rust/harfbuzz-wasm/src/lib.rs +++ b/src/wasm/rust/harfbuzz-wasm/src/lib.rs @@ -41,7 +41,7 @@ extern "C" { fn font_glyph_to_string(font: u32, glyph: u32, str: *const u8, len: u32); fn font_get_glyph_h_advance(font: u32, glyph: u32) -> i32; fn font_get_glyph_v_advance(font: u32, glyph: u32) -> i32; - fn face_reference_table(font: u32, tag: u32) -> Blob; + fn face_copy_table(font: u32, tag: u32) -> Blob; fn buffer_copy_contents(buffer: u32) -> CBufferContents; fn buffer_set_contents(buffer: u32, cbuffer: &CBufferContents) -> bool; fn debugprint(s: *const u8); @@ -165,7 +165,7 @@ impl Face { tag_u |= (chars.next().unwrap() as u32) << 16; tag_u |= (chars.next().unwrap() as u32) << 8; tag_u |= chars.next().unwrap() as u32; - unsafe { face_reference_table(self.0, tag_u) } + unsafe { face_copy_table(self.0, tag_u) } } /// Get the face's design units per em. diff --git a/src/wasm/sample/c/shape-fallback.cc b/src/wasm/sample/c/shape-fallback.cc index d554b11e3..ecfb6948a 100644 --- a/src/wasm/sample/c/shape-fallback.cc +++ b/src/wasm/sample/c/shape-fallback.cc @@ -17,7 +17,7 @@ shape (void *shape_plan, { face_t *face = font_get_face (font); - blob_t blob = face_reference_table (face, TAG ('c','m','a','p')); + blob_t blob = face_copy_table (face, TAG ('c','m','a','p')); debugprint1 ("cmap length", blob.length);