misc/libfreetype/src/sfnt/sfdriver.c
author sheepluva
Thu, 03 May 2012 14:21:53 +0200
changeset 7017 19a434fc91fc
parent 5172 88f2e05288ba
permissions -rw-r--r--
visually indicate when map preview generation is in progress.
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
/*  sfdriver.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
/*    High-level SFNT driver interface (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-2007, 2009-2011 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_DEBUG_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#include FT_INTERNAL_SFNT_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#include FT_INTERNAL_OBJECTS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
#include "sfdriver.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#include "ttload.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include "sfobjs.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#include "sfntpic.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
#include "sferrors.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
#include "ttsbit.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
#endif
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
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
#include "ttpost.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
#endif
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
#ifdef TT_CONFIG_OPTION_BDF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
#include "ttbdf.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
#include FT_SERVICE_BDF_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
#include "ttcmap.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
#include "ttkern.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
#include "ttmtx.h"
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
#include FT_SERVICE_GLYPH_DICT_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
#include FT_SERVICE_POSTSCRIPT_NAME_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
#include FT_SERVICE_SFNT_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
#include FT_SERVICE_TT_CMAP_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
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
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
  /* messages during execution.                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
#undef  FT_COMPONENT
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
#define FT_COMPONENT  trace_sfdriver
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
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
  *  SFNT TABLE SERVICE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  *
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  static void*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  get_sfnt_table( TT_Face      face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
                  FT_Sfnt_Tag  tag )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
    void*  table;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
    switch ( tag )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
    case ft_sfnt_head:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
      table = &face->header;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
      break;
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
    case ft_sfnt_hhea:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
      table = &face->horizontal;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
    case ft_sfnt_vhea:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
      table = face->vertical_info ? &face->vertical : 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
      break;
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
    case ft_sfnt_os2:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
      table = face->os2.version == 0xFFFFU ? 0 : &face->os2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
      break;
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
    case ft_sfnt_post:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
      table = &face->postscript;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
    case ft_sfnt_maxp:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
      table = &face->max_profile;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
    case ft_sfnt_pclt:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
      table = face->pclt.Version ? &face->pclt : 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
      break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
    default:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
      table = 0;
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
    return table;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
  sfnt_table_info( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
                   FT_UInt    idx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
                   FT_ULong  *tag,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
                   FT_ULong  *offset,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
                   FT_ULong  *length )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
    if ( !offset || !length )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
      return SFNT_Err_Invalid_Argument;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
    if ( !tag )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
      *length = face->num_tables;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
      if ( idx >= face->num_tables )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
        return SFNT_Err_Table_Missing;
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
      *tag    = face->dir_tables[idx].Tag;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
      *offset = face->dir_tables[idx].Offset;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
      *length = face->dir_tables[idx].Length;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
    return SFNT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
  }
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
  FT_DEFINE_SERVICE_SFNT_TABLEREC(sfnt_service_sfnt_table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
    (FT_SFNT_TableLoadFunc)tt_face_load_any,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
    (FT_SFNT_TableGetFunc) get_sfnt_table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
    (FT_SFNT_TableInfoFunc)sfnt_table_info
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
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
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
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
  *  GLYPH DICT SERVICE
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
  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
  sfnt_get_glyph_name( TT_Face     face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
                       FT_UInt     glyph_index,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
                       FT_Pointer  buffer,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
                       FT_UInt     buffer_max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
    FT_String*  gname;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
    FT_Error    error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
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
    error = tt_face_get_ps_name( face, glyph_index, &gname );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
    if ( !error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
      FT_STRCPYN( buffer, gname, buffer_max );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
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
  static FT_UInt
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
  sfnt_get_name_index( TT_Face     face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
                       FT_String*  glyph_name )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
    FT_Face   root = &face->root;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
    FT_UInt   i, max_gid = FT_UINT_MAX;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
    if ( root->num_glyphs < 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
      return 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
    else if ( ( FT_ULong ) root->num_glyphs < FT_UINT_MAX )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
      max_gid = ( FT_UInt ) root->num_glyphs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
      FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
         FT_UINT_MAX, root->num_glyphs ));
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
    for ( i = 0; i < max_gid; i++ )
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
      FT_String*  gname;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
      FT_Error    error = tt_face_get_ps_name( face, i, &gname );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
      if ( error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
        continue;
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
      if ( !ft_strcmp( glyph_name, gname ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
        return i;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
    return 0;
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
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
  FT_DEFINE_SERVICE_GLYPHDICTREC(sfnt_service_glyph_dict,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
    (FT_GlyphDict_GetNameFunc)  sfnt_get_glyph_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
    (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
 /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
  *  POSTSCRIPT NAME SERVICE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
  *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
  static const char*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
  sfnt_get_ps_name( TT_Face  face )
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
    FT_Int       n, found_win, found_apple;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
    const char*  result = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
    /* shouldn't happen, but just in case to avoid memory leaks */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
    if ( face->postscript_name )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
      return face->postscript_name;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
    /* scan the name table to see whether we have a Postscript name here, */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
    /* either in Macintosh or Windows platform encodings                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
    found_win   = -1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
    found_apple = -1;
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
    for ( n = 0; n < face->num_names; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
      TT_NameEntryRec*  name = face->name_table.names + n;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
      if ( name->nameID == 6 && name->stringLength > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
        if ( name->platformID == 3     &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
             name->encodingID == 1     &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
             name->languageID == 0x409 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
          found_win = n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
        if ( name->platformID == 1 &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
             name->encodingID == 0 &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
             name->languageID == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
          found_apple = n;
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
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
    if ( found_win != -1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
      FT_Memory         memory = face->root.memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
      TT_NameEntryRec*  name   = face->name_table.names + found_win;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
      FT_UInt           len    = name->stringLength / 2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
      FT_Error          error  = SFNT_Err_Ok;
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
      FT_UNUSED( error );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
      if ( !FT_ALLOC( result, name->stringLength + 1 ) )
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
        FT_Stream   stream = face->name_table.stream;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
        FT_String*  r      = (FT_String*)result;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
        FT_Byte*    p      = (FT_Byte*)name->string;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
        if ( FT_STREAM_SEEK( name->stringOffset ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
             FT_FRAME_ENTER( name->stringLength ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
          FT_FREE( result );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
          name->stringLength = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
          name->stringOffset = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
          FT_FREE( name->string );
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
          goto Exit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
        p = (FT_Byte*)stream->cursor;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   282
        for ( ; len > 0; len--, p += 2 )
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
          if ( p[0] == 0 && p[1] >= 32 && p[1] < 128 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
            *r++ = p[1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   287
        *r = '\0';
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
        FT_FRAME_EXIT();
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
      goto Exit;
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
    if ( found_apple != -1 )
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
      FT_Memory         memory = face->root.memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
      TT_NameEntryRec*  name   = face->name_table.names + found_apple;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
      FT_UInt           len    = name->stringLength;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
      FT_Error          error  = SFNT_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   300
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
      FT_UNUSED( error );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   303
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   304
      if ( !FT_ALLOC( result, len + 1 ) )
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_Stream  stream = face->name_table.stream;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
        if ( FT_STREAM_SEEK( name->stringOffset ) ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
             FT_STREAM_READ( result, len )        )
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
          name->stringOffset = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
          name->stringLength = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
          FT_FREE( name->string );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
          FT_FREE( result );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
          goto Exit;
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
        ((char*)result)[len] = '\0';
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   319
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
  Exit:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
    face->postscript_name = result;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   324
    return result;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
  FT_DEFINE_SERVICE_PSFONTNAMEREC(sfnt_service_ps_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
    (FT_PsName_GetFunc)sfnt_get_ps_name
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
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
   *  TT CMAP INFO
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   335
  FT_DEFINE_SERVICE_TTCMAPSREC(tt_service_get_cmap_info,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
    (TT_CMap_Info_GetFunc)tt_get_cmap_info
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
  )
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
#ifdef TT_CONFIG_OPTION_BDF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
  static FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
  sfnt_get_charset_id( TT_Face       face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
                       const char*  *acharset_encoding,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
                       const char*  *acharset_registry )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
    BDF_PropertyRec  encoding, registry;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
    FT_Error         error;
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
    /* XXX: I don't know whether this is correct, since
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
     *      tt_face_find_bdf_prop only returns something correct if we have
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
     *      previously selected a size that is listed in the BDF table.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
     *      Should we change the BDF table format to include single offsets
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
     *      for `CHARSET_REGISTRY' and `CHARSET_ENCODING'?
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
    error = tt_face_find_bdf_prop( face, "CHARSET_REGISTRY", &registry );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
    if ( !error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
      error = tt_face_find_bdf_prop( face, "CHARSET_ENCODING", &encoding );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
      if ( !error )
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
        if ( registry.type == BDF_PROPERTY_TYPE_ATOM &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
             encoding.type == BDF_PROPERTY_TYPE_ATOM )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
          *acharset_encoding = encoding.u.atom;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
          *acharset_registry = registry.u.atom;
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
        else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
          error = SFNT_Err_Invalid_Argument;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
    }
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
    return error;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
  FT_DEFINE_SERVICE_BDFRec(sfnt_service_bdf,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
    (FT_BDF_GetCharsetIdFunc) sfnt_get_charset_id,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
    (FT_BDF_GetPropertyFunc)  tt_face_find_bdf_prop
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
#endif /* TT_CONFIG_OPTION_BDF */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   385
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
  /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
   *  SERVICE LIST
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
#if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
  FT_DEFINE_SERVICEDESCREC5(sfnt_services,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
    FT_SERVICE_ID_GLYPH_DICT,           &FT_SFNT_SERVICE_GLYPH_DICT_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
    FT_SERVICE_ID_BDF,                  &FT_SFNT_SERVICE_BDF_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
#elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   399
  FT_DEFINE_SERVICEDESCREC4(sfnt_services,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   402
    FT_SERVICE_ID_GLYPH_DICT,           &FT_SFNT_SERVICE_GLYPH_DICT_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   403
    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
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
#elif defined TT_CONFIG_OPTION_BDF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
  FT_DEFINE_SERVICEDESCREC4(sfnt_services,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   407
    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   408
    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
    FT_SERVICE_ID_BDF,                  &FT_SFNT_SERVICE_BDF_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
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
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   413
  FT_DEFINE_SERVICEDESCREC3(sfnt_services,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   414
    FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   415
    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   416
    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   417
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   418
#endif
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
  FT_CALLBACK_DEF( FT_Module_Interface )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   422
  sfnt_get_interface( FT_Module    module,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   423
                      const char*  module_interface )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   424
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   425
    FT_UNUSED( module );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   426
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   427
    return ft_service_list_lookup( FT_SFNT_SERVICES_GET, module_interface );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   430
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   431
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   432
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   433
  FT_CALLBACK_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   434
  tt_face_load_sfnt_header_stub( TT_Face      face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   435
                                 FT_Stream    stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   436
                                 FT_Long      face_index,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   437
                                 SFNT_Header  header )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   438
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   439
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   440
    FT_UNUSED( stream );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   441
    FT_UNUSED( face_index );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   442
    FT_UNUSED( header );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   443
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   444
    return SFNT_Err_Unimplemented_Feature;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   447
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   448
  FT_CALLBACK_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   449
  tt_face_load_directory_stub( TT_Face      face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   450
                               FT_Stream    stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   451
                               SFNT_Header  header )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   452
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   453
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   454
    FT_UNUSED( stream );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   455
    FT_UNUSED( header );
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
    return SFNT_Err_Unimplemented_Feature;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   458
  }
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   461
  FT_CALLBACK_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   462
  tt_face_load_hdmx_stub( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   463
                          FT_Stream  stream )
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
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   466
    FT_UNUSED( stream );
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
    return SFNT_Err_Unimplemented_Feature;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   469
  }
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   472
  FT_CALLBACK_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   473
  tt_face_free_hdmx_stub( TT_Face  face )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   474
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   475
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   476
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   477
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
  FT_CALLBACK_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   480
  tt_face_set_sbit_strike_stub( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   481
                                FT_UInt    x_ppem,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   482
                                FT_UInt    y_ppem,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   483
                                FT_ULong*  astrike_index )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   484
  {
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
     * We simply forge a FT_Size_Request and call the real function
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   487
     * that does all the work.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   488
     *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   489
     * This stub might be called by libXfont in the X.Org Xserver,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   490
     * compiled against version 2.1.8 or newer.
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
    FT_Size_RequestRec  req;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   494
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   495
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   496
    req.type           = FT_SIZE_REQUEST_TYPE_NOMINAL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   497
    req.width          = (FT_F26Dot6)x_ppem;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   498
    req.height         = (FT_F26Dot6)y_ppem;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   499
    req.horiResolution = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   500
    req.vertResolution = 0;
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
    *astrike_index = 0x7FFFFFFFUL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   503
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   504
    return tt_face_set_sbit_strike( face, &req, astrike_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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   507
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   508
  FT_CALLBACK_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   509
  tt_face_load_sbit_stub( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   510
                          FT_Stream  stream )
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
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   513
    FT_UNUSED( stream );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   514
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
     *  This function was originally implemented to load the sbit table.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   517
     *  However, it has been replaced by `tt_face_load_eblc', and this stub
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   518
     *  is only there for some rogue clients which would want to call it
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   519
     *  directly (which doesn't make much sense).
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
    return SFNT_Err_Unimplemented_Feature;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   524
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   525
  FT_CALLBACK_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   526
  tt_face_free_sbit_stub( TT_Face  face )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   527
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   528
    /* nothing to do in this stub */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   529
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   530
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   531
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
  FT_CALLBACK_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   534
  tt_face_load_charmap_stub( TT_Face    face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   535
                             void*      cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   536
                             FT_Stream  input )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   537
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   538
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   539
    FT_UNUSED( cmap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   540
    FT_UNUSED( input );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   541
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   542
    return SFNT_Err_Unimplemented_Feature;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   543
  }
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   546
  FT_CALLBACK_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   547
  tt_face_free_charmap_stub( TT_Face  face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   548
                             void*    cmap )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   549
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   550
    FT_UNUSED( face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   551
    FT_UNUSED( cmap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   552
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   553
    return SFNT_Err_Ok;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   556
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
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
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   559
#define PUT_EMBEDDED_BITMAPS(a) a 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   560
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   561
#define PUT_EMBEDDED_BITMAPS(a) 0 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   562
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   563
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   564
#define PUT_PS_NAMES(a) a 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   565
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   566
#define PUT_PS_NAMES(a) 0 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   567
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   568
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   569
  FT_DEFINE_SFNT_INTERFACE(sfnt_interface,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   570
    tt_face_goto_table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   571
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   572
    sfnt_init_face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   573
    sfnt_load_face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   574
    sfnt_done_face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   575
    sfnt_get_interface,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   576
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   577
    tt_face_load_any,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   578
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   579
    tt_face_load_sfnt_header_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   580
    tt_face_load_directory_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
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
    tt_face_load_head,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   583
    tt_face_load_hhea,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   584
    tt_face_load_cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   585
    tt_face_load_maxp,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   586
    tt_face_load_os2,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   587
    tt_face_load_post,
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
    tt_face_load_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   590
    tt_face_free_name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   591
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   592
    tt_face_load_hdmx_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   593
    tt_face_free_hdmx_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
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
    tt_face_load_kern,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   596
    tt_face_load_gasp,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   597
    tt_face_load_pclt,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   598
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   599
    /* see `ttload.h' */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   600
    PUT_EMBEDDED_BITMAPS(tt_face_load_bhed),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   601
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   602
    tt_face_set_sbit_strike_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   603
    tt_face_load_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   604
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   605
    tt_find_sbit_image, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   606
    tt_load_sbit_metrics, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   607
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   608
    PUT_EMBEDDED_BITMAPS(tt_face_load_sbit_image),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   609
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   610
    tt_face_free_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   611
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   612
    /* see `ttpost.h' */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   613
    PUT_PS_NAMES(tt_face_get_ps_name),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   614
    PUT_PS_NAMES(tt_face_free_ps_names),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   615
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   616
    tt_face_load_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   617
    tt_face_free_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   618
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   619
    /* since version 2.1.8 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   620
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   621
    tt_face_get_kerning,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   622
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   623
    /* since version 2.2 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   624
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   625
    tt_face_load_font_dir,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   626
    tt_face_load_hmtx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   627
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   628
    /* see `ttsbit.h' and `sfnt.h' */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   629
    PUT_EMBEDDED_BITMAPS(tt_face_load_eblc),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   630
    PUT_EMBEDDED_BITMAPS(tt_face_free_eblc),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   631
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   632
    PUT_EMBEDDED_BITMAPS(tt_face_set_sbit_strike),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   633
    PUT_EMBEDDED_BITMAPS(tt_face_load_strike_metrics),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   634
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   635
    tt_face_get_metrics
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   636
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   637
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   638
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   639
  FT_DEFINE_MODULE(sfnt_module_class,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   640
  
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   641
    0,  /* not a font driver or renderer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   642
    sizeof( FT_ModuleRec ),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   643
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   644
    "sfnt",     /* driver name                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   645
    0x10000L,   /* driver version 1.0                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   646
    0x20000L,   /* driver requires FreeType 2.0 or higher */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   647
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   648
    (const void*)&FT_SFNT_INTERFACE_GET,  /* module specific interface */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   649
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   650
    (FT_Module_Constructor)0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   651
    (FT_Module_Destructor) 0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   652
    (FT_Module_Requester)  sfnt_get_interface
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   653
  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   654
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   655
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   656
/* END */