misc/libfreetype/include/freetype/internal/psaux.h
author koda
Mon, 25 Apr 2011 01:46:54 +0200
changeset 5172 88f2e05288ba
permissions -rw-r--r--
aaand let's add freetype as well while we are at it other smaller changes
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
/*  psaux.h                                                                */
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
/*    Auxiliary functions and data structures related to PostScript fonts  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*    (specification).                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  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
    12
/*  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
    13
/*  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
    14
/*  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
    15
/*  understand and accept it fully.                                        */
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#ifndef __PSAUX_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#define __PSAUX_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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#include FT_INTERNAL_OBJECTS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include FT_INTERNAL_TYPE1_TYPES_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#include FT_SERVICE_POSTSCRIPT_CMAPS_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
FT_BEGIN_HEADER
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
  /*************************************************************************/
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
  /*****                             T1_TABLE                          *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
  /*****                                                               *****/
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  typedef struct PS_TableRec_*              PS_Table;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
  /*************************************************************************/
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
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  /*    PS_Table_FuncsRec                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
  /*    A set of function pointers to manage PS_Table objects.             */
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
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
  /*    table_init    :: Used to initialize a table.                       */
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
  /*    table_done    :: Finalizes resp. destroy a given table.            */
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
  /*    table_add     :: Adds a new object to a table.                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
  /*    table_release :: Releases table data, then finalizes it.           */
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
  typedef struct  PS_Table_FuncsRec_
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
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
    (*init)( PS_Table   table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
             FT_Int     count,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
             FT_Memory  memory );
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
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
    (*done)( PS_Table  table );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
    (*add)( PS_Table    table,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
            FT_Int      idx,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
            void*       object,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
            FT_PtrDist  length );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
    (*release)( PS_Table  table );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
  } PS_Table_FuncsRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
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
  /*************************************************************************/
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
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
  /*    PS_TableRec                                                        */
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
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
  /*    A PS_Table is a simple object used to store an array of objects in */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
  /*    a single memory block.                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
  /*    block     :: The address in memory of the growheap's block.  This  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
  /*                 can change between two object adds, due to            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
  /*                 reallocation.                                         */
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
  /*    cursor    :: The current top of the grow heap within its block.    */
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
  /*    capacity  :: The current size of the heap block.  Increments by    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
  /*                 1kByte chunks.                                        */
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
  /*    max_elems :: The maximum number of elements in table.              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
  /*    num_elems :: The current number of elements in table.              */
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
  /*    elements  :: A table of element addresses within the block.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
  /*    lengths   :: A table of element sizes within the block.            */
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
  /*    memory    :: The object used for memory operations                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
  /*                 (alloc/realloc).                                      */
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
  /*    funcs     :: A table of method pointers for this object.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
  typedef struct  PS_TableRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
    FT_Byte*           block;          /* current memory block           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
    FT_Offset          cursor;         /* current cursor in memory block */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
    FT_Offset          capacity;       /* current size of memory block   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
    FT_Long            init;
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
    FT_Int             max_elems;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
    FT_Int             num_elems;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
    FT_Byte**          elements;       /* addresses of table elements */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
    FT_PtrDist*        lengths;        /* lengths of table elements   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
    FT_Memory          memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
    PS_Table_FuncsRec  funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
  } PS_TableRec;
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
  /*************************************************************************/
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
  /*****                       T1 FIELDS & TOKENS                      *****/
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
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
  /*************************************************************************/
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
  typedef struct PS_ParserRec_*  PS_Parser;
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
  typedef struct T1_TokenRec_*   T1_Token;
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
  typedef struct T1_FieldRec_*   T1_Field;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
  /* simple enumeration type used to identify token types */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
  typedef enum  T1_TokenType_
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
    T1_TOKEN_TYPE_NONE = 0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
    T1_TOKEN_TYPE_ANY,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
    T1_TOKEN_TYPE_STRING,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
    T1_TOKEN_TYPE_ARRAY,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
    T1_TOKEN_TYPE_KEY, /* aka `name' */
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
    /* do not remove */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
    T1_TOKEN_TYPE_MAX
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
  } T1_TokenType;
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
  /* a simple structure used to identify tokens */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
  typedef struct  T1_TokenRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
    FT_Byte*      start;   /* first character of token in input stream */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
    FT_Byte*      limit;   /* first character after the token          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
    T1_TokenType  type;    /* type of token                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
  } T1_TokenRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
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
  /* enumeration type used to identify object fields */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
  typedef enum  T1_FieldType_
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
    T1_FIELD_TYPE_NONE = 0,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
    T1_FIELD_TYPE_BOOL,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
    T1_FIELD_TYPE_INTEGER,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
    T1_FIELD_TYPE_FIXED,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
    T1_FIELD_TYPE_FIXED_1000,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
    T1_FIELD_TYPE_STRING,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
    T1_FIELD_TYPE_KEY,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
    T1_FIELD_TYPE_BBOX,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
    T1_FIELD_TYPE_INTEGER_ARRAY,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
    T1_FIELD_TYPE_FIXED_ARRAY,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
    T1_FIELD_TYPE_CALLBACK,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
    /* do not remove */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
    T1_FIELD_TYPE_MAX
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
  } T1_FieldType;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
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
  typedef enum  T1_FieldLocation_
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
    T1_FIELD_LOCATION_CID_INFO,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
    T1_FIELD_LOCATION_FONT_DICT,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
    T1_FIELD_LOCATION_FONT_EXTRA,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
    T1_FIELD_LOCATION_FONT_INFO,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
    T1_FIELD_LOCATION_PRIVATE,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
    T1_FIELD_LOCATION_BBOX,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
    T1_FIELD_LOCATION_LOADER,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
    T1_FIELD_LOCATION_FACE,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
    T1_FIELD_LOCATION_BLEND,
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
    /* do not remove */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
    T1_FIELD_LOCATION_MAX
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
  } T1_FieldLocation;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
  (*T1_Field_ParseFunc)( FT_Face     face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
                         FT_Pointer  parser );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
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
  /* structure type used to model object fields */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
  typedef struct  T1_FieldRec_
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
    const char*         ident;        /* field identifier               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
    T1_FieldLocation    location;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
    T1_FieldType        type;         /* type of field                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
    T1_Field_ParseFunc  reader;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
    FT_UInt             offset;       /* offset of field in object      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
    FT_Byte             size;         /* size of field in bytes         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
    FT_UInt             array_max;    /* maximal number of elements for */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
                                      /* array                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
    FT_UInt             count_offset; /* offset of element count for    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
                                      /* arrays; must not be zero if in */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
                                      /* use -- in other words, a       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
                                      /* `num_FOO' element must not     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
                                      /* start the used structure if we */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
                                      /* parse a `FOO' array            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
    FT_UInt             dict;         /* where we expect it             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
  } T1_FieldRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
#define T1_FIELD_DICT_PRIVATE  ( 1 << 1 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
          {                                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
            _ident, T1CODE, _type,                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
            0,                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
            FT_FIELD_OFFSET( _fname ),                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
            FT_FIELD_SIZE( _fname ),                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
            0, 0,                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
            _dict                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
          },
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
#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \
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
            _ident, T1CODE, T1_FIELD_TYPE_CALLBACK,     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
            (T1_Field_ParseFunc)_reader,                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
            0, 0,                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
            0, 0,                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
            _dict                                       \
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
          {                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
            _ident, T1CODE, _type,                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
            0,                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
            FT_FIELD_OFFSET( _fname ),                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
            FT_FIELD_SIZE_DELTA( _fname ),                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
            _max,                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
            FT_FIELD_OFFSET( num_ ## _fname ),                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
            _dict                                                \
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
#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \
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
            _ident, T1CODE, _type,                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
            0,                                                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
            FT_FIELD_OFFSET( _fname ),                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
            FT_FIELD_SIZE_DELTA( _fname ),                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
            _max, 0,                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
            _dict                                                 \
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
#define T1_FIELD_BOOL( _ident, _fname, _dict )                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )
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
#define T1_FIELD_NUM( _ident, _fname, _dict )                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )
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
#define T1_FIELD_FIXED( _ident, _fname, _dict )                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )
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
#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   295
          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
                               _dict )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
#define T1_FIELD_STRING( _ident, _fname, _dict )                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )
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
#define T1_FIELD_KEY( _ident, _fname, _dict )                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )
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
#define T1_FIELD_BBOX( _ident, _fname, _dict )                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   305
          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
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
#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
                              _fname, _fmax, _dict )
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
#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
                              _fname, _fmax, _dict )
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
#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   318
                               _fname, _fmax, _dict )
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
#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
                               _fname, _fmax, _dict )
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
#define T1_FIELD_CALLBACK( _ident, _name, _dict )       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   325
          T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
  /*************************************************************************/
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
  /*****                            T1 PARSER                          *****/
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
  /*************************************************************************/
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
  typedef const struct PS_Parser_FuncsRec_*  PS_Parser_Funcs;
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
  typedef struct  PS_Parser_FuncsRec_
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
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
    (*init)( PS_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
             FT_Byte*   base,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
             FT_Byte*   limit,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
             FT_Memory  memory );
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
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
    (*done)( PS_Parser  parser );
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
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
    (*skip_spaces)( PS_Parser  parser );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
    (*skip_PS_token)( PS_Parser  parser );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
    FT_Long
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
    (*to_int)( PS_Parser  parser );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
    FT_Fixed
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
    (*to_fixed)( PS_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
                 FT_Int     power_ten );
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
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
    (*to_bytes)( PS_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
                 FT_Byte*   bytes,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
                 FT_Offset  max_bytes,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
                 FT_Long*   pnum_bytes,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
                 FT_Bool    delimiters );
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
    FT_Int
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
    (*to_coord_array)( PS_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
                       FT_Int     max_coords,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
                       FT_Short*  coords );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
    FT_Int
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
    (*to_fixed_array)( PS_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   373
                       FT_Int     max_values,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   374
                       FT_Fixed*  values,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   375
                       FT_Int     power_ten );
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
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
    (*to_token)( PS_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
                 T1_Token   token );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   381
    (*to_token_array)( PS_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   382
                       T1_Token   tokens,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
                       FT_UInt    max_tokens,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
                       FT_Int*    pnum_tokens );
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
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
    (*load_field)( PS_Parser       parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
                   const T1_Field  field,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
                   void**          objects,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
                   FT_UInt         max_objects,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
                   FT_ULong*       pflags );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
    (*load_field_table)( PS_Parser       parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
                         const T1_Field  field,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
                         void**          objects,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
                         FT_UInt         max_objects,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
                         FT_ULong*       pflags );
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_Parser_FuncsRec;
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
  /*************************************************************************/
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
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
  /*    PS_ParserRec                                                       */
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
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
  /*    A PS_Parser is an object used to parse a Type 1 font very quickly. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   411
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   412
  /*    cursor :: The current position in the text.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   413
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   414
  /*    base   :: Start of the processed text.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   415
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   416
  /*    limit  :: End of the processed text.                               */
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
  /*    error  :: The last error returned.                                 */
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
  /*    memory :: The object used for memory operations (alloc/realloc).   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   421
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   422
  /*    funcs  :: A table of functions for the parser.                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   423
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   424
  typedef struct  PS_ParserRec_
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
    FT_Byte*   cursor;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   427
    FT_Byte*   base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   428
    FT_Byte*   limit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   429
    FT_Error   error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   430
    FT_Memory  memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   431
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   432
    PS_Parser_FuncsRec  funcs;
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
  } PS_ParserRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   435
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   436
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   437
  /*************************************************************************/
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
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   440
  /*****                         T1 BUILDER                            *****/
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
  /*************************************************************************/
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
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
  typedef struct T1_BuilderRec_*  T1_Builder;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   449
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   450
  (*T1_Builder_Check_Points_Func)( T1_Builder  builder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   451
                                   FT_Int      count );
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
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   454
  (*T1_Builder_Add_Point_Func)( T1_Builder  builder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   455
                                FT_Pos      x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   456
                                FT_Pos      y,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   457
                                FT_Byte     flag );
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
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   460
  (*T1_Builder_Add_Point1_Func)( T1_Builder  builder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   461
                                 FT_Pos      x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   462
                                 FT_Pos      y );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   463
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   464
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   465
  (*T1_Builder_Add_Contour_Func)( T1_Builder  builder );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   466
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   467
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   468
  (*T1_Builder_Start_Point_Func)( T1_Builder  builder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   469
                                  FT_Pos      x,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   470
                                  FT_Pos      y );
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
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   473
  (*T1_Builder_Close_Contour_Func)( T1_Builder  builder );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   476
  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;
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
  typedef struct  T1_Builder_FuncsRec_
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
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   481
    (*init)( T1_Builder    builder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   482
             FT_Face       face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   483
             FT_Size       size,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   484
             FT_GlyphSlot  slot,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   485
             FT_Bool       hinting );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   486
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   487
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   488
    (*done)( T1_Builder   builder );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   489
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   490
    T1_Builder_Check_Points_Func   check_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   491
    T1_Builder_Add_Point_Func      add_point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   492
    T1_Builder_Add_Point1_Func     add_point1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   493
    T1_Builder_Add_Contour_Func    add_contour;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   494
    T1_Builder_Start_Point_Func    start_point;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   495
    T1_Builder_Close_Contour_Func  close_contour;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   496
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   497
  } T1_Builder_FuncsRec;
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
  /* an enumeration type to handle charstring parsing states */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   501
  typedef enum  T1_ParseState_
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
    T1_Parse_Start,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   504
    T1_Parse_Have_Width,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   505
    T1_Parse_Have_Moveto,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   506
    T1_Parse_Have_Path
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
  } T1_ParseState;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   509
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
  /* <Structure>                                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   514
  /*    T1_BuilderRec                                                      */
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
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   517
  /*     A structure used during glyph loading to store its outline.       */
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
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   520
  /*    memory       :: The current memory object.                         */
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
  /*    face         :: The current face object.                           */
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
  /*    glyph        :: The current glyph slot.                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   525
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   526
  /*    loader       :: XXX                                                */
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
  /*    base         :: The base glyph outline.                            */
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
  /*    current      :: The current glyph outline.                         */
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
  /*    max_points   :: maximum points in builder outline                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   533
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   534
  /*    max_contours :: Maximal number of contours in builder outline.     */
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
  /*    pos_x        :: The horizontal translation (if composite glyph).   */
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
  /*    pos_y        :: The vertical translation (if composite glyph).     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   539
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   540
  /*    left_bearing :: The left side bearing point.                       */
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
  /*    advance      :: The horizontal advance vector.                     */
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
  /*    bbox         :: Unused.                                            */
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
  /*    parse_state  :: An enumeration which controls the charstring       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   547
  /*                    parsing state.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   548
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   549
  /*    load_points  :: If this flag is not set, no points are loaded.     */
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
  /*    no_recurse   :: Set but not used.                                  */
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
  /*    metrics_only :: A boolean indicating that we only want to compute  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   554
  /*                    the metrics of a given glyph, not load all of its  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   555
  /*                    points.                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   556
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   557
  /*    funcs        :: An array of function pointers for the builder.     */
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
  typedef struct  T1_BuilderRec_
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
    FT_Memory       memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   562
    FT_Face         face;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   563
    FT_GlyphSlot    glyph;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   564
    FT_GlyphLoader  loader;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   565
    FT_Outline*     base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   566
    FT_Outline*     current;
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
    FT_Pos          pos_x;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   569
    FT_Pos          pos_y;
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
    FT_Vector       left_bearing;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   572
    FT_Vector       advance;
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
    FT_BBox         bbox;          /* bounding box */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   575
    T1_ParseState   parse_state;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   576
    FT_Bool         load_points;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   577
    FT_Bool         no_recurse;
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
    FT_Bool         metrics_only;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   580
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   581
    void*           hints_funcs;    /* hinter-specific */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   582
    void*           hints_globals;  /* hinter-specific */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   583
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   584
    T1_Builder_FuncsRec  funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   585
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   586
  } T1_BuilderRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   587
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
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   590
  /*************************************************************************/
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
  /*****                         T1 DECODER                            *****/
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
#if 0
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
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   600
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   601
  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   602
  /* calls during glyph loading.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   603
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   604
#define T1_MAX_SUBRS_CALLS  8
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   605
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   606
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
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   609
  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   610
  /* minimum of 16 is required.                                            */
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
#define T1_MAX_CHARSTRINGS_OPERANDS  32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   613
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   614
#endif /* 0 */
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   617
  typedef struct  T1_Decoder_ZoneRec_
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
    FT_Byte*  cursor;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   620
    FT_Byte*  base;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   621
    FT_Byte*  limit;
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
  } T1_Decoder_ZoneRec, *T1_Decoder_Zone;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   626
  typedef struct T1_DecoderRec_*              T1_Decoder;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   627
  typedef const struct T1_Decoder_FuncsRec_*  T1_Decoder_Funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   628
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   629
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   630
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   631
  (*T1_Decoder_Callback)( T1_Decoder  decoder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   632
                          FT_UInt     glyph_index );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   633
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
  typedef struct  T1_Decoder_FuncsRec_
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
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   638
    (*init)( T1_Decoder           decoder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   639
             FT_Face              face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   640
             FT_Size              size,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   641
             FT_GlyphSlot         slot,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   642
             FT_Byte**            glyph_names,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   643
             PS_Blend             blend,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   644
             FT_Bool              hinting,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   645
             FT_Render_Mode       hint_mode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   646
             T1_Decoder_Callback  callback );
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
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   649
    (*done)( T1_Decoder  decoder );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   650
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   651
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   652
    (*parse_charstrings)( T1_Decoder  decoder,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   653
                          FT_Byte*    base,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   654
                          FT_UInt     len );
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
  } T1_Decoder_FuncsRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   657
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   658
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   659
  typedef struct  T1_DecoderRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   660
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   661
    T1_BuilderRec        builder;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   662
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   663
    FT_Long              stack[T1_MAX_CHARSTRINGS_OPERANDS];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   664
    FT_Long*             top;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   665
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   666
    T1_Decoder_ZoneRec   zones[T1_MAX_SUBRS_CALLS + 1];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   667
    T1_Decoder_Zone      zone;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   668
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   669
    FT_Service_PsCMaps   psnames;      /* for seac */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   670
    FT_UInt              num_glyphs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   671
    FT_Byte**            glyph_names;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   672
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   673
    FT_Int               lenIV;        /* internal for sub routine calls */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   674
    FT_UInt              num_subrs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   675
    FT_Byte**            subrs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   676
    FT_PtrDist*          subrs_len;    /* array of subrs length (optional) */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   677
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   678
    FT_Matrix            font_matrix;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   679
    FT_Vector            font_offset;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   680
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   681
    FT_Int               flex_state;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   682
    FT_Int               num_flex_vectors;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   683
    FT_Vector            flex_vectors[7];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   684
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   685
    PS_Blend             blend;       /* for multiple master support */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   686
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   687
    FT_Render_Mode       hint_mode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   688
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   689
    T1_Decoder_Callback  parse_callback;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   690
    T1_Decoder_FuncsRec  funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   691
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   692
    FT_Long*             buildchar;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   693
    FT_UInt              len_buildchar;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   694
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   695
    FT_Bool              seac;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   696
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   697
  } T1_DecoderRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   698
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   699
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   700
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   701
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   702
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   703
  /*****                            AFM PARSER                         *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   704
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   705
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   706
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   707
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   708
  typedef struct AFM_ParserRec_*  AFM_Parser;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   709
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   710
  typedef struct  AFM_Parser_FuncsRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   711
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   712
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   713
    (*init)( AFM_Parser  parser,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   714
             FT_Memory   memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   715
             FT_Byte*    base,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   716
             FT_Byte*    limit );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   717
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   718
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   719
    (*done)( AFM_Parser  parser );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   720
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   721
    FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   722
    (*parse)( AFM_Parser  parser );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   723
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   724
  } AFM_Parser_FuncsRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   725
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   726
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   727
  typedef struct AFM_StreamRec_*  AFM_Stream;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   728
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   729
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   730
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   731
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   732
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   733
  /*    AFM_ParserRec                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   734
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   735
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   736
  /*    An AFM_Parser is a parser for the AFM files.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   737
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   738
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   739
  /*    memory    :: The object used for memory operations (alloc and      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   740
  /*                 realloc).                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   741
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   742
  /*    stream    :: This is an opaque object.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   743
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   744
  /*    FontInfo  :: The result will be stored here.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   745
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   746
  /*    get_index :: A user provided function to get a glyph index by its  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   747
  /*                 name.                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   748
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   749
  typedef struct  AFM_ParserRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   750
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   751
    FT_Memory     memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   752
    AFM_Stream    stream;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   753
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   754
    AFM_FontInfo  FontInfo;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   755
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   756
    FT_Int
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   757
    (*get_index)( const char*  name,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   758
                  FT_Offset    len,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   759
                  void*        user_data );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   760
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   761
    void*         user_data;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   762
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   763
  } AFM_ParserRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   764
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   765
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   766
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   767
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   768
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   769
  /*****                     TYPE1 CHARMAPS                            *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   770
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   771
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   772
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   773
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   774
  typedef const struct T1_CMap_ClassesRec_*  T1_CMap_Classes;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   775
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   776
  typedef struct T1_CMap_ClassesRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   777
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   778
    FT_CMap_Class  standard;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   779
    FT_CMap_Class  expert;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   780
    FT_CMap_Class  custom;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   781
    FT_CMap_Class  unicode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   782
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   783
  } T1_CMap_ClassesRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   784
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   785
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   786
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   787
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   788
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   789
  /*****                        PSAux Module Interface                 *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   790
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   791
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   792
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   793
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   794
  typedef struct  PSAux_ServiceRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   795
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   796
    /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   797
    const PS_Table_FuncsRec*    ps_table_funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   798
    const PS_Parser_FuncsRec*   ps_parser_funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   799
    const T1_Builder_FuncsRec*  t1_builder_funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   800
    const T1_Decoder_FuncsRec*  t1_decoder_funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   801
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   802
    void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   803
    (*t1_decrypt)( FT_Byte*   buffer,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   804
                   FT_Offset  length,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   805
                   FT_UShort  seed );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   806
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   807
    T1_CMap_Classes  t1_cmap_classes;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   808
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   809
    /* fields after this comment line were added after version 2.1.10 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   810
    const AFM_Parser_FuncsRec*  afm_parser_funcs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   811
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   812
  } PSAux_ServiceRec, *PSAux_Service;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   813
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   814
  /* backwards-compatible type definition */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   815
  typedef PSAux_ServiceRec   PSAux_Interface;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   816
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   817
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   818
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   819
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   820
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   821
  /*****                 Some convenience functions                    *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   822
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   823
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   824
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   825
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   826
#define IS_PS_NEWLINE( ch ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   827
  ( (ch) == '\r' ||         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   828
    (ch) == '\n' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   829
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   830
#define IS_PS_SPACE( ch )  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   831
  ( (ch) == ' '         || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   832
    IS_PS_NEWLINE( ch ) || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   833
    (ch) == '\t'        || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   834
    (ch) == '\f'        || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   835
    (ch) == '\0' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   836
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   837
#define IS_PS_SPECIAL( ch )       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   838
  ( (ch) == '/'                || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   839
    (ch) == '(' || (ch) == ')' || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   840
    (ch) == '<' || (ch) == '>' || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   841
    (ch) == '[' || (ch) == ']' || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   842
    (ch) == '{' || (ch) == '}' || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   843
    (ch) == '%'                )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   844
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   845
#define IS_PS_DELIM( ch )  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   846
  ( IS_PS_SPACE( ch )   || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   847
    IS_PS_SPECIAL( ch ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   848
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   849
#define IS_PS_DIGIT( ch )        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   850
  ( (ch) >= '0' && (ch) <= '9' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   851
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   852
#define IS_PS_XDIGIT( ch )            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   853
  ( IS_PS_DIGIT( ch )              || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   854
    ( (ch) >= 'A' && (ch) <= 'F' ) || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   855
    ( (ch) >= 'a' && (ch) <= 'f' ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   856
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   857
#define IS_PS_BASE85( ch )       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   858
  ( (ch) >= '!' && (ch) <= 'u' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   859
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   860
#define IS_PS_TOKEN( cur, limit, token )                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   861
  ( (char)(cur)[0] == (token)[0]                                     && \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   862
    ( (cur) + sizeof ( (token) ) == (limit) ||                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   863
      ( (cur) + sizeof( (token) ) < (limit)          &&                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   864
        IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) )             && \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   865
    ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   866
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   867
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   868
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   869
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   870
#endif /* __PSAUX_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   871
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   872
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   873
/* END */