1 | /* Pango |
2 | * pango-script.h: Script tag handling |
3 | * |
4 | * Copyright (C) 2002 Red Hat Software |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Library General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Library General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Library General Public |
17 | * License along with this library; if not, write to the |
18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | * Boston, MA 02111-1307, USA. |
20 | */ |
21 | |
22 | #ifndef __PANGO_SCRIPT_H__ |
23 | #define __PANGO_SCRIPT_H__ |
24 | |
25 | #include <glib.h> |
26 | |
27 | G_BEGIN_DECLS |
28 | |
29 | /** |
30 | * PangoScriptIter: |
31 | * |
32 | * A #PangoScriptIter is used to iterate through a string |
33 | * and identify ranges in different scripts. |
34 | **/ |
35 | typedef struct _PangoScriptIter PangoScriptIter; |
36 | |
37 | /** |
38 | * PangoScript: |
39 | * @PANGO_SCRIPT_INVALID_CODE: a value never returned from pango_script_for_unichar() |
40 | * @PANGO_SCRIPT_COMMON: a character used by multiple different scripts |
41 | * @PANGO_SCRIPT_INHERITED: a mark glyph that takes its script from the |
42 | * base glyph to which it is attached |
43 | * @PANGO_SCRIPT_ARABIC: Arabic |
44 | * @PANGO_SCRIPT_ARMENIAN: Armenian |
45 | * @PANGO_SCRIPT_BENGALI: Bengali |
46 | * @PANGO_SCRIPT_BOPOMOFO: Bopomofo |
47 | * @PANGO_SCRIPT_CHEROKEE: Cherokee |
48 | * @PANGO_SCRIPT_COPTIC: Coptic |
49 | * @PANGO_SCRIPT_CYRILLIC: Cyrillic |
50 | * @PANGO_SCRIPT_DESERET: Deseret |
51 | * @PANGO_SCRIPT_DEVANAGARI: Devanagari |
52 | * @PANGO_SCRIPT_ETHIOPIC: Ethiopic |
53 | * @PANGO_SCRIPT_GEORGIAN: Georgian |
54 | * @PANGO_SCRIPT_GOTHIC: Gothic |
55 | * @PANGO_SCRIPT_GREEK: Greek |
56 | * @PANGO_SCRIPT_GUJARATI: Gujarati |
57 | * @PANGO_SCRIPT_GURMUKHI: Gurmukhi |
58 | * @PANGO_SCRIPT_HAN: Han |
59 | * @PANGO_SCRIPT_HANGUL: Hangul |
60 | * @PANGO_SCRIPT_HEBREW: Hebrew |
61 | * @PANGO_SCRIPT_HIRAGANA: Hiragana |
62 | * @PANGO_SCRIPT_KANNADA: Kannada |
63 | * @PANGO_SCRIPT_KATAKANA: Katakana |
64 | * @PANGO_SCRIPT_KHMER: Khmer |
65 | * @PANGO_SCRIPT_LAO: Lao |
66 | * @PANGO_SCRIPT_LATIN: Latin |
67 | * @PANGO_SCRIPT_MALAYALAM: Malayalam |
68 | * @PANGO_SCRIPT_MONGOLIAN: Mongolian |
69 | * @PANGO_SCRIPT_MYANMAR: Myanmar |
70 | * @PANGO_SCRIPT_OGHAM: Ogham |
71 | * @PANGO_SCRIPT_OLD_ITALIC: Old Italic |
72 | * @PANGO_SCRIPT_ORIYA: Oriya |
73 | * @PANGO_SCRIPT_RUNIC: Runic |
74 | * @PANGO_SCRIPT_SINHALA: Sinhala |
75 | * @PANGO_SCRIPT_SYRIAC: Syriac |
76 | * @PANGO_SCRIPT_TAMIL: Tamil |
77 | * @PANGO_SCRIPT_TELUGU: Telugu |
78 | * @PANGO_SCRIPT_THAANA: Thaana |
79 | * @PANGO_SCRIPT_THAI: Thai |
80 | * @PANGO_SCRIPT_TIBETAN: Tibetan |
81 | * @PANGO_SCRIPT_CANADIAN_ABORIGINAL: Canadian Aboriginal |
82 | * @PANGO_SCRIPT_YI: Yi |
83 | * @PANGO_SCRIPT_TAGALOG: Tagalog |
84 | * @PANGO_SCRIPT_HANUNOO: Hanunoo |
85 | * @PANGO_SCRIPT_BUHID: Buhid |
86 | * @PANGO_SCRIPT_TAGBANWA: Tagbanwa |
87 | * @PANGO_SCRIPT_BRAILLE: Braille |
88 | * @PANGO_SCRIPT_CYPRIOT: Cypriot |
89 | * @PANGO_SCRIPT_LIMBU: Limbu |
90 | * @PANGO_SCRIPT_OSMANYA: Osmanya |
91 | * @PANGO_SCRIPT_SHAVIAN: Shavian |
92 | * @PANGO_SCRIPT_LINEAR_B: Linear B |
93 | * @PANGO_SCRIPT_TAI_LE: Tai Le |
94 | * @PANGO_SCRIPT_UGARITIC: Ugaritic |
95 | * @PANGO_SCRIPT_NEW_TAI_LUE: New Tai Lue. Since 1.10 |
96 | * @PANGO_SCRIPT_BUGINESE: Buginese. Since 1.10 |
97 | * @PANGO_SCRIPT_GLAGOLITIC: Glagolitic. Since 1.10 |
98 | * @PANGO_SCRIPT_TIFINAGH: Tifinagh. Since 1.10 |
99 | * @PANGO_SCRIPT_SYLOTI_NAGRI: Syloti Nagri. Since 1.10 |
100 | * @PANGO_SCRIPT_OLD_PERSIAN: Old Persian. Since 1.10 |
101 | * @PANGO_SCRIPT_KHAROSHTHI: Kharoshthi. Since 1.10 |
102 | * @PANGO_SCRIPT_UNKNOWN: an unassigned code point. Since 1.14 |
103 | * @PANGO_SCRIPT_BALINESE: Balinese. Since 1.14 |
104 | * @PANGO_SCRIPT_CUNEIFORM: Cuneiform. Since 1.14 |
105 | * @PANGO_SCRIPT_PHOENICIAN: Phoenician. Since 1.14 |
106 | * @PANGO_SCRIPT_PHAGS_PA: Phags-pa. Since 1.14 |
107 | * @PANGO_SCRIPT_NKO: N'Ko. Since 1.14 |
108 | * @PANGO_SCRIPT_KAYAH_LI: Kayah Li. Since 1.20.1 |
109 | * @PANGO_SCRIPT_LEPCHA: Lepcha. Since 1.20.1 |
110 | * @PANGO_SCRIPT_REJANG: Rejang. Since 1.20.1 |
111 | * @PANGO_SCRIPT_SUNDANESE: Sundanese. Since 1.20.1 |
112 | * @PANGO_SCRIPT_SAURASHTRA: Saurashtra. Since 1.20.1 |
113 | * @PANGO_SCRIPT_CHAM: Cham. Since 1.20.1 |
114 | * @PANGO_SCRIPT_OL_CHIKI: Ol Chiki. Since 1.20.1 |
115 | * @PANGO_SCRIPT_VAI: Vai. Since 1.20.1 |
116 | * @PANGO_SCRIPT_CARIAN: Carian. Since 1.20.1 |
117 | * @PANGO_SCRIPT_LYCIAN: Lycian. Since 1.20.1 |
118 | * @PANGO_SCRIPT_LYDIAN: Lydian. Since 1.20.1 |
119 | * @PANGO_SCRIPT_BATAK: Batak. Since 1.32 |
120 | * @PANGO_SCRIPT_BRAHMI: Brahmi. Since 1.32 |
121 | * @PANGO_SCRIPT_MANDAIC: Mandaic. Since 1.32 |
122 | * @PANGO_SCRIPT_CHAKMA: Chakma. Since: 1.32 |
123 | * @PANGO_SCRIPT_MEROITIC_CURSIVE: Meroitic Cursive. Since: 1.32 |
124 | * @PANGO_SCRIPT_MEROITIC_HIEROGLYPHS: Meroitic Hieroglyphs. Since: 1.32 |
125 | * @PANGO_SCRIPT_MIAO: Miao. Since: 1.32 |
126 | * @PANGO_SCRIPT_SHARADA: Sharada. Since: 1.32 |
127 | * @PANGO_SCRIPT_SORA_SOMPENG: Sora Sompeng. Since: 1.32 |
128 | * @PANGO_SCRIPT_TAKRI: Takri. Since: 1.32 |
129 | * @PANGO_SCRIPT_BASSA_VAH: Bassa. Since: 1.40 |
130 | * @PANGO_SCRIPT_CAUCASIAN_ALBANIAN: Caucasian Albanian. Since: 1.40 |
131 | * @PANGO_SCRIPT_DUPLOYAN: Duployan. Since: 1.40 |
132 | * @PANGO_SCRIPT_ELBASAN: Elbasan. Since: 1.40 |
133 | * @PANGO_SCRIPT_GRANTHA: Grantha. Since: 1.40 |
134 | * @PANGO_SCRIPT_KHOJKI: Kjohki. Since: 1.40 |
135 | * @PANGO_SCRIPT_KHUDAWADI: Khudawadi, Sindhi. Since: 1.40 |
136 | * @PANGO_SCRIPT_LINEAR_A: Linear A. Since: 1.40 |
137 | * @PANGO_SCRIPT_MAHAJANI: Mahajani. Since: 1.40 |
138 | * @PANGO_SCRIPT_MANICHAEAN: Manichaean. Since: 1.40 |
139 | * @PANGO_SCRIPT_MENDE_KIKAKUI: Mende Kikakui. Since: 1.40 |
140 | * @PANGO_SCRIPT_MODI: Modi. Since: 1.40 |
141 | * @PANGO_SCRIPT_MRO: Mro. Since: 1.40 |
142 | * @PANGO_SCRIPT_NABATAEAN: Nabataean. Since: 1.40 |
143 | * @PANGO_SCRIPT_OLD_NORTH_ARABIAN: Old North Arabian. Since: 1.40 |
144 | * @PANGO_SCRIPT_OLD_PERMIC: Old Permic. Since: 1.40 |
145 | * @PANGO_SCRIPT_PAHAWH_HMONG: Pahawh Hmong. Since: 1.40 |
146 | * @PANGO_SCRIPT_PALMYRENE: Palmyrene. Since: 1.40 |
147 | * @PANGO_SCRIPT_PAU_CIN_HAU: Pau Cin Hau. Since: 1.40 |
148 | * @PANGO_SCRIPT_PSALTER_PAHLAVI: Psalter Pahlavi. Since: 1.40 |
149 | * @PANGO_SCRIPT_SIDDHAM: Siddham. Since: 1.40 |
150 | * @PANGO_SCRIPT_TIRHUTA: Tirhuta. Since: 1.40 |
151 | * @PANGO_SCRIPT_WARANG_CITI: Warang Citi. Since: 1.40 |
152 | * @PANGO_SCRIPT_AHOM: Ahom. Since: 1.40 |
153 | * @PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS: Anatolian Hieroglyphs. Since: 1.40 |
154 | * @PANGO_SCRIPT_HATRAN: Hatran. Since: 1.40 |
155 | * @PANGO_SCRIPT_MULTANI: Multani. Since: 1.40 |
156 | * @PANGO_SCRIPT_OLD_HUNGARIAN: Old Hungarian. Since: 1.40 |
157 | * @PANGO_SCRIPT_SIGNWRITING: Signwriting. Since: 1.40 |
158 | * |
159 | * The #PangoScript enumeration identifies different writing |
160 | * systems. The values correspond to the names as defined in the |
161 | * Unicode standard. |
162 | * Note that new types may be added in the future. Applications should be ready |
163 | * to handle unknown values. This enumeration is interchangeable with |
164 | * #GUnicodeScript. See <ulink |
165 | * url="http://www.unicode.org/reports/tr24/">Unicode Standard Annex |
166 | * #24: Script names</ulink>. |
167 | */ |
168 | typedef enum { /* ISO 15924 code */ |
169 | PANGO_SCRIPT_INVALID_CODE = -1, |
170 | PANGO_SCRIPT_COMMON = 0, /* Zyyy */ |
171 | PANGO_SCRIPT_INHERITED, /* Qaai */ |
172 | PANGO_SCRIPT_ARABIC, /* Arab */ |
173 | PANGO_SCRIPT_ARMENIAN, /* Armn */ |
174 | PANGO_SCRIPT_BENGALI, /* Beng */ |
175 | PANGO_SCRIPT_BOPOMOFO, /* Bopo */ |
176 | PANGO_SCRIPT_CHEROKEE, /* Cher */ |
177 | PANGO_SCRIPT_COPTIC, /* Qaac */ |
178 | PANGO_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */ |
179 | PANGO_SCRIPT_DESERET, /* Dsrt */ |
180 | PANGO_SCRIPT_DEVANAGARI, /* Deva */ |
181 | PANGO_SCRIPT_ETHIOPIC, /* Ethi */ |
182 | PANGO_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */ |
183 | PANGO_SCRIPT_GOTHIC, /* Goth */ |
184 | PANGO_SCRIPT_GREEK, /* Grek */ |
185 | PANGO_SCRIPT_GUJARATI, /* Gujr */ |
186 | PANGO_SCRIPT_GURMUKHI, /* Guru */ |
187 | PANGO_SCRIPT_HAN, /* Hani */ |
188 | PANGO_SCRIPT_HANGUL, /* Hang */ |
189 | PANGO_SCRIPT_HEBREW, /* Hebr */ |
190 | PANGO_SCRIPT_HIRAGANA, /* Hira */ |
191 | PANGO_SCRIPT_KANNADA, /* Knda */ |
192 | PANGO_SCRIPT_KATAKANA, /* Kana */ |
193 | PANGO_SCRIPT_KHMER, /* Khmr */ |
194 | PANGO_SCRIPT_LAO, /* Laoo */ |
195 | PANGO_SCRIPT_LATIN, /* Latn (Latf, Latg) */ |
196 | PANGO_SCRIPT_MALAYALAM, /* Mlym */ |
197 | PANGO_SCRIPT_MONGOLIAN, /* Mong */ |
198 | PANGO_SCRIPT_MYANMAR, /* Mymr */ |
199 | PANGO_SCRIPT_OGHAM, /* Ogam */ |
200 | PANGO_SCRIPT_OLD_ITALIC, /* Ital */ |
201 | PANGO_SCRIPT_ORIYA, /* Orya */ |
202 | PANGO_SCRIPT_RUNIC, /* Runr */ |
203 | PANGO_SCRIPT_SINHALA, /* Sinh */ |
204 | PANGO_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */ |
205 | PANGO_SCRIPT_TAMIL, /* Taml */ |
206 | PANGO_SCRIPT_TELUGU, /* Telu */ |
207 | PANGO_SCRIPT_THAANA, /* Thaa */ |
208 | PANGO_SCRIPT_THAI, /* Thai */ |
209 | PANGO_SCRIPT_TIBETAN, /* Tibt */ |
210 | PANGO_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */ |
211 | PANGO_SCRIPT_YI, /* Yiii */ |
212 | PANGO_SCRIPT_TAGALOG, /* Tglg */ |
213 | PANGO_SCRIPT_HANUNOO, /* Hano */ |
214 | PANGO_SCRIPT_BUHID, /* Buhd */ |
215 | PANGO_SCRIPT_TAGBANWA, /* Tagb */ |
216 | |
217 | /* Unicode-4.0 additions */ |
218 | PANGO_SCRIPT_BRAILLE, /* Brai */ |
219 | PANGO_SCRIPT_CYPRIOT, /* Cprt */ |
220 | PANGO_SCRIPT_LIMBU, /* Limb */ |
221 | PANGO_SCRIPT_OSMANYA, /* Osma */ |
222 | PANGO_SCRIPT_SHAVIAN, /* Shaw */ |
223 | PANGO_SCRIPT_LINEAR_B, /* Linb */ |
224 | PANGO_SCRIPT_TAI_LE, /* Tale */ |
225 | PANGO_SCRIPT_UGARITIC, /* Ugar */ |
226 | |
227 | /* Unicode-4.1 additions */ |
228 | PANGO_SCRIPT_NEW_TAI_LUE, /* Talu */ |
229 | PANGO_SCRIPT_BUGINESE, /* Bugi */ |
230 | PANGO_SCRIPT_GLAGOLITIC, /* Glag */ |
231 | PANGO_SCRIPT_TIFINAGH, /* Tfng */ |
232 | PANGO_SCRIPT_SYLOTI_NAGRI, /* Sylo */ |
233 | PANGO_SCRIPT_OLD_PERSIAN, /* Xpeo */ |
234 | PANGO_SCRIPT_KHAROSHTHI, /* Khar */ |
235 | |
236 | /* Unicode-5.0 additions */ |
237 | PANGO_SCRIPT_UNKNOWN, /* Zzzz */ |
238 | PANGO_SCRIPT_BALINESE, /* Bali */ |
239 | PANGO_SCRIPT_CUNEIFORM, /* Xsux */ |
240 | PANGO_SCRIPT_PHOENICIAN, /* Phnx */ |
241 | PANGO_SCRIPT_PHAGS_PA, /* Phag */ |
242 | PANGO_SCRIPT_NKO, /* Nkoo */ |
243 | |
244 | /* Unicode-5.1 additions */ |
245 | PANGO_SCRIPT_KAYAH_LI, /* Kali */ |
246 | PANGO_SCRIPT_LEPCHA, /* Lepc */ |
247 | PANGO_SCRIPT_REJANG, /* Rjng */ |
248 | PANGO_SCRIPT_SUNDANESE, /* Sund */ |
249 | PANGO_SCRIPT_SAURASHTRA, /* Saur */ |
250 | PANGO_SCRIPT_CHAM, /* Cham */ |
251 | PANGO_SCRIPT_OL_CHIKI, /* Olck */ |
252 | PANGO_SCRIPT_VAI, /* Vaii */ |
253 | PANGO_SCRIPT_CARIAN, /* Cari */ |
254 | PANGO_SCRIPT_LYCIAN, /* Lyci */ |
255 | PANGO_SCRIPT_LYDIAN, /* Lydi */ |
256 | |
257 | /* Unicode-6.0 additions */ |
258 | PANGO_SCRIPT_BATAK, /* Batk */ |
259 | PANGO_SCRIPT_BRAHMI, /* Brah */ |
260 | PANGO_SCRIPT_MANDAIC, /* Mand */ |
261 | |
262 | /* Unicode-6.1 additions */ |
263 | PANGO_SCRIPT_CHAKMA, /* Cakm */ |
264 | PANGO_SCRIPT_MEROITIC_CURSIVE, /* Merc */ |
265 | PANGO_SCRIPT_MEROITIC_HIEROGLYPHS,/* Mero */ |
266 | PANGO_SCRIPT_MIAO, /* Plrd */ |
267 | PANGO_SCRIPT_SHARADA, /* Shrd */ |
268 | PANGO_SCRIPT_SORA_SOMPENG, /* Sora */ |
269 | PANGO_SCRIPT_TAKRI, /* Takr */ |
270 | |
271 | /* Unicode 7.0 additions */ |
272 | PANGO_SCRIPT_BASSA_VAH, /* Bass */ |
273 | PANGO_SCRIPT_CAUCASIAN_ALBANIAN, /* Aghb */ |
274 | PANGO_SCRIPT_DUPLOYAN, /* Dupl */ |
275 | PANGO_SCRIPT_ELBASAN, /* Elba */ |
276 | PANGO_SCRIPT_GRANTHA, /* Gran */ |
277 | PANGO_SCRIPT_KHOJKI, /* Khoj */ |
278 | PANGO_SCRIPT_KHUDAWADI, /* Sind */ |
279 | PANGO_SCRIPT_LINEAR_A, /* Lina */ |
280 | PANGO_SCRIPT_MAHAJANI, /* Mahj */ |
281 | PANGO_SCRIPT_MANICHAEAN, /* Manu */ |
282 | PANGO_SCRIPT_MENDE_KIKAKUI, /* Mend */ |
283 | PANGO_SCRIPT_MODI, /* Modi */ |
284 | PANGO_SCRIPT_MRO, /* Mroo */ |
285 | PANGO_SCRIPT_NABATAEAN, /* Nbat */ |
286 | PANGO_SCRIPT_OLD_NORTH_ARABIAN, /* Narb */ |
287 | PANGO_SCRIPT_OLD_PERMIC, /* Perm */ |
288 | PANGO_SCRIPT_PAHAWH_HMONG, /* Hmng */ |
289 | PANGO_SCRIPT_PALMYRENE, /* Palm */ |
290 | PANGO_SCRIPT_PAU_CIN_HAU, /* Pauc */ |
291 | PANGO_SCRIPT_PSALTER_PAHLAVI, /* Phlp */ |
292 | PANGO_SCRIPT_SIDDHAM, /* Sidd */ |
293 | PANGO_SCRIPT_TIRHUTA, /* Tirh */ |
294 | PANGO_SCRIPT_WARANG_CITI, /* Wara */ |
295 | |
296 | /* Unicode 8.0 additions */ |
297 | PANGO_SCRIPT_AHOM, /* Ahom */ |
298 | PANGO_SCRIPT_ANATOLIAN_HIEROGLYPHS, /* Hluw */ |
299 | PANGO_SCRIPT_HATRAN, /* Hatr */ |
300 | PANGO_SCRIPT_MULTANI, /* Mult */ |
301 | PANGO_SCRIPT_OLD_HUNGARIAN, /* Hung */ |
302 | PANGO_SCRIPT_SIGNWRITING /* Sgnw */ |
303 | } PangoScript; |
304 | |
305 | #include <pango/pango-version-macros.h> |
306 | |
307 | PANGO_AVAILABLE_IN_1_4 |
308 | PangoScript pango_script_for_unichar (gunichar ch) G_GNUC_CONST; |
309 | |
310 | PANGO_AVAILABLE_IN_1_4 |
311 | PangoScriptIter *pango_script_iter_new (const char *text, |
312 | int length); |
313 | PANGO_AVAILABLE_IN_1_4 |
314 | void pango_script_iter_get_range (PangoScriptIter *iter, |
315 | const char **start, |
316 | const char **end, |
317 | PangoScript *script); |
318 | PANGO_AVAILABLE_IN_1_4 |
319 | gboolean pango_script_iter_next (PangoScriptIter *iter); |
320 | PANGO_AVAILABLE_IN_1_4 |
321 | void pango_script_iter_free (PangoScriptIter *iter); |
322 | |
323 | #include <pango/pango-language.h> |
324 | |
325 | PANGO_AVAILABLE_IN_1_4 |
326 | PangoLanguage *pango_script_get_sample_language (PangoScript script) G_GNUC_PURE; |
327 | |
328 | G_END_DECLS |
329 | |
330 | #endif /* __PANGO_SCRIPT_H__ */ |
331 | |