hb-common.h revision 39a840ae65327b173e6eb1bb291e235a8305d7a1
164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod/*
22409d5f8d7dd8b535ce5ea29e933f7db27d33793Behdad Esfahbod * Copyright © 2007,2008,2009  Red Hat, Inc.
32409d5f8d7dd8b535ce5ea29e933f7db27d33793Behdad Esfahbod * Copyright © 2011  Google, Inc.
464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
5c755cb3e3ac55156d0d2ec05adea7a650b97cc41Behdad Esfahbod *  This is part of HarfBuzz, a text shaping library.
664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
764aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Permission is hereby granted, without written agreement and without
864aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this
964aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * software and its documentation for any purpose, provided that the
1064aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * above copyright notice and the following two paragraphs appear in
1164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * all copies of this software.
1264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
1364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
1464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
1564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
1664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
1764aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * DAMAGE.
1864aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
1964aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
2064aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
2164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
2264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
2364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
2464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod *
2564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Red Hat Author(s): Behdad Esfahbod
262409d5f8d7dd8b535ce5ea29e933f7db27d33793Behdad Esfahbod * Google Author(s): Behdad Esfahbod
2764aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod */
2864aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod
298dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#ifndef HB_COMMON_H
308dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#define HB_COMMON_H
318dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod
32acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod# ifdef __cplusplus
33acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod#  define HB_BEGIN_DECLS	extern "C" {
34acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod#  define HB_END_DECLS		}
35acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod# else /* !__cplusplus */
36acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod#  define HB_BEGIN_DECLS
37acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod#  define HB_END_DECLS
38acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod# endif /* !__cplusplus */
39acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod
40acdba3f90b232fc12fcb200dca2584481b339118Behdad EsfahbodHB_BEGIN_DECLS
41acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod
42acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod
43cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#ifdef _MSC_VER
44cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef signed char int8_t;
45cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef unsigned char uint8_t;
46cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef signed short int16_t;
47cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef unsigned short uint16_t;
48cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef signed int int32_t;
49cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbodtypedef unsigned int uint32_t;
50ffbe0a853d5e7defa85d0eef53814c22d1ecb412Behdad Esfahbodtypedef signed long long int64_t;
51ffbe0a853d5e7defa85d0eef53814c22d1ecb412Behdad Esfahbodtypedef unsigned long long uint64_t;
52cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#else
538dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#include <stdint.h>
54cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#endif
558dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod
56590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef int hb_bool_t;
57590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod
588e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef uint32_t hb_codepoint_t;
598e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef int32_t hb_position_t;
608e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef uint32_t hb_mask_t;
618e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
628e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef union _hb_var_int_t {
638e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod  uint32_t u32;
648e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod  int32_t i32;
658e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod  uint16_t u16[2];
668e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod  int16_t i16[2];
678e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod  uint8_t u8[4];
688e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod  int8_t i8[4];
698e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod} hb_var_int_t;
708e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
718e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef void (*hb_destroy_func_t) (void *user_data);
728e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
738e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
748e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod/* hb_tag_t */
758e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
76590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef uint32_t hb_tag_t;
778e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
78d77b76200efbaa0611691920f9f2018b1e8be340Behdad Esfahbod#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))))
794188096a7722f09ffa9319986c0286071da10a27Behdad Esfahbod
800ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod#define HB_TAG_NONE HB_TAG(0,0,0,0)
81590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod
8283f34677bcbc6bb194940407b0fcb23575650e3dBehdad Esfahbodhb_tag_t hb_tag_from_string (const char *s);
8383f34677bcbc6bb194940407b0fcb23575650e3dBehdad Esfahbod
8483f34677bcbc6bb194940407b0fcb23575650e3dBehdad Esfahbod
858e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod/* hb_direction_t */
860090dc0f67b553d2f6eaaedc289c0956ade09ef6Behdad Esfahbod
87ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbodtypedef enum _hb_direction_t {
883286fc0e9adc3f2874c9409e7fdb09e4d2b7dda1Behdad Esfahbod  HB_DIRECTION_INVALID = -1,
893286fc0e9adc3f2874c9409e7fdb09e4d2b7dda1Behdad Esfahbod  HB_DIRECTION_LTR = 0,
90ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod  HB_DIRECTION_RTL,
91ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod  HB_DIRECTION_TTB,
92ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod  HB_DIRECTION_BTT
93ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod} hb_direction_t;
94ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod
9539a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodhb_direction_t
9639a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodhb_direction_from_string (const char *str);
9739a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbod
9839a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodconst char *
9939a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodhb_direction_to_string (hb_direction_t direction);
10039a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbod
1011ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_HORIZONTAL(dir)	((((unsigned int) (dir)) & ~1U) == 0)
1021ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_VERTICAL(dir)	((((unsigned int) (dir)) & ~1U) == 2)
1031ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_FORWARD(dir)	((((unsigned int) (dir)) & ~2U) == 0)
1041ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_BACKWARD(dir)	((((unsigned int) (dir)) & ~2U) == 1)
10522da7fd94d6318c52df69d70470a85464ffc533dBehdad Esfahbod#define HB_DIRECTION_REVERSE(dir)	((hb_direction_t) (((unsigned int) (dir)) ^ 1))
106ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod
107ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod
1088e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod/* hb_language_t */
1098e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
1103cbdf70e0a92f1c24e16c0d4dcfbec4ac59a77a3Behdad Esfahbodtypedef struct _hb_language_t *hb_language_t;
1118e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
1128e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodhb_language_t
1138e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodhb_language_from_string (const char *str);
1148e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod
1158e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodconst char *
1168e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodhb_language_to_string (hb_language_t language);
1176cb8c3493019e1497921666fc268cb81943f9f1fBehdad Esfahbod
1186cb8c3493019e1497921666fc268cb81943f9f1fBehdad Esfahbod
11900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* hb_unicode_general_category_t */
12000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
12100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodtypedef enum
12200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod{
12300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_CONTROL,			/* Cc */
12400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_FORMAT,			/* Cf */
12500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED,		/* Cn */
12600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE,		/* Co */
12700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_SURROGATE,		/* Cs */
12800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER,		/* Ll */
12900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER,		/* Lm */
13000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER,		/* Lo */
13100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER,		/* Lt */
13200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER,		/* Lu */
13300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_COMBINING_MARK,		/* Mc */
13400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK,		/* Me */
13500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK,		/* Mn */
13600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER,		/* Nd */
13700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER,		/* Nl */
13800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER,		/* No */
13900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION,	/* Pc */
14000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION,		/* Pd */
14100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION,	/* Pe */
14200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION,	/* Pf */
14300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION,	/* Pi */
14400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION,	/* Po */
14500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION,		/* Ps */
14600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL,		/* Sc */
14700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL,		/* Sk */
14800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL,		/* Sm */
14900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL,		/* So */
15000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR,		/* Zl */
15100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR,	/* Zp */
15200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR		/* Zs */
15300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod} hb_unicode_general_category_t;
15400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
15500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
15600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* hb_script_t */
15700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
15800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodtypedef enum
15962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod{
16062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_COMMON                  = HB_TAG ('Z','y','y','y'),
16162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_INHERITED               = HB_TAG ('Q','a','a','i'),
16262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_ARABIC                  = HB_TAG ('A','r','a','b'),
16362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_ARMENIAN                = HB_TAG ('A','r','m','n'),
16462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BENGALI                 = HB_TAG ('B','e','n','g'),
16562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BOPOMOFO                = HB_TAG ('B','o','p','o'),
16662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_CHEROKEE                = HB_TAG ('C','h','e','r'),
16762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_COPTIC                  = HB_TAG ('Q','a','a','c'),
16862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_CYRILLIC                = HB_TAG ('C','y','r','l'),
16962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_DESERET                 = HB_TAG ('D','s','r','t'),
17062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_DEVANAGARI              = HB_TAG ('D','e','v','a'),
17162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_ETHIOPIC                = HB_TAG ('E','t','h','i'),
17262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_GEORGIAN                = HB_TAG ('G','e','o','r'),
17362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_GOTHIC                  = HB_TAG ('G','o','t','h'),
17462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_GREEK                   = HB_TAG ('G','r','e','k'),
17562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_GUJARATI                = HB_TAG ('G','u','j','r'),
17662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_GURMUKHI                = HB_TAG ('G','u','r','u'),
17762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_HAN                     = HB_TAG ('H','a','n','i'),
17862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_HANGUL                  = HB_TAG ('H','a','n','g'),
17962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_HEBREW                  = HB_TAG ('H','e','b','r'),
18062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_HIRAGANA                = HB_TAG ('H','i','r','a'),
18162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_KANNADA                 = HB_TAG ('K','n','d','a'),
18262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_KATAKANA                = HB_TAG ('K','a','n','a'),
18362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_KHMER                   = HB_TAG ('K','h','m','r'),
18462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LAO                     = HB_TAG ('L','a','o','o'),
18562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LATIN                   = HB_TAG ('L','a','t','n'),
18662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_MALAYALAM               = HB_TAG ('M','l','y','m'),
18762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_MONGOLIAN               = HB_TAG ('M','o','n','g'),
18862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_MYANMAR                 = HB_TAG ('M','y','m','r'),
18962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_OGHAM                   = HB_TAG ('O','g','a','m'),
19062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_OLD_ITALIC              = HB_TAG ('I','t','a','l'),
19162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_ORIYA                   = HB_TAG ('O','r','y','a'),
19262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_RUNIC                   = HB_TAG ('R','u','n','r'),
19362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_SINHALA                 = HB_TAG ('S','i','n','h'),
19462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_SYRIAC                  = HB_TAG ('S','y','r','c'),
19562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TAMIL                   = HB_TAG ('T','a','m','l'),
19662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TELUGU                  = HB_TAG ('T','e','l','u'),
19762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_THAANA                  = HB_TAG ('T','h','a','a'),
19862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_THAI                    = HB_TAG ('T','h','a','i'),
19962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TIBETAN                 = HB_TAG ('T','i','b','t'),
20062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_CANADIAN_ABORIGINAL     = HB_TAG ('C','a','n','s'),
20162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_YI                      = HB_TAG ('Y','i','i','i'),
20262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TAGALOG                 = HB_TAG ('T','g','l','g'),
20362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_HANUNOO                 = HB_TAG ('H','a','n','o'),
20462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BUHID                   = HB_TAG ('B','u','h','d'),
20562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TAGBANWA                = HB_TAG ('T','a','g','b'),
20600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
20700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  /* Unicode-4.0 additions */
20862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BRAILLE                 = HB_TAG ('B','r','a','i'),
20962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_CYPRIOT                 = HB_TAG ('C','p','r','t'),
21062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LIMBU                   = HB_TAG ('L','i','m','b'),
21162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_OSMANYA                 = HB_TAG ('O','s','m','a'),
21262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_SHAVIAN                 = HB_TAG ('S','h','a','w'),
21362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LINEAR_B                = HB_TAG ('L','i','n','b'),
21462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TAI_LE                  = HB_TAG ('T','a','l','e'),
21562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_UGARITIC                = HB_TAG ('U','g','a','r'),
21600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
21700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  /* Unicode-4.1 additions */
21862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_NEW_TAI_LUE             = HB_TAG ('T','a','l','u'),
21962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BUGINESE                = HB_TAG ('B','u','g','i'),
22062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_GLAGOLITIC              = HB_TAG ('G','l','a','g'),
22162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TIFINAGH                = HB_TAG ('T','f','n','g'),
22262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_SYLOTI_NAGRI            = HB_TAG ('S','y','l','o'),
22362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_OLD_PERSIAN             = HB_TAG ('X','p','e','o'),
22462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_KHAROSHTHI              = HB_TAG ('K','h','a','r'),
22500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
22600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  /* Unicode-5.0 additions */
22762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_UNKNOWN                 = HB_TAG ('Z','z','z','z'),
22862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BALINESE                = HB_TAG ('B','a','l','i'),
22962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_CUNEIFORM               = HB_TAG ('X','s','u','x'),
23062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_PHOENICIAN              = HB_TAG ('P','h','n','x'),
23162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_PHAGS_PA                = HB_TAG ('P','h','a','g'),
23262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_NKO                     = HB_TAG ('N','k','o','o'),
23300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
23400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  /* Unicode-5.1 additions */
23562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_KAYAH_LI                = HB_TAG ('K','a','l','i'),
23662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LEPCHA                  = HB_TAG ('L','e','p','c'),
23762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_REJANG                  = HB_TAG ('R','j','n','g'),
23862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_SUNDANESE               = HB_TAG ('S','u','n','d'),
23962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_SAURASHTRA              = HB_TAG ('S','a','u','r'),
24062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_CHAM                    = HB_TAG ('C','h','a','m'),
24162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_OL_CHIKI                = HB_TAG ('O','l','c','k'),
24262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_VAI                     = HB_TAG ('V','a','i','i'),
24362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_CARIAN                  = HB_TAG ('C','a','r','i'),
24462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LYCIAN                  = HB_TAG ('L','y','c','i'),
24562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LYDIAN                  = HB_TAG ('L','y','d','i'),
24600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
24700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  /* Unicode-5.2 additions */
24862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_AVESTAN                 = HB_TAG ('A','v','s','t'),
24962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BAMUM                   = HB_TAG ('B','a','m','u'),
25062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_EGYPTIAN_HIEROGLYPHS    = HB_TAG ('E','g','y','p'),
25162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_IMPERIAL_ARAMAIC        = HB_TAG ('A','r','m','i'),
25262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_INSCRIPTIONAL_PAHLAVI   = HB_TAG ('P','h','l','i'),
25362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_INSCRIPTIONAL_PARTHIAN  = HB_TAG ('P','r','t','i'),
25462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_JAVANESE                = HB_TAG ('J','a','v','a'),
25562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_KAITHI                  = HB_TAG ('K','t','h','i'),
25662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_LISU                    = HB_TAG ('L','i','s','u'),
25762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_MEETEI_MAYEK            = HB_TAG ('M','t','e','i'),
25862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_OLD_SOUTH_ARABIAN       = HB_TAG ('S','a','r','b'),
25962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_OLD_TURKIC              = HB_TAG ('O','r','k','h'),
26062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_SAMARITAN               = HB_TAG ('S','a','m','r'),
26162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TAI_THAM                = HB_TAG ('L','a','n','a'),
26262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_TAI_VIET                = HB_TAG ('T','a','v','t'),
26300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
26400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod  /* Unicode-6.0 additions */
26562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BATAK                   = HB_TAG ('B','a','t','k'),
26662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_BRAHMI                  = HB_TAG ('B','r','a','h'),
26762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_MANDAIC                 = HB_TAG ('M','a','n','d'),
26862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod
26962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  /* No script set */
27062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod  HB_SCRIPT_INVALID                 = HB_TAG_NONE
27100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod} hb_script_t;
27200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
27300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
27400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* Script functions */
27500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
27600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_t
27700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_from_iso15924_tag (hb_tag_t tag);
27800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
27900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* suger for tag_from_string() then script_from_iso15924_tag */
28000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_t
28100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_from_string (const char *s);
28200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
28300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_tag_t
28400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_to_iso15924_tag (hb_script_t script);
28500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
28600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_direction_t
28700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_get_horizontal_direction (hb_script_t script);
28800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
28900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod
290acdba3f90b232fc12fcb200dca2584481b339118Behdad EsfahbodHB_END_DECLS
291acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod
2928dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#endif /* HB_COMMON_H */
293