Behdad Esfahbod | 64aef3a | 2008-01-23 16:14:38 -0500 | [diff] [blame] | 1 | /* |
Behdad Esfahbod | 2409d5f | 2011-04-21 17:14:28 -0400 | [diff] [blame] | 2 | * Copyright © 2007,2008,2009 Red Hat, Inc. |
Behdad Esfahbod | 64aef3a | 2008-01-23 16:14:38 -0500 | [diff] [blame] | 3 | * |
Behdad Esfahbod | c755cb3 | 2010-04-22 00:11:43 -0400 | [diff] [blame] | 4 | * This is part of HarfBuzz, a text shaping library. |
Behdad Esfahbod | 64aef3a | 2008-01-23 16:14:38 -0500 | [diff] [blame] | 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 | |
Behdad Esfahbod | d1c9eb4 | 2012-04-12 13:17:44 -0400 | [diff] [blame] | 27 | #ifndef HB_OT_H_IN |
| 28 | #error "Include <hb-ot.h> instead." |
| 29 | #endif |
| 30 | |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 31 | #ifndef HB_OT_LAYOUT_H |
| 32 | #define HB_OT_LAYOUT_H |
Behdad Esfahbod | 12c4568 | 2006-12-28 06:10:59 -0500 | [diff] [blame] | 33 | |
Behdad Esfahbod | d1c9eb4 | 2012-04-12 13:17:44 -0400 | [diff] [blame] | 34 | #include "hb.h" |
Behdad Esfahbod | 12c4568 | 2006-12-28 06:10:59 -0500 | [diff] [blame] | 35 | |
Behdad Esfahbod | 8a3511a | 2009-11-04 19:45:39 -0500 | [diff] [blame] | 36 | #include "hb-ot-tag.h" |
| 37 | |
Behdad Esfahbod | f96ffd4 | 2009-05-24 15:01:16 -0400 | [diff] [blame] | 38 | HB_BEGIN_DECLS |
Behdad Esfahbod | 12c4568 | 2006-12-28 06:10:59 -0500 | [diff] [blame] | 39 | |
Behdad Esfahbod | acdba3f | 2010-07-23 15:11:18 -0400 | [diff] [blame] | 40 | |
Behdad Esfahbod | 551fa2d | 2018-02-25 16:32:17 -0800 | [diff] [blame] | 41 | #define HB_OT_TAG_BASE HB_TAG('B','A','S','E') |
Behdad Esfahbod | 0ead481 | 2009-08-02 17:41:36 -0400 | [diff] [blame] | 42 | #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F') |
| 43 | #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B') |
| 44 | #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S') |
Behdad Esfahbod | 6c48f20 | 2013-09-09 15:43:10 -0400 | [diff] [blame] | 45 | #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F') |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 46 | |
Behdad Esfahbod | cfe9882 | 2012-07-27 03:06:30 -0400 | [diff] [blame] | 47 | |
Behdad Esfahbod | 590d55c | 2008-01-24 19:13:50 -0500 | [diff] [blame] | 48 | /* |
| 49 | * GDEF |
| 50 | */ |
| 51 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 52 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | b4b4272 | 2009-11-06 17:46:33 -0500 | [diff] [blame] | 53 | hb_ot_layout_has_glyph_classes (hb_face_t *face); |
Behdad Esfahbod | 590d55c | 2008-01-24 19:13:50 -0500 | [diff] [blame] | 54 | |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 55 | typedef enum { |
Behdad Esfahbod | 5a08ecf | 2012-11-16 13:34:29 -0800 | [diff] [blame] | 56 | HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0, |
| 57 | HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 1, |
| 58 | HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 2, |
| 59 | HB_OT_LAYOUT_GLYPH_CLASS_MARK = 3, |
| 60 | HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 4 |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 61 | } hb_ot_layout_glyph_class_t; |
| 62 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 63 | HB_EXTERN hb_ot_layout_glyph_class_t |
Behdad Esfahbod | 5a08ecf | 2012-11-16 13:34:29 -0800 | [diff] [blame] | 64 | hb_ot_layout_get_glyph_class (hb_face_t *face, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 65 | hb_codepoint_t glyph); |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 66 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 67 | HB_EXTERN void |
Behdad Esfahbod | 89ca8ee | 2012-11-16 13:53:40 -0800 | [diff] [blame] | 68 | hb_ot_layout_get_glyphs_in_class (hb_face_t *face, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 69 | hb_ot_layout_glyph_class_t klass, |
| 70 | hb_set_t *glyphs /* OUT */); |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 71 | |
| 72 | |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 73 | /* Not that useful. Provides list of attach points for a glyph that a |
| 74 | * client may want to cache */ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 75 | HB_EXTERN unsigned int |
Behdad Esfahbod | 0ead481 | 2009-08-02 17:41:36 -0400 | [diff] [blame] | 76 | hb_ot_layout_get_attach_points (hb_face_t *face, |
Behdad Esfahbod | 79420ad | 2009-05-26 12:24:16 -0400 | [diff] [blame] | 77 | hb_codepoint_t glyph, |
Behdad Esfahbod | e21899b | 2009-11-04 16:36:14 -0500 | [diff] [blame] | 78 | unsigned int start_offset, |
Behdad Esfahbod | 79420ad | 2009-05-26 12:24:16 -0400 | [diff] [blame] | 79 | unsigned int *point_count /* IN/OUT */, |
| 80 | unsigned int *point_array /* OUT */); |
| 81 | |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 82 | /* Ligature caret positions */ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 83 | HB_EXTERN unsigned int |
Behdad Esfahbod | e204674 | 2010-10-27 12:32:02 -0400 | [diff] [blame] | 84 | hb_ot_layout_get_ligature_carets (hb_font_t *font, |
Behdad Esfahbod | e204674 | 2010-10-27 12:32:02 -0400 | [diff] [blame] | 85 | hb_direction_t direction, |
| 86 | hb_codepoint_t glyph, |
| 87 | unsigned int start_offset, |
| 88 | unsigned int *caret_count /* IN/OUT */, |
Behdad Esfahbod | 60fbb36 | 2011-05-19 18:46:15 -0400 | [diff] [blame] | 89 | hb_position_t *caret_array /* OUT */); |
Behdad Esfahbod | 62964af | 2009-05-26 12:40:10 -0400 | [diff] [blame] | 90 | |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 91 | |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 92 | /* |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 93 | * GSUB/GPOS feature query and enumeration interface |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 94 | */ |
| 95 | |
Behdad Esfahbod | 7627100 | 2014-07-11 14:54:42 -0400 | [diff] [blame] | 96 | #define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu |
| 97 | #define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu |
| 98 | #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu |
Behdad Esfahbod | 30c42b6 | 2016-09-10 03:32:39 -0700 | [diff] [blame] | 99 | #define HB_OT_LAYOUT_NO_VARIATIONS_INDEX 0xFFFFFFFFu |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 100 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 101 | HB_EXTERN unsigned int |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 102 | hb_ot_layout_table_get_script_tags (hb_face_t *face, |
| 103 | hb_tag_t table_tag, |
Behdad Esfahbod | e21899b | 2009-11-04 16:36:14 -0500 | [diff] [blame] | 104 | unsigned int start_offset, |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 105 | unsigned int *script_count /* IN/OUT */, |
| 106 | hb_tag_t *script_tags /* OUT */); |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 107 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 108 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 0ead481 | 2009-08-02 17:41:36 -0400 | [diff] [blame] | 109 | hb_ot_layout_table_find_script (hb_face_t *face, |
| 110 | hb_tag_t table_tag, |
| 111 | hb_tag_t script_tag, |
| 112 | unsigned int *script_index); |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 113 | |
Behdad Esfahbod | 2014b8d | 2009-12-20 20:58:26 +0100 | [diff] [blame] | 114 | /* Like find_script, but takes zero-terminated array of scripts to test */ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 115 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 2014b8d | 2009-12-20 20:58:26 +0100 | [diff] [blame] | 116 | hb_ot_layout_table_choose_script (hb_face_t *face, |
| 117 | hb_tag_t table_tag, |
| 118 | const hb_tag_t *script_tags, |
Behdad Esfahbod | c47a31f | 2011-07-30 20:57:01 -0400 | [diff] [blame] | 119 | unsigned int *script_index, |
| 120 | hb_tag_t *chosen_script); |
Behdad Esfahbod | 2014b8d | 2009-12-20 20:58:26 +0100 | [diff] [blame] | 121 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 122 | HB_EXTERN unsigned int |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 123 | hb_ot_layout_table_get_feature_tags (hb_face_t *face, |
| 124 | hb_tag_t table_tag, |
Behdad Esfahbod | e21899b | 2009-11-04 16:36:14 -0500 | [diff] [blame] | 125 | unsigned int start_offset, |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 126 | unsigned int *feature_count /* IN/OUT */, |
| 127 | hb_tag_t *feature_tags /* OUT */); |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 128 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 129 | HB_EXTERN unsigned int |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 130 | hb_ot_layout_script_get_language_tags (hb_face_t *face, |
| 131 | hb_tag_t table_tag, |
| 132 | unsigned int script_index, |
Behdad Esfahbod | e21899b | 2009-11-04 16:36:14 -0500 | [diff] [blame] | 133 | unsigned int start_offset, |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 134 | unsigned int *language_count /* IN/OUT */, |
| 135 | hb_tag_t *language_tags /* OUT */); |
Behdad Esfahbod | 4a26ea4 | 2008-01-28 07:40:10 -0500 | [diff] [blame] | 136 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 137 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 0ead481 | 2009-08-02 17:41:36 -0400 | [diff] [blame] | 138 | hb_ot_layout_script_find_language (hb_face_t *face, |
| 139 | hb_tag_t table_tag, |
| 140 | unsigned int script_index, |
| 141 | hb_tag_t language_tag, |
| 142 | unsigned int *language_index); |
Behdad Esfahbod | c447335 | 2008-02-18 21:14:23 -0500 | [diff] [blame] | 143 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 144 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 911ca38 | 2014-06-24 10:20:36 -0600 | [diff] [blame] | 145 | hb_ot_layout_language_get_required_feature_index (hb_face_t *face, |
| 146 | hb_tag_t table_tag, |
| 147 | unsigned int script_index, |
| 148 | unsigned int language_index, |
| 149 | unsigned int *feature_index); |
| 150 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 151 | HB_EXTERN hb_bool_t |
Jonathan Kew | da13293 | 2014-04-27 14:05:24 +0100 | [diff] [blame] | 152 | hb_ot_layout_language_get_required_feature (hb_face_t *face, |
| 153 | hb_tag_t table_tag, |
| 154 | unsigned int script_index, |
| 155 | unsigned int language_index, |
| 156 | unsigned int *feature_index, |
| 157 | hb_tag_t *feature_tag); |
Behdad Esfahbod | c447335 | 2008-02-18 21:14:23 -0500 | [diff] [blame] | 158 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 159 | HB_EXTERN unsigned int |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 160 | hb_ot_layout_language_get_feature_indexes (hb_face_t *face, |
| 161 | hb_tag_t table_tag, |
| 162 | unsigned int script_index, |
| 163 | unsigned int language_index, |
Behdad Esfahbod | e21899b | 2009-11-04 16:36:14 -0500 | [diff] [blame] | 164 | unsigned int start_offset, |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 165 | unsigned int *feature_count /* IN/OUT */, |
| 166 | unsigned int *feature_indexes /* OUT */); |
Behdad Esfahbod | 4a26ea4 | 2008-01-28 07:40:10 -0500 | [diff] [blame] | 167 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 168 | HB_EXTERN unsigned int |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 169 | hb_ot_layout_language_get_feature_tags (hb_face_t *face, |
| 170 | hb_tag_t table_tag, |
| 171 | unsigned int script_index, |
| 172 | unsigned int language_index, |
Behdad Esfahbod | e21899b | 2009-11-04 16:36:14 -0500 | [diff] [blame] | 173 | unsigned int start_offset, |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 174 | unsigned int *feature_count /* IN/OUT */, |
| 175 | hb_tag_t *feature_tags /* OUT */); |
Behdad Esfahbod | 4a26ea4 | 2008-01-28 07:40:10 -0500 | [diff] [blame] | 176 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 177 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 0ead481 | 2009-08-02 17:41:36 -0400 | [diff] [blame] | 178 | hb_ot_layout_language_find_feature (hb_face_t *face, |
| 179 | hb_tag_t table_tag, |
| 180 | unsigned int script_index, |
| 181 | unsigned int language_index, |
| 182 | hb_tag_t feature_tag, |
| 183 | unsigned int *feature_index); |
Behdad Esfahbod | c447335 | 2008-02-18 21:14:23 -0500 | [diff] [blame] | 184 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 185 | HB_EXTERN unsigned int |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 186 | hb_ot_layout_feature_get_lookups (hb_face_t *face, |
| 187 | hb_tag_t table_tag, |
| 188 | unsigned int feature_index, |
| 189 | unsigned int start_offset, |
| 190 | unsigned int *lookup_count /* IN/OUT */, |
| 191 | unsigned int *lookup_indexes /* OUT */); |
| 192 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 193 | HB_EXTERN unsigned int |
Behdad Esfahbod | 27674b4 | 2013-10-03 14:54:50 -0400 | [diff] [blame] | 194 | hb_ot_layout_table_get_lookup_count (hb_face_t *face, |
| 195 | hb_tag_t table_tag); |
| 196 | |
| 197 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 198 | HB_EXTERN void |
Behdad Esfahbod | a88e716 | 2012-11-24 02:31:02 -0500 | [diff] [blame] | 199 | hb_ot_layout_collect_lookups (hb_face_t *face, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 200 | hb_tag_t table_tag, |
| 201 | const hb_tag_t *scripts, |
| 202 | const hb_tag_t *languages, |
| 203 | const hb_tag_t *features, |
| 204 | hb_set_t *lookup_indexes /* OUT */); |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 205 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 206 | HB_EXTERN void |
Behdad Esfahbod | e8cfdd7 | 2012-11-16 19:07:06 -0800 | [diff] [blame] | 207 | hb_ot_layout_lookup_collect_glyphs (hb_face_t *face, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 208 | hb_tag_t table_tag, |
| 209 | unsigned int lookup_index, |
| 210 | hb_set_t *glyphs_before, /* OUT. May be NULL */ |
| 211 | hb_set_t *glyphs_input, /* OUT. May be NULL */ |
| 212 | hb_set_t *glyphs_after, /* OUT. May be NULL */ |
| 213 | hb_set_t *glyphs_output /* OUT. May be NULL */); |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 214 | |
| 215 | #ifdef HB_NOT_IMPLEMENTED |
| 216 | typedef struct |
| 217 | { |
| 218 | const hb_codepoint_t *before, |
| 219 | unsigned int before_length, |
| 220 | const hb_codepoint_t *input, |
| 221 | unsigned int input_length, |
| 222 | const hb_codepoint_t *after, |
| 223 | unsigned int after_length, |
| 224 | } hb_ot_layout_glyph_sequence_t; |
| 225 | |
| 226 | typedef hb_bool_t |
| 227 | (*hb_ot_layout_glyph_sequence_func_t) (hb_font_t *font, |
| 228 | hb_tag_t table_tag, |
| 229 | unsigned int lookup_index, |
| 230 | const hb_ot_layout_glyph_sequence_t *sequence, |
| 231 | void *user_data); |
| 232 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 233 | HB_EXTERN void |
Behdad Esfahbod | 977f174 | 2012-11-16 13:10:07 -0800 | [diff] [blame] | 234 | Xhb_ot_layout_lookup_enumerate_sequences (hb_face_t *face, |
Behdad Esfahbod | bff3c0f | 2009-08-07 19:46:30 -0400 | [diff] [blame] | 235 | hb_tag_t table_tag, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 236 | unsigned int lookup_index, |
| 237 | hb_ot_layout_glyph_sequence_func_t callback, |
| 238 | void *user_data); |
| 239 | #endif |
Behdad Esfahbod | c447335 | 2008-02-18 21:14:23 -0500 | [diff] [blame] | 240 | |
Behdad Esfahbod | 30c42b6 | 2016-09-10 03:32:39 -0700 | [diff] [blame] | 241 | /* Variations support */ |
| 242 | |
| 243 | HB_EXTERN hb_bool_t |
| 244 | hb_ot_layout_table_find_feature_variations (hb_face_t *face, |
| 245 | hb_tag_t table_tag, |
| 246 | const int *coords, |
| 247 | unsigned int num_coords, |
| 248 | unsigned int *variations_index /* out */); |
| 249 | |
Behdad Esfahbod | ec87ba9 | 2016-09-10 03:53:11 -0700 | [diff] [blame] | 250 | HB_EXTERN unsigned int |
| 251 | hb_ot_layout_feature_with_variations_get_lookups (hb_face_t *face, |
| 252 | hb_tag_t table_tag, |
| 253 | unsigned int feature_index, |
| 254 | unsigned int variations_index, |
| 255 | unsigned int start_offset, |
| 256 | unsigned int *lookup_count /* IN/OUT */, |
| 257 | unsigned int *lookup_indexes /* OUT */); |
| 258 | |
Behdad Esfahbod | 706ab25 | 2008-01-28 05:58:50 -0500 | [diff] [blame] | 259 | |
Behdad Esfahbod | 2d15e72 | 2009-04-15 19:50:16 -0400 | [diff] [blame] | 260 | /* |
| 261 | * GSUB |
| 262 | */ |
| 263 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 264 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 0ead481 | 2009-08-02 17:41:36 -0400 | [diff] [blame] | 265 | hb_ot_layout_has_substitution (hb_face_t *face); |
Behdad Esfahbod | f9cd101 | 2009-07-28 15:43:34 -0400 | [diff] [blame] | 266 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 267 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 362a990 | 2012-11-15 14:57:31 -0800 | [diff] [blame] | 268 | hb_ot_layout_lookup_would_substitute (hb_face_t *face, |
Behdad Esfahbod | d9b204d | 2012-08-23 16:22:28 -0400 | [diff] [blame] | 269 | unsigned int lookup_index, |
Behdad Esfahbod | e72b360 | 2012-07-19 14:35:23 -0400 | [diff] [blame] | 270 | const hb_codepoint_t *glyphs, |
| 271 | unsigned int glyphs_length, |
Behdad Esfahbod | d9b204d | 2012-08-23 16:22:28 -0400 | [diff] [blame] | 272 | hb_bool_t zero_context); |
Behdad Esfahbod | e72b360 | 2012-07-19 14:35:23 -0400 | [diff] [blame] | 273 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 274 | HB_EXTERN void |
Behdad Esfahbod | 362a990 | 2012-11-15 14:57:31 -0800 | [diff] [blame] | 275 | hb_ot_layout_lookup_substitute_closure (hb_face_t *face, |
Behdad Esfahbod | d9b204d | 2012-08-23 16:22:28 -0400 | [diff] [blame] | 276 | unsigned int lookup_index, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 277 | hb_set_t *glyphs |
| 278 | /*TODO , hb_bool_t inclusive */); |
| 279 | |
| 280 | #ifdef HB_NOT_IMPLEMENTED |
| 281 | /* Note: You better have GDEF when using this API, or marks won't do much. */ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 282 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 977f174 | 2012-11-16 13:10:07 -0800 | [diff] [blame] | 283 | Xhb_ot_layout_lookup_substitute (hb_font_t *font, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 284 | unsigned int lookup_index, |
| 285 | const hb_ot_layout_glyph_sequence_t *sequence, |
| 286 | unsigned int out_size, |
| 287 | hb_codepoint_t *glyphs_out, /* OUT */ |
| 288 | unsigned int *clusters_out, /* OUT */ |
| 289 | unsigned int *out_length /* OUT */); |
| 290 | #endif |
| 291 | |
Behdad Esfahbod | 3e32cd9 | 2012-04-23 13:20:52 -0400 | [diff] [blame] | 292 | |
Behdad Esfahbod | f9cd101 | 2009-07-28 15:43:34 -0400 | [diff] [blame] | 293 | /* |
| 294 | * GPOS |
| 295 | */ |
| 296 | |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 297 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 0ead481 | 2009-08-02 17:41:36 -0400 | [diff] [blame] | 298 | hb_ot_layout_has_positioning (hb_face_t *face); |
Behdad Esfahbod | f9cd101 | 2009-07-28 15:43:34 -0400 | [diff] [blame] | 299 | |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 300 | #ifdef HB_NOT_IMPLEMENTED |
| 301 | /* Note: You better have GDEF when using this API, or marks won't do much. */ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 302 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 977f174 | 2012-11-16 13:10:07 -0800 | [diff] [blame] | 303 | Xhb_ot_layout_lookup_position (hb_font_t *font, |
Behdad Esfahbod | f306410 | 2012-11-15 18:39:46 -0800 | [diff] [blame] | 304 | unsigned int lookup_index, |
| 305 | const hb_ot_layout_glyph_sequence_t *sequence, |
| 306 | hb_glyph_position_t *positions /* IN / OUT */); |
| 307 | #endif |
| 308 | |
Behdad Esfahbod | e9ad71d | 2012-11-30 08:10:26 +0200 | [diff] [blame] | 309 | /* Optical 'size' feature info. Returns true if found. |
Behdad Esfahbod | 4ab99fb | 2012-11-30 15:02:04 +0200 | [diff] [blame] | 310 | * http://www.microsoft.com/typography/otspec/features_pt.htm#size */ |
Chun-wei Fan | 835bbdc | 2015-11-19 18:34:12 +0800 | [diff] [blame] | 311 | HB_EXTERN hb_bool_t |
Behdad Esfahbod | 875a5cb | 2012-12-11 14:17:01 -0500 | [diff] [blame] | 312 | hb_ot_layout_get_size_params (hb_face_t *face, |
| 313 | unsigned int *design_size, /* OUT. May be NULL */ |
| 314 | unsigned int *subfamily_id, /* OUT. May be NULL */ |
| 315 | unsigned int *subfamily_name_id, /* OUT. May be NULL */ |
| 316 | unsigned int *range_start, /* OUT. May be NULL */ |
| 317 | unsigned int *range_end /* OUT. May be NULL */); |
Behdad Esfahbod | f54cce3 | 2012-11-26 14:02:31 +0200 | [diff] [blame] | 318 | |
Behdad Esfahbod | 2d15e72 | 2009-04-15 19:50:16 -0400 | [diff] [blame] | 319 | |
Behdad Esfahbod | 790a117 | 2018-03-07 15:31:15 +0100 | [diff] [blame] | 320 | /* |
| 321 | * BASE |
| 322 | */ |
| 323 | #if 0 |
| 324 | |
| 325 | #define HB_OT_TAG_BASE_HANG HB_TAG('h','a','n','g') |
| 326 | #define HB_OT_TAG_BASE_ICFB HB_TAG('i','c','f','b') |
| 327 | #define HB_OT_TAG_BASE_ICFT HB_TAG('i','c','f','t') |
| 328 | #define HB_OT_TAG_BASE_IDEO HB_TAG('i','d','e','o') |
| 329 | #define HB_OT_TAG_BASE_IDTB HB_TAG('i','d','t','b') |
| 330 | #define HB_OT_TAG_BASE_MATH HB_TAG('m','a','t','h') |
| 331 | #define HB_OT_TAG_BASE_ROMN HB_TAG('r','o','m','n') |
| 332 | |
| 333 | #endif |
| 334 | |
| 335 | |
Behdad Esfahbod | f96ffd4 | 2009-05-24 15:01:16 -0400 | [diff] [blame] | 336 | HB_END_DECLS |
Behdad Esfahbod | 12c4568 | 2006-12-28 06:10:59 -0500 | [diff] [blame] | 337 | |
Behdad Esfahbod | fd92a3d | 2008-01-24 03:11:09 -0500 | [diff] [blame] | 338 | #endif /* HB_OT_LAYOUT_H */ |