More Indic data shuffling

This commit is contained in:
Behdad Esfahbod 2011-06-07 17:02:48 -04:00
parent 63b177e45c
commit 20503ccd57
1 changed files with 51 additions and 25 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2010 Google, Inc. * Copyright © 2011 Google, Inc.
* *
* This is part of HarfBuzz, a text shaping library. * This is part of HarfBuzz, a text shaping library.
* *
@ -34,37 +34,60 @@ HB_BEGIN_DECLS
#define INDIC_TABLE_ELEMENT_TYPE uint8_t #define INDIC_TABLE_ELEMENT_TYPE uint8_t
enum indic_syllabic_category_t { /* Cateories used in the OpenType spec:
INDIC_SYLLABIC_CATEGORY_AVAGRAHA, * https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx
INDIC_SYLLABIC_CATEGORY_BINDU, */
INDIC_SYLLABIC_CATEGORY_CONSONANT, enum {
INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD, OT_X = 0,
INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL, OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER, OT_V,
INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL, OT_N,
INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER, OT_H,
INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA, OT_ZWNJ,
INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED, OT_ZWJ,
INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER, OT_M,
INDIC_SYLLABIC_CATEGORY_NUKTA, OT_SM,
INDIC_SYLLABIC_CATEGORY_OTHER, OT_VD,
INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER, OT_A,
INDIC_SYLLABIC_CATEGORY_TONE_LETTER, OT_NBSP,
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 IndicSyllabicCategory.txt from UCD */
/* The assignments are guesswork */
enum indic_syllabic_category_t {
INDIC_SYLLABIC_CATEGORY_OTHER = OT_X,
INDIC_SYLLABIC_CATEGORY_AVAGRAHA = OT_SM,
INDIC_SYLLABIC_CATEGORY_BINDU = OT_SM,
INDIC_SYLLABIC_CATEGORY_CONSONANT = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER = OT_NBSP,
INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED = OT_C,
INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA = OT_C,
INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_SM,
INDIC_SYLLABIC_CATEGORY_NUKTA = OT_N,
INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_SM,
INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_V,
INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_M,
INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H,
INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM,
INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V,
INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT = OT_M,
INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT = OT_V,
};
/* Categories used in IndicSMatraCategory.txt from UCD */
enum indic_matra_category_t { enum indic_matra_category_t {
INDIC_MATRA_CATEGORY_NOT_APPLICABLE = 0,
INDIC_MATRA_CATEGORY_BOTTOM, INDIC_MATRA_CATEGORY_BOTTOM,
INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT, INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT,
INDIC_MATRA_CATEGORY_INVISIBLE, INDIC_MATRA_CATEGORY_INVISIBLE,
INDIC_MATRA_CATEGORY_LEFT, INDIC_MATRA_CATEGORY_LEFT,
INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT, INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT,
INDIC_MATRA_CATEGORY_NOT_APPLICABLE,
INDIC_MATRA_CATEGORY_OVERSTRUCK, INDIC_MATRA_CATEGORY_OVERSTRUCK,
INDIC_MATRA_CATEGORY_RIGHT, INDIC_MATRA_CATEGORY_RIGHT,
INDIC_MATRA_CATEGORY_TOP, INDIC_MATRA_CATEGORY_TOP,
@ -76,7 +99,10 @@ enum indic_matra_category_t {
INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT, INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT,
}; };
#define INDIC_COMBINE_CATEGORIES(S,M) (S) #define INDIC_COMBINE_CATEGORIES(S,M) \
(ASSERT_STATIC_EXPR (M == INDIC_MATRA_CATEGORY_NOT_APPLICABLE || (S == INDIC_SYLLABIC_CATEGORY_VIRAMA || S == INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT)), \
ASSERT_STATIC_EXPR (S < 16 && M < 16), \
(M << 4) | S)
#include "hb-ot-shape-complex-indic-table.hh" #include "hb-ot-shape-complex-indic-table.hh"