misc/libfreetype/src/psnames/psmodule.c
author m4tx
Sun, 11 Dec 2011 23:15:06 +0300
changeset 6525 6c97379c584b
parent 5172 88f2e05288ba
permissions -rw-r--r--
[GCI] backz task: unify the back button functionality, avoid using the save button
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  psmodule.c                                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    PSNames module implementation (body).                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008 by             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#include FT_INTERNAL_OBJECTS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#include "psmodule.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
#include "pstables.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include "psnamerr.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#include "pspic.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
#define VARIANT_BIT         0x80000000UL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
#define BASE_GLYPH( code )  ( (FT_UInt32)( (code) & ~VARIANT_BIT ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
  /* Return the Unicode value corresponding to a given glyph.  Note that */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  /* we do deal with glyph variants by detecting a non-initial dot in    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  /* the name, as in `A.swash' or `e.final'; in this case, the           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
  /* VARIANT_BIT is set in the return value.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
  /*                                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
  static FT_UInt32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
  ps_unicode_value( const char*  glyph_name )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
    /* If the name begins with `uni', then the glyph name may be a */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
    /* hard-coded unicode character code.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
    if ( glyph_name[0] == 'u' &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
         glyph_name[1] == 'n' &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
         glyph_name[2] == 'i' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
      /* determine whether the next four characters following are */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
      /* hexadecimal.                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
      /* XXX: Add code to deal with ligatures, i.e. glyph names like */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
      /*      `uniXXXXYYYYZZZZ'...                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
      FT_Int       count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
      FT_UInt32    value = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
      const char*  p     = glyph_name + 3;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
      for ( count = 4; count > 0; count--, p++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
        char          c = *p;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
        unsigned int  d;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
        d = (unsigned char)c - '0';
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
        if ( d >= 10 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
          d = (unsigned char)c - 'A';
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
          if ( d >= 6 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
            d = 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
          else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
            d += 10;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
        /* Exit if a non-uppercase hexadecimal character was found   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
        /* -- this also catches character codes below `0' since such */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
        /* negative numbers cast to `unsigned int' are far too big.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
        if ( d >= 16 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
        value = ( value << 4 ) + d;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
      /* there must be exactly four hex digits */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
      if ( count == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
        if ( *p == '\0' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
          return value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
        if ( *p == '.' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
          return (FT_UInt32)( value | VARIANT_BIT );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
    /* If the name begins with `u', followed by four to six uppercase */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
    /* hexadecimal digits, it is a hard-coded unicode character code. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
    if ( glyph_name[0] == 'u' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
      FT_Int       count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
      FT_UInt32    value = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
      const char*  p     = glyph_name + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
      for ( count = 6; count > 0; count--, p++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
        char          c = *p;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
        unsigned int  d;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
        d = (unsigned char)c - '0';
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
        if ( d >= 10 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
          d = (unsigned char)c - 'A';
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
          if ( d >= 6 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
            d = 16;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
          else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
            d += 10;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
        if ( d >= 16 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
        value = ( value << 4 ) + d;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
      if ( count <= 2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
        if ( *p == '\0' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
          return value;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
        if ( *p == '.' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
          return (FT_UInt32)( value | VARIANT_BIT );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
    /* Look for a non-initial dot in the glyph name in order to */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
    /* find variants like `A.swash', `e.final', etc.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
      const char*  p   = glyph_name;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
      const char*  dot = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
      for ( ; *p; p++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
        if ( *p == '.' && p > glyph_name )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
          dot = p;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
          break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
      /* now look up the glyph in the Adobe Glyph List */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
      if ( !dot )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
        return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
        return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
                            VARIANT_BIT );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
  /* ft_qsort callback to sort the unicode map */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
  FT_CALLBACK_DEF( int )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
  compare_uni_maps( const void*  a,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
                    const void*  b )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
    PS_UniMap*  map1 = (PS_UniMap*)a;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
    PS_UniMap*  map2 = (PS_UniMap*)b;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
    FT_UInt32   unicode1 = BASE_GLYPH( map1->unicode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
    FT_UInt32   unicode2 = BASE_GLYPH( map2->unicode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
    /* sort base glyphs before glyph variants */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
    if ( unicode1 == unicode2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
      if ( map1->unicode > map2->unicode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
        return 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
      else if ( map1->unicode < map2->unicode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
        return -1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
        return 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
      if ( unicode1 > unicode2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
        return 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
      else if ( unicode1 < unicode2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
        return -1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
        return 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
  /* support for extra glyphs not handled (well) in AGL; */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
  /* we add extra mappings for them if necessary         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
#define EXTRA_GLYPH_LIST_SIZE  10
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
  static const FT_UInt32  ft_extra_glyph_unicodes[EXTRA_GLYPH_LIST_SIZE] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
    /* WGL 4 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
    0x0394,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
    0x03A9,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
    0x2215,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
    0x00AD,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
    0x02C9,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
    0x03BC,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
    0x2219,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
    0x00A0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
    /* Romanian */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
    0x021A,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
    0x021B
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   219
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
  static const char  ft_extra_glyph_names[] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
    'D','e','l','t','a',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
    'O','m','e','g','a',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
    'f','r','a','c','t','i','o','n',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
    'h','y','p','h','e','n',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
    'm','a','c','r','o','n',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
    'm','u',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
    'p','e','r','i','o','d','c','e','n','t','e','r','e','d',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
    's','p','a','c','e',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
    'T','c','o','m','m','a','a','c','c','e','n','t',0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
    't','c','o','m','m','a','a','c','c','e','n','t',0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
  static const FT_Int
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
  ft_extra_glyph_name_offsets[EXTRA_GLYPH_LIST_SIZE] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
     0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
     6,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
    12,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
    21,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
    28,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
    35,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
    38,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
    53,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
    59,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
    72
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
  ps_check_extra_glyph_name( const char*  gname,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
                             FT_UInt      glyph,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
                             FT_UInt*     extra_glyphs,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
                             FT_UInt     *states )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
    FT_UInt  n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
    for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
      if ( ft_strcmp( ft_extra_glyph_names +
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
                        ft_extra_glyph_name_offsets[n], gname ) == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
        if ( states[n] == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
          /* mark this extra glyph as a candidate for the cmap */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
          states[n]     = 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
          extra_glyphs[n] = glyph;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
  static void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
  ps_check_extra_glyph_unicode( FT_UInt32  uni_char,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
                                FT_UInt   *states )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
    FT_UInt  n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   282
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   283
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   284
    for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
      if ( uni_char == ft_extra_glyph_unicodes[n] )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   287
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
        /* disable this extra glyph from being added to the cmap */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
        states[n] = 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   290
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   291
        return;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   293
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   294
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   295
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
  /* Build a table that maps Unicode values to glyph indices. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
  ps_unicodes_init( FT_Memory             memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   300
                    PS_Unicodes           table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
                    FT_UInt               num_glyphs,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
                    PS_GetGlyphNameFunc   get_glyph_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   303
                    PS_FreeGlyphNameFunc  free_glyph_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   304
                    FT_Pointer            glyph_data )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   305
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   307
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   308
    FT_UInt  extra_glyph_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
    FT_UInt  extra_glyphs[EXTRA_GLYPH_LIST_SIZE];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   311
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   312
    /* we first allocate the table */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
    table->num_maps = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
    table->maps     = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
    if ( !FT_NEW_ARRAY( table->maps, num_glyphs + EXTRA_GLYPH_LIST_SIZE ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   318
      FT_UInt     n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   319
      FT_UInt     count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
      PS_UniMap*  map;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
      FT_UInt32   uni_char;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   324
      map = table->maps;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   325
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   326
      for ( n = 0; n < num_glyphs; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
        const char*  gname = get_glyph_name( glyph_data, n );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   329
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   330
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   331
        if ( gname )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   332
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   333
          ps_check_extra_glyph_name( gname, n,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
                                     extra_glyphs, extra_glyph_list_states );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   335
          uni_char = ps_unicode_value( gname );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
          if ( BASE_GLYPH( uni_char ) != 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   338
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   339
            ps_check_extra_glyph_unicode( uni_char,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
                                          extra_glyph_list_states );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
            map->unicode     = uni_char;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
            map->glyph_index = n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
            map++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
          if ( free_glyph_name )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
            free_glyph_name( glyph_data, gname );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   349
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
      for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
        if ( extra_glyph_list_states[n] == 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
          /* This glyph name has an additional representation. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
          /* Add it to the cmap.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
          map->unicode     = ft_extra_glyph_unicodes[n];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
          map->glyph_index = extra_glyphs[n];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
          map++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
      /* now compress the table a bit */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
      count = (FT_UInt)( map - table->maps );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
      if ( count == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
        /* No unicode chars here! */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
        FT_FREE( table->maps );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
        if ( !error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
          error = PSnames_Err_No_Unicode_Glyph_Name;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   373
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   374
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   375
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   376
        /* Reallocate if the number of used entries is much smaller. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
        if ( count < num_glyphs / 2 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
          (void)FT_RENEW_ARRAY( table->maps, num_glyphs, count );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
          error = PSnames_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   381
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   382
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
        /* Sort the table in increasing order of unicode values, */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
        /* taking care of glyph variants.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   385
        ft_qsort( table->maps, count, sizeof ( PS_UniMap ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
                  compare_uni_maps );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
      table->num_maps = count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
  static FT_UInt
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
  ps_unicodes_char_index( PS_Unicodes  table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
                          FT_UInt32    unicode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   399
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
    PS_UniMap  *min, *max, *mid, *result = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   402
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   403
    /* Perform a binary search on the table. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   404
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   405
    min = table->maps;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
    max = min + table->num_maps - 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   407
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   408
    while ( min <= max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
      FT_UInt32  base_glyph;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   411
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   412
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   413
      mid = min + ( ( max - min ) >> 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   414
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   415
      if ( mid->unicode == unicode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   416
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   417
        result = mid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   418
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   419
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   420
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   421
      base_glyph = BASE_GLYPH( mid->unicode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   422
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   423
      if ( base_glyph == unicode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   424
        result = mid; /* remember match but continue search for base glyph */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   425
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   426
      if ( min == max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   427
        break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   428
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   429
      if ( base_glyph < unicode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   430
        min = mid + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   431
      else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   432
        max = mid - 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   433
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   434
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   435
    if ( result )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   436
      return result->glyph_index;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   437
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   438
      return 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   439
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   440
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   441
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   442
  static FT_UInt32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   443
  ps_unicodes_char_next( PS_Unicodes  table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   444
                         FT_UInt32   *unicode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   445
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   446
    FT_UInt    result    = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   447
    FT_UInt32  char_code = *unicode + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   448
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   449
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   450
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   451
      FT_UInt     min = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   452
      FT_UInt     max = table->num_maps;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   453
      FT_UInt     mid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   454
      PS_UniMap*  map;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   455
      FT_UInt32   base_glyph;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   456
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   457
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   458
      while ( min < max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   459
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   460
        mid = min + ( ( max - min ) >> 1 );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   461
        map = table->maps + mid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   462
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   463
        if ( map->unicode == char_code )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   464
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   465
          result = map->glyph_index;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   466
          goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   467
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   468
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   469
        base_glyph = BASE_GLYPH( map->unicode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   470
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   471
        if ( base_glyph == char_code )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   472
          result = map->glyph_index;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   473
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   474
        if ( base_glyph < char_code )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   475
          min = mid + 1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   476
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   477
          max = mid;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   478
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   479
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   480
      if ( result )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   481
        goto Exit;               /* we have a variant glyph */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   482
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   483
      /* we didn't find it; check whether we have a map just above it */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   484
      char_code = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   485
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   486
      if ( min < table->num_maps )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   487
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   488
        map       = table->maps + min;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   489
        result    = map->glyph_index;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   490
        char_code = BASE_GLYPH( map->unicode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   491
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   492
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   493
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   494
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   495
    *unicode = char_code;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   496
    return result;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   497
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   498
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   499
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   500
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   501
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   502
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   503
  static const char*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   504
  ps_get_macintosh_name( FT_UInt  name_index )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   505
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   506
    if ( name_index >= FT_NUM_MAC_NAMES )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   507
      name_index = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   508
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   509
    return ft_standard_glyph_names + ft_mac_names[name_index];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   510
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   511
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   512
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   513
  static const char*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   514
  ps_get_standard_strings( FT_UInt  sid )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   515
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   516
    if ( sid >= FT_NUM_SID_NAMES )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   517
      return 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   518
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   519
    return ft_standard_glyph_names + ft_sid_names[sid];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   520
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   521
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   522
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   523
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   524
  FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   525
    (PS_Unicode_ValueFunc)     ps_unicode_value,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   526
    (PS_Unicodes_InitFunc)     ps_unicodes_init,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   527
    (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   528
    (PS_Unicodes_CharNextFunc) ps_unicodes_char_next,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   529
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   530
    (PS_Macintosh_NameFunc)    ps_get_macintosh_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   531
    (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   532
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   533
    t1_standard_encoding,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   534
    t1_expert_encoding
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   535
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   536
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   537
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   538
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   539
  FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   540
    0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   541
    0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   542
    0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   543
    0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   544
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   545
    (PS_Macintosh_NameFunc)    ps_get_macintosh_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   546
    (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   547
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   548
    t1_standard_encoding,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   549
    t1_expert_encoding
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   550
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   551
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   552
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   553
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   554
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   555
  FT_DEFINE_SERVICEDESCREC1(pscmaps_services, 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   556
    FT_SERVICE_ID_POSTSCRIPT_CMAPS, &FT_PSCMAPS_INTERFACE_GET
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   557
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   558
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   559
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   560
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   561
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   562
  static FT_Pointer
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   563
  psnames_get_service( FT_Module    module,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   564
                       const char*  service_id )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   565
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   566
    FT_UNUSED( module );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   567
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   568
    return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   569
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   570
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   571
#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   572
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   573
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   574
#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   575
#define PUT_PS_NAMES_SERVICE(a) 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   576
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   577
#define PUT_PS_NAMES_SERVICE(a) a
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   578
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   579
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   580
  FT_DEFINE_MODULE(psnames_module_class,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   581
  
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   582
    0,  /* this is not a font driver, nor a renderer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   583
    sizeof ( FT_ModuleRec ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   584
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   585
    "psnames",  /* driver name                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   586
    0x10000L,   /* driver version                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   587
    0x20000L,   /* driver requires FreeType 2 or above */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   588
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   589
    PUT_PS_NAMES_SERVICE((void*)&FT_PSCMAPS_INTERFACE_GET),   /* module specific interface */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   590
    (FT_Module_Constructor)0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   591
    (FT_Module_Destructor) 0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   592
    (FT_Module_Requester)  PUT_PS_NAMES_SERVICE(psnames_get_service)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   593
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   594
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   595
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   596
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   597
/* END */