OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007,2008,2009 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009 Red Hat, Inc. |
| 3 * Copyright © 2011 Google, Inc. |
3 * | 4 * |
4 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
5 * | 6 * |
6 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
7 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
8 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
9 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
10 * all copies of this software. | 11 * all copies of this software. |
11 * | 12 * |
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR | 13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES | 14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN | 15 * 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 | 16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
16 * DAMAGE. | 17 * DAMAGE. |
17 * | 18 * |
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, | 19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | 20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS | 21 * 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 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
23 * | 24 * |
24 * Red Hat Author(s): Behdad Esfahbod | 25 * Red Hat Author(s): Behdad Esfahbod |
| 26 * Google Author(s): Behdad Esfahbod |
25 */ | 27 */ |
26 | 28 |
27 #ifndef HB_COMMON_H | 29 #ifndef HB_COMMON_H |
28 #define HB_COMMON_H | 30 #define HB_COMMON_H |
29 | 31 |
30 # ifdef __cplusplus | 32 # ifdef __cplusplus |
31 # define HB_BEGIN_DECLS extern "C" { | 33 # define HB_BEGIN_DECLS extern "C" { |
32 # define HB_END_DECLS } | 34 # define HB_END_DECLS } |
33 # else /* !__cplusplus */ | 35 # else /* !__cplusplus */ |
34 # define HB_BEGIN_DECLS | 36 # define HB_BEGIN_DECLS |
35 # define HB_END_DECLS | 37 # define HB_END_DECLS |
36 # endif /* !__cplusplus */ | 38 # endif /* !__cplusplus */ |
37 | 39 |
38 HB_BEGIN_DECLS | 40 HB_BEGIN_DECLS |
39 | 41 |
| 42 #if !defined (HB_DONT_DEFINE_STDINT) |
40 | 43 |
41 #ifdef _MSC_VER | 44 #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \ |
42 #define _HB__STR2__(x) #x | 45 defined (_sgi) || defined (__sun) || defined (sun) || \ |
43 #define _HB__STR1__(x) _HB__STR2__(x) | 46 defined (__digital__) || defined (__HP_cc) |
44 #define _HB__LOC__ __FILE__ "("_HB__STR1__(__LINE__)") : Warning Msg: " | 47 # include <inttypes.h> |
45 #pragma message(_HB__LOC__"Not using stdint.h; integer types may have wrong size
") | 48 #elif defined (_AIX) |
46 typedef signed char int8_t; | 49 # include <sys/inttypes.h> |
47 typedef unsigned char uint8_t; | 50 /* VS 2010 (_MSC_VER 1600) has stdint.h */ |
48 typedef signed short int16_t; | 51 #elif defined (_MSC_VER) && _MSC_VER < 1600 |
49 typedef unsigned short uint16_t; | 52 typedef __int8 int8_t; |
50 typedef signed int int32_t; | 53 typedef unsigned __int8 uint8_t; |
51 typedef unsigned int uint32_t; | 54 typedef __int16 int16_t; |
52 typedef signed long long int64_t; | 55 typedef unsigned __int16 uint16_t; |
53 typedef unsigned long long uint64_t; | 56 typedef __int32 int32_t; |
54 #ifndef __cplusplus | 57 typedef unsigned __int32 uint32_t; |
55 #define inline __inline | 58 typedef __int64 int64_t; |
56 #endif | 59 typedef unsigned __int64 uint64_t; |
57 #else | 60 #else |
58 #include <stdint.h> | 61 # include <stdint.h> |
59 #endif | 62 #endif |
60 | 63 |
| 64 #endif |
| 65 |
| 66 |
61 typedef int hb_bool_t; | 67 typedef int hb_bool_t; |
62 | 68 |
63 typedef uint32_t hb_tag_t; | |
64 #define HB_TAG(a,b,c,d) ((hb_tag_t)(((uint8_t)a<<24)|((uint8_t)b<<16)|((uint8_t)
c<<8)|(uint8_t)d)) | |
65 #define HB_TAG_STR(s) (HB_TAG(((const char *) s)[0], \ | |
66 ((const char *) s)[1], \ | |
67 ((const char *) s)[2], \ | |
68 ((const char *) s)[3])) | |
69 #define HB_TAG_NONE HB_TAG(0,0,0,0) | |
70 | |
71 hb_tag_t hb_tag_from_string (const char *s); | |
72 | |
73 | |
74 typedef uint32_t hb_codepoint_t; | 69 typedef uint32_t hb_codepoint_t; |
75 typedef int32_t hb_position_t; | 70 typedef int32_t hb_position_t; |
76 typedef uint32_t hb_mask_t; | 71 typedef uint32_t hb_mask_t; |
77 | 72 |
78 typedef void (*hb_destroy_func_t) (void *user_data); | 73 typedef union _hb_var_int_t { |
| 74 uint32_t u32; |
| 75 int32_t i32; |
| 76 uint16_t u16[2]; |
| 77 int16_t i16[2]; |
| 78 uint8_t u8[4]; |
| 79 int8_t i8[4]; |
| 80 } hb_var_int_t; |
79 | 81 |
80 typedef enum _hb_direction_t { | 82 |
81 HB_DIRECTION_LTR, | 83 /* hb_tag_t */ |
| 84 |
| 85 typedef uint32_t hb_tag_t; |
| 86 |
| 87 #define HB_TAG(a,b,c,d) ((hb_tag_t)((((uint8_t)(a))<<24)|(((uint8_t)(b))<<16)|((
(uint8_t)(c))<<8)|((uint8_t)(d)))) |
| 88 #define HB_UNTAG(tag) ((uint8_t)((tag)>>24)), ((uint8_t)((tag)>>16)), ((uint8_
t)((tag)>>8)), ((uint8_t)(tag)) |
| 89 |
| 90 #define HB_TAG_NONE HB_TAG(0,0,0,0) |
| 91 |
| 92 /* len=-1 means s is NUL-terminated */ |
| 93 hb_tag_t hb_tag_from_string (const char *s, int len); |
| 94 |
| 95 |
| 96 /* hb_direction_t */ |
| 97 |
| 98 typedef enum { |
| 99 HB_DIRECTION_INVALID = -1, |
| 100 HB_DIRECTION_LTR = 0, |
82 HB_DIRECTION_RTL, | 101 HB_DIRECTION_RTL, |
83 HB_DIRECTION_TTB, | 102 HB_DIRECTION_TTB, |
84 HB_DIRECTION_BTT | 103 HB_DIRECTION_BTT |
85 } hb_direction_t; | 104 } hb_direction_t; |
86 | 105 |
| 106 /* len=-1 means s is NUL-terminated */ |
| 107 hb_direction_t |
| 108 hb_direction_from_string (const char *str, int len); |
| 109 |
| 110 const char * |
| 111 hb_direction_to_string (hb_direction_t direction); |
| 112 |
87 #define HB_DIRECTION_IS_HORIZONTAL(dir) ((((unsigned int) (dir)) & ~1U) == 0) | 113 #define HB_DIRECTION_IS_HORIZONTAL(dir) ((((unsigned int) (dir)) & ~1U) == 0) |
88 #define HB_DIRECTION_IS_VERTICAL(dir) ((((unsigned int) (dir)) & ~1U) == 2) | 114 #define HB_DIRECTION_IS_VERTICAL(dir) ((((unsigned int) (dir)) & ~1U) == 2) |
89 #define HB_DIRECTION_IS_FORWARD(dir) ((((unsigned int) (dir)) & ~2U) == 0) | 115 #define HB_DIRECTION_IS_FORWARD(dir) ((((unsigned int) (dir)) & ~2U) == 0) |
90 #define HB_DIRECTION_IS_BACKWARD(dir) ((((unsigned int) (dir)) & ~2U) == 1) | 116 #define HB_DIRECTION_IS_BACKWARD(dir) ((((unsigned int) (dir)) & ~2U) == 1) |
91 #define HB_DIRECTION_REVERSE(dir) ((hb_direction_t) (((unsigned int) (dir)
) ^ 1)) | 117 #define HB_DIRECTION_REVERSE(dir) ((hb_direction_t) (((unsigned int) (dir)
) ^ 1)) |
92 | 118 |
93 | 119 |
94 typedef union _hb_var_int_t { | 120 /* hb_language_t */ |
95 uint32_t u32; | 121 |
96 int32_t i32; | 122 typedef struct _hb_language_t *hb_language_t; |
97 uint16_t u16[2]; | 123 |
98 int16_t i16[2]; | 124 /* len=-1 means s is NUL-terminated */ |
99 uint8_t u8[4]; | 125 hb_language_t |
100 int8_t i8[4]; | 126 hb_language_from_string (const char *str, int len); |
101 } hb_var_int_t; | 127 |
| 128 const char * |
| 129 hb_language_to_string (hb_language_t language); |
| 130 |
| 131 #define HB_LANGUAGE_INVALID ((hb_language_t) NULL) |
| 132 |
| 133 hb_language_t |
| 134 hb_language_get_default (void); |
| 135 |
| 136 |
| 137 /* hb_unicode_general_category_t */ |
| 138 |
| 139 typedef enum |
| 140 { |
| 141 HB_UNICODE_GENERAL_CATEGORY_CONTROL,» » » /* Cc */ |
| 142 HB_UNICODE_GENERAL_CATEGORY_FORMAT,» » » /* Cf */ |
| 143 HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED,» » /* Cn */ |
| 144 HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE,» » /* Co */ |
| 145 HB_UNICODE_GENERAL_CATEGORY_SURROGATE,» » /* Cs */ |
| 146 HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER,»» /* Ll */ |
| 147 HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER,» » /* Lm */ |
| 148 HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER,» » /* Lo */ |
| 149 HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER,»» /* Lt */ |
| 150 HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER,»» /* Lu */ |
| 151 HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK,» » /* Mc */ |
| 152 HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK,» » /* Me */ |
| 153 HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK,»» /* Mn */ |
| 154 HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER,» » /* Nd */ |
| 155 HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER,» » /* Nl */ |
| 156 HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER,» » /* No */ |
| 157 HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION,» /* Pc */ |
| 158 HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION,»» /* Pd */ |
| 159 HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION,» /* Pe */ |
| 160 HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION,» /* Pf */ |
| 161 HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION,» /* Pi */ |
| 162 HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION,» /* Po */ |
| 163 HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION,»» /* Ps */ |
| 164 HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL,» » /* Sc */ |
| 165 HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL,» » /* Sk */ |
| 166 HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL,» » /* Sm */ |
| 167 HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL,» » /* So */ |
| 168 HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR,» » /* Zl */ |
| 169 HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR,» /* Zp */ |
| 170 HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR» » /* Zs */ |
| 171 } hb_unicode_general_category_t; |
| 172 |
| 173 |
| 174 /* hb_script_t */ |
| 175 |
| 176 /* http://unicode.org/iso15924/ */ |
| 177 typedef enum |
| 178 { |
| 179 HB_SCRIPT_COMMON = HB_TAG ('Z','y','y','y'), |
| 180 HB_SCRIPT_INHERITED = HB_TAG ('Z','i','n','h'), |
| 181 HB_SCRIPT_ARABIC = HB_TAG ('A','r','a','b'), |
| 182 HB_SCRIPT_ARMENIAN = HB_TAG ('A','r','m','n'), |
| 183 HB_SCRIPT_BENGALI = HB_TAG ('B','e','n','g'), |
| 184 HB_SCRIPT_BOPOMOFO = HB_TAG ('B','o','p','o'), |
| 185 HB_SCRIPT_CHEROKEE = HB_TAG ('C','h','e','r'), |
| 186 HB_SCRIPT_COPTIC = HB_TAG ('C','o','p','t'), |
| 187 HB_SCRIPT_CYRILLIC = HB_TAG ('C','y','r','l'), |
| 188 HB_SCRIPT_DESERET = HB_TAG ('D','s','r','t'), |
| 189 HB_SCRIPT_DEVANAGARI = HB_TAG ('D','e','v','a'), |
| 190 HB_SCRIPT_ETHIOPIC = HB_TAG ('E','t','h','i'), |
| 191 HB_SCRIPT_GEORGIAN = HB_TAG ('G','e','o','r'), |
| 192 HB_SCRIPT_GOTHIC = HB_TAG ('G','o','t','h'), |
| 193 HB_SCRIPT_GREEK = HB_TAG ('G','r','e','k'), |
| 194 HB_SCRIPT_GUJARATI = HB_TAG ('G','u','j','r'), |
| 195 HB_SCRIPT_GURMUKHI = HB_TAG ('G','u','r','u'), |
| 196 HB_SCRIPT_HAN = HB_TAG ('H','a','n','i'), |
| 197 HB_SCRIPT_HANGUL = HB_TAG ('H','a','n','g'), |
| 198 HB_SCRIPT_HEBREW = HB_TAG ('H','e','b','r'), |
| 199 HB_SCRIPT_HIRAGANA = HB_TAG ('H','i','r','a'), |
| 200 HB_SCRIPT_KANNADA = HB_TAG ('K','n','d','a'), |
| 201 HB_SCRIPT_KATAKANA = HB_TAG ('K','a','n','a'), |
| 202 HB_SCRIPT_KHMER = HB_TAG ('K','h','m','r'), |
| 203 HB_SCRIPT_LAO = HB_TAG ('L','a','o','o'), |
| 204 HB_SCRIPT_LATIN = HB_TAG ('L','a','t','n'), |
| 205 HB_SCRIPT_MALAYALAM = HB_TAG ('M','l','y','m'), |
| 206 HB_SCRIPT_MONGOLIAN = HB_TAG ('M','o','n','g'), |
| 207 HB_SCRIPT_MYANMAR = HB_TAG ('M','y','m','r'), |
| 208 HB_SCRIPT_OGHAM = HB_TAG ('O','g','a','m'), |
| 209 HB_SCRIPT_OLD_ITALIC = HB_TAG ('I','t','a','l'), |
| 210 HB_SCRIPT_ORIYA = HB_TAG ('O','r','y','a'), |
| 211 HB_SCRIPT_RUNIC = HB_TAG ('R','u','n','r'), |
| 212 HB_SCRIPT_SINHALA = HB_TAG ('S','i','n','h'), |
| 213 HB_SCRIPT_SYRIAC = HB_TAG ('S','y','r','c'), |
| 214 HB_SCRIPT_TAMIL = HB_TAG ('T','a','m','l'), |
| 215 HB_SCRIPT_TELUGU = HB_TAG ('T','e','l','u'), |
| 216 HB_SCRIPT_THAANA = HB_TAG ('T','h','a','a'), |
| 217 HB_SCRIPT_THAI = HB_TAG ('T','h','a','i'), |
| 218 HB_SCRIPT_TIBETAN = HB_TAG ('T','i','b','t'), |
| 219 HB_SCRIPT_CANADIAN_ABORIGINAL = HB_TAG ('C','a','n','s'), |
| 220 HB_SCRIPT_YI = HB_TAG ('Y','i','i','i'), |
| 221 HB_SCRIPT_TAGALOG = HB_TAG ('T','g','l','g'), |
| 222 HB_SCRIPT_HANUNOO = HB_TAG ('H','a','n','o'), |
| 223 HB_SCRIPT_BUHID = HB_TAG ('B','u','h','d'), |
| 224 HB_SCRIPT_TAGBANWA = HB_TAG ('T','a','g','b'), |
| 225 |
| 226 /* Unicode-4.0 additions */ |
| 227 HB_SCRIPT_BRAILLE = HB_TAG ('B','r','a','i'), |
| 228 HB_SCRIPT_CYPRIOT = HB_TAG ('C','p','r','t'), |
| 229 HB_SCRIPT_LIMBU = HB_TAG ('L','i','m','b'), |
| 230 HB_SCRIPT_OSMANYA = HB_TAG ('O','s','m','a'), |
| 231 HB_SCRIPT_SHAVIAN = HB_TAG ('S','h','a','w'), |
| 232 HB_SCRIPT_LINEAR_B = HB_TAG ('L','i','n','b'), |
| 233 HB_SCRIPT_TAI_LE = HB_TAG ('T','a','l','e'), |
| 234 HB_SCRIPT_UGARITIC = HB_TAG ('U','g','a','r'), |
| 235 |
| 236 /* Unicode-4.1 additions */ |
| 237 HB_SCRIPT_NEW_TAI_LUE = HB_TAG ('T','a','l','u'), |
| 238 HB_SCRIPT_BUGINESE = HB_TAG ('B','u','g','i'), |
| 239 HB_SCRIPT_GLAGOLITIC = HB_TAG ('G','l','a','g'), |
| 240 HB_SCRIPT_TIFINAGH = HB_TAG ('T','f','n','g'), |
| 241 HB_SCRIPT_SYLOTI_NAGRI = HB_TAG ('S','y','l','o'), |
| 242 HB_SCRIPT_OLD_PERSIAN = HB_TAG ('X','p','e','o'), |
| 243 HB_SCRIPT_KHAROSHTHI = HB_TAG ('K','h','a','r'), |
| 244 |
| 245 /* Unicode-5.0 additions */ |
| 246 HB_SCRIPT_UNKNOWN = HB_TAG ('Z','z','z','z'), |
| 247 HB_SCRIPT_BALINESE = HB_TAG ('B','a','l','i'), |
| 248 HB_SCRIPT_CUNEIFORM = HB_TAG ('X','s','u','x'), |
| 249 HB_SCRIPT_PHOENICIAN = HB_TAG ('P','h','n','x'), |
| 250 HB_SCRIPT_PHAGS_PA = HB_TAG ('P','h','a','g'), |
| 251 HB_SCRIPT_NKO = HB_TAG ('N','k','o','o'), |
| 252 |
| 253 /* Unicode-5.1 additions */ |
| 254 HB_SCRIPT_KAYAH_LI = HB_TAG ('K','a','l','i'), |
| 255 HB_SCRIPT_LEPCHA = HB_TAG ('L','e','p','c'), |
| 256 HB_SCRIPT_REJANG = HB_TAG ('R','j','n','g'), |
| 257 HB_SCRIPT_SUNDANESE = HB_TAG ('S','u','n','d'), |
| 258 HB_SCRIPT_SAURASHTRA = HB_TAG ('S','a','u','r'), |
| 259 HB_SCRIPT_CHAM = HB_TAG ('C','h','a','m'), |
| 260 HB_SCRIPT_OL_CHIKI = HB_TAG ('O','l','c','k'), |
| 261 HB_SCRIPT_VAI = HB_TAG ('V','a','i','i'), |
| 262 HB_SCRIPT_CARIAN = HB_TAG ('C','a','r','i'), |
| 263 HB_SCRIPT_LYCIAN = HB_TAG ('L','y','c','i'), |
| 264 HB_SCRIPT_LYDIAN = HB_TAG ('L','y','d','i'), |
| 265 |
| 266 /* Unicode-5.2 additions */ |
| 267 HB_SCRIPT_AVESTAN = HB_TAG ('A','v','s','t'), |
| 268 HB_SCRIPT_BAMUM = HB_TAG ('B','a','m','u'), |
| 269 HB_SCRIPT_EGYPTIAN_HIEROGLYPHS = HB_TAG ('E','g','y','p'), |
| 270 HB_SCRIPT_IMPERIAL_ARAMAIC = HB_TAG ('A','r','m','i'), |
| 271 HB_SCRIPT_INSCRIPTIONAL_PAHLAVI = HB_TAG ('P','h','l','i'), |
| 272 HB_SCRIPT_INSCRIPTIONAL_PARTHIAN = HB_TAG ('P','r','t','i'), |
| 273 HB_SCRIPT_JAVANESE = HB_TAG ('J','a','v','a'), |
| 274 HB_SCRIPT_KAITHI = HB_TAG ('K','t','h','i'), |
| 275 HB_SCRIPT_LISU = HB_TAG ('L','i','s','u'), |
| 276 HB_SCRIPT_MEETEI_MAYEK = HB_TAG ('M','t','e','i'), |
| 277 HB_SCRIPT_OLD_SOUTH_ARABIAN = HB_TAG ('S','a','r','b'), |
| 278 HB_SCRIPT_OLD_TURKIC = HB_TAG ('O','r','k','h'), |
| 279 HB_SCRIPT_SAMARITAN = HB_TAG ('S','a','m','r'), |
| 280 HB_SCRIPT_TAI_THAM = HB_TAG ('L','a','n','a'), |
| 281 HB_SCRIPT_TAI_VIET = HB_TAG ('T','a','v','t'), |
| 282 |
| 283 /* Unicode-6.0 additions */ |
| 284 HB_SCRIPT_BATAK = HB_TAG ('B','a','t','k'), |
| 285 HB_SCRIPT_BRAHMI = HB_TAG ('B','r','a','h'), |
| 286 HB_SCRIPT_MANDAIC = HB_TAG ('M','a','n','d'), |
| 287 |
| 288 /* No script set */ |
| 289 HB_SCRIPT_INVALID = HB_TAG_NONE |
| 290 } hb_script_t; |
| 291 |
| 292 |
| 293 /* Script functions */ |
| 294 |
| 295 hb_script_t |
| 296 hb_script_from_iso15924_tag (hb_tag_t tag); |
| 297 |
| 298 /* suger for tag_from_string() then script_from_iso15924_tag */ |
| 299 /* len=-1 means s is NUL-terminated */ |
| 300 hb_script_t |
| 301 hb_script_from_string (const char *s, int len); |
| 302 |
| 303 hb_tag_t |
| 304 hb_script_to_iso15924_tag (hb_script_t script); |
| 305 |
| 306 hb_direction_t |
| 307 hb_script_get_horizontal_direction (hb_script_t script); |
| 308 |
| 309 |
| 310 /* User data */ |
| 311 |
| 312 typedef struct _hb_user_data_key_t { |
| 313 /*< private >*/ |
| 314 char unused; |
| 315 } hb_user_data_key_t; |
| 316 |
| 317 typedef void (*hb_destroy_func_t) (void *user_data); |
102 | 318 |
103 | 319 |
104 HB_END_DECLS | 320 HB_END_DECLS |
105 | 321 |
106 #endif /* HB_COMMON_H */ | 322 #endif /* HB_COMMON_H */ |
OLD | NEW |