2 * Copyright (C) 2007,2008 Red Hat, Inc.
4 * This is part of HarfBuzz, an OpenType Layout engine library.
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.
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
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.
24 * Red Hat Author(s): Behdad Esfahbod
27 #ifndef HB_OT_LAYOUT_H
28 #define HB_OT_LAYOUT_H
30 #include "hb-common.h"
38 typedef struct _hb_ot_layout_t hb_ot_layout_t;
41 hb_ot_layout_create_for_data (const char *font_data,
45 hb_ot_layout_destroy (hb_ot_layout_t *layout);
47 /* TODO sanitizing API/constructor (make_wrieable_func_t) */
48 /* TODO get_table_func_t constructor */
55 HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0x0000,
56 HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 0x0002,
57 HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 0x0004,
58 HB_OT_LAYOUT_GLYPH_CLASS_MARK = 0x0008,
59 HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 0x0010
60 } hb_ot_layout_glyph_class_t;
63 hb_ot_layout_has_font_glyph_classes (hb_ot_layout_t *layout);
65 hb_ot_layout_glyph_class_t
66 hb_ot_layout_get_glyph_class (hb_ot_layout_t *layout,
70 hb_ot_layout_set_glyph_class (hb_ot_layout_t *layout,
72 hb_ot_layout_glyph_class_t klass);
75 hb_ot_layout_build_glyph_classes (hb_ot_layout_t *layout,
76 uint16_t num_total_glyphs,
78 unsigned char *klasses,
86 HB_OT_LAYOUT_TABLE_TYPE_GSUB,
87 HB_OT_LAYOUT_TABLE_TYPE_GPOS,
88 HB_OT_LAYOUT_TABLE_TYPE_NONE
89 } hb_ot_layout_table_type_t;
91 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX ((unsigned int) 0xFFFF)
92 #define HB_OT_LAYOUT_NO_FEATURE_INDEX ((unsigned int) 0xFFFF)
93 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX ((unsigned int) 0xFFFF)
94 #define HB_OT_LAYOUT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T')
95 #define HB_OT_LAYOUT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't')
98 hb_ot_layout_get_script_count (hb_ot_layout_t *layout,
99 hb_ot_layout_table_type_t table_type);
102 hb_ot_layout_get_script_tag (hb_ot_layout_t *layout,
103 hb_ot_layout_table_type_t table_type,
104 unsigned int script_index);
107 hb_ot_layout_find_script (hb_ot_layout_t *layout,
108 hb_ot_layout_table_type_t table_type,
110 unsigned int *script_index);
113 hb_ot_layout_get_language_count (hb_ot_layout_t *layout,
114 hb_ot_layout_table_type_t table_type,
115 unsigned int script_index);
118 hb_ot_layout_get_language_tag (hb_ot_layout_t *layout,
119 hb_ot_layout_table_type_t table_type,
120 unsigned int script_index,
121 unsigned int language_index);
124 hb_ot_layout_find_language (hb_ot_layout_t *layout,
125 hb_ot_layout_table_type_t table_type,
126 unsigned int script_index,
127 hb_tag_t language_tag,
128 unsigned int *language_index,
129 unsigned int *required_features_index);
133 #define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)
139 #endif /* HB_OT_LAYOUT_H */