ICU 52.1  52.1
uscript.h
Go to the documentation of this file.
1 /*
2  **********************************************************************
3  * Copyright (C) 1997-2013, International Business Machines
4  * Corporation and others. All Rights Reserved.
5  **********************************************************************
6  *
7  * File USCRIPT.H
8  *
9  * Modification History:
10  *
11  * Date Name Description
12  * 07/06/2001 Ram Creation.
13  ******************************************************************************
14  */
15 
16 #ifndef USCRIPT_H
17 #define USCRIPT_H
18 #include "unicode/utypes.h"
19 
46 typedef enum UScriptCode {
47  /*
48  * Note: UScriptCode constants and their ISO script code comments
49  * are parsed by preparseucd.py.
50  * It matches lines like
51  * USCRIPT_<Unicode Script value name> = <integer>, / * <ISO script code> * /
52  */
53 
57  USCRIPT_COMMON = 0, /* Zyyy */
59  USCRIPT_INHERITED = 1, /* Zinh */ /* "Code for inherited script", for non-spacing combining marks; also Qaai */
61  USCRIPT_ARABIC = 2, /* Arab */
63  USCRIPT_ARMENIAN = 3, /* Armn */
65  USCRIPT_BENGALI = 4, /* Beng */
67  USCRIPT_BOPOMOFO = 5, /* Bopo */
69  USCRIPT_CHEROKEE = 6, /* Cher */
71  USCRIPT_COPTIC = 7, /* Copt */
73  USCRIPT_CYRILLIC = 8, /* Cyrl */
75  USCRIPT_DESERET = 9, /* Dsrt */
77  USCRIPT_DEVANAGARI = 10, /* Deva */
79  USCRIPT_ETHIOPIC = 11, /* Ethi */
81  USCRIPT_GEORGIAN = 12, /* Geor */
83  USCRIPT_GOTHIC = 13, /* Goth */
85  USCRIPT_GREEK = 14, /* Grek */
87  USCRIPT_GUJARATI = 15, /* Gujr */
89  USCRIPT_GURMUKHI = 16, /* Guru */
91  USCRIPT_HAN = 17, /* Hani */
93  USCRIPT_HANGUL = 18, /* Hang */
95  USCRIPT_HEBREW = 19, /* Hebr */
97  USCRIPT_HIRAGANA = 20, /* Hira */
99  USCRIPT_KANNADA = 21, /* Knda */
101  USCRIPT_KATAKANA = 22, /* Kana */
103  USCRIPT_KHMER = 23, /* Khmr */
105  USCRIPT_LAO = 24, /* Laoo */
107  USCRIPT_LATIN = 25, /* Latn */
109  USCRIPT_MALAYALAM = 26, /* Mlym */
111  USCRIPT_MONGOLIAN = 27, /* Mong */
113  USCRIPT_MYANMAR = 28, /* Mymr */
115  USCRIPT_OGHAM = 29, /* Ogam */
117  USCRIPT_OLD_ITALIC = 30, /* Ital */
119  USCRIPT_ORIYA = 31, /* Orya */
121  USCRIPT_RUNIC = 32, /* Runr */
123  USCRIPT_SINHALA = 33, /* Sinh */
125  USCRIPT_SYRIAC = 34, /* Syrc */
127  USCRIPT_TAMIL = 35, /* Taml */
129  USCRIPT_TELUGU = 36, /* Telu */
131  USCRIPT_THAANA = 37, /* Thaa */
133  USCRIPT_THAI = 38, /* Thai */
135  USCRIPT_TIBETAN = 39, /* Tibt */
141  USCRIPT_YI = 41, /* Yiii */
142  /* New scripts in Unicode 3.2 */
144  USCRIPT_TAGALOG = 42, /* Tglg */
146  USCRIPT_HANUNOO = 43, /* Hano */
148  USCRIPT_BUHID = 44, /* Buhd */
150  USCRIPT_TAGBANWA = 45, /* Tagb */
151 
152  /* New scripts in Unicode 4 */
154  USCRIPT_BRAILLE = 46, /* Brai */
156  USCRIPT_CYPRIOT = 47, /* Cprt */
158  USCRIPT_LIMBU = 48, /* Limb */
160  USCRIPT_LINEAR_B = 49, /* Linb */
162  USCRIPT_OSMANYA = 50, /* Osma */
164  USCRIPT_SHAVIAN = 51, /* Shaw */
166  USCRIPT_TAI_LE = 52, /* Tale */
168  USCRIPT_UGARITIC = 53, /* Ugar */
169 
172 
173  /* New scripts in Unicode 4.1 */
175  USCRIPT_BUGINESE = 55, /* Bugi */
177  USCRIPT_GLAGOLITIC = 56, /* Glag */
179  USCRIPT_KHAROSHTHI = 57, /* Khar */
181  USCRIPT_SYLOTI_NAGRI = 58, /* Sylo */
183  USCRIPT_NEW_TAI_LUE = 59, /* Talu */
185  USCRIPT_TIFINAGH = 60, /* Tfng */
187  USCRIPT_OLD_PERSIAN = 61, /* Xpeo */
188 
189  /* New script codes from ISO 15924 */
191  USCRIPT_BALINESE = 62, /* Bali */
193  USCRIPT_BATAK = 63, /* Batk */
195  USCRIPT_BLISSYMBOLS = 64, /* Blis */
197  USCRIPT_BRAHMI = 65, /* Brah */
199  USCRIPT_CHAM = 66, /* Cham */
201  USCRIPT_CIRTH = 67, /* Cirt */
205  USCRIPT_DEMOTIC_EGYPTIAN = 69, /* Egyd */
207  USCRIPT_HIERATIC_EGYPTIAN = 70, /* Egyh */
211  USCRIPT_KHUTSURI = 72, /* Geok */
213  USCRIPT_SIMPLIFIED_HAN = 73, /* Hans */
215  USCRIPT_TRADITIONAL_HAN = 74, /* Hant */
217  USCRIPT_PAHAWH_HMONG = 75, /* Hmng */
219  USCRIPT_OLD_HUNGARIAN = 76, /* Hung */
221  USCRIPT_HARAPPAN_INDUS = 77, /* Inds */
223  USCRIPT_JAVANESE = 78, /* Java */
225  USCRIPT_KAYAH_LI = 79, /* Kali */
227  USCRIPT_LATIN_FRAKTUR = 80, /* Latf */
229  USCRIPT_LATIN_GAELIC = 81, /* Latg */
231  USCRIPT_LEPCHA = 82, /* Lepc */
233  USCRIPT_LINEAR_A = 83, /* Lina */
235  USCRIPT_MANDAIC = 84, /* Mand */
239  USCRIPT_MAYAN_HIEROGLYPHS = 85, /* Maya */
245  USCRIPT_NKO = 87, /* Nkoo */
247  USCRIPT_ORKHON = 88, /* Orkh */
249  USCRIPT_OLD_PERMIC = 89, /* Perm */
251  USCRIPT_PHAGS_PA = 90, /* Phag */
253  USCRIPT_PHOENICIAN = 91, /* Phnx */
255  USCRIPT_MIAO = 92, /* Plrd */
259  USCRIPT_RONGORONGO = 93, /* Roro */
261  USCRIPT_SARATI = 94, /* Sara */
263  USCRIPT_ESTRANGELO_SYRIAC = 95, /* Syre */
265  USCRIPT_WESTERN_SYRIAC = 96, /* Syrj */
267  USCRIPT_EASTERN_SYRIAC = 97, /* Syrn */
269  USCRIPT_TENGWAR = 98, /* Teng */
271  USCRIPT_VAI = 99, /* Vaii */
273  USCRIPT_VISIBLE_SPEECH = 100,/* Visp */
275  USCRIPT_CUNEIFORM = 101,/* Xsux */
279  USCRIPT_UNKNOWN = 103,/* Zzzz */ /* Unknown="Code for uncoded script", for unassigned code points */
280 
281  /* New script codes from ISO 15924 */
283  USCRIPT_CARIAN = 104,/* Cari */
285  USCRIPT_JAPANESE = 105,/* Jpan */
287  USCRIPT_LANNA = 106,/* Lana */
289  USCRIPT_LYCIAN = 107,/* Lyci */
291  USCRIPT_LYDIAN = 108,/* Lydi */
293  USCRIPT_OL_CHIKI = 109,/* Olck */
295  USCRIPT_REJANG = 110,/* Rjng */
297  USCRIPT_SAURASHTRA = 111,/* Saur */
299  USCRIPT_SIGN_WRITING = 112,/* Sgnw */
301  USCRIPT_SUNDANESE = 113,/* Sund */
303  USCRIPT_MOON = 114,/* Moon */
305  USCRIPT_MEITEI_MAYEK = 115,/* Mtei */
306 
307  /* New script codes from ISO 15924 */
309  USCRIPT_IMPERIAL_ARAMAIC = 116,/* Armi */
311  USCRIPT_AVESTAN = 117,/* Avst */
313  USCRIPT_CHAKMA = 118,/* Cakm */
315  USCRIPT_KOREAN = 119,/* Kore */
317  USCRIPT_KAITHI = 120,/* Kthi */
319  USCRIPT_MANICHAEAN = 121,/* Mani */
323  USCRIPT_PSALTER_PAHLAVI = 123,/* Phlp */
325  USCRIPT_BOOK_PAHLAVI = 124,/* Phlv */
329  USCRIPT_SAMARITAN = 126,/* Samr */
331  USCRIPT_TAI_VIET = 127,/* Tavt */
335  USCRIPT_SYMBOLS = 129,/* Zsym */
336 
337  /* New script codes from ISO 15924 */
339  USCRIPT_BAMUM = 130,/* Bamu */
341  USCRIPT_LISU = 131,/* Lisu */
343  USCRIPT_NAKHI_GEBA = 132,/* Nkgb */
345  USCRIPT_OLD_SOUTH_ARABIAN = 133,/* Sarb */
346 
347  /* New script codes from ISO 15924 */
349  USCRIPT_BASSA_VAH = 134,/* Bass */
351  USCRIPT_DUPLOYAN_SHORTAND = 135,/* Dupl */
353  USCRIPT_ELBASAN = 136,/* Elba */
355  USCRIPT_GRANTHA = 137,/* Gran */
357  USCRIPT_KPELLE = 138,/* Kpel */
359  USCRIPT_LOMA = 139,/* Loma */
361  USCRIPT_MENDE = 140,/* Mend */
363  USCRIPT_MEROITIC_CURSIVE = 141,/* Merc */
365  USCRIPT_OLD_NORTH_ARABIAN = 142,/* Narb */
367  USCRIPT_NABATAEAN = 143,/* Nbat */
369  USCRIPT_PALMYRENE = 144,/* Palm */
371  USCRIPT_SINDHI = 145,/* Sind */
373  USCRIPT_WARANG_CITI = 146,/* Wara */
374 
376  USCRIPT_AFAKA = 147,/* Afak */
378  USCRIPT_JURCHEN = 148,/* Jurc */
380  USCRIPT_MRO = 149,/* Mroo */
382  USCRIPT_NUSHU = 150,/* Nshu */
384  USCRIPT_SHARADA = 151,/* Shrd */
386  USCRIPT_SORA_SOMPENG = 152,/* Sora */
388  USCRIPT_TAKRI = 153,/* Takr */
390  USCRIPT_TANGUT = 154,/* Tang */
392  USCRIPT_WOLEAI = 155,/* Wole */
393 
397  USCRIPT_KHOJKI = 157,/* Khoj */
399  USCRIPT_TIRHUTA = 158,/* Tirh */
400 
402  USCRIPT_CAUCASIAN_ALBANIAN = 159,/* Aghb */
404  USCRIPT_MAHAJANI = 160,/* Mahj */
405 
406  /* Private use codes from Qaaa - Qabx are not supported */
407 
410 } UScriptCode;
411 
430 U_STABLE int32_t U_EXPORT2
431 uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err);
432 
441 U_STABLE const char* U_EXPORT2
442 uscript_getName(UScriptCode scriptCode);
443 
452 U_STABLE const char* U_EXPORT2
454 
463 U_STABLE UScriptCode U_EXPORT2
464 uscript_getScript(UChar32 codepoint, UErrorCode *err);
465 
481 U_STABLE UBool U_EXPORT2
483 
515 U_STABLE int32_t U_EXPORT2
517  UScriptCode *scripts, int32_t capacity,
518  UErrorCode *errorCode);
519 
520 #ifndef U_HIDE_DRAFT_API
521 
529 typedef enum UScriptUsage {
542 } UScriptUsage;
543 
556 U_DRAFT int32_t U_EXPORT2
557 uscript_getSampleString(UScriptCode script, UChar *dest, int32_t capacity, UErrorCode *pErrorCode);
558 
559 #if U_SHOW_CPLUSPLUS_API
560 
562 class UnicodeString;
564 
576 
577 #endif
578 
588 U_DRAFT UScriptUsage U_EXPORT2
590 
599 U_DRAFT UBool U_EXPORT2
601 
611 U_DRAFT UBool U_EXPORT2
613 
622 U_DRAFT UBool U_EXPORT2
624 
625 #endif /* U_HIDE_DRAFT_API */
626 
627 #endif
UScriptCode uscript_getScript(UChar32 codepoint, UErrorCode *err)
Gets the script code associated with the given codepoint.
Canadian_Aboriginal script.
Definition: uscript.h:137
Aspirational Use script.
Definition: uscript.h:539
New script code in Unicode 4.0.1.
Definition: uscript.h:171
Candidate for Exclusion from Identifiers.
Definition: uscript.h:535
const char * uscript_getName(UScriptCode scriptCode)
Gets a script name associated with the given script code.
int32_t uscript_getSampleString(UScriptCode script, UChar *dest, int32_t capacity, UErrorCode *pErrorCode)
Writes the script sample character string.
UBool uscript_isCased(UScriptCode script)
Returns TRUE if in modern (or most recent) usage of the script case distinctions are customary...
UScriptCode
Constants for ISO 15924 script codes.
Definition: uscript.h:46
UBool uscript_isRightToLeft(UScriptCode script)
Returns TRUE if the script is written right-to-left.
UScriptUsage uscript_getUsage(UScriptCode script)
Returns the script usage according to UAX #31 Unicode Identifier and Pattern Syntax.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
int32_t uscript_getScriptExtensions(UChar32 c, UScriptCode *scripts, int32_t capacity, UErrorCode *errorCode)
Writes code point c's Script_Extensions as a list of UScriptCode values to the output scripts array a...
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:298
Unknown script usage.
Definition: uscript.h:533
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:278
UBool uscript_breaksBetweenLetters(UScriptCode script)
Returns TRUE if the script allows line breaks between letters (excluding hyphenation).
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
Canadian_Aboriginal script (alias).
Definition: uscript.h:139
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
UScriptUsage
Script usage constants.
Definition: uscript.h:529
Not encoded in Unicode.
Definition: uscript.h:531
Recommended script.
Definition: uscript.h:541
Basic definitions for ICU, for both C and C++ APIs.
Limited Use script.
Definition: uscript.h:537
const char * uscript_getShortName(UScriptCode scriptCode)
Gets a script name associated with the given script code.
int32_t uscript_getCode(const char *nameOrAbbrOrLocale, UScriptCode *fillIn, int32_t capacity, UErrorCode *err)
Gets script codes associated with the given locale or ISO 15924 abbreviation or name.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside...
Definition: utypes.h:357
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:245
UBool uscript_hasScript(UChar32 c, UScriptCode sc)
Do the Script_Extensions of code point c contain script sc? If c does not have explicit Script_Extens...
#define U_DRAFT
This is used to declare a function as a draft public ICU C API.
Definition: umachine.h:111
U_COMMON_API icu::UnicodeString uscript_getSampleUnicodeString(UScriptCode script)
Returns the script sample character string.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
int8_t UBool
The ICU boolean type.
Definition: umachine.h:200