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 (void);
44 hb_ot_layout_create_for_data (const char *font_data,
48 hb_ot_layout_destroy (hb_ot_layout_t *layout);
50 /* TODO sanitizing API/constructor (make_wrieable_func_t) */
51 /* TODO get_table_func_t constructor */
58 HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0x0000,
59 HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 0x0002,
60 HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE = 0x0004,
61 HB_OT_LAYOUT_GLYPH_CLASS_MARK = 0x0008,
62 HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT = 0x0010
63 } hb_ot_layout_glyph_class_t;
66 hb_ot_layout_has_font_glyph_classes (hb_ot_layout_t *layout);
68 hb_ot_layout_glyph_class_t
69 hb_ot_layout_get_glyph_class (hb_ot_layout_t *layout,
70 hb_codepoint_t glyph);
73 hb_ot_layout_set_glyph_class (hb_ot_layout_t *layout,
75 hb_ot_layout_glyph_class_t klass);
78 hb_ot_layout_build_glyph_classes (hb_ot_layout_t *layout,
79 uint16_t num_total_glyphs,
80 hb_codepoint_t *glyphs,
81 unsigned char *klasses,
89 HB_OT_LAYOUT_TABLE_TYPE_GSUB,
90 HB_OT_LAYOUT_TABLE_TYPE_GPOS,
91 HB_OT_LAYOUT_TABLE_TYPE_NONE
92 } hb_ot_layout_table_type_t;
94 typedef uint16_t hb_ot_layout_feature_mask_t;
96 #define HB_OT_LAYOUT_MAX_NESTING_LEVEL 100
98 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX ((unsigned int) 0xFFFF)
99 #define HB_OT_LAYOUT_NO_FEATURE_INDEX ((unsigned int) 0xFFFF)
100 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX ((unsigned int) 0xFFFF)
101 #define HB_OT_LAYOUT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T')
102 #define HB_OT_LAYOUT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't')
105 hb_ot_layout_table_get_script_count (hb_ot_layout_t *layout,
106 hb_ot_layout_table_type_t table_type);
109 hb_ot_layout_table_get_script_tag (hb_ot_layout_t *layout,
110 hb_ot_layout_table_type_t table_type,
111 unsigned int script_index);
114 hb_ot_layout_table_find_script (hb_ot_layout_t *layout,
115 hb_ot_layout_table_type_t table_type,
117 unsigned int *script_index);
120 hb_ot_layout_table_get_feature_count (hb_ot_layout_t *layout,
121 hb_ot_layout_table_type_t table_type);
124 hb_ot_layout_table_get_feature_tag (hb_ot_layout_t *layout,
125 hb_ot_layout_table_type_t table_type,
126 unsigned int feature_index);
129 hb_ot_layout_table_find_script (hb_ot_layout_t *layout,
130 hb_ot_layout_table_type_t table_type,
131 hb_tag_t feature_tag,
132 unsigned int *feature_index);
135 hb_ot_layout_table_get_lookup_count (hb_ot_layout_t *layout,
136 hb_ot_layout_table_type_t table_type);
139 hb_ot_layout_script_get_language_count (hb_ot_layout_t *layout,
140 hb_ot_layout_table_type_t table_type,
141 unsigned int script_index);
144 hb_ot_layout_script_get_language_tag (hb_ot_layout_t *layout,
145 hb_ot_layout_table_type_t table_type,
146 unsigned int script_index,
147 unsigned int language_index);
150 hb_ot_layout_script_find_language (hb_ot_layout_t *layout,
151 hb_ot_layout_table_type_t table_type,
152 unsigned int script_index,
153 hb_tag_t language_tag,
154 unsigned int *language_index);
157 hb_ot_layout_language_get_required_feature_index (hb_ot_layout_t *layout,
158 hb_ot_layout_table_type_t table_type,
159 unsigned int script_index,
160 unsigned int language_index,
161 unsigned int *feature_index);
164 hb_ot_layout_language_get_feature_count (hb_ot_layout_t *layout,
165 hb_ot_layout_table_type_t table_type,
166 unsigned int script_index,
167 unsigned int language_index);
170 hb_ot_layout_language_get_feature_index (hb_ot_layout_t *layout,
171 hb_ot_layout_table_type_t table_type,
172 unsigned int script_index,
173 unsigned int language_index,
174 unsigned int num_feature);
177 hb_ot_layout_language_get_feature_tag (hb_ot_layout_t *layout,
178 hb_ot_layout_table_type_t table_type,
179 unsigned int script_index,
180 unsigned int language_index,
181 unsigned int num_feature);
184 hb_ot_layout_language_find_feature (hb_ot_layout_t *layout,
185 hb_ot_layout_table_type_t table_type,
186 unsigned int script_index,
187 unsigned int language_index,
188 hb_tag_t feature_tag,
189 unsigned int *feature_index);
192 hb_ot_layout_feature_get_lookup_count (hb_ot_layout_t *layout,
193 hb_ot_layout_table_type_t table_type,
194 unsigned int feature_index);
197 hb_ot_layout_feature_get_lookup_index (hb_ot_layout_t *layout,
198 hb_ot_layout_table_type_t table_type,
199 unsigned int feature_index,
200 unsigned int num_lookup);
207 hb_ot_layout_substitute_lookup (hb_ot_layout_t *layout,
209 unsigned int lookup_index,
210 hb_ot_layout_feature_mask_t mask);
223 #define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)
229 #endif /* HB_OT_LAYOUT_H */