ttcmap.h

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ttcmap.h                                                               */
00004 /*                                                                         */
00005 /*    TrueType character mapping table (cmap) support (specification).     */
00006 /*                                                                         */
00007 /*  Copyright 2002, 2003, 2004, 2005 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 __TTCMAP_H__
00020 #define __TTCMAP_H__
00021 
00022 
00023 #include <ft2build.h>
00024 #include FT_INTERNAL_TRUETYPE_TYPES_H
00025 #include FT_INTERNAL_VALIDATE_H
00026 #include FT_SERVICE_TT_CMAP_H
00027 
00028 FT_BEGIN_HEADER
00029 
00030 
00031 #define TT_CMAP_FLAG_UNSORTED     1
00032 #define TT_CMAP_FLAG_OVERLAPPING  2
00033 
00034   typedef struct  TT_CMapRec_
00035   {
00036     FT_CMapRec  cmap;
00037     FT_Byte*    data;           /* pointer to in-memory cmap table */
00038     FT_Int      flags;          /* for format 4 only               */
00039 
00040   } TT_CMapRec, *TT_CMap;
00041 
00042   typedef const struct TT_CMap_ClassRec_*  TT_CMap_Class;
00043 
00044 
00045   typedef FT_Error
00046   (*TT_CMap_ValidateFunc)( FT_Byte*      data,
00047                            FT_Validator  valid );
00048 
00049   typedef struct  TT_CMap_ClassRec_
00050   {
00051     FT_CMap_ClassRec      clazz;
00052     FT_UInt               format;
00053     TT_CMap_ValidateFunc  validate;
00054     TT_CMap_Info_GetFunc  get_cmap_info;
00055 
00056   } TT_CMap_ClassRec;
00057 
00058 #ifndef FT_CONFIG_OPTION_PIC
00059 
00060 #define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_,          \
00061     char_next_, char_var_index_, char_var_default_, variant_list_,           \
00062     charvariant_list_,variantchar_list_,                                     \
00063     format_, validate_, get_cmap_info_)                                      \
00064   FT_CALLBACK_TABLE_DEF                                                      \
00065   const TT_CMap_ClassRec class_ =                                            \
00066   {                                                                          \
00067     {size_, init_, done_, char_index_,                                       \
00068      char_next_, char_var_index_, char_var_default_, variant_list_,          \
00069      charvariant_list_, variantchar_list_},                                  \
00070     format_, validate_, get_cmap_info_                                       \
00071   };
00072 
00073 #else /* FT_CONFIG_OPTION_PIC */ 
00074 
00075 #define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_,          \
00076     char_next_, char_var_index_, char_var_default_, variant_list_,           \
00077     charvariant_list_,variantchar_list_,                                     \
00078     format_, validate_, get_cmap_info_)                                      \
00079   void                                                                       \
00080   FT_Init_Class_##class_( TT_CMap_ClassRec*  clazz )                         \
00081   {                                                                          \
00082     clazz->clazz.size = size_;                                               \
00083     clazz->clazz.init = init_;                                               \
00084     clazz->clazz.done = done_;                                               \
00085     clazz->clazz.char_index = char_index_;                                   \
00086     clazz->clazz.char_next = char_next_;                                     \
00087     clazz->clazz.char_var_index = char_var_index_;                           \
00088     clazz->clazz.char_var_default = char_var_default_;                       \
00089     clazz->clazz.variant_list = variant_list_;                               \
00090     clazz->clazz.charvariant_list = charvariant_list_;                       \
00091     clazz->clazz.variantchar_list = variantchar_list_;                       \
00092     clazz->format = format_;                                                 \
00093     clazz->validate = validate_;                                             \
00094     clazz->get_cmap_info = get_cmap_info_;                                   \
00095   } 
00096 
00097 #endif /* FT_CONFIG_OPTION_PIC */ 
00098 
00099   typedef struct  TT_ValidatorRec_
00100   {
00101     FT_ValidatorRec  validator;
00102     FT_UInt          num_glyphs;
00103 
00104   } TT_ValidatorRec, *TT_Validator;
00105 
00106 
00107 #define TT_VALIDATOR( x )          ((TT_Validator)( x ))
00108 #define TT_VALID_GLYPH_COUNT( x )  TT_VALIDATOR( x )->num_glyphs
00109 
00110 
00111   FT_LOCAL( FT_Error )
00112   tt_face_build_cmaps( TT_Face  face );
00113 
00114   /* used in tt-cmaps service */
00115   FT_LOCAL( FT_Error )
00116   tt_get_cmap_info( FT_CharMap    charmap,
00117                     TT_CMapInfo  *cmap_info );
00118 
00119 
00120 FT_END_HEADER
00121 
00122 #endif /* __TTCMAP_H__ */
00123 
00124 
00125 /* END */

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