vrshoot

diff libs/ft2static/freetype/t1tables.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/ft2static/freetype/t1tables.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,504 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  t1tables.h                                                             */
     1.7 +/*                                                                         */
     1.8 +/*    Basic Type 1/Type 2 tables definitions and interface (specification  */
     1.9 +/*    only).                                                               */
    1.10 +/*                                                                         */
    1.11 +/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */
    1.12 +/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
    1.13 +/*                                                                         */
    1.14 +/*  This file is part of the FreeType project, and may only be used,       */
    1.15 +/*  modified, and distributed under the terms of the FreeType project      */
    1.16 +/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    1.17 +/*  this file you indicate that you have read the license and              */
    1.18 +/*  understand and accept it fully.                                        */
    1.19 +/*                                                                         */
    1.20 +/***************************************************************************/
    1.21 +
    1.22 +
    1.23 +#ifndef __T1TABLES_H__
    1.24 +#define __T1TABLES_H__
    1.25 +
    1.26 +
    1.27 +#include <ft2build.h>
    1.28 +#include FT_FREETYPE_H
    1.29 +
    1.30 +#ifdef FREETYPE_H
    1.31 +#error "freetype.h of FreeType 1 has been loaded!"
    1.32 +#error "Please fix the directory search order for header files"
    1.33 +#error "so that freetype.h of FreeType 2 is found first."
    1.34 +#endif
    1.35 +
    1.36 +
    1.37 +FT_BEGIN_HEADER
    1.38 +
    1.39 +
    1.40 +  /*************************************************************************/
    1.41 +  /*                                                                       */
    1.42 +  /* <Section>                                                             */
    1.43 +  /*    type1_tables                                                       */
    1.44 +  /*                                                                       */
    1.45 +  /* <Title>                                                               */
    1.46 +  /*    Type 1 Tables                                                      */
    1.47 +  /*                                                                       */
    1.48 +  /* <Abstract>                                                            */
    1.49 +  /*    Type~1 (PostScript) specific font tables.                          */
    1.50 +  /*                                                                       */
    1.51 +  /* <Description>                                                         */
    1.52 +  /*    This section contains the definition of Type 1-specific tables,    */
    1.53 +  /*    including structures related to other PostScript font formats.     */
    1.54 +  /*                                                                       */
    1.55 +  /*************************************************************************/
    1.56 +
    1.57 +
    1.58 +  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
    1.59 +  /* structures in order to support Multiple Master fonts.               */
    1.60 +
    1.61 +
    1.62 +  /*************************************************************************/
    1.63 +  /*                                                                       */
    1.64 +  /* <Struct>                                                              */
    1.65 +  /*    PS_FontInfoRec                                                     */
    1.66 +  /*                                                                       */
    1.67 +  /* <Description>                                                         */
    1.68 +  /*    A structure used to model a Type~1 or Type~2 FontInfo dictionary.  */
    1.69 +  /*    Note that for Multiple Master fonts, each instance has its own     */
    1.70 +  /*    FontInfo dictionary.                                               */
    1.71 +  /*                                                                       */
    1.72 +  typedef struct  PS_FontInfoRec_
    1.73 +  {
    1.74 +    FT_String*  version;
    1.75 +    FT_String*  notice;
    1.76 +    FT_String*  full_name;
    1.77 +    FT_String*  family_name;
    1.78 +    FT_String*  weight;
    1.79 +    FT_Long     italic_angle;
    1.80 +    FT_Bool     is_fixed_pitch;
    1.81 +    FT_Short    underline_position;
    1.82 +    FT_UShort   underline_thickness;
    1.83 +
    1.84 +  } PS_FontInfoRec;
    1.85 +
    1.86 +
    1.87 +  /*************************************************************************/
    1.88 +  /*                                                                       */
    1.89 +  /* <Struct>                                                              */
    1.90 +  /*    PS_FontInfo                                                        */
    1.91 +  /*                                                                       */
    1.92 +  /* <Description>                                                         */
    1.93 +  /*    A handle to a @PS_FontInfoRec structure.                           */
    1.94 +  /*                                                                       */
    1.95 +  typedef struct PS_FontInfoRec_*  PS_FontInfo;
    1.96 +
    1.97 +
    1.98 +  /*************************************************************************/
    1.99 +  /*                                                                       */
   1.100 +  /* <Struct>                                                              */
   1.101 +  /*    T1_FontInfo                                                        */
   1.102 +  /*                                                                       */
   1.103 +  /* <Description>                                                         */
   1.104 +  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */
   1.105 +  /*    kept to maintain source compatibility between various versions of  */
   1.106 +  /*    FreeType.                                                          */
   1.107 +  /*                                                                       */
   1.108 +  typedef PS_FontInfoRec  T1_FontInfo;
   1.109 +
   1.110 +
   1.111 +  /*************************************************************************/
   1.112 +  /*                                                                       */
   1.113 +  /* <Struct>                                                              */
   1.114 +  /*    PS_PrivateRec                                                      */
   1.115 +  /*                                                                       */
   1.116 +  /* <Description>                                                         */
   1.117 +  /*    A structure used to model a Type~1 or Type~2 private dictionary.   */
   1.118 +  /*    Note that for Multiple Master fonts, each instance has its own     */
   1.119 +  /*    Private dictionary.                                                */
   1.120 +  /*                                                                       */
   1.121 +  typedef struct  PS_PrivateRec_
   1.122 +  {
   1.123 +    FT_Int     unique_id;
   1.124 +    FT_Int     lenIV;
   1.125 +
   1.126 +    FT_Byte    num_blue_values;
   1.127 +    FT_Byte    num_other_blues;
   1.128 +    FT_Byte    num_family_blues;
   1.129 +    FT_Byte    num_family_other_blues;
   1.130 +
   1.131 +    FT_Short   blue_values[14];
   1.132 +    FT_Short   other_blues[10];
   1.133 +
   1.134 +    FT_Short   family_blues      [14];
   1.135 +    FT_Short   family_other_blues[10];
   1.136 +
   1.137 +    FT_Fixed   blue_scale;
   1.138 +    FT_Int     blue_shift;
   1.139 +    FT_Int     blue_fuzz;
   1.140 +
   1.141 +    FT_UShort  standard_width[1];
   1.142 +    FT_UShort  standard_height[1];
   1.143 +
   1.144 +    FT_Byte    num_snap_widths;
   1.145 +    FT_Byte    num_snap_heights;
   1.146 +    FT_Bool    force_bold;
   1.147 +    FT_Bool    round_stem_up;
   1.148 +
   1.149 +    FT_Short   snap_widths [13];  /* including std width  */
   1.150 +    FT_Short   snap_heights[13];  /* including std height */
   1.151 +
   1.152 +    FT_Fixed   expansion_factor;
   1.153 +
   1.154 +    FT_Long    language_group;
   1.155 +    FT_Long    password;
   1.156 +
   1.157 +    FT_Short   min_feature[2];
   1.158 +
   1.159 +  } PS_PrivateRec;
   1.160 +
   1.161 +
   1.162 +  /*************************************************************************/
   1.163 +  /*                                                                       */
   1.164 +  /* <Struct>                                                              */
   1.165 +  /*    PS_Private                                                         */
   1.166 +  /*                                                                       */
   1.167 +  /* <Description>                                                         */
   1.168 +  /*    A handle to a @PS_PrivateRec structure.                            */
   1.169 +  /*                                                                       */
   1.170 +  typedef struct PS_PrivateRec_*  PS_Private;
   1.171 +
   1.172 +
   1.173 +  /*************************************************************************/
   1.174 +  /*                                                                       */
   1.175 +  /* <Struct>                                                              */
   1.176 +  /*    T1_Private                                                         */
   1.177 +  /*                                                                       */
   1.178 +  /* <Description>                                                         */
   1.179 +  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */
   1.180 +  /*   kept to maintain source compatibility between various versions of   */
   1.181 +  /*   FreeType.                                                           */
   1.182 +  /*                                                                       */
   1.183 +  typedef PS_PrivateRec  T1_Private;
   1.184 +
   1.185 +
   1.186 +  /*************************************************************************/
   1.187 +  /*                                                                       */
   1.188 +  /* <Enum>                                                                */
   1.189 +  /*    T1_Blend_Flags                                                     */
   1.190 +  /*                                                                       */
   1.191 +  /* <Description>                                                         */
   1.192 +  /*    A set of flags used to indicate which fields are present in a      */
   1.193 +  /*    given blend dictionary (font info or private).  Used to support    */
   1.194 +  /*    Multiple Masters fonts.                                            */
   1.195 +  /*                                                                       */
   1.196 +  typedef enum  T1_Blend_Flags_
   1.197 +  {
   1.198 +    /*# required fields in a FontInfo blend dictionary */
   1.199 +    T1_BLEND_UNDERLINE_POSITION = 0,
   1.200 +    T1_BLEND_UNDERLINE_THICKNESS,
   1.201 +    T1_BLEND_ITALIC_ANGLE,
   1.202 +
   1.203 +    /*# required fields in a Private blend dictionary */
   1.204 +    T1_BLEND_BLUE_VALUES,
   1.205 +    T1_BLEND_OTHER_BLUES,
   1.206 +    T1_BLEND_STANDARD_WIDTH,
   1.207 +    T1_BLEND_STANDARD_HEIGHT,
   1.208 +    T1_BLEND_STEM_SNAP_WIDTHS,
   1.209 +    T1_BLEND_STEM_SNAP_HEIGHTS,
   1.210 +    T1_BLEND_BLUE_SCALE,
   1.211 +    T1_BLEND_BLUE_SHIFT,
   1.212 +    T1_BLEND_FAMILY_BLUES,
   1.213 +    T1_BLEND_FAMILY_OTHER_BLUES,
   1.214 +    T1_BLEND_FORCE_BOLD,
   1.215 +
   1.216 +    /*# never remove */
   1.217 +    T1_BLEND_MAX
   1.218 +
   1.219 +  } T1_Blend_Flags;
   1.220 +
   1.221 +  /* */
   1.222 +
   1.223 +
   1.224 +  /*# backwards compatible definitions */
   1.225 +#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION
   1.226 +#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS
   1.227 +#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE
   1.228 +#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES
   1.229 +#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES
   1.230 +#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH
   1.231 +#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT
   1.232 +#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS
   1.233 +#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS
   1.234 +#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE
   1.235 +#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT
   1.236 +#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES
   1.237 +#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES
   1.238 +#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD
   1.239 +#define t1_blend_max                  T1_BLEND_MAX
   1.240 +
   1.241 +
   1.242 +  /* maximum number of Multiple Masters designs, as defined in the spec */
   1.243 +#define T1_MAX_MM_DESIGNS     16
   1.244 +
   1.245 +  /* maximum number of Multiple Masters axes, as defined in the spec */
   1.246 +#define T1_MAX_MM_AXIS        4
   1.247 +
   1.248 +  /* maximum number of elements in a design map */
   1.249 +#define T1_MAX_MM_MAP_POINTS  20
   1.250 +
   1.251 +
   1.252 +  /* this structure is used to store the BlendDesignMap entry for an axis */
   1.253 +  typedef struct  PS_DesignMap_
   1.254 +  {
   1.255 +    FT_Byte    num_points;
   1.256 +    FT_Long*   design_points;
   1.257 +    FT_Fixed*  blend_points;
   1.258 +
   1.259 +  } PS_DesignMapRec, *PS_DesignMap;
   1.260 +
   1.261 +  /* backwards-compatible definition */
   1.262 +  typedef PS_DesignMapRec  T1_DesignMap;
   1.263 +
   1.264 +
   1.265 +  typedef struct  PS_BlendRec_
   1.266 +  {
   1.267 +    FT_UInt          num_designs;
   1.268 +    FT_UInt          num_axis;
   1.269 +
   1.270 +    FT_String*       axis_names[T1_MAX_MM_AXIS];
   1.271 +    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];
   1.272 +    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];
   1.273 +
   1.274 +    FT_Fixed*        weight_vector;
   1.275 +    FT_Fixed*        default_weight_vector;
   1.276 +
   1.277 +    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];
   1.278 +    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];
   1.279 +
   1.280 +    FT_ULong         blend_bitflags;
   1.281 +
   1.282 +    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];
   1.283 +
   1.284 +    /* since 2.3.0 */
   1.285 +
   1.286 +    /* undocumented, optional: the default design instance;   */
   1.287 +    /* corresponds to default_weight_vector --                */
   1.288 +    /* num_default_design_vector == 0 means it is not present */
   1.289 +    /* in the font and associated metrics files               */
   1.290 +    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];
   1.291 +    FT_UInt          num_default_design_vector;
   1.292 +
   1.293 +  } PS_BlendRec, *PS_Blend;
   1.294 +
   1.295 +
   1.296 +  /* backwards-compatible definition */
   1.297 +  typedef PS_BlendRec  T1_Blend;
   1.298 +
   1.299 +
   1.300 +  /*************************************************************************/
   1.301 +  /*                                                                       */
   1.302 +  /* <Struct>                                                              */
   1.303 +  /*    CID_FaceDictRec                                                    */
   1.304 +  /*                                                                       */
   1.305 +  /* <Description>                                                         */
   1.306 +  /*    A structure used to represent data in a CID top-level dictionary.  */
   1.307 +  /*                                                                       */
   1.308 +  typedef struct  CID_FaceDictRec_
   1.309 +  {
   1.310 +    PS_PrivateRec  private_dict;
   1.311 +
   1.312 +    FT_UInt        len_buildchar;
   1.313 +    FT_Fixed       forcebold_threshold;
   1.314 +    FT_Pos         stroke_width;
   1.315 +    FT_Fixed       expansion_factor;
   1.316 +
   1.317 +    FT_Byte        paint_type;
   1.318 +    FT_Byte        font_type;
   1.319 +    FT_Matrix      font_matrix;
   1.320 +    FT_Vector      font_offset;
   1.321 +
   1.322 +    FT_UInt        num_subrs;
   1.323 +    FT_ULong       subrmap_offset;
   1.324 +    FT_Int         sd_bytes;
   1.325 +
   1.326 +  } CID_FaceDictRec;
   1.327 +
   1.328 +
   1.329 +  /*************************************************************************/
   1.330 +  /*                                                                       */
   1.331 +  /* <Struct>                                                              */
   1.332 +  /*    CID_FaceDict                                                       */
   1.333 +  /*                                                                       */
   1.334 +  /* <Description>                                                         */
   1.335 +  /*    A handle to a @CID_FaceDictRec structure.                          */
   1.336 +  /*                                                                       */
   1.337 +  typedef struct CID_FaceDictRec_*  CID_FaceDict;
   1.338 +
   1.339 +  /* */
   1.340 +
   1.341 +
   1.342 +  /* backwards-compatible definition */
   1.343 +  typedef CID_FaceDictRec  CID_FontDict;
   1.344 +
   1.345 +
   1.346 +  /*************************************************************************/
   1.347 +  /*                                                                       */
   1.348 +  /* <Struct>                                                              */
   1.349 +  /*    CID_FaceInfoRec                                                    */
   1.350 +  /*                                                                       */
   1.351 +  /* <Description>                                                         */
   1.352 +  /*    A structure used to represent CID Face information.                */
   1.353 +  /*                                                                       */
   1.354 +  typedef struct  CID_FaceInfoRec_
   1.355 +  {
   1.356 +    FT_String*      cid_font_name;
   1.357 +    FT_Fixed        cid_version;
   1.358 +    FT_Int          cid_font_type;
   1.359 +
   1.360 +    FT_String*      registry;
   1.361 +    FT_String*      ordering;
   1.362 +    FT_Int          supplement;
   1.363 +
   1.364 +    PS_FontInfoRec  font_info;
   1.365 +    FT_BBox         font_bbox;
   1.366 +    FT_ULong        uid_base;
   1.367 +
   1.368 +    FT_Int          num_xuid;
   1.369 +    FT_ULong        xuid[16];
   1.370 +
   1.371 +    FT_ULong        cidmap_offset;
   1.372 +    FT_Int          fd_bytes;
   1.373 +    FT_Int          gd_bytes;
   1.374 +    FT_ULong        cid_count;
   1.375 +
   1.376 +    FT_Int          num_dicts;
   1.377 +    CID_FaceDict    font_dicts;
   1.378 +
   1.379 +    FT_ULong        data_offset;
   1.380 +
   1.381 +  } CID_FaceInfoRec;
   1.382 +
   1.383 +
   1.384 +  /*************************************************************************/
   1.385 +  /*                                                                       */
   1.386 +  /* <Struct>                                                              */
   1.387 +  /*    CID_FaceInfo                                                       */
   1.388 +  /*                                                                       */
   1.389 +  /* <Description>                                                         */
   1.390 +  /*    A handle to a @CID_FaceInfoRec structure.                          */
   1.391 +  /*                                                                       */
   1.392 +  typedef struct CID_FaceInfoRec_*  CID_FaceInfo;
   1.393 +
   1.394 +
   1.395 +  /*************************************************************************/
   1.396 +  /*                                                                       */
   1.397 +  /* <Struct>                                                              */
   1.398 +  /*    CID_Info                                                           */
   1.399 +  /*                                                                       */
   1.400 +  /* <Description>                                                         */
   1.401 +  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */
   1.402 +  /*   kept to maintain source compatibility between various versions of   */
   1.403 +  /*   FreeType.                                                           */
   1.404 +  /*                                                                       */
   1.405 +  typedef CID_FaceInfoRec  CID_Info;
   1.406 +
   1.407 +
   1.408 +  /************************************************************************
   1.409 +   *
   1.410 +   * @function:
   1.411 +   *    FT_Has_PS_Glyph_Names
   1.412 +   *
   1.413 +   * @description:
   1.414 +   *    Return true if a given face provides reliable PostScript glyph
   1.415 +   *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,
   1.416 +   *    except that certain fonts (mostly TrueType) contain incorrect
   1.417 +   *    glyph name tables.
   1.418 +   *
   1.419 +   *    When this function returns true, the caller is sure that the glyph
   1.420 +   *    names returned by @FT_Get_Glyph_Name are reliable.
   1.421 +   *
   1.422 +   * @input:
   1.423 +   *    face ::
   1.424 +   *       face handle
   1.425 +   *
   1.426 +   * @return:
   1.427 +   *    Boolean.  True if glyph names are reliable.
   1.428 +   *
   1.429 +   */
   1.430 +  FT_EXPORT( FT_Int )
   1.431 +  FT_Has_PS_Glyph_Names( FT_Face  face );
   1.432 +
   1.433 +
   1.434 +  /************************************************************************
   1.435 +   *
   1.436 +   * @function:
   1.437 +   *    FT_Get_PS_Font_Info
   1.438 +   *
   1.439 +   * @description:
   1.440 +   *    Retrieve the @PS_FontInfoRec structure corresponding to a given
   1.441 +   *    PostScript font.
   1.442 +   *
   1.443 +   * @input:
   1.444 +   *    face ::
   1.445 +   *       PostScript face handle.
   1.446 +   *
   1.447 +   * @output:
   1.448 +   *    afont_info ::
   1.449 +   *       Output font info structure pointer.
   1.450 +   *
   1.451 +   * @return:
   1.452 +   *    FreeType error code.  0~means success.
   1.453 +   *
   1.454 +   * @note:
   1.455 +   *    The string pointers within the font info structure are owned by
   1.456 +   *    the face and don't need to be freed by the caller.
   1.457 +   *
   1.458 +   *    If the font's format is not PostScript-based, this function will
   1.459 +   *    return the `FT_Err_Invalid_Argument' error code.
   1.460 +   *
   1.461 +   */
   1.462 +  FT_EXPORT( FT_Error )
   1.463 +  FT_Get_PS_Font_Info( FT_Face      face,
   1.464 +                       PS_FontInfo  afont_info );
   1.465 +
   1.466 +
   1.467 +  /************************************************************************
   1.468 +   *
   1.469 +   * @function:
   1.470 +   *    FT_Get_PS_Font_Private
   1.471 +   *
   1.472 +   * @description:
   1.473 +   *    Retrieve the @PS_PrivateRec structure corresponding to a given
   1.474 +   *    PostScript font.
   1.475 +   *
   1.476 +   * @input:
   1.477 +   *    face ::
   1.478 +   *       PostScript face handle.
   1.479 +   *
   1.480 +   * @output:
   1.481 +   *    afont_private ::
   1.482 +   *       Output private dictionary structure pointer.
   1.483 +   *
   1.484 +   * @return:
   1.485 +   *    FreeType error code.  0~means success.
   1.486 +   *
   1.487 +   * @note:
   1.488 +   *    The string pointers within the @PS_PrivateRec structure are owned by
   1.489 +   *    the face and don't need to be freed by the caller.
   1.490 +   *
   1.491 +   *    If the font's format is not PostScript-based, this function returns
   1.492 +   *    the `FT_Err_Invalid_Argument' error code.
   1.493 +   *
   1.494 +   */
   1.495 +  FT_EXPORT( FT_Error )
   1.496 +  FT_Get_PS_Font_Private( FT_Face     face,
   1.497 +                          PS_Private  afont_private );
   1.498 +
   1.499 +  /* */
   1.500 +
   1.501 +
   1.502 +FT_END_HEADER
   1.503 +
   1.504 +#endif /* __T1TABLES_H__ */
   1.505 +
   1.506 +
   1.507 +/* END */