From b4c0829bc18b696f140a260fa2e1089d10164519 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 21 Jul 2015 09:31:19 +0100 Subject: [PATCH] [USE] Remove unused Unicode data enums from USE C++ side --- src/hb-ot-shape-complex-use-private.hh | 66 +------------------------- src/hb-ot-shape-complex-use.cc | 14 +----- 2 files changed, 3 insertions(+), 77 deletions(-) diff --git a/src/hb-ot-shape-complex-use-private.hh b/src/hb-ot-shape-complex-use-private.hh index 835dbaf75..fc0cfc50b 100644 --- a/src/hb-ot-shape-complex-use-private.hh +++ b/src/hb-ot-shape-complex-use-private.hh @@ -35,7 +35,7 @@ #include "hb-ot-shape-complex-private.hh" -#define USE_TABLE_ELEMENT_TYPE uint16_t +#define USE_TABLE_ELEMENT_TYPE uint8_t /* Cateories used in the Universal Shaping Engine spec: * https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm @@ -90,70 +90,6 @@ enum use_category_t { USE_SMBlw = 42 /* SYM_MOD_BELOW */ }; -/* Categories used in IndicSyllabicCategory.txt from UCD. */ -enum indic_syllabic_category_t -{ - INDIC_SYLLABIC_CATEGORY_AVAGRAHA, - INDIC_SYLLABIC_CATEGORY_BINDU, - INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER, - INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK, - INDIC_SYLLABIC_CATEGORY_CONSONANT, - INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD, - INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL, - INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER, - INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER, - INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL, - INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER, - INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA, - INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED, - INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED, - INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA, - INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER, - INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK, - INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER, - INDIC_SYLLABIC_CATEGORY_JOINER, - INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER, - INDIC_SYLLABIC_CATEGORY_NON_JOINER, - INDIC_SYLLABIC_CATEGORY_NUKTA, - INDIC_SYLLABIC_CATEGORY_NUMBER, - INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER, - INDIC_SYLLABIC_CATEGORY_OTHER, - INDIC_SYLLABIC_CATEGORY_PURE_KILLER, - INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER, - INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER, - INDIC_SYLLABIC_CATEGORY_TONE_LETTER, - INDIC_SYLLABIC_CATEGORY_TONE_MARK, - INDIC_SYLLABIC_CATEGORY_VIRAMA, - INDIC_SYLLABIC_CATEGORY_VISARGA, - INDIC_SYLLABIC_CATEGORY_VOWEL, - INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT, - INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT, -}; - -/* Categories used in IndicPositionalCategory.txt from UCD */ -enum indic_positional_category_t { - INDIC_POSITIONAL_CATEGORY_BOTTOM, - INDIC_POSITIONAL_CATEGORY_BOTTOM_AND_RIGHT, - INDIC_POSITIONAL_CATEGORY_LEFT, - INDIC_POSITIONAL_CATEGORY_LEFT_AND_RIGHT, - INDIC_POSITIONAL_CATEGORY_NOT_APPLICABLE, - INDIC_POSITIONAL_CATEGORY_OVERSTRUCK, - INDIC_POSITIONAL_CATEGORY_RIGHT, - INDIC_POSITIONAL_CATEGORY_TOP, - INDIC_POSITIONAL_CATEGORY_TOP_AND_BOTTOM, - INDIC_POSITIONAL_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT, - INDIC_POSITIONAL_CATEGORY_TOP_AND_LEFT, - INDIC_POSITIONAL_CATEGORY_TOP_AND_LEFT_AND_RIGHT, - INDIC_POSITIONAL_CATEGORY_TOP_AND_RIGHT, - INDIC_POSITIONAL_CATEGORY_VISUAL_ORDER_LEFT, -}; - -/* Note: We use ASSERT_STATIC_EXPR_ZERO() instead of ASSERT_STATIC_EXPR() and the comma operation - * because gcc fails to optimize the latter and fills the table in at runtime. */ -#define USE_COMBINE_CATEGORIES(S,P) \ - (ASSERT_STATIC_EXPR_ZERO (S < 255 && P < 255) + \ - ((P << 8) | S)) - HB_INTERNAL USE_TABLE_ELEMENT_TYPE hb_use_get_categories (hb_codepoint_t u); diff --git a/src/hb-ot-shape-complex-use.cc b/src/hb-ot-shape-complex-use.cc index d8ce4517f..b019755f6 100644 --- a/src/hb-ot-shape-complex-use.cc +++ b/src/hb-ot-shape-complex-use.cc @@ -120,17 +120,7 @@ static inline void set_use_properties (hb_glyph_info_t &info) { hb_codepoint_t u = info.codepoint; - unsigned int type = hb_use_get_categories (u); - indic_syllabic_category_t cat = (indic_syllabic_category_t) (type & 0x7Fu); - indic_positional_category_t pos = (indic_positional_category_t) (type >> 8); - use_category_t use = USE_O; - - switch (cat) - { - /* TODO */ - } - - info.use_category() = use; + info.use_category() = hb_use_get_categories (u); } @@ -147,7 +137,7 @@ setup_masks_use (const hb_ot_shape_plan_t *plan HB_UNUSED, unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) - set_use_properties (info[i]); + info[i].use_category() = hb_use_get_categories (info[i].codepoint); } static void