2 * Copyright (C) 2009 Red Hat, Inc.
4 * This is part of HarfBuzz, an OpenType Layout engine library.
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24 * Red Hat Author(s): Behdad Esfahbod
30 #include "hb-common.h"
34 /* Unicode General Category property */
39 HB_CATEGORY_UNASSIGNED,
40 HB_CATEGORY_PRIVATE_USE,
41 HB_CATEGORY_SURROGATE,
42 HB_CATEGORY_LOWERCASE_LETTER,
43 HB_CATEGORY_MODIFIER_LETTER,
44 HB_CATEGORY_OTHER_LETTER,
45 HB_CATEGORY_TITLECASE_LETTER,
46 HB_CATEGORY_UPPERCASE_LETTER,
47 HB_CATEGORY_COMBINING_MARK,
48 HB_CATEGORY_ENCLOSING_MARK,
49 HB_CATEGORY_NON_SPACING_MARK,
50 HB_CATEGORY_DECIMAL_NUMBER,
51 HB_CATEGORY_LETTER_NUMBER,
52 HB_CATEGORY_OTHER_NUMBER,
53 HB_CATEGORY_CONNECT_PUNCTUATION,
54 HB_CATEGORY_DASH_PUNCTUATION,
55 HB_CATEGORY_CLOSE_PUNCTUATION,
56 HB_CATEGORY_FINAL_PUNCTUATION,
57 HB_CATEGORY_INITIAL_PUNCTUATION,
58 HB_CATEGORY_OTHER_PUNCTUATION,
59 HB_CATEGORY_OPEN_PUNCTUATION,
60 HB_CATEGORY_CURRENCY_SYMBOL,
61 HB_CATEGORY_MODIFIER_SYMBOL,
62 HB_CATEGORY_MATH_SYMBOL,
63 HB_CATEGORY_OTHER_SYMBOL,
64 HB_CATEGORY_LINE_SEPARATOR,
65 HB_CATEGORY_PARAGRAPH_SEPARATOR,
66 HB_CATEGORY_SPACE_SEPARATOR
69 /* Unicode Script property */
71 { /* ISO 15924 code */
72 HB_SCRIPT_INVALID_CODE = -1,
73 HB_SCRIPT_COMMON = 0, /* Zyyy */
74 HB_SCRIPT_INHERITED, /* Qaai */
75 HB_SCRIPT_ARABIC, /* Arab */
76 HB_SCRIPT_ARMENIAN, /* Armn */
77 HB_SCRIPT_BENGALI, /* Beng */
78 HB_SCRIPT_BOPOMOFO, /* Bopo */
79 HB_SCRIPT_CHEROKEE, /* Cher */
80 HB_SCRIPT_COPTIC, /* Qaac */
81 HB_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
82 HB_SCRIPT_DESERET, /* Dsrt */
83 HB_SCRIPT_DEVANAGARI, /* Deva */
84 HB_SCRIPT_ETHIOPIC, /* Ethi */
85 HB_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
86 HB_SCRIPT_GOTHIC, /* Goth */
87 HB_SCRIPT_GREEK, /* Grek */
88 HB_SCRIPT_GUJARATI, /* Gujr */
89 HB_SCRIPT_GURMUKHI, /* Guru */
90 HB_SCRIPT_HAN, /* Hani */
91 HB_SCRIPT_HANGUL, /* Hang */
92 HB_SCRIPT_HEBREW, /* Hebr */
93 HB_SCRIPT_HIRAGANA, /* Hira */
94 HB_SCRIPT_KANNADA, /* Knda */
95 HB_SCRIPT_KATAKANA, /* Kana */
96 HB_SCRIPT_KHMER, /* Khmr */
97 HB_SCRIPT_LAO, /* Laoo */
98 HB_SCRIPT_LATIN, /* Latn (Latf, Latg) */
99 HB_SCRIPT_MALAYALAM, /* Mlym */
100 HB_SCRIPT_MONGOLIAN, /* Mong */
101 HB_SCRIPT_MYANMAR, /* Mymr */
102 HB_SCRIPT_OGHAM, /* Ogam */
103 HB_SCRIPT_OLD_ITALIC, /* Ital */
104 HB_SCRIPT_ORIYA, /* Orya */
105 HB_SCRIPT_RUNIC, /* Runr */
106 HB_SCRIPT_SINHALA, /* Sinh */
107 HB_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
108 HB_SCRIPT_TAMIL, /* Taml */
109 HB_SCRIPT_TELUGU, /* Telu */
110 HB_SCRIPT_THAANA, /* Thaa */
111 HB_SCRIPT_THAI, /* Thai */
112 HB_SCRIPT_TIBETAN, /* Tibt */
113 HB_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
114 HB_SCRIPT_YI, /* Yiii */
115 HB_SCRIPT_TAGALOG, /* Tglg */
116 HB_SCRIPT_HANUNOO, /* Hano */
117 HB_SCRIPT_BUHID, /* Buhd */
118 HB_SCRIPT_TAGBANWA, /* Tagb */
120 /* Unicode-4.0 additions */
121 HB_SCRIPT_BRAILLE, /* Brai */
122 HB_SCRIPT_CYPRIOT, /* Cprt */
123 HB_SCRIPT_LIMBU, /* Limb */
124 HB_SCRIPT_OSMANYA, /* Osma */
125 HB_SCRIPT_SHAVIAN, /* Shaw */
126 HB_SCRIPT_LINEAR_B, /* Linb */
127 HB_SCRIPT_TAI_LE, /* Tale */
128 HB_SCRIPT_UGARITIC, /* Ugar */
130 /* Unicode-4.1 additions */
131 HB_SCRIPT_NEW_TAI_LUE, /* Talu */
132 HB_SCRIPT_BUGINESE, /* Bugi */
133 HB_SCRIPT_GLAGOLITIC, /* Glag */
134 HB_SCRIPT_TIFINAGH, /* Tfng */
135 HB_SCRIPT_SYLOTI_NAGRI, /* Sylo */
136 HB_SCRIPT_OLD_PERSIAN, /* Xpeo */
137 HB_SCRIPT_KHAROSHTHI, /* Khar */
139 /* Unicode-5.0 additions */
140 HB_SCRIPT_UNKNOWN, /* Zzzz */
141 HB_SCRIPT_BALINESE, /* Bali */
142 HB_SCRIPT_CUNEIFORM, /* Xsux */
143 HB_SCRIPT_PHOENICIAN, /* Phnx */
144 HB_SCRIPT_PHAGS_PA, /* Phag */
145 HB_SCRIPT_NKO, /* Nkoo */
147 /* Unicode-5.1 additions */
148 HB_SCRIPT_KAYAH_LI, /* Kali */
149 HB_SCRIPT_LEPCHA, /* Lepc */
150 HB_SCRIPT_REJANG, /* Rjng */
151 HB_SCRIPT_SUNDANESE, /* Sund */
152 HB_SCRIPT_SAURASHTRA, /* Saur */
153 HB_SCRIPT_CHAM, /* Cham */
154 HB_SCRIPT_OL_CHIKI, /* Olck */
155 HB_SCRIPT_VAI, /* Vaii */
156 HB_SCRIPT_CARIAN, /* Cari */
157 HB_SCRIPT_LYCIAN, /* Lyci */
158 HB_SCRIPT_LYDIAN /* Lydi */
166 typedef struct _hb_unicode_funcs_t hb_unicode_funcs_t;
169 hb_unicode_funcs_create (void);
172 hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs);
175 hb_unicode_funcs_get_reference_count (hb_unicode_funcs_t *ufuncs);
178 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs);
181 hb_unicode_funcs_copy (hb_unicode_funcs_t *ufuncs);
184 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs);
189 typedef hb_codepoint_t (*hb_unicode_get_mirroring_func_t) (hb_codepoint_t unicode);
190 typedef hb_category_t (*hb_unicode_get_general_category_func_t) (hb_codepoint_t unicode);
191 typedef hb_script_t (*hb_unicode_get_script_func_t) (hb_codepoint_t unicode);
192 typedef unsigned int (*hb_unicode_get_combining_class_func_t) (hb_codepoint_t unicode);
193 typedef unsigned int (*hb_unicode_get_eastasian_width_func_t) (hb_codepoint_t unicode);
197 hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
198 hb_unicode_get_mirroring_func_t mirroring_func);
201 hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
202 hb_unicode_get_general_category_func_t general_category_func);
205 hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
206 hb_unicode_get_script_func_t script_func);
209 hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
210 hb_unicode_get_combining_class_func_t combining_class_func);
213 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
214 hb_unicode_get_eastasian_width_func_t eastasian_width_func);
218 hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs,
219 hb_codepoint_t unicode);
222 hb_unicode_get_general_category (hb_unicode_funcs_t *ufuncs,
223 hb_codepoint_t unicode);
226 hb_unicode_get_script (hb_unicode_funcs_t *ufuncs,
227 hb_codepoint_t unicode);
230 hb_unicode_get_combining_class (hb_unicode_funcs_t *ufuncs,
231 hb_codepoint_t unicode);
234 hb_unicode_get_eastasian_width (hb_unicode_funcs_t *ufuncs,
235 hb_codepoint_t unicode);
240 #endif /* HB_UNICODE_H */