diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-10-13 22:53:19 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-10-13 22:53:19 +0000 |
commit | 1031c01a2674825fe7037630e3f37f05fd1e739c (patch) | |
tree | ebfef9c9c109565c30c9b2bc8b601a703aafa487 /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc | |
parent | eb1d91e185ce0b605a76da41e16cf0eb736edc06 (diff) |
harfbuzz-1.6.0
git-svn-id: svn://tug.org/texlive/trunk@45535 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc index 22998f00586..e96c8acd386 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-face.cc @@ -51,8 +51,6 @@ const hb_face_t _hb_face_nil = { 1000, /* upem */ 0, /* num_glyphs */ - hb_face_t::DIRTY_NOTHING, /* dirty */ - { #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID, #include "hb-shaper-list.hh" @@ -120,8 +118,10 @@ _hb_face_for_data_closure_create (hb_blob_t *blob, unsigned int index) } static void -_hb_face_for_data_closure_destroy (hb_face_for_data_closure_t *closure) +_hb_face_for_data_closure_destroy (void *data) { + hb_face_for_data_closure_t *closure = (hb_face_for_data_closure_t *) data; + hb_blob_destroy (closure->blob); free (closure); } @@ -171,7 +171,7 @@ hb_face_create (hb_blob_t *blob, face = hb_face_create_for_tables (_hb_face_for_data_reference_table, closure, - (hb_destroy_func_t) _hb_face_for_data_closure_destroy); + _hb_face_for_data_closure_destroy); face->index = index; @@ -367,11 +367,6 @@ hb_face_set_index (hb_face_t *face, if (face->immutable) return; - if (face->index == index) - return; - - face->dirty |= face->DIRTY_INDEX; - face->index = index; } @@ -407,11 +402,6 @@ hb_face_set_upem (hb_face_t *face, if (face->immutable) return; - if (face->upem == upem) - return; - - face->dirty |= face->DIRTY_UPEM; - face->upem = upem; } @@ -456,11 +446,6 @@ hb_face_set_glyph_count (hb_face_t *face, if (face->immutable) return; - if (face->num_glyphs == glyph_count) - return; - - face->dirty |= face->DIRTY_NUM_GLYPHS; - face->num_glyphs = glyph_count; } @@ -489,4 +474,33 @@ hb_face_t::load_num_glyphs (void) const hb_blob_destroy (maxp_blob); } +/** + * hb_face_get_table_tags: + * @face: a face. + * + * Retrieves table tags for a face, if possible. + * + * Return value: total number of tables, or 0 if not possible to list. + * + * Since: 1.6.0 + **/ +unsigned int +hb_face_get_table_tags (hb_face_t *face, + unsigned int start_offset, + unsigned int *table_count, /* IN/OUT */ + hb_tag_t *table_tags /* OUT */) +{ + if (face->destroy != _hb_face_for_data_closure_destroy) + { + if (table_count) + *table_count = 0; + return 0; + } + + hb_face_for_data_closure_t *data = (hb_face_for_data_closure_t *) face->user_data; + + const OT::OpenTypeFontFile &ot_file = *OT::Sanitizer<OT::OpenTypeFontFile>::lock_instance (data->blob); + const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index); + return ot_face.get_table_tags (start_offset, table_count, table_tags); +} |