1 /***************************************************************************/ 2 /* */ 3 /* otlcommn.h */ 4 /* */ 5 /* OpenType layout support, common tables (specification). */ 6 /* */ 7 /* Copyright 2002 by */ 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 /* */ 10 /* This file is part of the FreeType project, and may only be used, */ 11 /* modified, and distributed under the terms of the FreeType project */ 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 /* this file you indicate that you have read the license and */ 14 /* understand and accept it fully. */ 15 /* */ 16 /***************************************************************************/ 17 18 19 #ifndef __OTLCOMMN_H__ 20 #define __OTLCOMMN_H__ 21 22 #include "otlayout.h" 23 24 OTL_BEGIN_HEADER 25 26 27 /*************************************************************************/ 28 /*************************************************************************/ 29 /***** *****/ 30 /***** COVERAGE TABLE *****/ 31 /***** *****/ 32 /*************************************************************************/ 33 /*************************************************************************/ 34 35 /* validate coverage table */ 36 OTL_LOCALDEF( void ) 37 otl_coverage_validate( OTL_Bytes base, 38 OTL_Validator valid ); 39 40 /* return number of covered glyphs */ 41 OTL_LOCALDEF( OTL_UInt ) 42 otl_coverage_get_count( OTL_Bytes base ); 43 44 /* Return the coverage index corresponding to a glyph glyph index. */ 45 /* Return -1 if the glyph isn't covered. */ 46 OTL_LOCALDEF( OTL_Int ) 47 otl_coverage_get_index( OTL_Bytes base, 48 OTL_UInt glyph_index ); 49 50 51 /*************************************************************************/ 52 /*************************************************************************/ 53 /***** *****/ 54 /***** CLASS DEFINITION TABLE *****/ 55 /***** *****/ 56 /*************************************************************************/ 57 /*************************************************************************/ 58 59 /* validate class definition table */ 60 OTL_LOCALDEF( void ) 61 otl_class_definition_validate( OTL_Bytes table, 62 OTL_Validator valid ); 63 64 /* return class value for a given glyph index */ 65 OTL_LOCALDEF( OTL_UInt ) 66 otl_class_definition_get_value( OTL_Bytes table, 67 OTL_UInt glyph_index ); 68 69 70 /*************************************************************************/ 71 /*************************************************************************/ 72 /***** *****/ 73 /***** DEVICE TABLE *****/ 74 /***** *****/ 75 /*************************************************************************/ 76 /*************************************************************************/ 77 78 /* validate a device table */ 79 OTL_LOCALDEF( void ) 80 otl_device_table_validate( OTL_Bytes table, 81 OTL_Validator valid ); 82 83 /* return a device table's first size */ 84 OTL_LOCALDEF( OTL_UInt ) 85 otl_device_table_get_start( OTL_Bytes table ); 86 87 /* return a device table's last size */ 88 OTL_LOCALDEF( OTL_UInt ) 89 otl_device_table_get_end( OTL_Bytes table ); 90 91 /* return pixel adjustment for a given size */ 92 OTL_LOCALDEF( OTL_Int ) 93 otl_device_table_get_delta( OTL_Bytes table, 94 OTL_UInt size ); 95 96 97 /*************************************************************************/ 98 /*************************************************************************/ 99 /***** *****/ 100 /***** LOOKUPS *****/ 101 /***** *****/ 102 /*************************************************************************/ 103 /*************************************************************************/ 104 105 /* validate lookup table */ 106 OTL_LOCALDEF( void ) 107 otl_lookup_validate( OTL_Bytes table, 108 OTL_Validator valid ); 109 110 /* return number of sub-tables in a lookup */ 111 OTL_LOCALDEF( OTL_UInt ) 112 otl_lookup_get_count( OTL_Bytes table ); 113 114 115 /* return lookup sub-table */ 116 OTL_LOCALDEF( OTL_Bytes ) 117 otl_lookup_get_table( OTL_Bytes table, 118 OTL_UInt idx ); 119 120 121 /*************************************************************************/ 122 /*************************************************************************/ 123 /***** *****/ 124 /***** LOOKUP LISTS *****/ 125 /***** *****/ 126 /*************************************************************************/ 127 /*************************************************************************/ 128 129 /* validate lookup list */ 130 OTL_LOCALDEF( void ) 131 otl_lookup_list_validate( OTL_Bytes table, 132 OTL_Validator valid ); 133 134 /* return number of lookups in list */ 135 OTL_LOCALDEF( OTL_UInt ) 136 otl_lookup_list_get_count( OTL_Bytes table ); 137 138 /* return a given lookup from a list */ 139 OTL_LOCALDEF( OTL_Bytes ) 140 otl_lookup_list_get_lookup( OTL_Bytes table, 141 OTL_UInt idx ); 142 143 /* return lookup sub-table from a list */ 144 OTL_LOCALDEF( OTL_Bytes ) 145 otl_lookup_list_get_table( OTL_Bytes table, 146 OTL_UInt lookup_index, 147 OTL_UInt table_index ); 148 149 /* iterate over lookup list */ 150 OTL_LOCALDEF( void ) 151 otl_lookup_list_foreach( OTL_Bytes table, 152 OTL_ForeachFunc func, 153 OTL_Pointer func_data ); 154 155 156 /*************************************************************************/ 157 /*************************************************************************/ 158 /***** *****/ 159 /***** FEATURES *****/ 160 /***** *****/ 161 /*************************************************************************/ 162 /*************************************************************************/ 163 164 /* validate feature table */ 165 OTL_LOCALDEF( void ) 166 otl_feature_validate( OTL_Bytes table, 167 OTL_Validator valid ); 168 169 /* return feature's lookup count */ 170 OTL_LOCALDEF( OTL_UInt ) 171 otl_feature_get_count( OTL_Bytes table ); 172 173 /* get several lookups indices from a feature. returns the number of */ 174 /* lookups grabbed */ 175 OTL_LOCALDEF( OTL_UInt ) 176 otl_feature_get_lookups( OTL_Bytes table, 177 OTL_UInt start, 178 OTL_UInt count, 179 OTL_UInt *lookups ); 180 181 182 /*************************************************************************/ 183 /*************************************************************************/ 184 /***** *****/ 185 /***** FEATURE LIST *****/ 186 /***** *****/ 187 /*************************************************************************/ 188 /*************************************************************************/ 189 190 /* validate a feature list */ 191 OTL_LOCALDEF( void ) 192 otl_feature_list_validate( OTL_Bytes table, 193 OTL_Validator valid ); 194 195 /* return number of features in list */ 196 OTL_LOCALDEF( OTL_UInt ) 197 otl_feature_list_get_count( OTL_Bytes table ); 198 199 200 /* return a given feature from a list */ 201 OTL_LOCALDEF( OTL_Bytes ) 202 otl_feature_list_get_feature( OTL_Bytes table, 203 OTL_UInt idx ); 204 205 /* iterate over all features in a list */ 206 OTL_LOCALDEF( void ) 207 otl_feature_list_foreach( OTL_Bytes table, 208 OTL_ForeachFunc func, 209 OTL_Pointer func_data ); 210 211 212 /*************************************************************************/ 213 /*************************************************************************/ 214 /***** *****/ 215 /***** LANGUAGE SYSTEM *****/ 216 /***** *****/ 217 /*************************************************************************/ 218 /*************************************************************************/ 219 220 OTL_LOCAL( void ) 221 otl_lang_validate( OTL_Bytes table, 222 OTL_Validator valid ); 223 224 225 OTL_LOCAL( OTL_UInt ) 226 otl_lang_get_req_feature( OTL_Bytes table ); 227 228 229 OTL_LOCAL( OTL_UInt ) 230 otl_lang_get_count( OTL_Bytes table ); 231 232 233 OTL_LOCAL( OTL_UInt ) 234 otl_lang_get_features( OTL_Bytes table, 235 OTL_UInt start, 236 OTL_UInt count, 237 OTL_UInt *features ); 238 239 240 /*************************************************************************/ 241 /*************************************************************************/ 242 /***** *****/ 243 /***** SCRIPTS *****/ 244 /***** *****/ 245 /*************************************************************************/ 246 /*************************************************************************/ 247 248 OTL_LOCAL( void ) 249 otl_script_list_validate( OTL_Bytes list, 250 OTL_Validator valid ); 251 252 OTL_LOCAL( OTL_Bytes ) 253 otl_script_list_get_script( OTL_Bytes table ); 254 255 256 /*************************************************************************/ 257 /*************************************************************************/ 258 /***** *****/ 259 /***** LOOKUP LISTS *****/ 260 /***** *****/ 261 /*************************************************************************/ 262 /*************************************************************************/ 263 264 OTL_LOCAL( void ) 265 otl_lookup_list_validate( OTL_Bytes list, 266 OTL_UInt type_count, 267 OTL_ValidateFunc* type_funcs, 268 OTL_Validator valid ); 269 270 /* */ 271 272 OTL_END_HEADER 273 274 #endif /* __OTLCOMMN_H__ */ 275 276 277 /* END */ 278