| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2007,2008,2009 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009 Red Hat, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F') | 41 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F') |
| 42 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B') | 42 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B') |
| 43 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S') | 43 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S') |
| 44 #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F') | 44 #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F') |
| 45 | 45 |
| 46 | 46 |
| 47 /* | 47 /* |
| 48 * GDEF | 48 * GDEF |
| 49 */ | 49 */ |
| 50 | 50 |
| 51 hb_bool_t | 51 HB_EXTERN hb_bool_t |
| 52 hb_ot_layout_has_glyph_classes (hb_face_t *face); | 52 hb_ot_layout_has_glyph_classes (hb_face_t *face); |
| 53 | 53 |
| 54 typedef enum { | 54 typedef enum { |
| 55 HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0, | 55 HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0, |
| 56 HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 1, | 56 HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 1, |
| 57 HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 2, | 57 HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 2, |
| 58 HB_OT_LAYOUT_GLYPH_CLASS_MARK = 3, | 58 HB_OT_LAYOUT_GLYPH_CLASS_MARK = 3, |
| 59 HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 4 | 59 HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 4 |
| 60 } hb_ot_layout_glyph_class_t; | 60 } hb_ot_layout_glyph_class_t; |
| 61 | 61 |
| 62 hb_ot_layout_glyph_class_t | 62 HB_EXTERN hb_ot_layout_glyph_class_t |
| 63 hb_ot_layout_get_glyph_class (hb_face_t *face, | 63 hb_ot_layout_get_glyph_class (hb_face_t *face, |
| 64 hb_codepoint_t glyph); | 64 hb_codepoint_t glyph); |
| 65 | 65 |
| 66 void | 66 HB_EXTERN void |
| 67 hb_ot_layout_get_glyphs_in_class (hb_face_t *face, | 67 hb_ot_layout_get_glyphs_in_class (hb_face_t *face, |
| 68 hb_ot_layout_glyph_class_t klass, | 68 hb_ot_layout_glyph_class_t klass, |
| 69 hb_set_t *glyphs /* OUT */); | 69 hb_set_t *glyphs /* OUT */); |
| 70 | 70 |
| 71 | 71 |
| 72 /* Not that useful. Provides list of attach points for a glyph that a | 72 /* Not that useful. Provides list of attach points for a glyph that a |
| 73 * client may want to cache */ | 73 * client may want to cache */ |
| 74 unsigned int | 74 HB_EXTERN unsigned int |
| 75 hb_ot_layout_get_attach_points (hb_face_t *face, | 75 hb_ot_layout_get_attach_points (hb_face_t *face, |
| 76 hb_codepoint_t glyph, | 76 hb_codepoint_t glyph, |
| 77 unsigned int start_offset, | 77 unsigned int start_offset, |
| 78 unsigned int *point_count /* IN/OUT */, | 78 unsigned int *point_count /* IN/OUT */, |
| 79 unsigned int *point_array /* OUT */); | 79 unsigned int *point_array /* OUT */); |
| 80 | 80 |
| 81 /* Ligature caret positions */ | 81 /* Ligature caret positions */ |
| 82 unsigned int | 82 HB_EXTERN unsigned int |
| 83 hb_ot_layout_get_ligature_carets (hb_font_t *font, | 83 hb_ot_layout_get_ligature_carets (hb_font_t *font, |
| 84 hb_direction_t direction, | 84 hb_direction_t direction, |
| 85 hb_codepoint_t glyph, | 85 hb_codepoint_t glyph, |
| 86 unsigned int start_offset, | 86 unsigned int start_offset, |
| 87 unsigned int *caret_count /* IN/OUT */, | 87 unsigned int *caret_count /* IN/OUT */, |
| 88 hb_position_t *caret_array /* OUT */); | 88 hb_position_t *caret_array /* OUT */); |
| 89 | 89 |
| 90 | 90 |
| 91 /* | 91 /* |
| 92 * GSUB/GPOS feature query and enumeration interface | 92 * GSUB/GPOS feature query and enumeration interface |
| 93 */ | 93 */ |
| 94 | 94 |
| 95 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu | 95 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu |
| 96 #define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu | 96 #define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu |
| 97 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu | 97 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu |
| 98 | 98 |
| 99 unsigned int | 99 HB_EXTERN unsigned int |
| 100 hb_ot_layout_table_get_script_tags (hb_face_t *face, | 100 hb_ot_layout_table_get_script_tags (hb_face_t *face, |
| 101 hb_tag_t table_tag, | 101 hb_tag_t table_tag, |
| 102 unsigned int start_offset, | 102 unsigned int start_offset, |
| 103 unsigned int *script_count /* IN/OUT */, | 103 unsigned int *script_count /* IN/OUT */, |
| 104 hb_tag_t *script_tags /* OUT */); | 104 hb_tag_t *script_tags /* OUT */); |
| 105 | 105 |
| 106 hb_bool_t | 106 HB_EXTERN hb_bool_t |
| 107 hb_ot_layout_table_find_script (hb_face_t *face, | 107 hb_ot_layout_table_find_script (hb_face_t *face, |
| 108 hb_tag_t table_tag, | 108 hb_tag_t table_tag, |
| 109 hb_tag_t script_tag, | 109 hb_tag_t script_tag, |
| 110 unsigned int *script_index); | 110 unsigned int *script_index); |
| 111 | 111 |
| 112 /* Like find_script, but takes zero-terminated array of scripts to test */ | 112 /* Like find_script, but takes zero-terminated array of scripts to test */ |
| 113 hb_bool_t | 113 HB_EXTERN hb_bool_t |
| 114 hb_ot_layout_table_choose_script (hb_face_t *face, | 114 hb_ot_layout_table_choose_script (hb_face_t *face, |
| 115 hb_tag_t table_tag, | 115 hb_tag_t table_tag, |
| 116 const hb_tag_t *script_tags, | 116 const hb_tag_t *script_tags, |
| 117 unsigned int *script_index, | 117 unsigned int *script_index, |
| 118 hb_tag_t *chosen_script); | 118 hb_tag_t *chosen_script); |
| 119 | 119 |
| 120 unsigned int | 120 HB_EXTERN unsigned int |
| 121 hb_ot_layout_table_get_feature_tags (hb_face_t *face, | 121 hb_ot_layout_table_get_feature_tags (hb_face_t *face, |
| 122 hb_tag_t table_tag, | 122 hb_tag_t table_tag, |
| 123 unsigned int start_offset, | 123 unsigned int start_offset, |
| 124 unsigned int *feature_count /* IN/OUT */, | 124 unsigned int *feature_count /* IN/OUT */, |
| 125 hb_tag_t *feature_tags /* OUT */); | 125 hb_tag_t *feature_tags /* OUT */); |
| 126 | 126 |
| 127 unsigned int | 127 HB_EXTERN unsigned int |
| 128 hb_ot_layout_script_get_language_tags (hb_face_t *face, | 128 hb_ot_layout_script_get_language_tags (hb_face_t *face, |
| 129 hb_tag_t table_tag, | 129 hb_tag_t table_tag, |
| 130 unsigned int script_index, | 130 unsigned int script_index, |
| 131 unsigned int start_offset, | 131 unsigned int start_offset, |
| 132 unsigned int *language_count /* IN/OUT */
, | 132 unsigned int *language_count /* IN/OUT */
, |
| 133 hb_tag_t *language_tags /* OUT */); | 133 hb_tag_t *language_tags /* OUT */); |
| 134 | 134 |
| 135 hb_bool_t | 135 HB_EXTERN hb_bool_t |
| 136 hb_ot_layout_script_find_language (hb_face_t *face, | 136 hb_ot_layout_script_find_language (hb_face_t *face, |
| 137 hb_tag_t table_tag, | 137 hb_tag_t table_tag, |
| 138 unsigned int script_index, | 138 unsigned int script_index, |
| 139 hb_tag_t language_tag, | 139 hb_tag_t language_tag, |
| 140 unsigned int *language_index); | 140 unsigned int *language_index); |
| 141 | 141 |
| 142 hb_bool_t | 142 HB_EXTERN hb_bool_t |
| 143 hb_ot_layout_language_get_required_feature_index (hb_face_t *face, | 143 hb_ot_layout_language_get_required_feature_index (hb_face_t *face, |
| 144 hb_tag_t table_tag, | 144 hb_tag_t table_tag, |
| 145 unsigned int script_index, | 145 unsigned int script_index, |
| 146 unsigned int language_index, | 146 unsigned int language_index, |
| 147 unsigned int *feature_index); | 147 unsigned int *feature_index); |
| 148 | 148 |
| 149 hb_bool_t | 149 HB_EXTERN hb_bool_t |
| 150 hb_ot_layout_language_get_required_feature (hb_face_t *face, | 150 hb_ot_layout_language_get_required_feature (hb_face_t *face, |
| 151 hb_tag_t table_tag, | 151 hb_tag_t table_tag, |
| 152 unsigned int script_index, | 152 unsigned int script_index, |
| 153 unsigned int language_index, | 153 unsigned int language_index, |
| 154 unsigned int *feature_index, | 154 unsigned int *feature_index, |
| 155 hb_tag_t *feature_tag); | 155 hb_tag_t *feature_tag); |
| 156 | 156 |
| 157 unsigned int | 157 HB_EXTERN unsigned int |
| 158 hb_ot_layout_language_get_feature_indexes (hb_face_t *face, | 158 hb_ot_layout_language_get_feature_indexes (hb_face_t *face, |
| 159 hb_tag_t table_tag, | 159 hb_tag_t table_tag, |
| 160 unsigned int script_index, | 160 unsigned int script_index, |
| 161 unsigned int language_index, | 161 unsigned int language_index, |
| 162 unsigned int start_offset, | 162 unsigned int start_offset, |
| 163 unsigned int *feature_count /* IN/OUT
*/, | 163 unsigned int *feature_count /* IN/OUT
*/, |
| 164 unsigned int *feature_indexes /* OUT
*/); | 164 unsigned int *feature_indexes /* OUT
*/); |
| 165 | 165 |
| 166 unsigned int | 166 HB_EXTERN unsigned int |
| 167 hb_ot_layout_language_get_feature_tags (hb_face_t *face, | 167 hb_ot_layout_language_get_feature_tags (hb_face_t *face, |
| 168 hb_tag_t table_tag, | 168 hb_tag_t table_tag, |
| 169 unsigned int script_index, | 169 unsigned int script_index, |
| 170 unsigned int language_index, | 170 unsigned int language_index, |
| 171 unsigned int start_offset, | 171 unsigned int start_offset, |
| 172 unsigned int *feature_count /* IN/OUT */
, | 172 unsigned int *feature_count /* IN/OUT */
, |
| 173 hb_tag_t *feature_tags /* OUT */); | 173 hb_tag_t *feature_tags /* OUT */); |
| 174 | 174 |
| 175 hb_bool_t | 175 HB_EXTERN hb_bool_t |
| 176 hb_ot_layout_language_find_feature (hb_face_t *face, | 176 hb_ot_layout_language_find_feature (hb_face_t *face, |
| 177 hb_tag_t table_tag, | 177 hb_tag_t table_tag, |
| 178 unsigned int script_index, | 178 unsigned int script_index, |
| 179 unsigned int language_index, | 179 unsigned int language_index, |
| 180 hb_tag_t feature_tag, | 180 hb_tag_t feature_tag, |
| 181 unsigned int *feature_index); | 181 unsigned int *feature_index); |
| 182 | 182 |
| 183 unsigned int | 183 HB_EXTERN unsigned int |
| 184 hb_ot_layout_feature_get_lookups (hb_face_t *face, | 184 hb_ot_layout_feature_get_lookups (hb_face_t *face, |
| 185 hb_tag_t table_tag, | 185 hb_tag_t table_tag, |
| 186 unsigned int feature_index, | 186 unsigned int feature_index, |
| 187 unsigned int start_offset, | 187 unsigned int start_offset, |
| 188 unsigned int *lookup_count /* IN/OUT */, | 188 unsigned int *lookup_count /* IN/OUT */, |
| 189 unsigned int *lookup_indexes /* OUT */); | 189 unsigned int *lookup_indexes /* OUT */); |
| 190 | 190 |
| 191 unsigned int | 191 HB_EXTERN unsigned int |
| 192 hb_ot_layout_table_get_lookup_count (hb_face_t *face, | 192 hb_ot_layout_table_get_lookup_count (hb_face_t *face, |
| 193 hb_tag_t table_tag); | 193 hb_tag_t table_tag); |
| 194 | 194 |
| 195 | 195 |
| 196 void | 196 HB_EXTERN void |
| 197 hb_ot_layout_collect_lookups (hb_face_t *face, | 197 hb_ot_layout_collect_lookups (hb_face_t *face, |
| 198 hb_tag_t table_tag, | 198 hb_tag_t table_tag, |
| 199 const hb_tag_t *scripts, | 199 const hb_tag_t *scripts, |
| 200 const hb_tag_t *languages, | 200 const hb_tag_t *languages, |
| 201 const hb_tag_t *features, | 201 const hb_tag_t *features, |
| 202 hb_set_t *lookup_indexes /* OUT */); | 202 hb_set_t *lookup_indexes /* OUT */); |
| 203 | 203 |
| 204 void | 204 HB_EXTERN void |
| 205 hb_ot_layout_lookup_collect_glyphs (hb_face_t *face, | 205 hb_ot_layout_lookup_collect_glyphs (hb_face_t *face, |
| 206 hb_tag_t table_tag, | 206 hb_tag_t table_tag, |
| 207 unsigned int lookup_index, | 207 unsigned int lookup_index, |
| 208 hb_set_t *glyphs_before, /* OUT. May be
NULL */ | 208 hb_set_t *glyphs_before, /* OUT. May be
NULL */ |
| 209 hb_set_t *glyphs_input, /* OUT. May be
NULL */ | 209 hb_set_t *glyphs_input, /* OUT. May be
NULL */ |
| 210 hb_set_t *glyphs_after, /* OUT. May be
NULL */ | 210 hb_set_t *glyphs_after, /* OUT. May be
NULL */ |
| 211 hb_set_t *glyphs_output /* OUT. May be
NULL */); | 211 hb_set_t *glyphs_output /* OUT. May be
NULL */); |
| 212 | 212 |
| 213 #ifdef HB_NOT_IMPLEMENTED | 213 #ifdef HB_NOT_IMPLEMENTED |
| 214 typedef struct | 214 typedef struct |
| 215 { | 215 { |
| 216 const hb_codepoint_t *before, | 216 const hb_codepoint_t *before, |
| 217 unsigned int before_length, | 217 unsigned int before_length, |
| 218 const hb_codepoint_t *input, | 218 const hb_codepoint_t *input, |
| 219 unsigned int input_length, | 219 unsigned int input_length, |
| 220 const hb_codepoint_t *after, | 220 const hb_codepoint_t *after, |
| 221 unsigned int after_length, | 221 unsigned int after_length, |
| 222 } hb_ot_layout_glyph_sequence_t; | 222 } hb_ot_layout_glyph_sequence_t; |
| 223 | 223 |
| 224 typedef hb_bool_t | 224 typedef hb_bool_t |
| 225 (*hb_ot_layout_glyph_sequence_func_t) (hb_font_t *font, | 225 (*hb_ot_layout_glyph_sequence_func_t) (hb_font_t *font, |
| 226 hb_tag_t table_tag, | 226 hb_tag_t table_tag, |
| 227 unsigned int lookup_index, | 227 unsigned int lookup_index, |
| 228 const hb_ot_layout_glyph_sequence_t *sequ
ence, | 228 const hb_ot_layout_glyph_sequence_t *sequ
ence, |
| 229 void *user_data); | 229 void *user_data); |
| 230 | 230 |
| 231 void | 231 HB_EXTERN void |
| 232 Xhb_ot_layout_lookup_enumerate_sequences (hb_face_t *face, | 232 Xhb_ot_layout_lookup_enumerate_sequences (hb_face_t *face, |
| 233 hb_tag_t table_tag, | 233 hb_tag_t table_tag, |
| 234 unsigned int lookup_index, | 234 unsigned int lookup_index, |
| 235 hb_ot_layout_glyph_sequence_func_t call
back, | 235 hb_ot_layout_glyph_sequence_func_t call
back, |
| 236 void *user_data); | 236 void *user_data); |
| 237 #endif | 237 #endif |
| 238 | 238 |
| 239 | 239 |
| 240 /* | 240 /* |
| 241 * GSUB | 241 * GSUB |
| 242 */ | 242 */ |
| 243 | 243 |
| 244 hb_bool_t | 244 HB_EXTERN hb_bool_t |
| 245 hb_ot_layout_has_substitution (hb_face_t *face); | 245 hb_ot_layout_has_substitution (hb_face_t *face); |
| 246 | 246 |
| 247 hb_bool_t | 247 HB_EXTERN hb_bool_t |
| 248 hb_ot_layout_lookup_would_substitute (hb_face_t *face, | 248 hb_ot_layout_lookup_would_substitute (hb_face_t *face, |
| 249 unsigned int lookup_index, | 249 unsigned int lookup_index, |
| 250 const hb_codepoint_t *glyphs, | 250 const hb_codepoint_t *glyphs, |
| 251 unsigned int glyphs_length, | 251 unsigned int glyphs_length, |
| 252 hb_bool_t zero_context); | 252 hb_bool_t zero_context); |
| 253 | 253 |
| 254 void | 254 HB_EXTERN void |
| 255 hb_ot_layout_lookup_substitute_closure (hb_face_t *face, | 255 hb_ot_layout_lookup_substitute_closure (hb_face_t *face, |
| 256 unsigned int lookup_index, | 256 unsigned int lookup_index, |
| 257 hb_set_t *glyphs | 257 hb_set_t *glyphs |
| 258 /*TODO , hb_bool_t inclusive */); | 258 /*TODO , hb_bool_t inclusive */); |
| 259 | 259 |
| 260 #ifdef HB_NOT_IMPLEMENTED | 260 #ifdef HB_NOT_IMPLEMENTED |
| 261 /* Note: You better have GDEF when using this API, or marks won't do much. */ | 261 /* Note: You better have GDEF when using this API, or marks won't do much. */ |
| 262 hb_bool_t | 262 HB_EXTERN hb_bool_t |
| 263 Xhb_ot_layout_lookup_substitute (hb_font_t *font, | 263 Xhb_ot_layout_lookup_substitute (hb_font_t *font, |
| 264 unsigned int lookup_index, | 264 unsigned int lookup_index, |
| 265 const hb_ot_layout_glyph_sequence_t *sequence, | 265 const hb_ot_layout_glyph_sequence_t *sequence, |
| 266 unsigned int out_size, | 266 unsigned int out_size, |
| 267 hb_codepoint_t *glyphs_out, /* OUT */ | 267 hb_codepoint_t *glyphs_out, /* OUT */ |
| 268 unsigned int *clusters_out, /* OUT */ | 268 unsigned int *clusters_out, /* OUT */ |
| 269 unsigned int *out_length /* OUT */); | 269 unsigned int *out_length /* OUT */); |
| 270 #endif | 270 #endif |
| 271 | 271 |
| 272 | 272 |
| 273 /* | 273 /* |
| 274 * GPOS | 274 * GPOS |
| 275 */ | 275 */ |
| 276 | 276 |
| 277 hb_bool_t | 277 HB_EXTERN hb_bool_t |
| 278 hb_ot_layout_has_positioning (hb_face_t *face); | 278 hb_ot_layout_has_positioning (hb_face_t *face); |
| 279 | 279 |
| 280 #ifdef HB_NOT_IMPLEMENTED | 280 #ifdef HB_NOT_IMPLEMENTED |
| 281 /* Note: You better have GDEF when using this API, or marks won't do much. */ | 281 /* Note: You better have GDEF when using this API, or marks won't do much. */ |
| 282 hb_bool_t | 282 HB_EXTERN hb_bool_t |
| 283 Xhb_ot_layout_lookup_position (hb_font_t *font, | 283 Xhb_ot_layout_lookup_position (hb_font_t *font, |
| 284 unsigned int lookup_index, | 284 unsigned int lookup_index, |
| 285 const hb_ot_layout_glyph_sequence_t *sequence, | 285 const hb_ot_layout_glyph_sequence_t *sequence, |
| 286 hb_glyph_position_t *positions /* IN / OUT */); | 286 hb_glyph_position_t *positions /* IN / OUT */); |
| 287 #endif | 287 #endif |
| 288 | 288 |
| 289 /* Optical 'size' feature info. Returns true if found. | 289 /* Optical 'size' feature info. Returns true if found. |
| 290 * http://www.microsoft.com/typography/otspec/features_pt.htm#size */ | 290 * http://www.microsoft.com/typography/otspec/features_pt.htm#size */ |
| 291 hb_bool_t | 291 HB_EXTERN hb_bool_t |
| 292 hb_ot_layout_get_size_params (hb_face_t *face, | 292 hb_ot_layout_get_size_params (hb_face_t *face, |
| 293 unsigned int *design_size, /* OUT. May be N
ULL */ | 293 unsigned int *design_size, /* OUT. May be N
ULL */ |
| 294 unsigned int *subfamily_id, /* OUT. May be N
ULL */ | 294 unsigned int *subfamily_id, /* OUT. May be N
ULL */ |
| 295 unsigned int *subfamily_name_id, /* OUT. May be N
ULL */ | 295 unsigned int *subfamily_name_id, /* OUT. May be N
ULL */ |
| 296 unsigned int *range_start, /* OUT. May be N
ULL */ | 296 unsigned int *range_start, /* OUT. May be N
ULL */ |
| 297 unsigned int *range_end /* OUT. May be N
ULL */); | 297 unsigned int *range_end /* OUT. May be N
ULL */); |
| 298 | 298 |
| 299 | 299 |
| 300 HB_END_DECLS | 300 HB_END_DECLS |
| 301 | 301 |
| 302 #endif /* HB_OT_LAYOUT_H */ | 302 #endif /* HB_OT_LAYOUT_H */ |
| OLD | NEW |