fontservices/freetypefontrasteriser/freetype2/include/freetype/internal/t1types.h
changeset 71 6cc5529d4a89
equal deleted inserted replaced
64:f66674566702 71:6cc5529d4a89
       
     1 /***************************************************************************/
       
     2 /*                                                                         */
       
     3 /*  t1types.h                                                              */
       
     4 /*                                                                         */
       
     5 /*    Basic Type1/Type2 type definitions and interface (specification      */
       
     6 /*    only).                                                               */
       
     7 /*                                                                         */
       
     8 /*  Copyright 1996-2001, 2002, 2003, 2004, 2006 by                         */
       
     9 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
       
    10 /*                                                                         */
       
    11 /*  This file is part of the FreeType project, and may only be used,       */
       
    12 /*  modified, and distributed under the terms of the FreeType project      */
       
    13 /*  license, FTL.TXT.  By continuing to use, modify, or distribute     */
       
    14 /*  this file you indicate that you have read the license and              */
       
    15 /*  understand and accept it fully.                                        */
       
    16 /*                                                                         */
       
    17 /***************************************************************************/
       
    18 
       
    19 
       
    20 #ifndef __T1TYPES_H__
       
    21 #define __T1TYPES_H__
       
    22 
       
    23 
       
    24 #include <ft2build.h>
       
    25 #include FT_TYPE1_TABLES_H
       
    26 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
       
    27 #include FT_INTERNAL_SERVICE_H
       
    28 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
       
    29 
       
    30 
       
    31 FT_BEGIN_HEADER
       
    32 
       
    33 
       
    34   /*************************************************************************/
       
    35   /*************************************************************************/
       
    36   /*************************************************************************/
       
    37   /***                                                                   ***/
       
    38   /***                                                                   ***/
       
    39   /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/
       
    40   /***                                                                   ***/
       
    41   /***                                                                   ***/
       
    42   /*************************************************************************/
       
    43   /*************************************************************************/
       
    44   /*************************************************************************/
       
    45 
       
    46 
       
    47   /*************************************************************************/
       
    48   /*                                                                       */
       
    49   /* <Struct>                                                              */
       
    50   /*    T1_EncodingRec                                                     */
       
    51   /*                                                                       */
       
    52   /* <Description>                                                         */
       
    53   /*    A structure modeling a custom encoding.                            */
       
    54   /*                                                                       */
       
    55   /* <Fields>                                                              */
       
    56   /*    num_chars  :: The number of character codes in the encoding.       */
       
    57   /*                  Usually 256.                                         */
       
    58   /*                                                                       */
       
    59   /*    code_first :: The lowest valid character code in the encoding.     */
       
    60   /*                                                                       */
       
    61   /*    code_last  :: The highest valid character code in the encoding.    */
       
    62   /*                                                                       */
       
    63   /*    char_index :: An array of corresponding glyph indices.             */
       
    64   /*                                                                       */
       
    65   /*    char_name  :: An array of corresponding glyph names.               */
       
    66   /*                                                                       */
       
    67   typedef struct  T1_EncodingRecRec_
       
    68   {
       
    69     FT_Int       num_chars;
       
    70     FT_Int       code_first;
       
    71     FT_Int       code_last;
       
    72 
       
    73     FT_UShort*   char_index;
       
    74     FT_String**  char_name;
       
    75 
       
    76   } T1_EncodingRec, *T1_Encoding;
       
    77 
       
    78 
       
    79   typedef enum  T1_EncodingType_
       
    80   {
       
    81     T1_ENCODING_TYPE_NONE = 0,
       
    82     T1_ENCODING_TYPE_ARRAY,
       
    83     T1_ENCODING_TYPE_STANDARD,
       
    84     T1_ENCODING_TYPE_ISOLATIN1,
       
    85     T1_ENCODING_TYPE_EXPERT
       
    86 
       
    87   } T1_EncodingType;
       
    88 
       
    89 
       
    90   typedef struct  T1_FontRec_
       
    91   {
       
    92     PS_FontInfoRec   font_info;         /* font info dictionary */
       
    93     PS_PrivateRec    private_dict;      /* private dictionary   */
       
    94     FT_String*       font_name;         /* top-level dictionary */
       
    95 
       
    96     T1_EncodingType  encoding_type;
       
    97     T1_EncodingRec   encoding;
       
    98 
       
    99     FT_Byte*         subrs_block;
       
   100     FT_Byte*         charstrings_block;
       
   101     FT_Byte*         glyph_names_block;
       
   102 
       
   103     FT_Int           num_subrs;
       
   104     FT_Byte**        subrs;
       
   105     FT_PtrDist*      subrs_len;
       
   106 
       
   107     FT_Int           num_glyphs;
       
   108     FT_String**      glyph_names;       /* array of glyph names       */
       
   109     FT_Byte**        charstrings;       /* array of glyph charstrings */
       
   110     FT_PtrDist*      charstrings_len;
       
   111 
       
   112     FT_Byte          paint_type;
       
   113     FT_Byte          font_type;
       
   114     FT_Matrix        font_matrix;
       
   115     FT_Vector        font_offset;
       
   116     FT_BBox          font_bbox;
       
   117     FT_Long          font_id;
       
   118 
       
   119     FT_Fixed         stroke_width;
       
   120 
       
   121   } T1_FontRec, *T1_Font;
       
   122 
       
   123 
       
   124   typedef struct  CID_SubrsRec_
       
   125   {
       
   126     FT_UInt    num_subrs;
       
   127     FT_Byte**  code;
       
   128 
       
   129   } CID_SubrsRec, *CID_Subrs;
       
   130 
       
   131 
       
   132   /*************************************************************************/
       
   133   /*************************************************************************/
       
   134   /*************************************************************************/
       
   135   /***                                                                   ***/
       
   136   /***                                                                   ***/
       
   137   /***                AFM FONT INFORMATION STRUCTURES                    ***/
       
   138   /***                                                                   ***/
       
   139   /***                                                                   ***/
       
   140   /*************************************************************************/
       
   141   /*************************************************************************/
       
   142   /*************************************************************************/
       
   143 
       
   144   typedef struct  AFM_TrackKernRec_
       
   145   {
       
   146     FT_Int    degree;
       
   147     FT_Fixed  min_ptsize;
       
   148     FT_Fixed  min_kern;
       
   149     FT_Fixed  max_ptsize;
       
   150     FT_Fixed  max_kern;
       
   151 
       
   152   } AFM_TrackKernRec, *AFM_TrackKern;
       
   153 
       
   154   typedef struct  AFM_KernPairRec_
       
   155   {
       
   156     FT_Int  index1;
       
   157     FT_Int  index2;
       
   158     FT_Int  x;
       
   159     FT_Int  y;
       
   160 
       
   161   } AFM_KernPairRec, *AFM_KernPair;
       
   162 
       
   163   typedef struct  AFM_FontInfoRec_
       
   164   {
       
   165     FT_Bool        IsCIDFont;
       
   166     FT_BBox        FontBBox;
       
   167     FT_Fixed       Ascender;
       
   168     FT_Fixed       Descender;
       
   169     AFM_TrackKern  TrackKerns;   /* free if non-NULL */
       
   170     FT_Int         NumTrackKern;
       
   171     AFM_KernPair   KernPairs;    /* free if non-NULL */
       
   172     FT_Int         NumKernPair;
       
   173 
       
   174   } AFM_FontInfoRec, *AFM_FontInfo;
       
   175 
       
   176 
       
   177   /*************************************************************************/
       
   178   /*************************************************************************/
       
   179   /*************************************************************************/
       
   180   /***                                                                   ***/
       
   181   /***                                                                   ***/
       
   182   /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/
       
   183   /***                                                                   ***/
       
   184   /***                                                                   ***/
       
   185   /*************************************************************************/
       
   186   /*************************************************************************/
       
   187   /*************************************************************************/
       
   188 
       
   189 
       
   190   typedef struct T1_FaceRec_*   T1_Face;
       
   191   typedef struct CID_FaceRec_*  CID_Face;
       
   192 
       
   193 
       
   194   typedef struct  T1_FaceRec_
       
   195   {
       
   196     FT_FaceRec      root;
       
   197     T1_FontRec      type1;
       
   198     const void*     psnames;
       
   199     const void*     psaux;
       
   200     const void*     afm_data;
       
   201     FT_CharMapRec   charmaprecs[2];
       
   202     FT_CharMap      charmaps[2];
       
   203 
       
   204 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
       
   205     PS_Unicodes     unicode_map;
       
   206 #endif    
       
   207 
       
   208     /* support for Multiple Masters fonts */
       
   209     PS_Blend        blend;
       
   210 
       
   211     /* since version 2.1 - interface to PostScript hinter */
       
   212     const void*     pshinter;
       
   213 
       
   214   } T1_FaceRec;
       
   215 
       
   216 
       
   217   typedef struct  CID_FaceRec_
       
   218   {
       
   219     FT_FaceRec       root;
       
   220     void*            psnames;
       
   221     void*            psaux;
       
   222     CID_FaceInfoRec  cid;
       
   223     void*            afm_data;
       
   224     CID_Subrs        subrs;
       
   225 
       
   226     /* since version 2.1 - interface to PostScript hinter */
       
   227     void*            pshinter;
       
   228 
       
   229     /* since version 2.1.8, but was originally positioned after `afm_data' */
       
   230     FT_Byte*         binary_data; /* used if hex data has been converted */
       
   231     FT_Stream        cid_stream;
       
   232 
       
   233   } CID_FaceRec;
       
   234 
       
   235 
       
   236 FT_END_HEADER
       
   237 
       
   238 #endif /* __T1TYPES_H__ */
       
   239 
       
   240 
       
   241 /* END */