5d8431c4056cc44e07dc8f95a8a9744714ab984f
[profile/ivi/org.tizen.video-player.git] / src / hb-unicode.h
1 /*
2  * Copyright (C) 2009  Red Hat, Inc.
3  *
4  *  This is part of HarfBuzz, an OpenType Layout engine library.
5  *
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.
11  *
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
16  * DAMAGE.
17  *
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.
23  *
24  * Red Hat Author(s): Behdad Esfahbod
25  */
26
27 #ifndef HB_UNICODE_H
28 #define HB_UNICODE_H
29
30 #include "hb-common.h"
31
32 HB_BEGIN_DECLS
33
34 /* Unicode General Category property */
35 typedef enum
36 {
37   HB_CATEGORY_CONTROL,
38   HB_CATEGORY_FORMAT,
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
67 } hb_category_t;
68
69 /* Unicode Script property */
70 typedef enum
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 */
119
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 */
129
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 */
138
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 */
146
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 */
159 } hb_script_t;
160
161
162 /*
163  * hb_unicode_funcs_t
164  */
165
166 typedef struct _hb_unicode_funcs_t hb_unicode_funcs_t;
167
168 hb_unicode_funcs_t *
169 hb_unicode_funcs_create (void);
170
171 hb_unicode_funcs_t *
172 hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs);
173
174 unsigned int
175 hb_unicode_funcs_get_reference_count (hb_unicode_funcs_t *ufuncs);
176
177 void
178 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs);
179
180 hb_unicode_funcs_t *
181 hb_unicode_funcs_copy (hb_unicode_funcs_t *ufuncs);
182
183
184
185 /* funcs */
186
187 typedef hb_codepoint_t (*hb_unicode_get_mirroring_char_func_t) (hb_codepoint_t unicode);
188 typedef hb_category_t (*hb_unicode_get_general_category_func_t) (hb_codepoint_t unicode);
189 typedef hb_script_t (*hb_unicode_get_script_func_t) (hb_codepoint_t unicode);
190 typedef unsigned int (*hb_unicode_get_combining_class_func_t) (hb_codepoint_t unicode);
191 typedef unsigned int (*hb_unicode_get_eastasian_width_func_t) (hb_codepoint_t unicode);
192
193
194 void
195 hb_unicode_funcs_set_mirroring_char_func (hb_unicode_funcs_t *ufuncs,
196                                           hb_unicode_get_mirroring_char_func_t mirroring_char_func);
197
198 void
199 hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
200                                             hb_unicode_get_general_category_func_t general_category_func);
201
202 void
203 hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
204                                   hb_unicode_get_script_func_t script_func);
205
206 void
207 hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
208                                            hb_unicode_get_combining_class_func_t combining_class_func);
209
210 void
211 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
212                                            hb_unicode_get_eastasian_width_func_t eastasian_width_func);
213
214
215 HB_END_DECLS
216
217 #endif /* HB_FONT_H */