ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ftmodapi.h
Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ftmodapi.h                                                             */
00004 /*                                                                         */
00005 /*    FreeType modules public interface (specification).                   */
00006 /*                                                                         */
00007 /*  Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by             */
00008 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00009 /*                                                                         */
00010 /*  This file is part of the FreeType project, and may only be used,       */
00011 /*  modified, and distributed under the terms of the FreeType project      */
00012 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00013 /*  this file you indicate that you have read the license and              */
00014 /*  understand and accept it fully.                                        */
00015 /*                                                                         */
00016 /***************************************************************************/
00017 
00018 
00019 #ifndef __FTMODAPI_H__
00020 #define __FTMODAPI_H__
00021 
00022 
00023 #include <ft2build.h>
00024 #include FT_FREETYPE_H
00025 
00026 #ifdef FREETYPE_H
00027 #error "freetype.h of FreeType 1 has been loaded!"
00028 #error "Please fix the directory search order for header files"
00029 #error "so that freetype.h of FreeType 2 is found first."
00030 #endif
00031 
00032 
00033 FT_BEGIN_HEADER
00034 
00035 
00036   /*************************************************************************/
00037   /*                                                                       */
00038   /* <Section>                                                             */
00039   /*    module_management                                                  */
00040   /*                                                                       */
00041   /* <Title>                                                               */
00042   /*    Module Management                                                  */
00043   /*                                                                       */
00044   /* <Abstract>                                                            */
00045   /*    How to add, upgrade, and remove modules from FreeType.             */
00046   /*                                                                       */
00047   /* <Description>                                                         */
00048   /*    The definitions below are used to manage modules within FreeType.  */
00049   /*    Modules can be added, upgraded, and removed at runtime.            */
00050   /*                                                                       */
00051   /*************************************************************************/
00052 
00053 
00054   /* module bit flags */
00055 #define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */
00056 #define FT_MODULE_RENDERER            2  /* this module is a renderer     */
00057 #define FT_MODULE_HINTER              4  /* this module is a glyph hinter */
00058 #define FT_MODULE_STYLER              8  /* this module is a styler       */
00059 
00060 #define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */
00061                                               /* scalable fonts           */
00062 #define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */
00063                                               /* support vector outlines  */
00064 #define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */
00065                                               /* own hinter               */
00066 
00067 
00068   /* deprecated values */
00069 #define ft_module_font_driver         FT_MODULE_FONT_DRIVER
00070 #define ft_module_renderer            FT_MODULE_RENDERER
00071 #define ft_module_hinter              FT_MODULE_HINTER
00072 #define ft_module_styler              FT_MODULE_STYLER
00073 
00074 #define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE
00075 #define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES
00076 #define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER
00077 
00078 
00079   typedef FT_Pointer  FT_Module_Interface;
00080 
00081 
00082   /*************************************************************************/
00083   /*                                                                       */
00084   /* <FuncType>                                                            */
00085   /*    FT_Module_Constructor                                              */
00086   /*                                                                       */
00087   /* <Description>                                                         */
00088   /*    A function used to initialize (not create) a new module object.    */
00089   /*                                                                       */
00090   /* <Input>                                                               */
00091   /*    module :: The module to initialize.                                */
00092   /*                                                                       */
00093   typedef FT_Error
00094   (*FT_Module_Constructor)( FT_Module  module );
00095 
00096 
00097   /*************************************************************************/
00098   /*                                                                       */
00099   /* <FuncType>                                                            */
00100   /*    FT_Module_Destructor                                               */
00101   /*                                                                       */
00102   /* <Description>                                                         */
00103   /*    A function used to finalize (not destroy) a given module object.   */
00104   /*                                                                       */
00105   /* <Input>                                                               */
00106   /*    module :: The module to finalize.                                  */
00107   /*                                                                       */
00108   typedef void
00109   (*FT_Module_Destructor)( FT_Module  module );
00110 
00111 
00112   /*************************************************************************/
00113   /*                                                                       */
00114   /* <FuncType>                                                            */
00115   /*    FT_Module_Requester                                                */
00116   /*                                                                       */
00117   /* <Description>                                                         */
00118   /*    A function used to query a given module for a specific interface.  */
00119   /*                                                                       */
00120   /* <Input>                                                               */
00121   /*    module :: The module to finalize.                                  */
00122   /*                                                                       */
00123   /*    name ::   The name of the interface in the module.                 */
00124   /*                                                                       */
00125   typedef FT_Module_Interface
00126   (*FT_Module_Requester)( FT_Module    module,
00127                           const char*  name );
00128 
00129 
00130   /*************************************************************************/
00131   /*                                                                       */
00132   /* <Struct>                                                              */
00133   /*    FT_Module_Class                                                    */
00134   /*                                                                       */
00135   /* <Description>                                                         */
00136   /*    The module class descriptor.                                       */
00137   /*                                                                       */
00138   /* <Fields>                                                              */
00139   /*    module_flags    :: Bit flags describing the module.                */
00140   /*                                                                       */
00141   /*    module_size     :: The size of one module object/instance in       */
00142   /*                       bytes.                                          */
00143   /*                                                                       */
00144   /*    module_name     :: The name of the module.                         */
00145   /*                                                                       */
00146   /*    module_version  :: The version, as a 16.16 fixed number            */
00147   /*                       (major.minor).                                  */
00148   /*                                                                       */
00149   /*    module_requires :: The version of FreeType this module requires,   */
00150   /*                       as a 16.16 fixed number (major.minor).  Starts  */
00151   /*                       at version 2.0, i.e., 0x20000.                  */
00152   /*                                                                       */
00153   /*    module_init     :: The initializing function.                      */
00154   /*                                                                       */
00155   /*    module_done     :: The finalizing function.                        */
00156   /*                                                                       */
00157   /*    get_interface   :: The interface requesting function.              */
00158   /*                                                                       */
00159   typedef struct  FT_Module_Class_
00160   {
00161     FT_ULong               module_flags;
00162     FT_Long                module_size;
00163     const FT_String*       module_name;
00164     FT_Fixed               module_version;
00165     FT_Fixed               module_requires;
00166 
00167     const void*            module_interface;
00168 
00169     FT_Module_Constructor  module_init;
00170     FT_Module_Destructor   module_done;
00171     FT_Module_Requester    get_interface;
00172 
00173   } FT_Module_Class;
00174 
00175 
00176   /*************************************************************************/
00177   /*                                                                       */
00178   /* <Function>                                                            */
00179   /*    FT_Add_Module                                                      */
00180   /*                                                                       */
00181   /* <Description>                                                         */
00182   /*    Add a new module to a given library instance.                      */
00183   /*                                                                       */
00184   /* <InOut>                                                               */
00185   /*    library :: A handle to the library object.                         */
00186   /*                                                                       */
00187   /* <Input>                                                               */
00188   /*    clazz   :: A pointer to class descriptor for the module.           */
00189   /*                                                                       */
00190   /* <Return>                                                              */
00191   /*    FreeType error code.  0~means success.                             */
00192   /*                                                                       */
00193   /* <Note>                                                                */
00194   /*    An error will be returned if a module already exists by that name, */
00195   /*    or if the module requires a version of FreeType that is too great. */
00196   /*                                                                       */
00197   FT_EXPORT( FT_Error )
00198   FT_Add_Module( FT_Library              library,
00199                  const FT_Module_Class*  clazz );
00200 
00201 
00202   /*************************************************************************/
00203   /*                                                                       */
00204   /* <Function>                                                            */
00205   /*    FT_Get_Module                                                      */
00206   /*                                                                       */
00207   /* <Description>                                                         */
00208   /*    Find a module by its name.                                         */
00209   /*                                                                       */
00210   /* <Input>                                                               */
00211   /*    library     :: A handle to the library object.                     */
00212   /*                                                                       */
00213   /*    module_name :: The module's name (as an ASCII string).             */
00214   /*                                                                       */
00215   /* <Return>                                                              */
00216   /*    A module handle.  0~if none was found.                             */
00217   /*                                                                       */
00218   /* <Note>                                                                */
00219   /*    FreeType's internal modules aren't documented very well, and you   */
00220   /*    should look up the source code for details.                        */
00221   /*                                                                       */
00222   FT_EXPORT( FT_Module )
00223   FT_Get_Module( FT_Library   library,
00224                  const char*  module_name );
00225 
00226 
00227   /*************************************************************************/
00228   /*                                                                       */
00229   /* <Function>                                                            */
00230   /*    FT_Remove_Module                                                   */
00231   /*                                                                       */
00232   /* <Description>                                                         */
00233   /*    Remove a given module from a library instance.                     */
00234   /*                                                                       */
00235   /* <InOut>                                                               */
00236   /*    library :: A handle to a library object.                           */
00237   /*                                                                       */
00238   /* <Input>                                                               */
00239   /*    module  :: A handle to a module object.                            */
00240   /*                                                                       */
00241   /* <Return>                                                              */
00242   /*    FreeType error code.  0~means success.                             */
00243   /*                                                                       */
00244   /* <Note>                                                                */
00245   /*    The module object is destroyed by the function in case of success. */
00246   /*                                                                       */
00247   FT_EXPORT( FT_Error )
00248   FT_Remove_Module( FT_Library  library,
00249                     FT_Module   module );
00250 
00251 
00252   /*************************************************************************/
00253   /*                                                                       */
00254   /* <Function>                                                            */
00255   /*    FT_Reference_Library                                               */
00256   /*                                                                       */
00257   /* <Description>                                                         */
00258   /*    A counter gets initialized to~1 at the time an @FT_Library         */
00259   /*    structure is created.  This function increments the counter.       */
00260   /*    @FT_Done_Library then only destroys a library if the counter is~1, */
00261   /*    otherwise it simply decrements the counter.                        */
00262   /*                                                                       */
00263   /*    This function helps in managing life-cycles of structures which    */
00264   /*    reference @FT_Library objects.                                     */
00265   /*                                                                       */
00266   /* <Input>                                                               */
00267   /*    library :: A handle to a target library object.                    */
00268   /*                                                                       */
00269   /* <Return>                                                              */
00270   /*    FreeType error code.  0~means success.                             */
00271   /*                                                                       */
00272   /* <Since>                                                               */
00273   /*    2.4.2                                                              */
00274   /*                                                                       */
00275   FT_EXPORT( FT_Error )
00276   FT_Reference_Library( FT_Library  library );
00277 
00278 
00279   /*************************************************************************/
00280   /*                                                                       */
00281   /* <Function>                                                            */
00282   /*    FT_New_Library                                                     */
00283   /*                                                                       */
00284   /* <Description>                                                         */
00285   /*    This function is used to create a new FreeType library instance    */
00286   /*    from a given memory object.  It is thus possible to use libraries  */
00287   /*    with distinct memory allocators within the same program.           */
00288   /*                                                                       */
00289   /*    Normally, you would call this function (followed by a call to      */
00290   /*    @FT_Add_Default_Modules or a series of calls to @FT_Add_Module)    */
00291   /*    instead of @FT_Init_FreeType to initialize the FreeType library.   */
00292   /*                                                                       */
00293   /*    Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a      */
00294   /*    library instance.                                                  */
00295   /*                                                                       */
00296   /* <Input>                                                               */
00297   /*    memory   :: A handle to the original memory object.                */
00298   /*                                                                       */
00299   /* <Output>                                                              */
00300   /*    alibrary :: A pointer to handle of a new library object.           */
00301   /*                                                                       */
00302   /* <Return>                                                              */
00303   /*    FreeType error code.  0~means success.                             */
00304   /*                                                                       */
00305   /* <Note>                                                                */
00306   /*    See the discussion of reference counters in the description of     */
00307   /*    @FT_Reference_Library.                                             */
00308   /*                                                                       */
00309   FT_EXPORT( FT_Error )
00310   FT_New_Library( FT_Memory    memory,
00311                   FT_Library  *alibrary );
00312 
00313 
00314   /*************************************************************************/
00315   /*                                                                       */
00316   /* <Function>                                                            */
00317   /*    FT_Done_Library                                                    */
00318   /*                                                                       */
00319   /* <Description>                                                         */
00320   /*    Discard a given library object.  This closes all drivers and       */
00321   /*    discards all resource objects.                                     */
00322   /*                                                                       */
00323   /* <Input>                                                               */
00324   /*    library :: A handle to the target library.                         */
00325   /*                                                                       */
00326   /* <Return>                                                              */
00327   /*    FreeType error code.  0~means success.                             */
00328   /*                                                                       */
00329   /* <Note>                                                                */
00330   /*    See the discussion of reference counters in the description of     */
00331   /*    @FT_Reference_Library.                                             */
00332   /*                                                                       */
00333   FT_EXPORT( FT_Error )
00334   FT_Done_Library( FT_Library  library );
00335 
00336 /* */
00337 
00338   typedef void
00339   (*FT_DebugHook_Func)( void*  arg );
00340 
00341 
00342   /*************************************************************************/
00343   /*                                                                       */
00344   /* <Function>                                                            */
00345   /*    FT_Set_Debug_Hook                                                  */
00346   /*                                                                       */
00347   /* <Description>                                                         */
00348   /*    Set a debug hook function for debugging the interpreter of a font  */
00349   /*    format.                                                            */
00350   /*                                                                       */
00351   /* <InOut>                                                               */
00352   /*    library    :: A handle to the library object.                      */
00353   /*                                                                       */
00354   /* <Input>                                                               */
00355   /*    hook_index :: The index of the debug hook.  You should use the     */
00356   /*                  values defined in `ftobjs.h', e.g.,                  */
00357   /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */
00358   /*                                                                       */
00359   /*    debug_hook :: The function used to debug the interpreter.          */
00360   /*                                                                       */
00361   /* <Note>                                                                */
00362   /*    Currently, four debug hook slots are available, but only two (for  */
00363   /*    the TrueType and the Type~1 interpreter) are defined.              */
00364   /*                                                                       */
00365   /*    Since the internal headers of FreeType are no longer installed,    */
00366   /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */
00367   /*    This is a bug and will be fixed in a forthcoming release.          */
00368   /*                                                                       */
00369   FT_EXPORT( void )
00370   FT_Set_Debug_Hook( FT_Library         library,
00371                      FT_UInt            hook_index,
00372                      FT_DebugHook_Func  debug_hook );
00373 
00374 
00375   /*************************************************************************/
00376   /*                                                                       */
00377   /* <Function>                                                            */
00378   /*    FT_Add_Default_Modules                                             */
00379   /*                                                                       */
00380   /* <Description>                                                         */
00381   /*    Add the set of default drivers to a given library object.          */
00382   /*    This is only useful when you create a library object with          */
00383   /*    @FT_New_Library (usually to plug a custom memory manager).         */
00384   /*                                                                       */
00385   /* <InOut>                                                               */
00386   /*    library :: A handle to a new library object.                       */
00387   /*                                                                       */
00388   FT_EXPORT( void )
00389   FT_Add_Default_Modules( FT_Library  library );
00390 
00391 
00392 
00393   /**************************************************************************
00394    *
00395    * @section:
00396    *   truetype_engine
00397    *
00398    * @title:
00399    *   The TrueType Engine
00400    *
00401    * @abstract:
00402    *   TrueType bytecode support.
00403    *
00404    * @description:
00405    *   This section contains a function used to query the level of TrueType
00406    *   bytecode support compiled in this version of the library.
00407    *
00408    */
00409 
00410 
00411   /**************************************************************************
00412    *
00413    *  @enum:
00414    *     FT_TrueTypeEngineType
00415    *
00416    *  @description:
00417    *     A list of values describing which kind of TrueType bytecode
00418    *     engine is implemented in a given FT_Library instance.  It is used
00419    *     by the @FT_Get_TrueType_Engine_Type function.
00420    *
00421    *  @values:
00422    *     FT_TRUETYPE_ENGINE_TYPE_NONE ::
00423    *       The library doesn't implement any kind of bytecode interpreter.
00424    *
00425    *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
00426    *       The library implements a bytecode interpreter that doesn't
00427    *       support the patented operations of the TrueType virtual machine.
00428    *
00429    *       Its main use is to load certain Asian fonts which position and
00430    *       scale glyph components with bytecode instructions.  It produces
00431    *       bad output for most other fonts.
00432    *
00433    *    FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
00434    *       The library implements a bytecode interpreter that covers
00435    *       the full instruction set of the TrueType virtual machine (this
00436    *       was governed by patents until May 2010, hence the name).
00437    *
00438    *  @since:
00439    *       2.2
00440    *
00441    */
00442   typedef enum  FT_TrueTypeEngineType_
00443   {
00444     FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
00445     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
00446     FT_TRUETYPE_ENGINE_TYPE_PATENTED
00447 
00448   } FT_TrueTypeEngineType;
00449 
00450 
00451   /**************************************************************************
00452    *
00453    *  @func:
00454    *     FT_Get_TrueType_Engine_Type
00455    *
00456    *  @description:
00457    *     Return an @FT_TrueTypeEngineType value to indicate which level of
00458    *     the TrueType virtual machine a given library instance supports.
00459    *
00460    *  @input:
00461    *     library ::
00462    *       A library instance.
00463    *
00464    *  @return:
00465    *     A value indicating which level is supported.
00466    *
00467    *  @since:
00468    *     2.2
00469    *
00470    */
00471   FT_EXPORT( FT_TrueTypeEngineType )
00472   FT_Get_TrueType_Engine_Type( FT_Library  library );
00473 
00474 
00475   /* */
00476 
00477 
00478 FT_END_HEADER
00479 
00480 #endif /* __FTMODAPI_H__ */
00481 
00482 
00483 /* END */

Generated on Sat May 26 2012 04:32:26 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.