ftsizes.h

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ftsizes.h                                                              */
00004 /*                                                                         */
00005 /*    FreeType size objects management (specification).                    */
00006 /*                                                                         */
00007 /*  Copyright 1996-2001, 2003, 2004, 2006, 2009 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   /*************************************************************************/
00020   /*                                                                       */
00021   /* Typical application would normally not need to use these functions.   */
00022   /* However, they have been placed in a public API for the rare cases     */
00023   /* where they are needed.                                                */
00024   /*                                                                       */
00025   /*************************************************************************/
00026 
00027 
00028 #ifndef __FTSIZES_H__
00029 #define __FTSIZES_H__
00030 
00031 
00032 #include <ft2build.h>
00033 #include FT_FREETYPE_H
00034 
00035 #ifdef FREETYPE_H
00036 #error "freetype.h of FreeType 1 has been loaded!"
00037 #error "Please fix the directory search order for header files"
00038 #error "so that freetype.h of FreeType 2 is found first."
00039 #endif
00040 
00041 
00042 FT_BEGIN_HEADER
00043 
00044 
00045   /*************************************************************************/
00046   /*                                                                       */
00047   /* <Section>                                                             */
00048   /*    sizes_management                                                   */
00049   /*                                                                       */
00050   /* <Title>                                                               */
00051   /*    Size Management                                                    */
00052   /*                                                                       */
00053   /* <Abstract>                                                            */
00054   /*    Managing multiple sizes per face.                                  */
00055   /*                                                                       */
00056   /* <Description>                                                         */
00057   /*    When creating a new face object (e.g., with @FT_New_Face), an      */
00058   /*    @FT_Size object is automatically created and used to store all     */
00059   /*    pixel-size dependent information, available in the `face->size'    */
00060   /*    field.                                                             */
00061   /*                                                                       */
00062   /*    It is however possible to create more sizes for a given face,      */
00063   /*    mostly in order to manage several character pixel sizes of the     */
00064   /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */
00065   /*                                                                       */
00066   /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */
00067   /*    modify the contents of the current `active' size; you thus need    */
00068   /*    to use @FT_Activate_Size to change it.                             */
00069   /*                                                                       */
00070   /*    99% of applications won't need the functions provided here,        */
00071   /*    especially if they use the caching sub-system, so be cautious      */
00072   /*    when using these.                                                  */
00073   /*                                                                       */
00074   /*************************************************************************/
00075 
00076 
00077   /*************************************************************************/
00078   /*                                                                       */
00079   /* <Function>                                                            */
00080   /*    FT_New_Size                                                        */
00081   /*                                                                       */
00082   /* <Description>                                                         */
00083   /*    Create a new size object from a given face object.                 */
00084   /*                                                                       */
00085   /* <Input>                                                               */
00086   /*    face :: A handle to a parent face object.                          */
00087   /*                                                                       */
00088   /* <Output>                                                              */
00089   /*    asize :: A handle to a new size object.                            */
00090   /*                                                                       */
00091   /* <Return>                                                              */
00092   /*    FreeType error code.  0~means success.                             */
00093   /*                                                                       */
00094   /* <Note>                                                                */
00095   /*    You need to call @FT_Activate_Size in order to select the new size */
00096   /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */
00097   /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */
00098   /*                                                                       */
00099   FT_EXPORT( FT_Error )
00100   FT_New_Size( FT_Face   face,
00101                FT_Size*  size );
00102 
00103 
00104   /*************************************************************************/
00105   /*                                                                       */
00106   /* <Function>                                                            */
00107   /*    FT_Done_Size                                                       */
00108   /*                                                                       */
00109   /* <Description>                                                         */
00110   /*    Discard a given size object.  Note that @FT_Done_Face              */
00111   /*    automatically discards all size objects allocated with             */
00112   /*    @FT_New_Size.                                                      */
00113   /*                                                                       */
00114   /* <Input>                                                               */
00115   /*    size :: A handle to a target size object.                          */
00116   /*                                                                       */
00117   /* <Return>                                                              */
00118   /*    FreeType error code.  0~means success.                             */
00119   /*                                                                       */
00120   FT_EXPORT( FT_Error )
00121   FT_Done_Size( FT_Size  size );
00122 
00123 
00124   /*************************************************************************/
00125   /*                                                                       */
00126   /* <Function>                                                            */
00127   /*    FT_Activate_Size                                                   */
00128   /*                                                                       */
00129   /* <Description>                                                         */
00130   /*    Even though it is possible to create several size objects for a    */
00131   /*    given face (see @FT_New_Size for details), functions like          */
00132   /*    @FT_Load_Glyph or @FT_Load_Char only use the one which has been    */
00133   /*    activated last to determine the `current character pixel size'.    */
00134   /*                                                                       */
00135   /*    This function can be used to `activate' a previously created size  */
00136   /*    object.                                                            */
00137   /*                                                                       */
00138   /* <Input>                                                               */
00139   /*    size :: A handle to a target size object.                          */
00140   /*                                                                       */
00141   /* <Return>                                                              */
00142   /*    FreeType error code.  0~means success.                             */
00143   /*                                                                       */
00144   /* <Note>                                                                */
00145   /*    If `face' is the size's parent face object, this function changes  */
00146   /*    the value of `face->size' to the input size handle.                */
00147   /*                                                                       */
00148   FT_EXPORT( FT_Error )
00149   FT_Activate_Size( FT_Size  size );
00150 
00151   /* */
00152 
00153 
00154 FT_END_HEADER
00155 
00156 #endif /* __FTSIZES_H__ */
00157 
00158 
00159 /* END */

Generated on Tue Jul 5 14:13:38 2011 for ROOT_528-00b_version by  doxygen 1.5.1