QtBase  v6.3.1
hb-ot-layout.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2007,2008,2009 Red Hat, Inc.
3  *
4  * This is part of HarfBuzz, a text shaping library.
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 
27 #if !defined(HB_OT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
28 #error "Include <hb-ot.h> instead."
29 #endif
30 
31 #ifndef HB_OT_LAYOUT_H
32 #define HB_OT_LAYOUT_H
33 
34 #include "hb.h"
35 
36 #include "hb-ot-name.h"
37 
39 
40 
46 #define HB_OT_TAG_BASE HB_TAG('B','A','S','E')
52 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F')
58 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B')
64 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S')
70 #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F')
71 
72 
73 /*
74  * Script & Language tags.
75  */
76 
83 #define HB_OT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T')
90 #define HB_OT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't')
91 
99 #define HB_OT_MAX_TAGS_PER_SCRIPT 3u
107 #define HB_OT_MAX_TAGS_PER_LANGUAGE 3u
108 
109 HB_EXTERN void
112  unsigned int *script_count /* IN/OUT */,
113  hb_tag_t *script_tags /* OUT */,
114  unsigned int *language_count /* IN/OUT */,
115  hb_tag_t *language_tags /* OUT */);
116 
119 
122 
123 HB_EXTERN void
126  hb_script_t *script /* OUT */,
127  hb_language_t *language /* OUT */);
128 
129 
130 /*
131  * GDEF
132  */
133 
136 
148 typedef enum {
155 
158  hb_codepoint_t glyph);
159 
160 HB_EXTERN void
163  hb_set_t *glyphs /* OUT */);
164 
165 /* Not that useful. Provides list of attach points for a glyph that a
166  * client may want to cache */
167 HB_EXTERN unsigned int
169  hb_codepoint_t glyph,
170  unsigned int start_offset,
171  unsigned int *point_count /* IN/OUT */,
172  unsigned int *point_array /* OUT */);
173 
174 /* Ligature caret positions */
175 HB_EXTERN unsigned int
178  hb_codepoint_t glyph,
179  unsigned int start_offset,
180  unsigned int *caret_count /* IN/OUT */,
181  hb_position_t *caret_array /* OUT */);
182 
183 
184 /*
185  * GSUB/GPOS feature query and enumeration interface
186  */
187 
193 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu
199 #define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu
205 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu
211 #define HB_OT_LAYOUT_NO_VARIATIONS_INDEX 0xFFFFFFFFu
212 
213 HB_EXTERN unsigned int
216  unsigned int start_offset,
217  unsigned int *script_count /* IN/OUT */,
218  hb_tag_t *script_tags /* OUT */);
219 
223  hb_tag_t script_tag,
224  unsigned int *script_index /* OUT */);
225 
229  unsigned int script_count,
230  const hb_tag_t *script_tags,
231  unsigned int *script_index /* OUT */,
232  hb_tag_t *chosen_script /* OUT */);
233 
234 HB_EXTERN unsigned int
237  unsigned int start_offset,
238  unsigned int *feature_count /* IN/OUT */,
239  hb_tag_t *feature_tags /* OUT */);
240 
241 HB_EXTERN unsigned int
244  unsigned int script_index,
245  unsigned int start_offset,
246  unsigned int *language_count /* IN/OUT */,
247  hb_tag_t *language_tags /* OUT */);
248 
252  unsigned int script_index,
253  unsigned int language_count,
254  const hb_tag_t *language_tags,
255  unsigned int *language_index /* OUT */);
256 
260  unsigned int script_index,
261  unsigned int language_index,
262  unsigned int *feature_index /* OUT */);
263 
267  unsigned int script_index,
268  unsigned int language_index,
269  unsigned int *feature_index /* OUT */,
270  hb_tag_t *feature_tag /* OUT */);
271 
272 HB_EXTERN unsigned int
275  unsigned int script_index,
276  unsigned int language_index,
277  unsigned int start_offset,
278  unsigned int *feature_count /* IN/OUT */,
279  unsigned int *feature_indexes /* OUT */);
280 
281 HB_EXTERN unsigned int
284  unsigned int script_index,
285  unsigned int language_index,
286  unsigned int start_offset,
287  unsigned int *feature_count /* IN/OUT */,
288  hb_tag_t *feature_tags /* OUT */);
289 
293  unsigned int script_index,
294  unsigned int language_index,
295  hb_tag_t feature_tag,
296  unsigned int *feature_index /* OUT */);
297 
298 HB_EXTERN unsigned int
301  unsigned int feature_index,
302  unsigned int start_offset,
303  unsigned int *lookup_count /* IN/OUT */,
304  unsigned int *lookup_indexes /* OUT */);
305 
306 HB_EXTERN unsigned int
309 
310 HB_EXTERN void
313  const hb_tag_t *scripts,
314  const hb_tag_t *languages,
315  const hb_tag_t *features,
316  hb_set_t *feature_indexes /* OUT */);
317 
318 HB_EXTERN void
321  const hb_tag_t *scripts,
322  const hb_tag_t *languages,
323  const hb_tag_t *features,
324  hb_set_t *lookup_indexes /* OUT */);
325 
326 HB_EXTERN void
329  unsigned int lookup_index,
330  hb_set_t *glyphs_before, /* OUT. May be NULL */
331  hb_set_t *glyphs_input, /* OUT. May be NULL */
332  hb_set_t *glyphs_after, /* OUT. May be NULL */
333  hb_set_t *glyphs_output /* OUT. May be NULL */);
334 
335 
336 /* Variations support */
337 
341  const int *coords,
342  unsigned int num_coords,
343  unsigned int *variations_index /* out */);
344 
345 HB_EXTERN unsigned int
348  unsigned int feature_index,
349  unsigned int variations_index,
350  unsigned int start_offset,
351  unsigned int *lookup_count /* IN/OUT */,
352  unsigned int *lookup_indexes /* OUT */);
353 
354 
355 /*
356  * GSUB
357  */
358 
361 
362 HB_EXTERN unsigned
364  unsigned lookup_index,
365  hb_codepoint_t glyph,
366  unsigned start_offset,
367  unsigned *alternate_count /* IN/OUT */,
368  hb_codepoint_t *alternate_glyphs /* OUT */);
369 
372  unsigned int lookup_index,
373  const hb_codepoint_t *glyphs,
374  unsigned int glyphs_length,
375  hb_bool_t zero_context);
376 
377 HB_EXTERN void
379  unsigned int lookup_index,
380  hb_set_t *glyphs
381  /*TODO , hb_bool_t inclusive */);
382 
383 HB_EXTERN void
385  const hb_set_t *lookups,
386  hb_set_t *glyphs);
387 
388 
389 /*
390  * GPOS
391  */
392 
395 
396 /* Optical 'size' feature info. Returns true if found.
397  * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */
400  unsigned int *design_size, /* OUT. May be NULL */
401  unsigned int *subfamily_id, /* OUT. May be NULL */
402  hb_ot_name_id_t *subfamily_name_id, /* OUT. May be NULL */
403  unsigned int *range_start, /* OUT. May be NULL */
404  unsigned int *range_end /* OUT. May be NULL */);
405 
406 
410  unsigned int feature_index,
411  hb_ot_name_id_t *label_id /* OUT. May be NULL */,
412  hb_ot_name_id_t *tooltip_id /* OUT. May be NULL */,
413  hb_ot_name_id_t *sample_id /* OUT. May be NULL */,
414  unsigned int *num_named_parameters /* OUT. May be NULL */,
415  hb_ot_name_id_t *first_param_id /* OUT. May be NULL */);
416 
417 
418 HB_EXTERN unsigned int
421  unsigned int feature_index,
422  unsigned int start_offset,
423  unsigned int *char_count /* IN/OUT. May be NULL */,
424  hb_codepoint_t *characters /* OUT. May be NULL */);
425 
426 /*
427  * BASE
428  */
429 
456 typedef enum {
466 
467  /*< private >*/
470 
473 
476  hb_ot_layout_baseline_tag_t baseline_tag,
478  hb_tag_t script_tag,
480  hb_position_t *coord /* OUT. May be NULL. */);
481 
482 HB_EXTERN void
484  hb_ot_layout_baseline_tag_t baseline_tag,
486  hb_tag_t script_tag,
488  hb_position_t *coord /* OUT */);
489 
491 
492 #endif /* HB_OT_LAYOUT_H */
xD9 x84 xD8 xAD xD9 x80 xF0 x90 xAC x9A xE0 xA7 xA6 xE0 xA7 xAA xF0 x91 x84 xA4 xF0 x91 x84 x89 xF0 x91 x84 x9B xF0 x90 x8A xAB xF0 x90 x8B x89 xE2 xB2 x9E xE2 xB2 x9F xD0 xBE xD0 x9E xF0 x90 x90 x84 xF0 x90 x90 xAC xE1 x83 x98 xE1 x83 x94 xE1 x83 x90 xE1 xB2 xBF xE2 xB0 x95 xE2 xB1 x85 xCE xBF xCE x9F xE0 xA8 xA0 xE0 xA8 xB0 xE0 xA9 xA6 Kayah xEA xA4 x8D xEA xA4 x80 Khmer xE1 xA7 xA1 xE1 xA7 xAA xE0 xBB x90 Latin Subscript xE2 x82 x92 xE2 x82 x80 xEA x93 xB3 xF0 x96 xB9 xA1 xF0 x96 xB9 x9B xF0 x96 xB9 xAF xE1 x80 x9D xE1 x80 x84 xE1 x80 x82 no script
Definition: afscript.h:271
direction
HB_EXTERN hb_tag_t const hb_tag_t unsigned int * script_index
HB_EXTERN hb_tag_t const hb_tag_t unsigned int hb_tag_t * chosen_script
HB_EXTERN hb_tag_t unsigned int hb_tag_t language_tag
HB_EXTERN unsigned int start_offset
HB_EXTERN hb_tag_t unsigned int hb_tag_t unsigned int * language_index
HB_EXTERN hb_tag_t const hb_tag_t * script_tags
HB_EXTERN hb_tag_t table_tag
unsigned int hb_ot_name_id_t
Definition: hb-ot-name.h:109
GLsizei const GLubyte GLsizei GLenum const void * coords
GLenum face
GLuint coord
Definition: qopenglext.h:6219
HB_BEGIN_DECLS typedef int hb_bool_t
Definition: hb-common.h:97
uint32_t hb_codepoint_t
Definition: hb-common.h:106
#define HB_TAG(c1, c2, c3, c4)
Definition: hb-common.h:169
#define HB_TAG_MAX_SIGNED
Definition: hb-common.h:203
int32_t hb_position_t
Definition: hb-common.h:115
hb_script_t
Definition: hb-common.h:506
#define HB_BEGIN_DECLS
Definition: hb-common.h:45
uint32_t hb_tag_t
Definition: hb-common.h:157
hb_direction_t
Definition: hb-common.h:229
#define HB_END_DECLS
Definition: hb-common.h:46
#define HB_EXTERN
Definition: hb-common.h:37
HB_EXTERN unsigned hb_ot_layout_lookup_get_glyph_alternates(hb_face_t *face, unsigned lookup_index, hb_codepoint_t glyph, unsigned start_offset, unsigned *alternate_count, hb_codepoint_t *alternate_glyphs)
HB_EXTERN unsigned int hb_ot_layout_feature_get_lookups(hb_face_t *face, hb_tag_t table_tag, unsigned int feature_index, unsigned int start_offset, unsigned int *lookup_count, unsigned int *lookup_indexes)
HB_EXTERN hb_bool_t hb_ot_layout_has_substitution(hb_face_t *face)
HB_EXTERN hb_bool_t hb_ot_layout_language_get_required_feature_index(hb_face_t *face, hb_tag_t table_tag, unsigned int script_index, unsigned int language_index, unsigned int *feature_index)
HB_EXTERN void hb_ot_tags_to_script_and_language(hb_tag_t script_tag, hb_tag_t language_tag, hb_script_t *script, hb_language_t *language)
Definition: hb-ot-tag.cc:505
HB_EXTERN void hb_ot_layout_lookups_substitute_closure(hb_face_t *face, const hb_set_t *lookups, hb_set_t *glyphs)
HB_EXTERN void hb_ot_tags_from_script_and_language(hb_script_t script, hb_language_t language, unsigned int *script_count, hb_tag_t *script_tags, unsigned int *language_count, hb_tag_t *language_tags)
Definition: hb-ot-tag.cc:380
HB_EXTERN hb_bool_t hb_ot_layout_script_select_language(hb_face_t *face, hb_tag_t table_tag, unsigned int script_index, unsigned int language_count, const hb_tag_t *language_tags, unsigned int *language_index)
HB_EXTERN unsigned int hb_ot_layout_get_attach_points(hb_face_t *face, hb_codepoint_t glyph, unsigned int start_offset, unsigned int *point_count, unsigned int *point_array)
HB_EXTERN hb_bool_t hb_ot_layout_language_get_required_feature(hb_face_t *face, hb_tag_t table_tag, unsigned int script_index, unsigned int language_index, unsigned int *feature_index, hb_tag_t *feature_tag)
HB_EXTERN void hb_ot_layout_lookup_substitute_closure(hb_face_t *face, unsigned int lookup_index, hb_set_t *glyphs)
HB_EXTERN hb_language_t hb_ot_tag_to_language(hb_tag_t tag)
Definition: hb-ot-tag.cc:449
HB_EXTERN void hb_ot_layout_get_glyphs_in_class(hb_face_t *face, hb_ot_layout_glyph_class_t klass, hb_set_t *glyphs)
HB_EXTERN unsigned int hb_ot_layout_table_get_feature_tags(hb_face_t *face, hb_tag_t table_tag, unsigned int start_offset, unsigned int *feature_count, hb_tag_t *feature_tags)
HB_EXTERN hb_ot_layout_glyph_class_t hb_ot_layout_get_glyph_class(hb_face_t *face, hb_codepoint_t glyph)
HB_EXTERN hb_bool_t hb_ot_layout_table_select_script(hb_face_t *face, hb_tag_t table_tag, unsigned int script_count, const hb_tag_t *script_tags, unsigned int *script_index, hb_tag_t *chosen_script)
hb_ot_layout_glyph_class_t
Definition: hb-ot-layout.h:148
@ HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
Definition: hb-ot-layout.h:149
@ HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
Definition: hb-ot-layout.h:150
@ HB_OT_LAYOUT_GLYPH_CLASS_MARK
Definition: hb-ot-layout.h:152
@ HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT
Definition: hb-ot-layout.h:153
@ HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
Definition: hb-ot-layout.h:151
HB_EXTERN hb_bool_t hb_ot_layout_lookup_would_substitute(hb_face_t *face, unsigned int lookup_index, const hb_codepoint_t *glyphs, unsigned int glyphs_length, hb_bool_t zero_context)
HB_EXTERN unsigned int hb_ot_layout_script_get_language_tags(hb_face_t *face, hb_tag_t table_tag, unsigned int script_index, unsigned int start_offset, unsigned int *language_count, hb_tag_t *language_tags)
HB_EXTERN void hb_ot_layout_collect_lookups(hb_face_t *face, hb_tag_t table_tag, const hb_tag_t *scripts, const hb_tag_t *languages, const hb_tag_t *features, hb_set_t *lookup_indexes)
hb_ot_layout_baseline_tag_t
Definition: hb-ot-layout.h:456
@ HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT
Definition: hb-ot-layout.h:459
@ HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_CENTRAL
Definition: hb-ot-layout.h:464
@ HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT
Definition: hb-ot-layout.h:460
@ _HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE
Definition: hb-ot-layout.h:468
@ HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT
Definition: hb-ot-layout.h:463
@ HB_OT_LAYOUT_BASELINE_TAG_ROMAN
Definition: hb-ot-layout.h:457
@ HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_CENTRAL
Definition: hb-ot-layout.h:461
@ HB_OT_LAYOUT_BASELINE_TAG_MATH
Definition: hb-ot-layout.h:465
@ HB_OT_LAYOUT_BASELINE_TAG_HANGING
Definition: hb-ot-layout.h:458
@ HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT
Definition: hb-ot-layout.h:462
HB_EXTERN hb_bool_t hb_ot_layout_language_find_feature(hb_face_t *face, hb_tag_t table_tag, unsigned int script_index, unsigned int language_index, hb_tag_t feature_tag, unsigned int *feature_index)
HB_EXTERN unsigned int hb_ot_layout_language_get_feature_indexes(hb_face_t *face, hb_tag_t table_tag, unsigned int script_index, unsigned int language_index, unsigned int start_offset, unsigned int *feature_count, unsigned int *feature_indexes)
HB_EXTERN hb_bool_t hb_ot_layout_table_find_script(hb_face_t *face, hb_tag_t table_tag, hb_tag_t script_tag, unsigned int *script_index)
HB_EXTERN hb_bool_t hb_ot_layout_has_glyph_classes(hb_face_t *face)
HB_EXTERN void hb_ot_layout_lookup_collect_glyphs(hb_face_t *face, hb_tag_t table_tag, unsigned int lookup_index, hb_set_t *glyphs_before, hb_set_t *glyphs_input, hb_set_t *glyphs_after, hb_set_t *glyphs_output)
HB_EXTERN hb_bool_t hb_ot_layout_has_positioning(hb_face_t *face)
HB_EXTERN hb_bool_t hb_ot_layout_table_find_feature_variations(hb_face_t *face, hb_tag_t table_tag, const int *coords, unsigned int num_coords, unsigned int *variations_index)
HB_EXTERN unsigned int hb_ot_layout_language_get_feature_tags(hb_face_t *face, hb_tag_t table_tag, unsigned int script_index, unsigned int language_index, unsigned int start_offset, unsigned int *feature_count, hb_tag_t *feature_tags)
HB_EXTERN unsigned int hb_ot_layout_table_get_lookup_count(hb_face_t *face, hb_tag_t table_tag)
HB_EXTERN hb_bool_t hb_ot_layout_feature_get_name_ids(hb_face_t *face, hb_tag_t table_tag, unsigned int feature_index, hb_ot_name_id_t *label_id, hb_ot_name_id_t *tooltip_id, hb_ot_name_id_t *sample_id, unsigned int *num_named_parameters, hb_ot_name_id_t *first_param_id)
HB_EXTERN unsigned int hb_ot_layout_table_get_script_tags(hb_face_t *face, hb_tag_t table_tag, unsigned int start_offset, unsigned int *script_count, hb_tag_t *script_tags)
HB_EXTERN unsigned int hb_ot_layout_get_ligature_carets(hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph, unsigned int start_offset, unsigned int *caret_count, hb_position_t *caret_array)
HB_EXTERN hb_script_t hb_ot_tag_to_script(hb_tag_t tag)
Definition: hb-ot-tag.cc:180
HB_EXTERN unsigned int hb_ot_layout_feature_get_characters(hb_face_t *face, hb_tag_t table_tag, unsigned int feature_index, unsigned int start_offset, unsigned int *char_count, hb_codepoint_t *characters)
HB_EXTERN unsigned int hb_ot_layout_feature_with_variations_get_lookups(hb_face_t *face, hb_tag_t table_tag, unsigned int feature_index, unsigned int variations_index, unsigned int start_offset, unsigned int *lookup_count, unsigned int *lookup_indexes)
HB_EXTERN hb_bool_t hb_ot_layout_get_baseline(hb_font_t *font, hb_ot_layout_baseline_tag_t baseline_tag, hb_direction_t direction, hb_tag_t script_tag, hb_tag_t language_tag, hb_position_t *coord)
HB_EXTERN hb_ot_layout_baseline_tag_t hb_ot_layout_get_horizontal_baseline_tag_for_script(hb_script_t script)
HB_EXTERN void hb_ot_layout_get_baseline_with_fallback(hb_font_t *font, hb_ot_layout_baseline_tag_t baseline_tag, hb_direction_t direction, hb_tag_t script_tag, hb_tag_t language_tag, hb_position_t *coord)
HB_EXTERN hb_bool_t hb_ot_layout_get_size_params(hb_face_t *face, unsigned int *design_size, unsigned int *subfamily_id, hb_ot_name_id_t *subfamily_name_id, unsigned int *range_start, unsigned int *range_end)
HB_EXTERN void hb_ot_layout_collect_features(hb_face_t *face, hb_tag_t table_tag, const hb_tag_t *scripts, const hb_tag_t *languages, const hb_tag_t *features, hb_set_t *feature_indexes)
QList< QChar > characters
XmlOutput::xml_output tag(const QString &name)
Definition: xmloutput.h:154