OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 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 #ifndef HB_OT_LAYOUT_H |
| 28 #define HB_OT_LAYOUT_H |
| 29 |
| 30 #include "hb-common.h" |
| 31 #include "hb-buffer.h" |
| 32 #include "hb-font.h" |
| 33 |
| 34 #include "hb-ot-tag.h" |
| 35 |
| 36 HB_BEGIN_DECLS |
| 37 |
| 38 |
| 39 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F') |
| 40 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B') |
| 41 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S') |
| 42 |
| 43 /* |
| 44 * GDEF |
| 45 */ |
| 46 |
| 47 hb_bool_t |
| 48 hb_ot_layout_has_glyph_classes (hb_face_t *face); |
| 49 |
| 50 /* Not that useful. Provides list of attach points for a glyph that a |
| 51 * client may want to cache */ |
| 52 unsigned int |
| 53 hb_ot_layout_get_attach_points (hb_face_t *face, |
| 54 hb_codepoint_t glyph, |
| 55 unsigned int start_offset, |
| 56 unsigned int *point_count /* IN/OUT */, |
| 57 unsigned int *point_array /* OUT */); |
| 58 |
| 59 /* Ligature caret positions */ |
| 60 unsigned int |
| 61 hb_ot_layout_get_ligature_carets (hb_font_t *font, |
| 62 hb_face_t *face, |
| 63 hb_direction_t direction, |
| 64 hb_codepoint_t glyph, |
| 65 unsigned int start_offset, |
| 66 unsigned int *caret_count /* IN/OUT */, |
| 67 int *caret_array /* OUT */); |
| 68 |
| 69 |
| 70 /* |
| 71 * GSUB/GPOS feature query and enumeration interface |
| 72 */ |
| 73 |
| 74 #define HB_OT_LAYOUT_NO_SCRIPT_INDEX ((unsigned int) 0xFFFF) |
| 75 #define HB_OT_LAYOUT_NO_FEATURE_INDEX ((unsigned int) 0xFFFF) |
| 76 #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX ((unsigned int) 0xFFFF) |
| 77 |
| 78 unsigned int |
| 79 hb_ot_layout_table_get_script_tags (hb_face_t *face, |
| 80 hb_tag_t table_tag, |
| 81 unsigned int start_offset, |
| 82 unsigned int *script_count /* IN/OUT */, |
| 83 hb_tag_t *script_tags /* OUT */); |
| 84 |
| 85 hb_bool_t |
| 86 hb_ot_layout_table_find_script (hb_face_t *face, |
| 87 hb_tag_t table_tag, |
| 88 hb_tag_t script_tag, |
| 89 unsigned int *script_index); |
| 90 |
| 91 /* Like find_script, but takes zero-terminated array of scripts to test */ |
| 92 hb_bool_t |
| 93 hb_ot_layout_table_choose_script (hb_face_t *face, |
| 94 hb_tag_t table_tag, |
| 95 const hb_tag_t *script_tags, |
| 96 unsigned int *script_index); |
| 97 |
| 98 unsigned int |
| 99 hb_ot_layout_table_get_feature_tags (hb_face_t *face, |
| 100 hb_tag_t table_tag, |
| 101 unsigned int start_offset, |
| 102 unsigned int *feature_count /* IN/OUT */, |
| 103 hb_tag_t *feature_tags /* OUT */); |
| 104 |
| 105 unsigned int |
| 106 hb_ot_layout_script_get_language_tags (hb_face_t *face, |
| 107 hb_tag_t table_tag, |
| 108 unsigned int script_index, |
| 109 unsigned int start_offset, |
| 110 unsigned int *language_count /* IN/OUT */
, |
| 111 hb_tag_t *language_tags /* OUT */); |
| 112 |
| 113 hb_bool_t |
| 114 hb_ot_layout_script_find_language (hb_face_t *face, |
| 115 hb_tag_t table_tag, |
| 116 unsigned int script_index, |
| 117 hb_tag_t language_tag, |
| 118 unsigned int *language_index); |
| 119 |
| 120 hb_bool_t |
| 121 hb_ot_layout_language_get_required_feature_index (hb_face_t *face, |
| 122 hb_tag_t table_tag, |
| 123 unsigned int script_index, |
| 124 unsigned int language_index, |
| 125 unsigned int *feature_index); |
| 126 |
| 127 unsigned int |
| 128 hb_ot_layout_language_get_feature_indexes (hb_face_t *face, |
| 129 hb_tag_t table_tag, |
| 130 unsigned int script_index, |
| 131 unsigned int language_index, |
| 132 unsigned int start_offset, |
| 133 unsigned int *feature_count /* IN/OUT
*/, |
| 134 unsigned int *feature_indexes /* OUT
*/); |
| 135 |
| 136 unsigned int |
| 137 hb_ot_layout_language_get_feature_tags (hb_face_t *face, |
| 138 hb_tag_t table_tag, |
| 139 unsigned int script_index, |
| 140 unsigned int language_index, |
| 141 unsigned int start_offset, |
| 142 unsigned int *feature_count /* IN/OUT */
, |
| 143 hb_tag_t *feature_tags /* OUT */); |
| 144 |
| 145 hb_bool_t |
| 146 hb_ot_layout_language_find_feature (hb_face_t *face, |
| 147 hb_tag_t table_tag, |
| 148 unsigned int script_index, |
| 149 unsigned int language_index, |
| 150 hb_tag_t feature_tag, |
| 151 unsigned int *feature_index); |
| 152 |
| 153 unsigned int |
| 154 hb_ot_layout_feature_get_lookup_indexes (hb_face_t *face, |
| 155 hb_tag_t table_tag, |
| 156 unsigned int feature_index, |
| 157 unsigned int start_offset, |
| 158 unsigned int *lookup_count /* IN/OUT */
, |
| 159 unsigned int *lookup_indexes /* OUT */)
; |
| 160 |
| 161 |
| 162 /* |
| 163 * GSUB |
| 164 */ |
| 165 |
| 166 hb_bool_t |
| 167 hb_ot_layout_has_substitution (hb_face_t *face); |
| 168 |
| 169 hb_bool_t |
| 170 hb_ot_layout_substitute_lookup (hb_face_t *face, |
| 171 hb_buffer_t *buffer, |
| 172 unsigned int lookup_index, |
| 173 hb_mask_t mask); |
| 174 |
| 175 /* |
| 176 * GPOS |
| 177 */ |
| 178 |
| 179 hb_bool_t |
| 180 hb_ot_layout_has_positioning (hb_face_t *face); |
| 181 |
| 182 hb_bool_t |
| 183 hb_ot_layout_position_lookup (hb_font_t *font, |
| 184 hb_face_t *face, |
| 185 hb_buffer_t *buffer, |
| 186 unsigned int lookup_index, |
| 187 hb_mask_t mask); |
| 188 |
| 189 /* Should be called after all the position_lookup's are done */ |
| 190 void |
| 191 hb_ot_layout_position_finish (hb_buffer_t *buffer); |
| 192 |
| 193 |
| 194 HB_END_DECLS |
| 195 |
| 196 #endif /* HB_OT_LAYOUT_H */ |
OLD | NEW |