vrshoot

annotate libs/ft2static/freetype/ftmodapi.h @ 1:e7ca128b8713

looks nice :)
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 00:35:22 +0200
parents
children
rev   line source
nuclear@0 1 /***************************************************************************/
nuclear@0 2 /* */
nuclear@0 3 /* ftmodapi.h */
nuclear@0 4 /* */
nuclear@0 5 /* FreeType modules public interface (specification). */
nuclear@0 6 /* */
nuclear@0 7 /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */
nuclear@0 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
nuclear@0 9 /* */
nuclear@0 10 /* This file is part of the FreeType project, and may only be used, */
nuclear@0 11 /* modified, and distributed under the terms of the FreeType project */
nuclear@0 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
nuclear@0 13 /* this file you indicate that you have read the license and */
nuclear@0 14 /* understand and accept it fully. */
nuclear@0 15 /* */
nuclear@0 16 /***************************************************************************/
nuclear@0 17
nuclear@0 18
nuclear@0 19 #ifndef __FTMODAPI_H__
nuclear@0 20 #define __FTMODAPI_H__
nuclear@0 21
nuclear@0 22
nuclear@0 23 #include <ft2build.h>
nuclear@0 24 #include FT_FREETYPE_H
nuclear@0 25
nuclear@0 26 #ifdef FREETYPE_H
nuclear@0 27 #error "freetype.h of FreeType 1 has been loaded!"
nuclear@0 28 #error "Please fix the directory search order for header files"
nuclear@0 29 #error "so that freetype.h of FreeType 2 is found first."
nuclear@0 30 #endif
nuclear@0 31
nuclear@0 32
nuclear@0 33 FT_BEGIN_HEADER
nuclear@0 34
nuclear@0 35
nuclear@0 36 /*************************************************************************/
nuclear@0 37 /* */
nuclear@0 38 /* <Section> */
nuclear@0 39 /* module_management */
nuclear@0 40 /* */
nuclear@0 41 /* <Title> */
nuclear@0 42 /* Module Management */
nuclear@0 43 /* */
nuclear@0 44 /* <Abstract> */
nuclear@0 45 /* How to add, upgrade, and remove modules from FreeType. */
nuclear@0 46 /* */
nuclear@0 47 /* <Description> */
nuclear@0 48 /* The definitions below are used to manage modules within FreeType. */
nuclear@0 49 /* Modules can be added, upgraded, and removed at runtime. */
nuclear@0 50 /* */
nuclear@0 51 /*************************************************************************/
nuclear@0 52
nuclear@0 53
nuclear@0 54 /* module bit flags */
nuclear@0 55 #define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
nuclear@0 56 #define FT_MODULE_RENDERER 2 /* this module is a renderer */
nuclear@0 57 #define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
nuclear@0 58 #define FT_MODULE_STYLER 8 /* this module is a styler */
nuclear@0 59
nuclear@0 60 #define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
nuclear@0 61 /* scalable fonts */
nuclear@0 62 #define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
nuclear@0 63 /* support vector outlines */
nuclear@0 64 #define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
nuclear@0 65 /* own hinter */
nuclear@0 66
nuclear@0 67
nuclear@0 68 /* deprecated values */
nuclear@0 69 #define ft_module_font_driver FT_MODULE_FONT_DRIVER
nuclear@0 70 #define ft_module_renderer FT_MODULE_RENDERER
nuclear@0 71 #define ft_module_hinter FT_MODULE_HINTER
nuclear@0 72 #define ft_module_styler FT_MODULE_STYLER
nuclear@0 73
nuclear@0 74 #define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
nuclear@0 75 #define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
nuclear@0 76 #define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
nuclear@0 77
nuclear@0 78
nuclear@0 79 typedef FT_Pointer FT_Module_Interface;
nuclear@0 80
nuclear@0 81
nuclear@0 82 /*************************************************************************/
nuclear@0 83 /* */
nuclear@0 84 /* <FuncType> */
nuclear@0 85 /* FT_Module_Constructor */
nuclear@0 86 /* */
nuclear@0 87 /* <Description> */
nuclear@0 88 /* A function used to initialize (not create) a new module object. */
nuclear@0 89 /* */
nuclear@0 90 /* <Input> */
nuclear@0 91 /* module :: The module to initialize. */
nuclear@0 92 /* */
nuclear@0 93 typedef FT_Error
nuclear@0 94 (*FT_Module_Constructor)( FT_Module module );
nuclear@0 95
nuclear@0 96
nuclear@0 97 /*************************************************************************/
nuclear@0 98 /* */
nuclear@0 99 /* <FuncType> */
nuclear@0 100 /* FT_Module_Destructor */
nuclear@0 101 /* */
nuclear@0 102 /* <Description> */
nuclear@0 103 /* A function used to finalize (not destroy) a given module object. */
nuclear@0 104 /* */
nuclear@0 105 /* <Input> */
nuclear@0 106 /* module :: The module to finalize. */
nuclear@0 107 /* */
nuclear@0 108 typedef void
nuclear@0 109 (*FT_Module_Destructor)( FT_Module module );
nuclear@0 110
nuclear@0 111
nuclear@0 112 /*************************************************************************/
nuclear@0 113 /* */
nuclear@0 114 /* <FuncType> */
nuclear@0 115 /* FT_Module_Requester */
nuclear@0 116 /* */
nuclear@0 117 /* <Description> */
nuclear@0 118 /* A function used to query a given module for a specific interface. */
nuclear@0 119 /* */
nuclear@0 120 /* <Input> */
nuclear@0 121 /* module :: The module to finalize. */
nuclear@0 122 /* */
nuclear@0 123 /* name :: The name of the interface in the module. */
nuclear@0 124 /* */
nuclear@0 125 typedef FT_Module_Interface
nuclear@0 126 (*FT_Module_Requester)( FT_Module module,
nuclear@0 127 const char* name );
nuclear@0 128
nuclear@0 129
nuclear@0 130 /*************************************************************************/
nuclear@0 131 /* */
nuclear@0 132 /* <Struct> */
nuclear@0 133 /* FT_Module_Class */
nuclear@0 134 /* */
nuclear@0 135 /* <Description> */
nuclear@0 136 /* The module class descriptor. */
nuclear@0 137 /* */
nuclear@0 138 /* <Fields> */
nuclear@0 139 /* module_flags :: Bit flags describing the module. */
nuclear@0 140 /* */
nuclear@0 141 /* module_size :: The size of one module object/instance in */
nuclear@0 142 /* bytes. */
nuclear@0 143 /* */
nuclear@0 144 /* module_name :: The name of the module. */
nuclear@0 145 /* */
nuclear@0 146 /* module_version :: The version, as a 16.16 fixed number */
nuclear@0 147 /* (major.minor). */
nuclear@0 148 /* */
nuclear@0 149 /* module_requires :: The version of FreeType this module requires, */
nuclear@0 150 /* as a 16.16 fixed number (major.minor). Starts */
nuclear@0 151 /* at version 2.0, i.e., 0x20000. */
nuclear@0 152 /* */
nuclear@0 153 /* module_init :: The initializing function. */
nuclear@0 154 /* */
nuclear@0 155 /* module_done :: The finalizing function. */
nuclear@0 156 /* */
nuclear@0 157 /* get_interface :: The interface requesting function. */
nuclear@0 158 /* */
nuclear@0 159 typedef struct FT_Module_Class_
nuclear@0 160 {
nuclear@0 161 FT_ULong module_flags;
nuclear@0 162 FT_Long module_size;
nuclear@0 163 const FT_String* module_name;
nuclear@0 164 FT_Fixed module_version;
nuclear@0 165 FT_Fixed module_requires;
nuclear@0 166
nuclear@0 167 const void* module_interface;
nuclear@0 168
nuclear@0 169 FT_Module_Constructor module_init;
nuclear@0 170 FT_Module_Destructor module_done;
nuclear@0 171 FT_Module_Requester get_interface;
nuclear@0 172
nuclear@0 173 } FT_Module_Class;
nuclear@0 174
nuclear@0 175
nuclear@0 176 /*************************************************************************/
nuclear@0 177 /* */
nuclear@0 178 /* <Function> */
nuclear@0 179 /* FT_Add_Module */
nuclear@0 180 /* */
nuclear@0 181 /* <Description> */
nuclear@0 182 /* Add a new module to a given library instance. */
nuclear@0 183 /* */
nuclear@0 184 /* <InOut> */
nuclear@0 185 /* library :: A handle to the library object. */
nuclear@0 186 /* */
nuclear@0 187 /* <Input> */
nuclear@0 188 /* clazz :: A pointer to class descriptor for the module. */
nuclear@0 189 /* */
nuclear@0 190 /* <Return> */
nuclear@0 191 /* FreeType error code. 0~means success. */
nuclear@0 192 /* */
nuclear@0 193 /* <Note> */
nuclear@0 194 /* An error will be returned if a module already exists by that name, */
nuclear@0 195 /* or if the module requires a version of FreeType that is too great. */
nuclear@0 196 /* */
nuclear@0 197 FT_EXPORT( FT_Error )
nuclear@0 198 FT_Add_Module( FT_Library library,
nuclear@0 199 const FT_Module_Class* clazz );
nuclear@0 200
nuclear@0 201
nuclear@0 202 /*************************************************************************/
nuclear@0 203 /* */
nuclear@0 204 /* <Function> */
nuclear@0 205 /* FT_Get_Module */
nuclear@0 206 /* */
nuclear@0 207 /* <Description> */
nuclear@0 208 /* Find a module by its name. */
nuclear@0 209 /* */
nuclear@0 210 /* <Input> */
nuclear@0 211 /* library :: A handle to the library object. */
nuclear@0 212 /* */
nuclear@0 213 /* module_name :: The module's name (as an ASCII string). */
nuclear@0 214 /* */
nuclear@0 215 /* <Return> */
nuclear@0 216 /* A module handle. 0~if none was found. */
nuclear@0 217 /* */
nuclear@0 218 /* <Note> */
nuclear@0 219 /* FreeType's internal modules aren't documented very well, and you */
nuclear@0 220 /* should look up the source code for details. */
nuclear@0 221 /* */
nuclear@0 222 FT_EXPORT( FT_Module )
nuclear@0 223 FT_Get_Module( FT_Library library,
nuclear@0 224 const char* module_name );
nuclear@0 225
nuclear@0 226
nuclear@0 227 /*************************************************************************/
nuclear@0 228 /* */
nuclear@0 229 /* <Function> */
nuclear@0 230 /* FT_Remove_Module */
nuclear@0 231 /* */
nuclear@0 232 /* <Description> */
nuclear@0 233 /* Remove a given module from a library instance. */
nuclear@0 234 /* */
nuclear@0 235 /* <InOut> */
nuclear@0 236 /* library :: A handle to a library object. */
nuclear@0 237 /* */
nuclear@0 238 /* <Input> */
nuclear@0 239 /* module :: A handle to a module object. */
nuclear@0 240 /* */
nuclear@0 241 /* <Return> */
nuclear@0 242 /* FreeType error code. 0~means success. */
nuclear@0 243 /* */
nuclear@0 244 /* <Note> */
nuclear@0 245 /* The module object is destroyed by the function in case of success. */
nuclear@0 246 /* */
nuclear@0 247 FT_EXPORT( FT_Error )
nuclear@0 248 FT_Remove_Module( FT_Library library,
nuclear@0 249 FT_Module module );
nuclear@0 250
nuclear@0 251
nuclear@0 252 /*************************************************************************/
nuclear@0 253 /* */
nuclear@0 254 /* <Function> */
nuclear@0 255 /* FT_Reference_Library */
nuclear@0 256 /* */
nuclear@0 257 /* <Description> */
nuclear@0 258 /* A counter gets initialized to~1 at the time an @FT_Library */
nuclear@0 259 /* structure is created. This function increments the counter. */
nuclear@0 260 /* @FT_Done_Library then only destroys a library if the counter is~1, */
nuclear@0 261 /* otherwise it simply decrements the counter. */
nuclear@0 262 /* */
nuclear@0 263 /* This function helps in managing life-cycles of structures which */
nuclear@0 264 /* reference @FT_Library objects. */
nuclear@0 265 /* */
nuclear@0 266 /* <Input> */
nuclear@0 267 /* library :: A handle to a target library object. */
nuclear@0 268 /* */
nuclear@0 269 /* <Return> */
nuclear@0 270 /* FreeType error code. 0~means success. */
nuclear@0 271 /* */
nuclear@0 272 /* <Since> */
nuclear@0 273 /* 2.4.2 */
nuclear@0 274 /* */
nuclear@0 275 FT_EXPORT( FT_Error )
nuclear@0 276 FT_Reference_Library( FT_Library library );
nuclear@0 277
nuclear@0 278
nuclear@0 279 /*************************************************************************/
nuclear@0 280 /* */
nuclear@0 281 /* <Function> */
nuclear@0 282 /* FT_New_Library */
nuclear@0 283 /* */
nuclear@0 284 /* <Description> */
nuclear@0 285 /* This function is used to create a new FreeType library instance */
nuclear@0 286 /* from a given memory object. It is thus possible to use libraries */
nuclear@0 287 /* with distinct memory allocators within the same program. */
nuclear@0 288 /* */
nuclear@0 289 /* Normally, you would call this function (followed by a call to */
nuclear@0 290 /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
nuclear@0 291 /* instead of @FT_Init_FreeType to initialize the FreeType library. */
nuclear@0 292 /* */
nuclear@0 293 /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
nuclear@0 294 /* library instance. */
nuclear@0 295 /* */
nuclear@0 296 /* <Input> */
nuclear@0 297 /* memory :: A handle to the original memory object. */
nuclear@0 298 /* */
nuclear@0 299 /* <Output> */
nuclear@0 300 /* alibrary :: A pointer to handle of a new library object. */
nuclear@0 301 /* */
nuclear@0 302 /* <Return> */
nuclear@0 303 /* FreeType error code. 0~means success. */
nuclear@0 304 /* */
nuclear@0 305 /* <Note> */
nuclear@0 306 /* See the discussion of reference counters in the description of */
nuclear@0 307 /* @FT_Reference_Library. */
nuclear@0 308 /* */
nuclear@0 309 FT_EXPORT( FT_Error )
nuclear@0 310 FT_New_Library( FT_Memory memory,
nuclear@0 311 FT_Library *alibrary );
nuclear@0 312
nuclear@0 313
nuclear@0 314 /*************************************************************************/
nuclear@0 315 /* */
nuclear@0 316 /* <Function> */
nuclear@0 317 /* FT_Done_Library */
nuclear@0 318 /* */
nuclear@0 319 /* <Description> */
nuclear@0 320 /* Discard a given library object. This closes all drivers and */
nuclear@0 321 /* discards all resource objects. */
nuclear@0 322 /* */
nuclear@0 323 /* <Input> */
nuclear@0 324 /* library :: A handle to the target library. */
nuclear@0 325 /* */
nuclear@0 326 /* <Return> */
nuclear@0 327 /* FreeType error code. 0~means success. */
nuclear@0 328 /* */
nuclear@0 329 /* <Note> */
nuclear@0 330 /* See the discussion of reference counters in the description of */
nuclear@0 331 /* @FT_Reference_Library. */
nuclear@0 332 /* */
nuclear@0 333 FT_EXPORT( FT_Error )
nuclear@0 334 FT_Done_Library( FT_Library library );
nuclear@0 335
nuclear@0 336 /* */
nuclear@0 337
nuclear@0 338 typedef void
nuclear@0 339 (*FT_DebugHook_Func)( void* arg );
nuclear@0 340
nuclear@0 341
nuclear@0 342 /*************************************************************************/
nuclear@0 343 /* */
nuclear@0 344 /* <Function> */
nuclear@0 345 /* FT_Set_Debug_Hook */
nuclear@0 346 /* */
nuclear@0 347 /* <Description> */
nuclear@0 348 /* Set a debug hook function for debugging the interpreter of a font */
nuclear@0 349 /* format. */
nuclear@0 350 /* */
nuclear@0 351 /* <InOut> */
nuclear@0 352 /* library :: A handle to the library object. */
nuclear@0 353 /* */
nuclear@0 354 /* <Input> */
nuclear@0 355 /* hook_index :: The index of the debug hook. You should use the */
nuclear@0 356 /* values defined in `ftobjs.h', e.g., */
nuclear@0 357 /* `FT_DEBUG_HOOK_TRUETYPE'. */
nuclear@0 358 /* */
nuclear@0 359 /* debug_hook :: The function used to debug the interpreter. */
nuclear@0 360 /* */
nuclear@0 361 /* <Note> */
nuclear@0 362 /* Currently, four debug hook slots are available, but only two (for */
nuclear@0 363 /* the TrueType and the Type~1 interpreter) are defined. */
nuclear@0 364 /* */
nuclear@0 365 /* Since the internal headers of FreeType are no longer installed, */
nuclear@0 366 /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
nuclear@0 367 /* This is a bug and will be fixed in a forthcoming release. */
nuclear@0 368 /* */
nuclear@0 369 FT_EXPORT( void )
nuclear@0 370 FT_Set_Debug_Hook( FT_Library library,
nuclear@0 371 FT_UInt hook_index,
nuclear@0 372 FT_DebugHook_Func debug_hook );
nuclear@0 373
nuclear@0 374
nuclear@0 375 /*************************************************************************/
nuclear@0 376 /* */
nuclear@0 377 /* <Function> */
nuclear@0 378 /* FT_Add_Default_Modules */
nuclear@0 379 /* */
nuclear@0 380 /* <Description> */
nuclear@0 381 /* Add the set of default drivers to a given library object. */
nuclear@0 382 /* This is only useful when you create a library object with */
nuclear@0 383 /* @FT_New_Library (usually to plug a custom memory manager). */
nuclear@0 384 /* */
nuclear@0 385 /* <InOut> */
nuclear@0 386 /* library :: A handle to a new library object. */
nuclear@0 387 /* */
nuclear@0 388 FT_EXPORT( void )
nuclear@0 389 FT_Add_Default_Modules( FT_Library library );
nuclear@0 390
nuclear@0 391
nuclear@0 392
nuclear@0 393 /**************************************************************************
nuclear@0 394 *
nuclear@0 395 * @section:
nuclear@0 396 * truetype_engine
nuclear@0 397 *
nuclear@0 398 * @title:
nuclear@0 399 * The TrueType Engine
nuclear@0 400 *
nuclear@0 401 * @abstract:
nuclear@0 402 * TrueType bytecode support.
nuclear@0 403 *
nuclear@0 404 * @description:
nuclear@0 405 * This section contains a function used to query the level of TrueType
nuclear@0 406 * bytecode support compiled in this version of the library.
nuclear@0 407 *
nuclear@0 408 */
nuclear@0 409
nuclear@0 410
nuclear@0 411 /**************************************************************************
nuclear@0 412 *
nuclear@0 413 * @enum:
nuclear@0 414 * FT_TrueTypeEngineType
nuclear@0 415 *
nuclear@0 416 * @description:
nuclear@0 417 * A list of values describing which kind of TrueType bytecode
nuclear@0 418 * engine is implemented in a given FT_Library instance. It is used
nuclear@0 419 * by the @FT_Get_TrueType_Engine_Type function.
nuclear@0 420 *
nuclear@0 421 * @values:
nuclear@0 422 * FT_TRUETYPE_ENGINE_TYPE_NONE ::
nuclear@0 423 * The library doesn't implement any kind of bytecode interpreter.
nuclear@0 424 *
nuclear@0 425 * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
nuclear@0 426 * The library implements a bytecode interpreter that doesn't
nuclear@0 427 * support the patented operations of the TrueType virtual machine.
nuclear@0 428 *
nuclear@0 429 * Its main use is to load certain Asian fonts which position and
nuclear@0 430 * scale glyph components with bytecode instructions. It produces
nuclear@0 431 * bad output for most other fonts.
nuclear@0 432 *
nuclear@0 433 * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
nuclear@0 434 * The library implements a bytecode interpreter that covers
nuclear@0 435 * the full instruction set of the TrueType virtual machine (this
nuclear@0 436 * was governed by patents until May 2010, hence the name).
nuclear@0 437 *
nuclear@0 438 * @since:
nuclear@0 439 * 2.2
nuclear@0 440 *
nuclear@0 441 */
nuclear@0 442 typedef enum FT_TrueTypeEngineType_
nuclear@0 443 {
nuclear@0 444 FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
nuclear@0 445 FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
nuclear@0 446 FT_TRUETYPE_ENGINE_TYPE_PATENTED
nuclear@0 447
nuclear@0 448 } FT_TrueTypeEngineType;
nuclear@0 449
nuclear@0 450
nuclear@0 451 /**************************************************************************
nuclear@0 452 *
nuclear@0 453 * @func:
nuclear@0 454 * FT_Get_TrueType_Engine_Type
nuclear@0 455 *
nuclear@0 456 * @description:
nuclear@0 457 * Return an @FT_TrueTypeEngineType value to indicate which level of
nuclear@0 458 * the TrueType virtual machine a given library instance supports.
nuclear@0 459 *
nuclear@0 460 * @input:
nuclear@0 461 * library ::
nuclear@0 462 * A library instance.
nuclear@0 463 *
nuclear@0 464 * @return:
nuclear@0 465 * A value indicating which level is supported.
nuclear@0 466 *
nuclear@0 467 * @since:
nuclear@0 468 * 2.2
nuclear@0 469 *
nuclear@0 470 */
nuclear@0 471 FT_EXPORT( FT_TrueTypeEngineType )
nuclear@0 472 FT_Get_TrueType_Engine_Type( FT_Library library );
nuclear@0 473
nuclear@0 474
nuclear@0 475 /* */
nuclear@0 476
nuclear@0 477
nuclear@0 478 FT_END_HEADER
nuclear@0 479
nuclear@0 480 #endif /* __FTMODAPI_H__ */
nuclear@0 481
nuclear@0 482
nuclear@0 483 /* END */