svpscmap.h

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  svpscmap.h                                                             */
00004 /*                                                                         */
00005 /*    The FreeType PostScript charmap service (specification).             */
00006 /*                                                                         */
00007 /*  Copyright 2003, 2006 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 __SVPSCMAP_H__
00020 #define __SVPSCMAP_H__
00021 
00022 #include FT_INTERNAL_OBJECTS_H
00023 
00024 
00025 FT_BEGIN_HEADER
00026 
00027 
00028 #define FT_SERVICE_ID_POSTSCRIPT_CMAPS  "postscript-cmaps"
00029 
00030 
00031   /*
00032    *  Adobe glyph name to unicode value.
00033    */
00034   typedef FT_UInt32
00035   (*PS_Unicode_ValueFunc)( const char*  glyph_name );
00036 
00037   /*
00038    *  Macintosh name id to glyph name.  NULL if invalid index.
00039    */
00040   typedef const char*
00041   (*PS_Macintosh_NameFunc)( FT_UInt  name_index );
00042 
00043   /*
00044    *  Adobe standard string ID to glyph name.  NULL if invalid index.
00045    */
00046   typedef const char*
00047   (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );
00048 
00049 
00050   /*
00051    *  Simple unicode -> glyph index charmap built from font glyph names
00052    *  table.
00053    */
00054   typedef struct  PS_UniMap_
00055   {
00056     FT_UInt32  unicode;      /* bit 31 set: is glyph variant */
00057     FT_UInt    glyph_index;
00058 
00059   } PS_UniMap;
00060 
00061 
00062   typedef struct PS_UnicodesRec_*  PS_Unicodes;
00063 
00064   typedef struct  PS_UnicodesRec_
00065   {
00066     FT_CMapRec  cmap;
00067     FT_UInt     num_maps;
00068     PS_UniMap*  maps;
00069 
00070   } PS_UnicodesRec;
00071 
00072 
00073   /*
00074    *  A function which returns a glyph name for a given index.  Returns
00075    *  NULL if invalid index.
00076    */
00077   typedef const char*
00078   (*PS_GetGlyphNameFunc)( FT_Pointer  data,
00079                           FT_UInt     string_index );
00080 
00081   /*
00082    *  A function used to release the glyph name returned by
00083    *  PS_GetGlyphNameFunc, when needed
00084    */
00085   typedef void
00086   (*PS_FreeGlyphNameFunc)( FT_Pointer  data,
00087                            const char*  name );
00088 
00089   typedef FT_Error
00090   (*PS_Unicodes_InitFunc)( FT_Memory             memory,
00091                            PS_Unicodes           unicodes,
00092                            FT_UInt               num_glyphs,
00093                            PS_GetGlyphNameFunc   get_glyph_name,
00094                            PS_FreeGlyphNameFunc  free_glyph_name,
00095                            FT_Pointer            glyph_data );
00096 
00097   typedef FT_UInt
00098   (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,
00099                                 FT_UInt32    unicode );
00100 
00101   typedef FT_UInt32
00102   (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,
00103                                FT_UInt32   *unicode );
00104 
00105 
00106   FT_DEFINE_SERVICE( PsCMaps )
00107   {
00108     PS_Unicode_ValueFunc       unicode_value;
00109 
00110     PS_Unicodes_InitFunc       unicodes_init;
00111     PS_Unicodes_CharIndexFunc  unicodes_char_index;
00112     PS_Unicodes_CharNextFunc   unicodes_char_next;
00113 
00114     PS_Macintosh_NameFunc      macintosh_name;
00115     PS_Adobe_Std_StringsFunc   adobe_std_strings;
00116     const unsigned short*      adobe_std_encoding;
00117     const unsigned short*      adobe_expert_encoding;
00118   };
00119 
00120 
00121 #ifndef FT_CONFIG_OPTION_PIC
00122 
00123 #define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
00124         unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \
00125         adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \
00126   static const FT_Service_PsCMapsRec class_ =                                \
00127   {                                                                          \
00128     unicode_value_, unicodes_init_,                                          \
00129     unicodes_char_index_, unicodes_char_next_, macintosh_name_,              \
00130     adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_          \
00131   };
00132 
00133 #else /* FT_CONFIG_OPTION_PIC */ 
00134 
00135 #define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
00136         unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \
00137         adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \
00138   void                                                                       \
00139   FT_Init_Class_##class_( FT_Library library,                                \
00140                           FT_Service_PsCMapsRec* clazz)                      \
00141   {                                                                          \
00142     FT_UNUSED(library);                                                      \
00143     clazz->unicode_value = unicode_value_;                                   \
00144     clazz->unicodes_init = unicodes_init_;                                   \
00145     clazz->unicodes_char_index = unicodes_char_index_;                       \
00146     clazz->unicodes_char_next = unicodes_char_next_;                         \
00147     clazz->macintosh_name = macintosh_name_;                                 \
00148     clazz->adobe_std_strings = adobe_std_strings_;                           \
00149     clazz->adobe_std_encoding = adobe_std_encoding_;                         \
00150     clazz->adobe_expert_encoding = adobe_expert_encoding_;                   \
00151   } 
00152 
00153 #endif /* FT_CONFIG_OPTION_PIC */ 
00154 
00155   /* */
00156 
00157 
00158 FT_END_HEADER
00159 
00160 
00161 #endif /* __SVPSCMAP_H__ */
00162 
00163 
00164 /* END */

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