[wasm-api] Rename face_reference_table to face_copy_table

This commit is contained in:
Behdad Esfahbod 2023-02-25 08:16:31 -07:00
parent b5b577f29f
commit 28a7c1f932
6 changed files with 11 additions and 11 deletions

View File

@ -31,9 +31,9 @@ namespace hb {
namespace wasm { namespace wasm {
HB_WASM_API_COMPOUND (blob_t, face_reference_table) (HB_WASM_EXEC_ENV_COMPOUND HB_WASM_API_COMPOUND (blob_t, face_copy_table) (HB_WASM_EXEC_ENV_COMPOUND
ptr_d(face_t, face), ptr_d(face_t, face),
tag_t table_tag) tag_t table_tag)
{ {
HB_RETURN_STRUCT (blob_t, ret); HB_RETURN_STRUCT (blob_t, ret);
HB_REF2OBJ (face); HB_REF2OBJ (face);

View File

@ -67,7 +67,7 @@ static NativeSymbol _hb_wasm_native_symbols[] =
NATIVE_SYMBOL ("(i)", buffer_reverse_clusters), NATIVE_SYMBOL ("(i)", buffer_reverse_clusters),
/* face */ /* face */
NATIVE_SYMBOL ("(iii)", face_reference_table), NATIVE_SYMBOL ("(iii)", face_copy_table),
NATIVE_SYMBOL ("(i)i", face_get_upem), NATIVE_SYMBOL ("(i)i", face_get_upem),
/* font */ /* font */

View File

@ -173,9 +173,9 @@ HB_WASM_API (void, buffer_reverse_clusters) (HB_WASM_EXEC_ENV
typedef struct face_t face_t; typedef struct face_t face_t;
HB_WASM_API_COMPOUND (blob_t, face_reference_table) (HB_WASM_EXEC_ENV_COMPOUND HB_WASM_API_COMPOUND (blob_t, face_copy_table) (HB_WASM_EXEC_ENV_COMPOUND
ptr_d(face_t, face), ptr_d(face_t, face),
tag_t table_tag); tag_t table_tag);
HB_WASM_API (unsigned, face_get_upem) (HB_WASM_EXEC_ENV HB_WASM_API (unsigned, face_get_upem) (HB_WASM_EXEC_ENV
ptr_d(face_t, face)); ptr_d(face_t, face));

View File

@ -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) static const void *copy_table (const void *data, unsigned int tag, size_t *len)
{ {
face_t *face = (face_t *) data; 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; *len = blob.length;
return blob.data; return blob.data;

View File

@ -41,7 +41,7 @@ extern "C" {
fn font_glyph_to_string(font: u32, glyph: u32, str: *const u8, len: u32); 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_h_advance(font: u32, glyph: u32) -> i32;
fn font_get_glyph_v_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_copy_contents(buffer: u32) -> CBufferContents;
fn buffer_set_contents(buffer: u32, cbuffer: &CBufferContents) -> bool; fn buffer_set_contents(buffer: u32, cbuffer: &CBufferContents) -> bool;
fn debugprint(s: *const u8); 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) << 16;
tag_u |= (chars.next().unwrap() as u32) << 8; tag_u |= (chars.next().unwrap() as u32) << 8;
tag_u |= chars.next().unwrap() as u32; 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. /// Get the face's design units per em.

View File

@ -17,7 +17,7 @@ shape (void *shape_plan,
{ {
face_t *face = font_get_face (font); 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); debugprint1 ("cmap length", blob.length);