diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc | 144 |
1 files changed, 48 insertions, 96 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc index 22cbd733883..c08bb11f460 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout.cc @@ -25,9 +25,8 @@ * Google Author(s): Behdad Esfahbod */ -#include "hb-open-type.hh" +#include "hb.hh" -#include "hb-ot-face.hh" #include "hb-aat-layout.hh" #include "hb-aat-fdsc-table.hh" // Just so we compile it; unused otherwise. #include "hb-aat-layout-ankr-table.hh" @@ -40,6 +39,45 @@ #include "hb-aat-ltag-table.hh" +/* + * hb_aat_apply_context_t + */ + +/* Note: This context is used for kerning, even without AAT, hence the condition. */ +#if !defined(HB_NO_AAT) || !defined(HB_NO_OT_KERN) + +AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (const hb_ot_shape_plan_t *plan_, + hb_font_t *font_, + hb_buffer_t *buffer_, + hb_blob_t *blob) : + plan (plan_), + font (font_), + face (font->face), + buffer (buffer_), + sanitizer (), + ankr_table (&Null(AAT::ankr)), + lookup_index (0), + debug_depth (0) +{ + sanitizer.init (blob); + sanitizer.set_num_glyphs (face->get_num_glyphs ()); + sanitizer.start_processing (); + sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX); +} + +AAT::hb_aat_apply_context_t::~hb_aat_apply_context_t () +{ sanitizer.end_processing (); } + +void +AAT::hb_aat_apply_context_t::set_ankr_table (const AAT::ankr *ankr_table_) +{ ankr_table = ankr_table_; } + +#endif + + +#ifndef HB_NO_AAT + + /** * SECTION:hb-aat-layout * @title: hb-aat-layout @@ -135,52 +173,15 @@ static const hb_aat_feature_mapping_t feature_mappings[] = const hb_aat_feature_mapping_t * hb_aat_layout_find_feature_mapping (hb_tag_t tag) { -#ifdef HB_NO_SHAPE_AAT - return nullptr; -#endif - - return (const hb_aat_feature_mapping_t *) bsearch (&tag, - feature_mappings, - ARRAY_LENGTH (feature_mappings), - sizeof (feature_mappings[0]), - hb_aat_feature_mapping_t::cmp); + return (const hb_aat_feature_mapping_t *) hb_bsearch (&tag, + feature_mappings, + ARRAY_LENGTH (feature_mappings), + sizeof (feature_mappings[0]), + hb_aat_feature_mapping_t::cmp); } /* - * hb_aat_apply_context_t - */ - -/* Note: This context is used for kerning, even without AAT. */ - -AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (const hb_ot_shape_plan_t *plan_, - hb_font_t *font_, - hb_buffer_t *buffer_, - hb_blob_t *blob) : - plan (plan_), - font (font_), - face (font->face), - buffer (buffer_), - sanitizer (), - ankr_table (&Null(AAT::ankr)), - lookup_index (0), - debug_depth (0) -{ - sanitizer.init (blob); - sanitizer.set_num_glyphs (face->get_num_glyphs ()); - sanitizer.start_processing (); - sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX); -} - -AAT::hb_aat_apply_context_t::~hb_aat_apply_context_t () -{ sanitizer.end_processing (); } - -void -AAT::hb_aat_apply_context_t::set_ankr_table (const AAT::ankr *ankr_table_) -{ ankr_table = ankr_table_; } - - -/* * mort/morx/kerx/trak */ @@ -189,10 +190,6 @@ void hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper, hb_aat_map_t *map) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - const AAT::morx& morx = *mapper->face->table.morx; if (morx.has_data ()) { @@ -219,10 +216,6 @@ hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper, hb_bool_t hb_aat_layout_has_substitution (hb_face_t *face) { -#ifdef HB_NO_SHAPE_AAT - return false; -#endif - return face->table.morx->has_data () || face->table.mort->has_data (); } @@ -232,10 +225,6 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - hb_blob_t *morx_blob = font->face->table.morx.get_blob (); const AAT::morx& morx = *morx_blob->as<AAT::morx> (); if (morx.has_data ()) @@ -258,10 +247,6 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan, void hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; hb_glyph_position_t *pos = buffer->pos; @@ -279,10 +264,6 @@ is_deleted_glyph (const hb_glyph_info_t *info) void hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - hb_ot_layout_delete_glyphs_inplace (buffer, is_deleted_glyph); } @@ -296,10 +277,6 @@ hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) hb_bool_t hb_aat_layout_has_positioning (hb_face_t *face) { -#ifdef HB_NO_SHAPE_AAT - return false; -#endif - return face->table.kerx->has_data (); } @@ -308,10 +285,6 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - hb_blob_t *kerx_blob = font->face->table.kerx.get_blob (); const AAT::kerx& kerx = *kerx_blob->as<AAT::kerx> (); @@ -331,10 +304,6 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan, hb_bool_t hb_aat_layout_has_tracking (hb_face_t *face) { -#ifdef HB_NO_SHAPE_AAT - return false; -#endif - return face->table.trak->has_data (); } @@ -343,10 +312,6 @@ hb_aat_layout_track (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#ifdef HB_NO_SHAPE_AAT - return; -#endif - const AAT::trak& trak = *font->face->table.trak; AAT::hb_aat_apply_context_t c (plan, font, buffer); @@ -370,12 +335,6 @@ hb_aat_layout_get_feature_types (hb_face_t *face, unsigned int *feature_count, /* IN/OUT. May be NULL. */ hb_aat_layout_feature_type_t *features /* OUT. May be NULL. */) { -#ifdef HB_NO_SHAPE_AAT - if (feature_count) - *feature_count = 0; - return 0; -#endif - return face->table.feat->get_feature_types (start_offset, feature_count, features); } @@ -392,10 +351,6 @@ hb_ot_name_id_t hb_aat_layout_feature_type_get_name_id (hb_face_t *face, hb_aat_layout_feature_type_t feature_type) { -#ifdef HB_NO_SHAPE_AAT - return HB_OT_NAME_ID_INVALID; -#endif - return face->table.feat->get_feature_name_id (feature_type); } @@ -424,11 +379,8 @@ hb_aat_layout_feature_type_get_selector_infos (hb_face_t hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ unsigned int *default_index /* OUT. May be NULL. */) { -#ifdef HB_NO_SHAPE_AAT - if (selector_count) - *selector_count = 0; - return 0; -#endif - return face->table.feat->get_selector_infos (feature_type, start_offset, selector_count, selectors, default_index); } + + +#endif |