Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /***************************************************************************/ |
michael@0 | 2 | /* */ |
michael@0 | 3 | /* ftmodapi.h */ |
michael@0 | 4 | /* */ |
michael@0 | 5 | /* FreeType modules public interface (specification). */ |
michael@0 | 6 | /* */ |
michael@0 | 7 | /* Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by */ |
michael@0 | 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
michael@0 | 9 | /* */ |
michael@0 | 10 | /* This file is part of the FreeType project, and may only be used, */ |
michael@0 | 11 | /* modified, and distributed under the terms of the FreeType project */ |
michael@0 | 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
michael@0 | 13 | /* this file you indicate that you have read the license and */ |
michael@0 | 14 | /* understand and accept it fully. */ |
michael@0 | 15 | /* */ |
michael@0 | 16 | /***************************************************************************/ |
michael@0 | 17 | |
michael@0 | 18 | |
michael@0 | 19 | #ifndef __FTMODAPI_H__ |
michael@0 | 20 | #define __FTMODAPI_H__ |
michael@0 | 21 | |
michael@0 | 22 | |
michael@0 | 23 | #include <ft2build.h> |
michael@0 | 24 | #include FT_FREETYPE_H |
michael@0 | 25 | |
michael@0 | 26 | #ifdef FREETYPE_H |
michael@0 | 27 | #error "freetype.h of FreeType 1 has been loaded!" |
michael@0 | 28 | #error "Please fix the directory search order for header files" |
michael@0 | 29 | #error "so that freetype.h of FreeType 2 is found first." |
michael@0 | 30 | #endif |
michael@0 | 31 | |
michael@0 | 32 | |
michael@0 | 33 | FT_BEGIN_HEADER |
michael@0 | 34 | |
michael@0 | 35 | |
michael@0 | 36 | /*************************************************************************/ |
michael@0 | 37 | /* */ |
michael@0 | 38 | /* <Section> */ |
michael@0 | 39 | /* module_management */ |
michael@0 | 40 | /* */ |
michael@0 | 41 | /* <Title> */ |
michael@0 | 42 | /* Module Management */ |
michael@0 | 43 | /* */ |
michael@0 | 44 | /* <Abstract> */ |
michael@0 | 45 | /* How to add, upgrade, remove, and control modules from FreeType. */ |
michael@0 | 46 | /* */ |
michael@0 | 47 | /* <Description> */ |
michael@0 | 48 | /* The definitions below are used to manage modules within FreeType. */ |
michael@0 | 49 | /* Modules can be added, upgraded, and removed at runtime. */ |
michael@0 | 50 | /* Additionally, some module properties can be controlled also. */ |
michael@0 | 51 | /* */ |
michael@0 | 52 | /* Here is a list of possible values of the `module_name' field in */ |
michael@0 | 53 | /* the @FT_Module_Class structure. */ |
michael@0 | 54 | /* */ |
michael@0 | 55 | /* { */ |
michael@0 | 56 | /* autofitter */ |
michael@0 | 57 | /* bdf */ |
michael@0 | 58 | /* cff */ |
michael@0 | 59 | /* gxvalid */ |
michael@0 | 60 | /* otvalid */ |
michael@0 | 61 | /* pcf */ |
michael@0 | 62 | /* pfr */ |
michael@0 | 63 | /* psaux */ |
michael@0 | 64 | /* pshinter */ |
michael@0 | 65 | /* psnames */ |
michael@0 | 66 | /* raster1, raster5 */ |
michael@0 | 67 | /* sfnt */ |
michael@0 | 68 | /* smooth, smooth-lcd, smooth-lcdv */ |
michael@0 | 69 | /* truetype */ |
michael@0 | 70 | /* type1 */ |
michael@0 | 71 | /* type42 */ |
michael@0 | 72 | /* t1cid */ |
michael@0 | 73 | /* winfonts */ |
michael@0 | 74 | /* } */ |
michael@0 | 75 | /* */ |
michael@0 | 76 | /* Note that the FreeType Cache sub-system is not a FreeType module. */ |
michael@0 | 77 | /* */ |
michael@0 | 78 | /*************************************************************************/ |
michael@0 | 79 | |
michael@0 | 80 | |
michael@0 | 81 | /* module bit flags */ |
michael@0 | 82 | #define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ |
michael@0 | 83 | #define FT_MODULE_RENDERER 2 /* this module is a renderer */ |
michael@0 | 84 | #define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ |
michael@0 | 85 | #define FT_MODULE_STYLER 8 /* this module is a styler */ |
michael@0 | 86 | |
michael@0 | 87 | #define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ |
michael@0 | 88 | /* scalable fonts */ |
michael@0 | 89 | #define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ |
michael@0 | 90 | /* support vector outlines */ |
michael@0 | 91 | #define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ |
michael@0 | 92 | /* own hinter */ |
michael@0 | 93 | |
michael@0 | 94 | |
michael@0 | 95 | /* deprecated values */ |
michael@0 | 96 | #define ft_module_font_driver FT_MODULE_FONT_DRIVER |
michael@0 | 97 | #define ft_module_renderer FT_MODULE_RENDERER |
michael@0 | 98 | #define ft_module_hinter FT_MODULE_HINTER |
michael@0 | 99 | #define ft_module_styler FT_MODULE_STYLER |
michael@0 | 100 | |
michael@0 | 101 | #define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE |
michael@0 | 102 | #define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES |
michael@0 | 103 | #define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER |
michael@0 | 104 | |
michael@0 | 105 | |
michael@0 | 106 | typedef FT_Pointer FT_Module_Interface; |
michael@0 | 107 | |
michael@0 | 108 | |
michael@0 | 109 | /*************************************************************************/ |
michael@0 | 110 | /* */ |
michael@0 | 111 | /* <FuncType> */ |
michael@0 | 112 | /* FT_Module_Constructor */ |
michael@0 | 113 | /* */ |
michael@0 | 114 | /* <Description> */ |
michael@0 | 115 | /* A function used to initialize (not create) a new module object. */ |
michael@0 | 116 | /* */ |
michael@0 | 117 | /* <Input> */ |
michael@0 | 118 | /* module :: The module to initialize. */ |
michael@0 | 119 | /* */ |
michael@0 | 120 | typedef FT_Error |
michael@0 | 121 | (*FT_Module_Constructor)( FT_Module module ); |
michael@0 | 122 | |
michael@0 | 123 | |
michael@0 | 124 | /*************************************************************************/ |
michael@0 | 125 | /* */ |
michael@0 | 126 | /* <FuncType> */ |
michael@0 | 127 | /* FT_Module_Destructor */ |
michael@0 | 128 | /* */ |
michael@0 | 129 | /* <Description> */ |
michael@0 | 130 | /* A function used to finalize (not destroy) a given module object. */ |
michael@0 | 131 | /* */ |
michael@0 | 132 | /* <Input> */ |
michael@0 | 133 | /* module :: The module to finalize. */ |
michael@0 | 134 | /* */ |
michael@0 | 135 | typedef void |
michael@0 | 136 | (*FT_Module_Destructor)( FT_Module module ); |
michael@0 | 137 | |
michael@0 | 138 | |
michael@0 | 139 | /*************************************************************************/ |
michael@0 | 140 | /* */ |
michael@0 | 141 | /* <FuncType> */ |
michael@0 | 142 | /* FT_Module_Requester */ |
michael@0 | 143 | /* */ |
michael@0 | 144 | /* <Description> */ |
michael@0 | 145 | /* A function used to query a given module for a specific interface. */ |
michael@0 | 146 | /* */ |
michael@0 | 147 | /* <Input> */ |
michael@0 | 148 | /* module :: The module to be searched. */ |
michael@0 | 149 | /* */ |
michael@0 | 150 | /* name :: The name of the interface in the module. */ |
michael@0 | 151 | /* */ |
michael@0 | 152 | typedef FT_Module_Interface |
michael@0 | 153 | (*FT_Module_Requester)( FT_Module module, |
michael@0 | 154 | const char* name ); |
michael@0 | 155 | |
michael@0 | 156 | |
michael@0 | 157 | /*************************************************************************/ |
michael@0 | 158 | /* */ |
michael@0 | 159 | /* <Struct> */ |
michael@0 | 160 | /* FT_Module_Class */ |
michael@0 | 161 | /* */ |
michael@0 | 162 | /* <Description> */ |
michael@0 | 163 | /* The module class descriptor. */ |
michael@0 | 164 | /* */ |
michael@0 | 165 | /* <Fields> */ |
michael@0 | 166 | /* module_flags :: Bit flags describing the module. */ |
michael@0 | 167 | /* */ |
michael@0 | 168 | /* module_size :: The size of one module object/instance in */ |
michael@0 | 169 | /* bytes. */ |
michael@0 | 170 | /* */ |
michael@0 | 171 | /* module_name :: The name of the module. */ |
michael@0 | 172 | /* */ |
michael@0 | 173 | /* module_version :: The version, as a 16.16 fixed number */ |
michael@0 | 174 | /* (major.minor). */ |
michael@0 | 175 | /* */ |
michael@0 | 176 | /* module_requires :: The version of FreeType this module requires, */ |
michael@0 | 177 | /* as a 16.16 fixed number (major.minor). Starts */ |
michael@0 | 178 | /* at version 2.0, i.e., 0x20000. */ |
michael@0 | 179 | /* */ |
michael@0 | 180 | /* module_init :: The initializing function. */ |
michael@0 | 181 | /* */ |
michael@0 | 182 | /* module_done :: The finalizing function. */ |
michael@0 | 183 | /* */ |
michael@0 | 184 | /* get_interface :: The interface requesting function. */ |
michael@0 | 185 | /* */ |
michael@0 | 186 | typedef struct FT_Module_Class_ |
michael@0 | 187 | { |
michael@0 | 188 | FT_ULong module_flags; |
michael@0 | 189 | FT_Long module_size; |
michael@0 | 190 | const FT_String* module_name; |
michael@0 | 191 | FT_Fixed module_version; |
michael@0 | 192 | FT_Fixed module_requires; |
michael@0 | 193 | |
michael@0 | 194 | const void* module_interface; |
michael@0 | 195 | |
michael@0 | 196 | FT_Module_Constructor module_init; |
michael@0 | 197 | FT_Module_Destructor module_done; |
michael@0 | 198 | FT_Module_Requester get_interface; |
michael@0 | 199 | |
michael@0 | 200 | } FT_Module_Class; |
michael@0 | 201 | |
michael@0 | 202 | |
michael@0 | 203 | /*************************************************************************/ |
michael@0 | 204 | /* */ |
michael@0 | 205 | /* <Function> */ |
michael@0 | 206 | /* FT_Add_Module */ |
michael@0 | 207 | /* */ |
michael@0 | 208 | /* <Description> */ |
michael@0 | 209 | /* Add a new module to a given library instance. */ |
michael@0 | 210 | /* */ |
michael@0 | 211 | /* <InOut> */ |
michael@0 | 212 | /* library :: A handle to the library object. */ |
michael@0 | 213 | /* */ |
michael@0 | 214 | /* <Input> */ |
michael@0 | 215 | /* clazz :: A pointer to class descriptor for the module. */ |
michael@0 | 216 | /* */ |
michael@0 | 217 | /* <Return> */ |
michael@0 | 218 | /* FreeType error code. 0~means success. */ |
michael@0 | 219 | /* */ |
michael@0 | 220 | /* <Note> */ |
michael@0 | 221 | /* An error will be returned if a module already exists by that name, */ |
michael@0 | 222 | /* or if the module requires a version of FreeType that is too great. */ |
michael@0 | 223 | /* */ |
michael@0 | 224 | FT_EXPORT( FT_Error ) |
michael@0 | 225 | FT_Add_Module( FT_Library library, |
michael@0 | 226 | const FT_Module_Class* clazz ); |
michael@0 | 227 | |
michael@0 | 228 | |
michael@0 | 229 | /*************************************************************************/ |
michael@0 | 230 | /* */ |
michael@0 | 231 | /* <Function> */ |
michael@0 | 232 | /* FT_Get_Module */ |
michael@0 | 233 | /* */ |
michael@0 | 234 | /* <Description> */ |
michael@0 | 235 | /* Find a module by its name. */ |
michael@0 | 236 | /* */ |
michael@0 | 237 | /* <Input> */ |
michael@0 | 238 | /* library :: A handle to the library object. */ |
michael@0 | 239 | /* */ |
michael@0 | 240 | /* module_name :: The module's name (as an ASCII string). */ |
michael@0 | 241 | /* */ |
michael@0 | 242 | /* <Return> */ |
michael@0 | 243 | /* A module handle. 0~if none was found. */ |
michael@0 | 244 | /* */ |
michael@0 | 245 | /* <Note> */ |
michael@0 | 246 | /* FreeType's internal modules aren't documented very well, and you */ |
michael@0 | 247 | /* should look up the source code for details. */ |
michael@0 | 248 | /* */ |
michael@0 | 249 | FT_EXPORT( FT_Module ) |
michael@0 | 250 | FT_Get_Module( FT_Library library, |
michael@0 | 251 | const char* module_name ); |
michael@0 | 252 | |
michael@0 | 253 | |
michael@0 | 254 | /*************************************************************************/ |
michael@0 | 255 | /* */ |
michael@0 | 256 | /* <Function> */ |
michael@0 | 257 | /* FT_Remove_Module */ |
michael@0 | 258 | /* */ |
michael@0 | 259 | /* <Description> */ |
michael@0 | 260 | /* Remove a given module from a library instance. */ |
michael@0 | 261 | /* */ |
michael@0 | 262 | /* <InOut> */ |
michael@0 | 263 | /* library :: A handle to a library object. */ |
michael@0 | 264 | /* */ |
michael@0 | 265 | /* <Input> */ |
michael@0 | 266 | /* module :: A handle to a module object. */ |
michael@0 | 267 | /* */ |
michael@0 | 268 | /* <Return> */ |
michael@0 | 269 | /* FreeType error code. 0~means success. */ |
michael@0 | 270 | /* */ |
michael@0 | 271 | /* <Note> */ |
michael@0 | 272 | /* The module object is destroyed by the function in case of success. */ |
michael@0 | 273 | /* */ |
michael@0 | 274 | FT_EXPORT( FT_Error ) |
michael@0 | 275 | FT_Remove_Module( FT_Library library, |
michael@0 | 276 | FT_Module module ); |
michael@0 | 277 | |
michael@0 | 278 | |
michael@0 | 279 | /********************************************************************** |
michael@0 | 280 | * |
michael@0 | 281 | * @function: |
michael@0 | 282 | * FT_Property_Set |
michael@0 | 283 | * |
michael@0 | 284 | * @description: |
michael@0 | 285 | * Set a property for a given module. |
michael@0 | 286 | * |
michael@0 | 287 | * @input: |
michael@0 | 288 | * library :: |
michael@0 | 289 | * A handle to the library the module is part of. |
michael@0 | 290 | * |
michael@0 | 291 | * module_name :: |
michael@0 | 292 | * The module name. |
michael@0 | 293 | * |
michael@0 | 294 | * property_name :: |
michael@0 | 295 | * The property name. Properties are described in the `Synopsis' |
michael@0 | 296 | * subsection of the module's documentation. |
michael@0 | 297 | * |
michael@0 | 298 | * Note that only a few modules have properties. |
michael@0 | 299 | * |
michael@0 | 300 | * value :: |
michael@0 | 301 | * A generic pointer to a variable or structure that gives the new |
michael@0 | 302 | * value of the property. The exact definition of `value' is |
michael@0 | 303 | * dependent on the property; see the `Synopsis' subsection of the |
michael@0 | 304 | * module's documentation. |
michael@0 | 305 | * |
michael@0 | 306 | * @return: |
michael@0 | 307 | * FreeType error code. 0~means success. |
michael@0 | 308 | * |
michael@0 | 309 | * @note: |
michael@0 | 310 | * If `module_name' isn't a valid module name, or `property_name' |
michael@0 | 311 | * doesn't specify a valid property, or if `value' doesn't represent a |
michael@0 | 312 | * valid value for the given property, an error is returned. |
michael@0 | 313 | * |
michael@0 | 314 | * The following example sets property `bar' (a simple integer) in |
michael@0 | 315 | * module `foo' to value~1. |
michael@0 | 316 | * |
michael@0 | 317 | * { |
michael@0 | 318 | * FT_UInt bar; |
michael@0 | 319 | * |
michael@0 | 320 | * |
michael@0 | 321 | * bar = 1; |
michael@0 | 322 | * FT_Property_Set( library, "foo", "bar", &bar ); |
michael@0 | 323 | * } |
michael@0 | 324 | * |
michael@0 | 325 | * Note that the FreeType Cache sub-system doesn't recognize module |
michael@0 | 326 | * property changes. To avoid glyph lookup confusion within the cache |
michael@0 | 327 | * you should call @FTC_Manager_Reset to completely flush the cache if |
michael@0 | 328 | * a module property gets changed after @FTC_Manager_New has been |
michael@0 | 329 | * called. |
michael@0 | 330 | * |
michael@0 | 331 | * It is not possible to set properties of the FreeType Cache |
michael@0 | 332 | * sub-system itself with FT_Property_Set; use @FTC_Property_Set |
michael@0 | 333 | * instead. |
michael@0 | 334 | * |
michael@0 | 335 | * @since: |
michael@0 | 336 | * 2.4.11 |
michael@0 | 337 | * |
michael@0 | 338 | */ |
michael@0 | 339 | FT_EXPORT( FT_Error ) |
michael@0 | 340 | FT_Property_Set( FT_Library library, |
michael@0 | 341 | const FT_String* module_name, |
michael@0 | 342 | const FT_String* property_name, |
michael@0 | 343 | const void* value ); |
michael@0 | 344 | |
michael@0 | 345 | |
michael@0 | 346 | /********************************************************************** |
michael@0 | 347 | * |
michael@0 | 348 | * @function: |
michael@0 | 349 | * FT_Property_Get |
michael@0 | 350 | * |
michael@0 | 351 | * @description: |
michael@0 | 352 | * Get a module's property value. |
michael@0 | 353 | * |
michael@0 | 354 | * @input: |
michael@0 | 355 | * library :: |
michael@0 | 356 | * A handle to the library the module is part of. |
michael@0 | 357 | * |
michael@0 | 358 | * module_name :: |
michael@0 | 359 | * The module name. |
michael@0 | 360 | * |
michael@0 | 361 | * property_name :: |
michael@0 | 362 | * The property name. Properties are described in the `Synopsis' |
michael@0 | 363 | * subsection of the module's documentation. |
michael@0 | 364 | * |
michael@0 | 365 | * @inout: |
michael@0 | 366 | * value :: |
michael@0 | 367 | * A generic pointer to a variable or structure that gives the |
michael@0 | 368 | * value of the property. The exact definition of `value' is |
michael@0 | 369 | * dependent on the property; see the `Synopsis' subsection of the |
michael@0 | 370 | * module's documentation. |
michael@0 | 371 | * |
michael@0 | 372 | * @return: |
michael@0 | 373 | * FreeType error code. 0~means success. |
michael@0 | 374 | * |
michael@0 | 375 | * @note: |
michael@0 | 376 | * If `module_name' isn't a valid module name, or `property_name' |
michael@0 | 377 | * doesn't specify a valid property, or if `value' doesn't represent a |
michael@0 | 378 | * valid value for the given property, an error is returned. |
michael@0 | 379 | * |
michael@0 | 380 | * The following example gets property `baz' (a range) in module `foo'. |
michael@0 | 381 | * |
michael@0 | 382 | * { |
michael@0 | 383 | * typedef range_ |
michael@0 | 384 | * { |
michael@0 | 385 | * FT_Int32 min; |
michael@0 | 386 | * FT_Int32 max; |
michael@0 | 387 | * |
michael@0 | 388 | * } range; |
michael@0 | 389 | * |
michael@0 | 390 | * range baz; |
michael@0 | 391 | * |
michael@0 | 392 | * |
michael@0 | 393 | * FT_Property_Get( library, "foo", "baz", &baz ); |
michael@0 | 394 | * } |
michael@0 | 395 | * |
michael@0 | 396 | * It is not possible to retrieve properties of the FreeType Cache |
michael@0 | 397 | * sub-system with FT_Property_Get; use @FTC_Property_Get instead. |
michael@0 | 398 | * |
michael@0 | 399 | * @since: |
michael@0 | 400 | * 2.4.11 |
michael@0 | 401 | * |
michael@0 | 402 | */ |
michael@0 | 403 | FT_EXPORT( FT_Error ) |
michael@0 | 404 | FT_Property_Get( FT_Library library, |
michael@0 | 405 | const FT_String* module_name, |
michael@0 | 406 | const FT_String* property_name, |
michael@0 | 407 | void* value ); |
michael@0 | 408 | |
michael@0 | 409 | |
michael@0 | 410 | /*************************************************************************/ |
michael@0 | 411 | /* */ |
michael@0 | 412 | /* <Function> */ |
michael@0 | 413 | /* FT_Reference_Library */ |
michael@0 | 414 | /* */ |
michael@0 | 415 | /* <Description> */ |
michael@0 | 416 | /* A counter gets initialized to~1 at the time an @FT_Library */ |
michael@0 | 417 | /* structure is created. This function increments the counter. */ |
michael@0 | 418 | /* @FT_Done_Library then only destroys a library if the counter is~1, */ |
michael@0 | 419 | /* otherwise it simply decrements the counter. */ |
michael@0 | 420 | /* */ |
michael@0 | 421 | /* This function helps in managing life-cycles of structures that */ |
michael@0 | 422 | /* reference @FT_Library objects. */ |
michael@0 | 423 | /* */ |
michael@0 | 424 | /* <Input> */ |
michael@0 | 425 | /* library :: A handle to a target library object. */ |
michael@0 | 426 | /* */ |
michael@0 | 427 | /* <Return> */ |
michael@0 | 428 | /* FreeType error code. 0~means success. */ |
michael@0 | 429 | /* */ |
michael@0 | 430 | /* <Since> */ |
michael@0 | 431 | /* 2.4.2 */ |
michael@0 | 432 | /* */ |
michael@0 | 433 | FT_EXPORT( FT_Error ) |
michael@0 | 434 | FT_Reference_Library( FT_Library library ); |
michael@0 | 435 | |
michael@0 | 436 | |
michael@0 | 437 | /*************************************************************************/ |
michael@0 | 438 | /* */ |
michael@0 | 439 | /* <Function> */ |
michael@0 | 440 | /* FT_New_Library */ |
michael@0 | 441 | /* */ |
michael@0 | 442 | /* <Description> */ |
michael@0 | 443 | /* This function is used to create a new FreeType library instance */ |
michael@0 | 444 | /* from a given memory object. It is thus possible to use libraries */ |
michael@0 | 445 | /* with distinct memory allocators within the same program. */ |
michael@0 | 446 | /* */ |
michael@0 | 447 | /* Normally, you would call this function (followed by a call to */ |
michael@0 | 448 | /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ |
michael@0 | 449 | /* instead of @FT_Init_FreeType to initialize the FreeType library. */ |
michael@0 | 450 | /* */ |
michael@0 | 451 | /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ |
michael@0 | 452 | /* library instance. */ |
michael@0 | 453 | /* */ |
michael@0 | 454 | /* <Input> */ |
michael@0 | 455 | /* memory :: A handle to the original memory object. */ |
michael@0 | 456 | /* */ |
michael@0 | 457 | /* <Output> */ |
michael@0 | 458 | /* alibrary :: A pointer to handle of a new library object. */ |
michael@0 | 459 | /* */ |
michael@0 | 460 | /* <Return> */ |
michael@0 | 461 | /* FreeType error code. 0~means success. */ |
michael@0 | 462 | /* */ |
michael@0 | 463 | /* <Note> */ |
michael@0 | 464 | /* See the discussion of reference counters in the description of */ |
michael@0 | 465 | /* @FT_Reference_Library. */ |
michael@0 | 466 | /* */ |
michael@0 | 467 | FT_EXPORT( FT_Error ) |
michael@0 | 468 | FT_New_Library( FT_Memory memory, |
michael@0 | 469 | FT_Library *alibrary ); |
michael@0 | 470 | |
michael@0 | 471 | |
michael@0 | 472 | /*************************************************************************/ |
michael@0 | 473 | /* */ |
michael@0 | 474 | /* <Function> */ |
michael@0 | 475 | /* FT_Done_Library */ |
michael@0 | 476 | /* */ |
michael@0 | 477 | /* <Description> */ |
michael@0 | 478 | /* Discard a given library object. This closes all drivers and */ |
michael@0 | 479 | /* discards all resource objects. */ |
michael@0 | 480 | /* */ |
michael@0 | 481 | /* <Input> */ |
michael@0 | 482 | /* library :: A handle to the target library. */ |
michael@0 | 483 | /* */ |
michael@0 | 484 | /* <Return> */ |
michael@0 | 485 | /* FreeType error code. 0~means success. */ |
michael@0 | 486 | /* */ |
michael@0 | 487 | /* <Note> */ |
michael@0 | 488 | /* See the discussion of reference counters in the description of */ |
michael@0 | 489 | /* @FT_Reference_Library. */ |
michael@0 | 490 | /* */ |
michael@0 | 491 | FT_EXPORT( FT_Error ) |
michael@0 | 492 | FT_Done_Library( FT_Library library ); |
michael@0 | 493 | |
michael@0 | 494 | /* */ |
michael@0 | 495 | |
michael@0 | 496 | typedef void |
michael@0 | 497 | (*FT_DebugHook_Func)( void* arg ); |
michael@0 | 498 | |
michael@0 | 499 | |
michael@0 | 500 | /*************************************************************************/ |
michael@0 | 501 | /* */ |
michael@0 | 502 | /* <Function> */ |
michael@0 | 503 | /* FT_Set_Debug_Hook */ |
michael@0 | 504 | /* */ |
michael@0 | 505 | /* <Description> */ |
michael@0 | 506 | /* Set a debug hook function for debugging the interpreter of a font */ |
michael@0 | 507 | /* format. */ |
michael@0 | 508 | /* */ |
michael@0 | 509 | /* <InOut> */ |
michael@0 | 510 | /* library :: A handle to the library object. */ |
michael@0 | 511 | /* */ |
michael@0 | 512 | /* <Input> */ |
michael@0 | 513 | /* hook_index :: The index of the debug hook. You should use the */ |
michael@0 | 514 | /* values defined in `ftobjs.h', e.g., */ |
michael@0 | 515 | /* `FT_DEBUG_HOOK_TRUETYPE'. */ |
michael@0 | 516 | /* */ |
michael@0 | 517 | /* debug_hook :: The function used to debug the interpreter. */ |
michael@0 | 518 | /* */ |
michael@0 | 519 | /* <Note> */ |
michael@0 | 520 | /* Currently, four debug hook slots are available, but only two (for */ |
michael@0 | 521 | /* the TrueType and the Type~1 interpreter) are defined. */ |
michael@0 | 522 | /* */ |
michael@0 | 523 | /* Since the internal headers of FreeType are no longer installed, */ |
michael@0 | 524 | /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ |
michael@0 | 525 | /* This is a bug and will be fixed in a forthcoming release. */ |
michael@0 | 526 | /* */ |
michael@0 | 527 | FT_EXPORT( void ) |
michael@0 | 528 | FT_Set_Debug_Hook( FT_Library library, |
michael@0 | 529 | FT_UInt hook_index, |
michael@0 | 530 | FT_DebugHook_Func debug_hook ); |
michael@0 | 531 | |
michael@0 | 532 | |
michael@0 | 533 | /*************************************************************************/ |
michael@0 | 534 | /* */ |
michael@0 | 535 | /* <Function> */ |
michael@0 | 536 | /* FT_Add_Default_Modules */ |
michael@0 | 537 | /* */ |
michael@0 | 538 | /* <Description> */ |
michael@0 | 539 | /* Add the set of default drivers to a given library object. */ |
michael@0 | 540 | /* This is only useful when you create a library object with */ |
michael@0 | 541 | /* @FT_New_Library (usually to plug a custom memory manager). */ |
michael@0 | 542 | /* */ |
michael@0 | 543 | /* <InOut> */ |
michael@0 | 544 | /* library :: A handle to a new library object. */ |
michael@0 | 545 | /* */ |
michael@0 | 546 | FT_EXPORT( void ) |
michael@0 | 547 | FT_Add_Default_Modules( FT_Library library ); |
michael@0 | 548 | |
michael@0 | 549 | |
michael@0 | 550 | |
michael@0 | 551 | /************************************************************************** |
michael@0 | 552 | * |
michael@0 | 553 | * @section: |
michael@0 | 554 | * truetype_engine |
michael@0 | 555 | * |
michael@0 | 556 | * @title: |
michael@0 | 557 | * The TrueType Engine |
michael@0 | 558 | * |
michael@0 | 559 | * @abstract: |
michael@0 | 560 | * TrueType bytecode support. |
michael@0 | 561 | * |
michael@0 | 562 | * @description: |
michael@0 | 563 | * This section contains a function used to query the level of TrueType |
michael@0 | 564 | * bytecode support compiled in this version of the library. |
michael@0 | 565 | * |
michael@0 | 566 | */ |
michael@0 | 567 | |
michael@0 | 568 | |
michael@0 | 569 | /************************************************************************** |
michael@0 | 570 | * |
michael@0 | 571 | * @enum: |
michael@0 | 572 | * FT_TrueTypeEngineType |
michael@0 | 573 | * |
michael@0 | 574 | * @description: |
michael@0 | 575 | * A list of values describing which kind of TrueType bytecode |
michael@0 | 576 | * engine is implemented in a given FT_Library instance. It is used |
michael@0 | 577 | * by the @FT_Get_TrueType_Engine_Type function. |
michael@0 | 578 | * |
michael@0 | 579 | * @values: |
michael@0 | 580 | * FT_TRUETYPE_ENGINE_TYPE_NONE :: |
michael@0 | 581 | * The library doesn't implement any kind of bytecode interpreter. |
michael@0 | 582 | * |
michael@0 | 583 | * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: |
michael@0 | 584 | * The library implements a bytecode interpreter that doesn't |
michael@0 | 585 | * support the patented operations of the TrueType virtual machine. |
michael@0 | 586 | * |
michael@0 | 587 | * Its main use is to load certain Asian fonts that position and |
michael@0 | 588 | * scale glyph components with bytecode instructions. It produces |
michael@0 | 589 | * bad output for most other fonts. |
michael@0 | 590 | * |
michael@0 | 591 | * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: |
michael@0 | 592 | * The library implements a bytecode interpreter that covers |
michael@0 | 593 | * the full instruction set of the TrueType virtual machine (this |
michael@0 | 594 | * was governed by patents until May 2010, hence the name). |
michael@0 | 595 | * |
michael@0 | 596 | * @since: |
michael@0 | 597 | * 2.2 |
michael@0 | 598 | * |
michael@0 | 599 | */ |
michael@0 | 600 | typedef enum FT_TrueTypeEngineType_ |
michael@0 | 601 | { |
michael@0 | 602 | FT_TRUETYPE_ENGINE_TYPE_NONE = 0, |
michael@0 | 603 | FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, |
michael@0 | 604 | FT_TRUETYPE_ENGINE_TYPE_PATENTED |
michael@0 | 605 | |
michael@0 | 606 | } FT_TrueTypeEngineType; |
michael@0 | 607 | |
michael@0 | 608 | |
michael@0 | 609 | /************************************************************************** |
michael@0 | 610 | * |
michael@0 | 611 | * @func: |
michael@0 | 612 | * FT_Get_TrueType_Engine_Type |
michael@0 | 613 | * |
michael@0 | 614 | * @description: |
michael@0 | 615 | * Return an @FT_TrueTypeEngineType value to indicate which level of |
michael@0 | 616 | * the TrueType virtual machine a given library instance supports. |
michael@0 | 617 | * |
michael@0 | 618 | * @input: |
michael@0 | 619 | * library :: |
michael@0 | 620 | * A library instance. |
michael@0 | 621 | * |
michael@0 | 622 | * @return: |
michael@0 | 623 | * A value indicating which level is supported. |
michael@0 | 624 | * |
michael@0 | 625 | * @since: |
michael@0 | 626 | * 2.2 |
michael@0 | 627 | * |
michael@0 | 628 | */ |
michael@0 | 629 | FT_EXPORT( FT_TrueTypeEngineType ) |
michael@0 | 630 | FT_Get_TrueType_Engine_Type( FT_Library library ); |
michael@0 | 631 | |
michael@0 | 632 | |
michael@0 | 633 | /* */ |
michael@0 | 634 | |
michael@0 | 635 | |
michael@0 | 636 | FT_END_HEADER |
michael@0 | 637 | |
michael@0 | 638 | #endif /* __FTMODAPI_H__ */ |
michael@0 | 639 | |
michael@0 | 640 | |
michael@0 | 641 | /* END */ |