hb-common.h revision c214cff55ce539d004d069a484dac3988953cb11
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 42902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod#if !defined (HB_DONT_DEFINE_STDINT) 43acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod 44902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \ 45902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod defined (_sgi) || defined (__sun) || defined (sun) || \ 46902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod defined (__digital__) || defined (__HP_cc) 47902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod# include <inttypes.h> 48902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod#elif defined (_AIX) 49902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod# include <sys/inttypes.h> 50902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod/* VS 2010 (_MSC_VER 1600) has stdint.h */ 51902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod#elif defined (_MSC_VER) && _MSC_VER < 1600 52902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef __int8 int8_t; 53902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef unsigned __int8 uint8_t; 54902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef __int16 int16_t; 55902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef unsigned __int16 uint16_t; 56902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef __int32 int32_t; 57902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef unsigned __int32 uint32_t; 58902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef __int64 int64_t; 59902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbodtypedef unsigned __int64 uint64_t; 60cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#else 61902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod# include <stdint.h> 62cc4c096a7e08ae96b3030fe27f871ce5b797f370Behdad Esfahbod#endif 638dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod 64902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod#endif 65902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod 66902ab866f2d2edc3a71c1203065e6ddf49e5b431Behdad Esfahbod 67590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef int hb_bool_t; 68590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod 698e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef uint32_t hb_codepoint_t; 708e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef int32_t hb_position_t; 718e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef uint32_t hb_mask_t; 728e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 738e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodtypedef union _hb_var_int_t { 748e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod uint32_t u32; 758e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod int32_t i32; 768e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod uint16_t u16[2]; 778e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod int16_t i16[2]; 788e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod uint8_t u8[4]; 798e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod int8_t i8[4]; 808e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod} hb_var_int_t; 818e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 828e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 838e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod/* hb_tag_t */ 848e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 85590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbodtypedef uint32_t hb_tag_t; 868e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 87d77b76200efbaa0611691920f9f2018b1e8be340Behdad 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)))) 88d3b30be378c1dec0259a626d9a408bb9ca1b71acBehdad Esfahbod#define HB_UNTAG(tag) ((uint8_t)((tag)>>24)), ((uint8_t)((tag)>>16)), ((uint8_t)((tag)>>8)), ((uint8_t)(tag)) 894188096a7722f09ffa9319986c0286071da10a27Behdad Esfahbod 900ead481a5a8623103565fd7d924666e7342278ddBehdad Esfahbod#define HB_TAG_NONE HB_TAG(0,0,0,0) 91590d55cbb9e21ef74dfd88eee51fd0a763958cd2Behdad Esfahbod 9283f34677bcbc6bb194940407b0fcb23575650e3dBehdad Esfahbodhb_tag_t hb_tag_from_string (const char *s); 9383f34677bcbc6bb194940407b0fcb23575650e3dBehdad Esfahbod 9483f34677bcbc6bb194940407b0fcb23575650e3dBehdad Esfahbod 958e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod/* hb_direction_t */ 960090dc0f67b553d2f6eaaedc289c0956ade09ef6Behdad Esfahbod 9777a328769545f6b2970d8491fe77fe98781961cfBehdad Esfahbodtypedef enum { 983286fc0e9adc3f2874c9409e7fdb09e4d2b7dda1Behdad Esfahbod HB_DIRECTION_INVALID = -1, 993286fc0e9adc3f2874c9409e7fdb09e4d2b7dda1Behdad Esfahbod HB_DIRECTION_LTR = 0, 100ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod HB_DIRECTION_RTL, 101ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod HB_DIRECTION_TTB, 102ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod HB_DIRECTION_BTT 103ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod} hb_direction_t; 104ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod 10539a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodhb_direction_t 10639a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodhb_direction_from_string (const char *str); 10739a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbod 10839a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodconst char * 10939a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbodhb_direction_to_string (hb_direction_t direction); 11039a840ae65327b173e6eb1bb291e235a8305d7a1Behdad Esfahbod 1111ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_HORIZONTAL(dir) ((((unsigned int) (dir)) & ~1U) == 0) 1121ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_VERTICAL(dir) ((((unsigned int) (dir)) & ~1U) == 2) 1131ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_FORWARD(dir) ((((unsigned int) (dir)) & ~2U) == 0) 1141ce4dc95dbb28842085342aea4f9d12cbe9671a9Behdad Esfahbod#define HB_DIRECTION_IS_BACKWARD(dir) ((((unsigned int) (dir)) & ~2U) == 1) 11522da7fd94d6318c52df69d70470a85464ffc533dBehdad Esfahbod#define HB_DIRECTION_REVERSE(dir) ((hb_direction_t) (((unsigned int) (dir)) ^ 1)) 116ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod 117ff44f88df2c46920f3ec2384ef321a4c7bb0f6efBehdad Esfahbod 1188e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod/* hb_language_t */ 1198e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 1203cbdf70e0a92f1c24e16c0d4dcfbec4ac59a77a3Behdad Esfahbodtypedef struct _hb_language_t *hb_language_t; 1218e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 1228e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodhb_language_t 1238e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodhb_language_from_string (const char *str); 1248e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbod 1258e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodconst char * 1268e4bb3cacc269ed32187aaaeaa166c64f41a0418Behdad Esfahbodhb_language_to_string (hb_language_t language); 1276cb8c3493019e1497921666fc268cb81943f9f1fBehdad Esfahbod 1281a64f6e19a4b483e278c85e4941107be2f71b0a4Behdad Esfahbod#define HB_LANGUAGE_INVALID ((hb_language_t) NULL) 1291a64f6e19a4b483e278c85e4941107be2f71b0a4Behdad Esfahbod 13034fb5521a5fbb6b95ceff4bbac42a62628bc9f31Behdad Esfahbodhb_language_t 13134fb5521a5fbb6b95ceff4bbac42a62628bc9f31Behdad Esfahbodhb_language_get_default (void); 13234fb5521a5fbb6b95ceff4bbac42a62628bc9f31Behdad Esfahbod 1336cb8c3493019e1497921666fc268cb81943f9f1fBehdad Esfahbod 13400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* hb_unicode_general_category_t */ 13500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 13600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodtypedef enum 13700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod{ 13800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_CONTROL, /* Cc */ 13900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_FORMAT, /* Cf */ 14000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED, /* Cn */ 14100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE, /* Co */ 14200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_SURROGATE, /* Cs */ 14300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER, /* Ll */ 14400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER, /* Lm */ 14500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER, /* Lo */ 14600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER, /* Lt */ 14700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER, /* Lu */ 1485157e12a55f943b7fc5be7dce0b2ee1bcacca6ecBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK, /* Mc */ 14900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK, /* Me */ 15000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK, /* Mn */ 15100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER, /* Nd */ 15200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER, /* Nl */ 15300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER, /* No */ 15400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION, /* Pc */ 15500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION, /* Pd */ 15600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION, /* Pe */ 15700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION, /* Pf */ 15800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION, /* Pi */ 15900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION, /* Po */ 16000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION, /* Ps */ 16100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL, /* Sc */ 16200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL, /* Sk */ 16300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL, /* Sm */ 16400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL, /* So */ 16500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR, /* Zl */ 16600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR, /* Zp */ 16700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR /* Zs */ 16800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod} hb_unicode_general_category_t; 16900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 17000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 17100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* hb_script_t */ 17200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 173d02985ec5a24c659a0a133cc6bc103f1d76bcb29Behdad Esfahbod/* http://unicode.org/iso15924/ */ 17400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodtypedef enum 17562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod{ 17662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_COMMON = HB_TAG ('Z','y','y','y'), 177d02985ec5a24c659a0a133cc6bc103f1d76bcb29Behdad Esfahbod HB_SCRIPT_INHERITED = HB_TAG ('Z','i','n','h'), 17862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_ARABIC = HB_TAG ('A','r','a','b'), 17962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_ARMENIAN = HB_TAG ('A','r','m','n'), 18062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BENGALI = HB_TAG ('B','e','n','g'), 18162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BOPOMOFO = HB_TAG ('B','o','p','o'), 18262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_CHEROKEE = HB_TAG ('C','h','e','r'), 183d02985ec5a24c659a0a133cc6bc103f1d76bcb29Behdad Esfahbod HB_SCRIPT_COPTIC = HB_TAG ('C','o','p','t'), 18462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_CYRILLIC = HB_TAG ('C','y','r','l'), 18562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_DESERET = HB_TAG ('D','s','r','t'), 18662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_DEVANAGARI = HB_TAG ('D','e','v','a'), 18762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_ETHIOPIC = HB_TAG ('E','t','h','i'), 18862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_GEORGIAN = HB_TAG ('G','e','o','r'), 18962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_GOTHIC = HB_TAG ('G','o','t','h'), 19062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_GREEK = HB_TAG ('G','r','e','k'), 19162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_GUJARATI = HB_TAG ('G','u','j','r'), 19262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_GURMUKHI = HB_TAG ('G','u','r','u'), 19362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_HAN = HB_TAG ('H','a','n','i'), 19462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_HANGUL = HB_TAG ('H','a','n','g'), 19562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_HEBREW = HB_TAG ('H','e','b','r'), 19662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_HIRAGANA = HB_TAG ('H','i','r','a'), 19762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_KANNADA = HB_TAG ('K','n','d','a'), 19862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_KATAKANA = HB_TAG ('K','a','n','a'), 19962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_KHMER = HB_TAG ('K','h','m','r'), 20062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LAO = HB_TAG ('L','a','o','o'), 20162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LATIN = HB_TAG ('L','a','t','n'), 20262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_MALAYALAM = HB_TAG ('M','l','y','m'), 20362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_MONGOLIAN = HB_TAG ('M','o','n','g'), 20462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_MYANMAR = HB_TAG ('M','y','m','r'), 20562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_OGHAM = HB_TAG ('O','g','a','m'), 20662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_OLD_ITALIC = HB_TAG ('I','t','a','l'), 20762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_ORIYA = HB_TAG ('O','r','y','a'), 20862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_RUNIC = HB_TAG ('R','u','n','r'), 20962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_SINHALA = HB_TAG ('S','i','n','h'), 21062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_SYRIAC = HB_TAG ('S','y','r','c'), 21162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TAMIL = HB_TAG ('T','a','m','l'), 21262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TELUGU = HB_TAG ('T','e','l','u'), 21362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_THAANA = HB_TAG ('T','h','a','a'), 21462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_THAI = HB_TAG ('T','h','a','i'), 21562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TIBETAN = HB_TAG ('T','i','b','t'), 21662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_CANADIAN_ABORIGINAL = HB_TAG ('C','a','n','s'), 21762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_YI = HB_TAG ('Y','i','i','i'), 21862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TAGALOG = HB_TAG ('T','g','l','g'), 21962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_HANUNOO = HB_TAG ('H','a','n','o'), 22062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BUHID = HB_TAG ('B','u','h','d'), 22162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TAGBANWA = HB_TAG ('T','a','g','b'), 22200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 22300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod /* Unicode-4.0 additions */ 22462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BRAILLE = HB_TAG ('B','r','a','i'), 22562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_CYPRIOT = HB_TAG ('C','p','r','t'), 22662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LIMBU = HB_TAG ('L','i','m','b'), 22762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_OSMANYA = HB_TAG ('O','s','m','a'), 22862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_SHAVIAN = HB_TAG ('S','h','a','w'), 22962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LINEAR_B = HB_TAG ('L','i','n','b'), 23062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TAI_LE = HB_TAG ('T','a','l','e'), 23162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_UGARITIC = HB_TAG ('U','g','a','r'), 23200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 23300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod /* Unicode-4.1 additions */ 23462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_NEW_TAI_LUE = HB_TAG ('T','a','l','u'), 23562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BUGINESE = HB_TAG ('B','u','g','i'), 23662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_GLAGOLITIC = HB_TAG ('G','l','a','g'), 23762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TIFINAGH = HB_TAG ('T','f','n','g'), 23862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_SYLOTI_NAGRI = HB_TAG ('S','y','l','o'), 23962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_OLD_PERSIAN = HB_TAG ('X','p','e','o'), 24062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_KHAROSHTHI = HB_TAG ('K','h','a','r'), 24100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 24200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod /* Unicode-5.0 additions */ 24362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_UNKNOWN = HB_TAG ('Z','z','z','z'), 24462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BALINESE = HB_TAG ('B','a','l','i'), 24562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_CUNEIFORM = HB_TAG ('X','s','u','x'), 24662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_PHOENICIAN = HB_TAG ('P','h','n','x'), 24762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_PHAGS_PA = HB_TAG ('P','h','a','g'), 24862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_NKO = HB_TAG ('N','k','o','o'), 24900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 25000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod /* Unicode-5.1 additions */ 25162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_KAYAH_LI = HB_TAG ('K','a','l','i'), 25262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LEPCHA = HB_TAG ('L','e','p','c'), 25362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_REJANG = HB_TAG ('R','j','n','g'), 25462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_SUNDANESE = HB_TAG ('S','u','n','d'), 25562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_SAURASHTRA = HB_TAG ('S','a','u','r'), 25662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_CHAM = HB_TAG ('C','h','a','m'), 25762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_OL_CHIKI = HB_TAG ('O','l','c','k'), 25862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_VAI = HB_TAG ('V','a','i','i'), 25962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_CARIAN = HB_TAG ('C','a','r','i'), 26062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LYCIAN = HB_TAG ('L','y','c','i'), 26162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LYDIAN = HB_TAG ('L','y','d','i'), 26200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 26300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod /* Unicode-5.2 additions */ 26462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_AVESTAN = HB_TAG ('A','v','s','t'), 26562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BAMUM = HB_TAG ('B','a','m','u'), 26662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_EGYPTIAN_HIEROGLYPHS = HB_TAG ('E','g','y','p'), 26762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_IMPERIAL_ARAMAIC = HB_TAG ('A','r','m','i'), 26862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_INSCRIPTIONAL_PAHLAVI = HB_TAG ('P','h','l','i'), 26962879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_INSCRIPTIONAL_PARTHIAN = HB_TAG ('P','r','t','i'), 27062879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_JAVANESE = HB_TAG ('J','a','v','a'), 27162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_KAITHI = HB_TAG ('K','t','h','i'), 27262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_LISU = HB_TAG ('L','i','s','u'), 27362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_MEETEI_MAYEK = HB_TAG ('M','t','e','i'), 27462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_OLD_SOUTH_ARABIAN = HB_TAG ('S','a','r','b'), 27562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_OLD_TURKIC = HB_TAG ('O','r','k','h'), 27662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_SAMARITAN = HB_TAG ('S','a','m','r'), 27762879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TAI_THAM = HB_TAG ('L','a','n','a'), 27862879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_TAI_VIET = HB_TAG ('T','a','v','t'), 27900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 28000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod /* Unicode-6.0 additions */ 28162879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BATAK = HB_TAG ('B','a','t','k'), 28262879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_BRAHMI = HB_TAG ('B','r','a','h'), 28362879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_MANDAIC = HB_TAG ('M','a','n','d'), 28462879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod 28562879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod /* No script set */ 28662879eebd9965179af8602ba29ac0a64a739b757Behdad Esfahbod HB_SCRIPT_INVALID = HB_TAG_NONE 28700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod} hb_script_t; 28800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 28900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 29000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* Script functions */ 29100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 29200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_t 29300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_from_iso15924_tag (hb_tag_t tag); 29400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 29500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod/* suger for tag_from_string() then script_from_iso15924_tag */ 29600bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_t 29700bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_from_string (const char *s); 29800bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 29900bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_tag_t 30000bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_to_iso15924_tag (hb_script_t script); 30100bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 30200bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_direction_t 30300bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbodhb_script_get_horizontal_direction (hb_script_t script); 30400bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 30500bec2c969555e76c3f84650a1d3c45308e585adBehdad Esfahbod 30629c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbod/* User data */ 30729c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbod 30829c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbodtypedef struct _hb_user_data_key_t { 309c214cff55ce539d004d069a484dac3988953cb11Behdad Esfahbod /*< private >*/ 31029c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbod char unused; 31129c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbod} hb_user_data_key_t; 31229c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbod 31329c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbodtypedef void (*hb_destroy_func_t) (void *user_data); 31429c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbod 31529c67d3f70b081766a6c01353980f457f38aeb12Behdad Esfahbod 316acdba3f90b232fc12fcb200dca2584481b339118Behdad EsfahbodHB_END_DECLS 317acdba3f90b232fc12fcb200dca2584481b339118Behdad Esfahbod 3188dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#endif /* HB_COMMON_H */ 319