vrshoot

diff libs/ft2static/freetype/internal/services/svpscmap.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/internal/services/svpscmap.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,164 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  svpscmap.h                                                             */
     1.7 +/*                                                                         */
     1.8 +/*    The FreeType PostScript charmap service (specification).             */
     1.9 +/*                                                                         */
    1.10 +/*  Copyright 2003, 2006 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 __SVPSCMAP_H__
    1.23 +#define __SVPSCMAP_H__
    1.24 +
    1.25 +#include FT_INTERNAL_OBJECTS_H
    1.26 +
    1.27 +
    1.28 +FT_BEGIN_HEADER
    1.29 +
    1.30 +
    1.31 +#define FT_SERVICE_ID_POSTSCRIPT_CMAPS  "postscript-cmaps"
    1.32 +
    1.33 +
    1.34 +  /*
    1.35 +   *  Adobe glyph name to unicode value.
    1.36 +   */
    1.37 +  typedef FT_UInt32
    1.38 +  (*PS_Unicode_ValueFunc)( const char*  glyph_name );
    1.39 +
    1.40 +  /*
    1.41 +   *  Macintosh name id to glyph name.  NULL if invalid index.
    1.42 +   */
    1.43 +  typedef const char*
    1.44 +  (*PS_Macintosh_NameFunc)( FT_UInt  name_index );
    1.45 +
    1.46 +  /*
    1.47 +   *  Adobe standard string ID to glyph name.  NULL if invalid index.
    1.48 +   */
    1.49 +  typedef const char*
    1.50 +  (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );
    1.51 +
    1.52 +
    1.53 +  /*
    1.54 +   *  Simple unicode -> glyph index charmap built from font glyph names
    1.55 +   *  table.
    1.56 +   */
    1.57 +  typedef struct  PS_UniMap_
    1.58 +  {
    1.59 +    FT_UInt32  unicode;      /* bit 31 set: is glyph variant */
    1.60 +    FT_UInt    glyph_index;
    1.61 +
    1.62 +  } PS_UniMap;
    1.63 +
    1.64 +
    1.65 +  typedef struct PS_UnicodesRec_*  PS_Unicodes;
    1.66 +
    1.67 +  typedef struct  PS_UnicodesRec_
    1.68 +  {
    1.69 +    FT_CMapRec  cmap;
    1.70 +    FT_UInt     num_maps;
    1.71 +    PS_UniMap*  maps;
    1.72 +
    1.73 +  } PS_UnicodesRec;
    1.74 +
    1.75 +
    1.76 +  /*
    1.77 +   *  A function which returns a glyph name for a given index.  Returns
    1.78 +   *  NULL if invalid index.
    1.79 +   */
    1.80 +  typedef const char*
    1.81 +  (*PS_GetGlyphNameFunc)( FT_Pointer  data,
    1.82 +                          FT_UInt     string_index );
    1.83 +
    1.84 +  /*
    1.85 +   *  A function used to release the glyph name returned by
    1.86 +   *  PS_GetGlyphNameFunc, when needed
    1.87 +   */
    1.88 +  typedef void
    1.89 +  (*PS_FreeGlyphNameFunc)( FT_Pointer  data,
    1.90 +                           const char*  name );
    1.91 +
    1.92 +  typedef FT_Error
    1.93 +  (*PS_Unicodes_InitFunc)( FT_Memory             memory,
    1.94 +                           PS_Unicodes           unicodes,
    1.95 +                           FT_UInt               num_glyphs,
    1.96 +                           PS_GetGlyphNameFunc   get_glyph_name,
    1.97 +                           PS_FreeGlyphNameFunc  free_glyph_name,
    1.98 +                           FT_Pointer            glyph_data );
    1.99 +
   1.100 +  typedef FT_UInt
   1.101 +  (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,
   1.102 +                                FT_UInt32    unicode );
   1.103 +
   1.104 +  typedef FT_UInt32
   1.105 +  (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,
   1.106 +                               FT_UInt32   *unicode );
   1.107 +
   1.108 +
   1.109 +  FT_DEFINE_SERVICE( PsCMaps )
   1.110 +  {
   1.111 +    PS_Unicode_ValueFunc       unicode_value;
   1.112 +
   1.113 +    PS_Unicodes_InitFunc       unicodes_init;
   1.114 +    PS_Unicodes_CharIndexFunc  unicodes_char_index;
   1.115 +    PS_Unicodes_CharNextFunc   unicodes_char_next;
   1.116 +
   1.117 +    PS_Macintosh_NameFunc      macintosh_name;
   1.118 +    PS_Adobe_Std_StringsFunc   adobe_std_strings;
   1.119 +    const unsigned short*      adobe_std_encoding;
   1.120 +    const unsigned short*      adobe_expert_encoding;
   1.121 +  };
   1.122 +
   1.123 +
   1.124 +#ifndef FT_CONFIG_OPTION_PIC
   1.125 +
   1.126 +#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
   1.127 +        unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \
   1.128 +        adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \
   1.129 +  static const FT_Service_PsCMapsRec class_ =                                \
   1.130 +  {                                                                          \
   1.131 +    unicode_value_, unicodes_init_,                                          \
   1.132 +    unicodes_char_index_, unicodes_char_next_, macintosh_name_,              \
   1.133 +    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_          \
   1.134 +  };
   1.135 +
   1.136 +#else /* FT_CONFIG_OPTION_PIC */ 
   1.137 +
   1.138 +#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
   1.139 +        unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \
   1.140 +        adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \
   1.141 +  void                                                                       \
   1.142 +  FT_Init_Class_##class_( FT_Library library,                                \
   1.143 +                          FT_Service_PsCMapsRec* clazz)                      \
   1.144 +  {                                                                          \
   1.145 +    FT_UNUSED(library);                                                      \
   1.146 +    clazz->unicode_value = unicode_value_;                                   \
   1.147 +    clazz->unicodes_init = unicodes_init_;                                   \
   1.148 +    clazz->unicodes_char_index = unicodes_char_index_;                       \
   1.149 +    clazz->unicodes_char_next = unicodes_char_next_;                         \
   1.150 +    clazz->macintosh_name = macintosh_name_;                                 \
   1.151 +    clazz->adobe_std_strings = adobe_std_strings_;                           \
   1.152 +    clazz->adobe_std_encoding = adobe_std_encoding_;                         \
   1.153 +    clazz->adobe_expert_encoding = adobe_expert_encoding_;                   \
   1.154 +  } 
   1.155 +
   1.156 +#endif /* FT_CONFIG_OPTION_PIC */ 
   1.157 +
   1.158 +  /* */
   1.159 +
   1.160 +
   1.161 +FT_END_HEADER
   1.162 +
   1.163 +
   1.164 +#endif /* __SVPSCMAP_H__ */
   1.165 +
   1.166 +
   1.167 +/* END */