vrshoot
diff libs/ft2static/freetype/ftmodapi.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/ftmodapi.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,483 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftmodapi.h */ 1.7 +/* */ 1.8 +/* FreeType modules public interface (specification). */ 1.9 +/* */ 1.10 +/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FTMODAPI_H__ 1.23 +#define __FTMODAPI_H__ 1.24 + 1.25 + 1.26 +#include <ft2build.h> 1.27 +#include FT_FREETYPE_H 1.28 + 1.29 +#ifdef FREETYPE_H 1.30 +#error "freetype.h of FreeType 1 has been loaded!" 1.31 +#error "Please fix the directory search order for header files" 1.32 +#error "so that freetype.h of FreeType 2 is found first." 1.33 +#endif 1.34 + 1.35 + 1.36 +FT_BEGIN_HEADER 1.37 + 1.38 + 1.39 + /*************************************************************************/ 1.40 + /* */ 1.41 + /* <Section> */ 1.42 + /* module_management */ 1.43 + /* */ 1.44 + /* <Title> */ 1.45 + /* Module Management */ 1.46 + /* */ 1.47 + /* <Abstract> */ 1.48 + /* How to add, upgrade, and remove modules from FreeType. */ 1.49 + /* */ 1.50 + /* <Description> */ 1.51 + /* The definitions below are used to manage modules within FreeType. */ 1.52 + /* Modules can be added, upgraded, and removed at runtime. */ 1.53 + /* */ 1.54 + /*************************************************************************/ 1.55 + 1.56 + 1.57 + /* module bit flags */ 1.58 +#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ 1.59 +#define FT_MODULE_RENDERER 2 /* this module is a renderer */ 1.60 +#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ 1.61 +#define FT_MODULE_STYLER 8 /* this module is a styler */ 1.62 + 1.63 +#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ 1.64 + /* scalable fonts */ 1.65 +#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ 1.66 + /* support vector outlines */ 1.67 +#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ 1.68 + /* own hinter */ 1.69 + 1.70 + 1.71 + /* deprecated values */ 1.72 +#define ft_module_font_driver FT_MODULE_FONT_DRIVER 1.73 +#define ft_module_renderer FT_MODULE_RENDERER 1.74 +#define ft_module_hinter FT_MODULE_HINTER 1.75 +#define ft_module_styler FT_MODULE_STYLER 1.76 + 1.77 +#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE 1.78 +#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES 1.79 +#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER 1.80 + 1.81 + 1.82 + typedef FT_Pointer FT_Module_Interface; 1.83 + 1.84 + 1.85 + /*************************************************************************/ 1.86 + /* */ 1.87 + /* <FuncType> */ 1.88 + /* FT_Module_Constructor */ 1.89 + /* */ 1.90 + /* <Description> */ 1.91 + /* A function used to initialize (not create) a new module object. */ 1.92 + /* */ 1.93 + /* <Input> */ 1.94 + /* module :: The module to initialize. */ 1.95 + /* */ 1.96 + typedef FT_Error 1.97 + (*FT_Module_Constructor)( FT_Module module ); 1.98 + 1.99 + 1.100 + /*************************************************************************/ 1.101 + /* */ 1.102 + /* <FuncType> */ 1.103 + /* FT_Module_Destructor */ 1.104 + /* */ 1.105 + /* <Description> */ 1.106 + /* A function used to finalize (not destroy) a given module object. */ 1.107 + /* */ 1.108 + /* <Input> */ 1.109 + /* module :: The module to finalize. */ 1.110 + /* */ 1.111 + typedef void 1.112 + (*FT_Module_Destructor)( FT_Module module ); 1.113 + 1.114 + 1.115 + /*************************************************************************/ 1.116 + /* */ 1.117 + /* <FuncType> */ 1.118 + /* FT_Module_Requester */ 1.119 + /* */ 1.120 + /* <Description> */ 1.121 + /* A function used to query a given module for a specific interface. */ 1.122 + /* */ 1.123 + /* <Input> */ 1.124 + /* module :: The module to finalize. */ 1.125 + /* */ 1.126 + /* name :: The name of the interface in the module. */ 1.127 + /* */ 1.128 + typedef FT_Module_Interface 1.129 + (*FT_Module_Requester)( FT_Module module, 1.130 + const char* name ); 1.131 + 1.132 + 1.133 + /*************************************************************************/ 1.134 + /* */ 1.135 + /* <Struct> */ 1.136 + /* FT_Module_Class */ 1.137 + /* */ 1.138 + /* <Description> */ 1.139 + /* The module class descriptor. */ 1.140 + /* */ 1.141 + /* <Fields> */ 1.142 + /* module_flags :: Bit flags describing the module. */ 1.143 + /* */ 1.144 + /* module_size :: The size of one module object/instance in */ 1.145 + /* bytes. */ 1.146 + /* */ 1.147 + /* module_name :: The name of the module. */ 1.148 + /* */ 1.149 + /* module_version :: The version, as a 16.16 fixed number */ 1.150 + /* (major.minor). */ 1.151 + /* */ 1.152 + /* module_requires :: The version of FreeType this module requires, */ 1.153 + /* as a 16.16 fixed number (major.minor). Starts */ 1.154 + /* at version 2.0, i.e., 0x20000. */ 1.155 + /* */ 1.156 + /* module_init :: The initializing function. */ 1.157 + /* */ 1.158 + /* module_done :: The finalizing function. */ 1.159 + /* */ 1.160 + /* get_interface :: The interface requesting function. */ 1.161 + /* */ 1.162 + typedef struct FT_Module_Class_ 1.163 + { 1.164 + FT_ULong module_flags; 1.165 + FT_Long module_size; 1.166 + const FT_String* module_name; 1.167 + FT_Fixed module_version; 1.168 + FT_Fixed module_requires; 1.169 + 1.170 + const void* module_interface; 1.171 + 1.172 + FT_Module_Constructor module_init; 1.173 + FT_Module_Destructor module_done; 1.174 + FT_Module_Requester get_interface; 1.175 + 1.176 + } FT_Module_Class; 1.177 + 1.178 + 1.179 + /*************************************************************************/ 1.180 + /* */ 1.181 + /* <Function> */ 1.182 + /* FT_Add_Module */ 1.183 + /* */ 1.184 + /* <Description> */ 1.185 + /* Add a new module to a given library instance. */ 1.186 + /* */ 1.187 + /* <InOut> */ 1.188 + /* library :: A handle to the library object. */ 1.189 + /* */ 1.190 + /* <Input> */ 1.191 + /* clazz :: A pointer to class descriptor for the module. */ 1.192 + /* */ 1.193 + /* <Return> */ 1.194 + /* FreeType error code. 0~means success. */ 1.195 + /* */ 1.196 + /* <Note> */ 1.197 + /* An error will be returned if a module already exists by that name, */ 1.198 + /* or if the module requires a version of FreeType that is too great. */ 1.199 + /* */ 1.200 + FT_EXPORT( FT_Error ) 1.201 + FT_Add_Module( FT_Library library, 1.202 + const FT_Module_Class* clazz ); 1.203 + 1.204 + 1.205 + /*************************************************************************/ 1.206 + /* */ 1.207 + /* <Function> */ 1.208 + /* FT_Get_Module */ 1.209 + /* */ 1.210 + /* <Description> */ 1.211 + /* Find a module by its name. */ 1.212 + /* */ 1.213 + /* <Input> */ 1.214 + /* library :: A handle to the library object. */ 1.215 + /* */ 1.216 + /* module_name :: The module's name (as an ASCII string). */ 1.217 + /* */ 1.218 + /* <Return> */ 1.219 + /* A module handle. 0~if none was found. */ 1.220 + /* */ 1.221 + /* <Note> */ 1.222 + /* FreeType's internal modules aren't documented very well, and you */ 1.223 + /* should look up the source code for details. */ 1.224 + /* */ 1.225 + FT_EXPORT( FT_Module ) 1.226 + FT_Get_Module( FT_Library library, 1.227 + const char* module_name ); 1.228 + 1.229 + 1.230 + /*************************************************************************/ 1.231 + /* */ 1.232 + /* <Function> */ 1.233 + /* FT_Remove_Module */ 1.234 + /* */ 1.235 + /* <Description> */ 1.236 + /* Remove a given module from a library instance. */ 1.237 + /* */ 1.238 + /* <InOut> */ 1.239 + /* library :: A handle to a library object. */ 1.240 + /* */ 1.241 + /* <Input> */ 1.242 + /* module :: A handle to a module object. */ 1.243 + /* */ 1.244 + /* <Return> */ 1.245 + /* FreeType error code. 0~means success. */ 1.246 + /* */ 1.247 + /* <Note> */ 1.248 + /* The module object is destroyed by the function in case of success. */ 1.249 + /* */ 1.250 + FT_EXPORT( FT_Error ) 1.251 + FT_Remove_Module( FT_Library library, 1.252 + FT_Module module ); 1.253 + 1.254 + 1.255 + /*************************************************************************/ 1.256 + /* */ 1.257 + /* <Function> */ 1.258 + /* FT_Reference_Library */ 1.259 + /* */ 1.260 + /* <Description> */ 1.261 + /* A counter gets initialized to~1 at the time an @FT_Library */ 1.262 + /* structure is created. This function increments the counter. */ 1.263 + /* @FT_Done_Library then only destroys a library if the counter is~1, */ 1.264 + /* otherwise it simply decrements the counter. */ 1.265 + /* */ 1.266 + /* This function helps in managing life-cycles of structures which */ 1.267 + /* reference @FT_Library objects. */ 1.268 + /* */ 1.269 + /* <Input> */ 1.270 + /* library :: A handle to a target library object. */ 1.271 + /* */ 1.272 + /* <Return> */ 1.273 + /* FreeType error code. 0~means success. */ 1.274 + /* */ 1.275 + /* <Since> */ 1.276 + /* 2.4.2 */ 1.277 + /* */ 1.278 + FT_EXPORT( FT_Error ) 1.279 + FT_Reference_Library( FT_Library library ); 1.280 + 1.281 + 1.282 + /*************************************************************************/ 1.283 + /* */ 1.284 + /* <Function> */ 1.285 + /* FT_New_Library */ 1.286 + /* */ 1.287 + /* <Description> */ 1.288 + /* This function is used to create a new FreeType library instance */ 1.289 + /* from a given memory object. It is thus possible to use libraries */ 1.290 + /* with distinct memory allocators within the same program. */ 1.291 + /* */ 1.292 + /* Normally, you would call this function (followed by a call to */ 1.293 + /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ 1.294 + /* instead of @FT_Init_FreeType to initialize the FreeType library. */ 1.295 + /* */ 1.296 + /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ 1.297 + /* library instance. */ 1.298 + /* */ 1.299 + /* <Input> */ 1.300 + /* memory :: A handle to the original memory object. */ 1.301 + /* */ 1.302 + /* <Output> */ 1.303 + /* alibrary :: A pointer to handle of a new library object. */ 1.304 + /* */ 1.305 + /* <Return> */ 1.306 + /* FreeType error code. 0~means success. */ 1.307 + /* */ 1.308 + /* <Note> */ 1.309 + /* See the discussion of reference counters in the description of */ 1.310 + /* @FT_Reference_Library. */ 1.311 + /* */ 1.312 + FT_EXPORT( FT_Error ) 1.313 + FT_New_Library( FT_Memory memory, 1.314 + FT_Library *alibrary ); 1.315 + 1.316 + 1.317 + /*************************************************************************/ 1.318 + /* */ 1.319 + /* <Function> */ 1.320 + /* FT_Done_Library */ 1.321 + /* */ 1.322 + /* <Description> */ 1.323 + /* Discard a given library object. This closes all drivers and */ 1.324 + /* discards all resource objects. */ 1.325 + /* */ 1.326 + /* <Input> */ 1.327 + /* library :: A handle to the target library. */ 1.328 + /* */ 1.329 + /* <Return> */ 1.330 + /* FreeType error code. 0~means success. */ 1.331 + /* */ 1.332 + /* <Note> */ 1.333 + /* See the discussion of reference counters in the description of */ 1.334 + /* @FT_Reference_Library. */ 1.335 + /* */ 1.336 + FT_EXPORT( FT_Error ) 1.337 + FT_Done_Library( FT_Library library ); 1.338 + 1.339 +/* */ 1.340 + 1.341 + typedef void 1.342 + (*FT_DebugHook_Func)( void* arg ); 1.343 + 1.344 + 1.345 + /*************************************************************************/ 1.346 + /* */ 1.347 + /* <Function> */ 1.348 + /* FT_Set_Debug_Hook */ 1.349 + /* */ 1.350 + /* <Description> */ 1.351 + /* Set a debug hook function for debugging the interpreter of a font */ 1.352 + /* format. */ 1.353 + /* */ 1.354 + /* <InOut> */ 1.355 + /* library :: A handle to the library object. */ 1.356 + /* */ 1.357 + /* <Input> */ 1.358 + /* hook_index :: The index of the debug hook. You should use the */ 1.359 + /* values defined in `ftobjs.h', e.g., */ 1.360 + /* `FT_DEBUG_HOOK_TRUETYPE'. */ 1.361 + /* */ 1.362 + /* debug_hook :: The function used to debug the interpreter. */ 1.363 + /* */ 1.364 + /* <Note> */ 1.365 + /* Currently, four debug hook slots are available, but only two (for */ 1.366 + /* the TrueType and the Type~1 interpreter) are defined. */ 1.367 + /* */ 1.368 + /* Since the internal headers of FreeType are no longer installed, */ 1.369 + /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ 1.370 + /* This is a bug and will be fixed in a forthcoming release. */ 1.371 + /* */ 1.372 + FT_EXPORT( void ) 1.373 + FT_Set_Debug_Hook( FT_Library library, 1.374 + FT_UInt hook_index, 1.375 + FT_DebugHook_Func debug_hook ); 1.376 + 1.377 + 1.378 + /*************************************************************************/ 1.379 + /* */ 1.380 + /* <Function> */ 1.381 + /* FT_Add_Default_Modules */ 1.382 + /* */ 1.383 + /* <Description> */ 1.384 + /* Add the set of default drivers to a given library object. */ 1.385 + /* This is only useful when you create a library object with */ 1.386 + /* @FT_New_Library (usually to plug a custom memory manager). */ 1.387 + /* */ 1.388 + /* <InOut> */ 1.389 + /* library :: A handle to a new library object. */ 1.390 + /* */ 1.391 + FT_EXPORT( void ) 1.392 + FT_Add_Default_Modules( FT_Library library ); 1.393 + 1.394 + 1.395 + 1.396 + /************************************************************************** 1.397 + * 1.398 + * @section: 1.399 + * truetype_engine 1.400 + * 1.401 + * @title: 1.402 + * The TrueType Engine 1.403 + * 1.404 + * @abstract: 1.405 + * TrueType bytecode support. 1.406 + * 1.407 + * @description: 1.408 + * This section contains a function used to query the level of TrueType 1.409 + * bytecode support compiled in this version of the library. 1.410 + * 1.411 + */ 1.412 + 1.413 + 1.414 + /************************************************************************** 1.415 + * 1.416 + * @enum: 1.417 + * FT_TrueTypeEngineType 1.418 + * 1.419 + * @description: 1.420 + * A list of values describing which kind of TrueType bytecode 1.421 + * engine is implemented in a given FT_Library instance. It is used 1.422 + * by the @FT_Get_TrueType_Engine_Type function. 1.423 + * 1.424 + * @values: 1.425 + * FT_TRUETYPE_ENGINE_TYPE_NONE :: 1.426 + * The library doesn't implement any kind of bytecode interpreter. 1.427 + * 1.428 + * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: 1.429 + * The library implements a bytecode interpreter that doesn't 1.430 + * support the patented operations of the TrueType virtual machine. 1.431 + * 1.432 + * Its main use is to load certain Asian fonts which position and 1.433 + * scale glyph components with bytecode instructions. It produces 1.434 + * bad output for most other fonts. 1.435 + * 1.436 + * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: 1.437 + * The library implements a bytecode interpreter that covers 1.438 + * the full instruction set of the TrueType virtual machine (this 1.439 + * was governed by patents until May 2010, hence the name). 1.440 + * 1.441 + * @since: 1.442 + * 2.2 1.443 + * 1.444 + */ 1.445 + typedef enum FT_TrueTypeEngineType_ 1.446 + { 1.447 + FT_TRUETYPE_ENGINE_TYPE_NONE = 0, 1.448 + FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, 1.449 + FT_TRUETYPE_ENGINE_TYPE_PATENTED 1.450 + 1.451 + } FT_TrueTypeEngineType; 1.452 + 1.453 + 1.454 + /************************************************************************** 1.455 + * 1.456 + * @func: 1.457 + * FT_Get_TrueType_Engine_Type 1.458 + * 1.459 + * @description: 1.460 + * Return an @FT_TrueTypeEngineType value to indicate which level of 1.461 + * the TrueType virtual machine a given library instance supports. 1.462 + * 1.463 + * @input: 1.464 + * library :: 1.465 + * A library instance. 1.466 + * 1.467 + * @return: 1.468 + * A value indicating which level is supported. 1.469 + * 1.470 + * @since: 1.471 + * 2.2 1.472 + * 1.473 + */ 1.474 + FT_EXPORT( FT_TrueTypeEngineType ) 1.475 + FT_Get_TrueType_Engine_Type( FT_Library library ); 1.476 + 1.477 + 1.478 + /* */ 1.479 + 1.480 + 1.481 +FT_END_HEADER 1.482 + 1.483 +#endif /* __FTMODAPI_H__ */ 1.484 + 1.485 + 1.486 +/* END */