godot/thirdparty/freetype/include/freetype/internal/psaux.h

/****************************************************************************
 *
 * psaux.h
 *
 *   Auxiliary functions and data structures related to PostScript fonts
 *   (specification).
 *
 * Copyright (C) 1996-2023 by
 * David Turner, Robert Wilhelm, and Werner Lemberg.
 *
 * This file is part of the FreeType project, and may only be used,
 * modified, and distributed under the terms of the FreeType project
 * license, LICENSE.TXT.  By continuing to use, modify, or distribute
 * this file you indicate that you have read the license and
 * understand and accept it fully.
 *
 */


#ifndef PSAUX_H_
#define PSAUX_H_


#include <freetype/internal/ftobjs.h>
#include <freetype/internal/t1types.h>
#include <freetype/internal/fthash.h>
#include <freetype/internal/tttypes.h>
#include <freetype/internal/services/svpscmap.h>
#include <freetype/internal/cfftypes.h>
#include <freetype/internal/cffotypes.h>



FT_BEGIN_HEADER


  /**************************************************************************
   *
   * PostScript modules driver class.
   */
  PS_Driver;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                             T1_TABLE                          *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/


  PS_Table;
  PS_Table_Funcs;


  /**************************************************************************
   *
   * @struct:
   *   PS_Table_FuncsRec
   *
   * @description:
   *   A set of function pointers to manage PS_Table objects.
   *
   * @fields:
   *   table_init ::
   *     Used to initialize a table.
   *
   *   table_done ::
   *     Finalizes resp. destroy a given table.
   *
   *   table_add ::
   *     Adds a new object to a table.
   *
   *   table_release ::
   *     Releases table data, then finalizes it.
   */
  PS_Table_FuncsRec;


  /**************************************************************************
   *
   * @struct:
   *   PS_TableRec
   *
   * @description:
   *   A PS_Table is a simple object used to store an array of objects in a
   *   single memory block.
   *
   * @fields:
   *   block ::
   *     The address in memory of the growheap's block.  This can change
   *     between two object adds, due to reallocation.
   *
   *   cursor ::
   *     The current top of the grow heap within its block.
   *
   *   capacity ::
   *     The current size of the heap block.  Increments by 1kByte chunks.
   *
   *   init ::
   *     Set to 0xDEADBEEF if 'elements' and 'lengths' have been allocated.
   *
   *   max_elems ::
   *     The maximum number of elements in table.
   *
   *   elements ::
   *     A table of element addresses within the block.
   *
   *   lengths ::
   *     A table of element sizes within the block.
   *
   *   memory ::
   *     The object used for memory operations (alloc/realloc).
   *
   *   funcs ::
   *     A table of method pointers for this object.
   */
  PS_TableRec;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                       T1 FIELDS & TOKENS                      *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

  PS_Parser;

  T1_Token;

  T1_Field;


  /* simple enumeration type used to identify token types */
  T1_TokenType;


  /* a simple structure used to identify tokens */
  T1_TokenRec;


  /* enumeration type used to identify object fields */
  T1_FieldType;


  T1_FieldLocation;


  T1_Field_ParseFunc;


  /* structure type used to model object fields */
  T1_FieldRec;

#define T1_FIELD_DICT_FONTDICT
#define T1_FIELD_DICT_PRIVATE



#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict )

#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict )

#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict )

#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict )


#define T1_FIELD_BOOL( _ident, _fname, _dict )

#define T1_FIELD_NUM( _ident, _fname, _dict )

#define T1_FIELD_FIXED( _ident, _fname, _dict )

#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )

#define T1_FIELD_STRING( _ident, _fname, _dict )

#define T1_FIELD_KEY( _ident, _fname, _dict )

#define T1_FIELD_BBOX( _ident, _fname, _dict )


#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )

#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )

#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )

#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )

#define T1_FIELD_CALLBACK( _ident, _name, _dict )


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                            T1 PARSER                          *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

  PS_Parser_Funcs;

  PS_Parser_FuncsRec;


  /**************************************************************************
   *
   * @struct:
   *   PS_ParserRec
   *
   * @description:
   *   A PS_Parser is an object used to parse a Type 1 font very quickly.
   *
   * @fields:
   *   cursor ::
   *     The current position in the text.
   *
   *   base ::
   *     Start of the processed text.
   *
   *   limit ::
   *     End of the processed text.
   *
   *   error ::
   *     The last error returned.
   *
   *   memory ::
   *     The object used for memory operations (alloc/realloc).
   *
   *   funcs ::
   *     A table of functions for the parser.
   */
  PS_ParserRec;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                         PS BUILDER                            *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/


  PS_Builder;
  PS_Builder_Funcs;

  PS_Builder_FuncsRec;


  /**************************************************************************
   *
   * @struct:
   *   PS_Builder
   *
   * @description:
   *    A structure used during glyph loading to store its outline.
   *
   * @fields:
   *   memory ::
   *     The current memory object.
   *
   *   face ::
   *     The current face object.
   *
   *   glyph ::
   *     The current glyph slot.
   *
   *   loader ::
   *     XXX
   *
   *   base ::
   *     The base glyph outline.
   *
   *   current ::
   *     The current glyph outline.
   *
   *   pos_x ::
   *     The horizontal translation (if composite glyph).
   *
   *   pos_y ::
   *     The vertical translation (if composite glyph).
   *
   *   left_bearing ::
   *     The left side bearing point.
   *
   *   advance ::
   *     The horizontal advance vector.
   *
   *   bbox ::
   *     Unused.
   *
   *   path_begun ::
   *     A flag which indicates that a new path has begun.
   *
   *   load_points ::
   *     If this flag is not set, no points are loaded.
   *
   *   no_recurse ::
   *     Set but not used.
   *
   *   metrics_only ::
   *     A boolean indicating that we only want to compute the metrics of a
   *     given glyph, not load all of its points.
   *
   *   is_t1 ::
   *     Set if current font type is Type 1.
   *
   *   funcs ::
   *     An array of function pointers for the builder.
   */
  struct  PS_Builder_
  {};


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                            PS DECODER                         *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

#define PS_MAX_OPERANDS
#define PS_MAX_SUBRS_CALLS
                                    /* only 10 are allowed but there exist */
                                    /* fonts like `HiraKakuProN-W3.ttf'    */
                                    /* (Hiragino Kaku Gothic ProN W3;      */
                                    /* 8.2d6e1; 2014-12-19) that exceed    */
                                    /* this limit                          */

  /* execution context charstring zone */

  PS_Decoder_Zone;


  CFF_Decoder_Get_Glyph_Callback;

  CFF_Decoder_Free_Glyph_Callback;


  PS_Decoder;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                         T1 BUILDER                            *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/


  T1_Builder;


  T1_Builder_Check_Points_Func;

  T1_Builder_Add_Point_Func;

  T1_Builder_Add_Point1_Func;

  T1_Builder_Add_Contour_Func;

  T1_Builder_Start_Point_Func;

  T1_Builder_Close_Contour_Func;


  T1_Builder_Funcs;

  T1_Builder_FuncsRec;


  /* an enumeration type to handle charstring parsing states */
  T1_ParseState;


  /**************************************************************************
   *
   * @struct:
   *   T1_BuilderRec
   *
   * @description:
   *    A structure used during glyph loading to store its outline.
   *
   * @fields:
   *   memory ::
   *     The current memory object.
   *
   *   face ::
   *     The current face object.
   *
   *   glyph ::
   *     The current glyph slot.
   *
   *   loader ::
   *     XXX
   *
   *   base ::
   *     The base glyph outline.
   *
   *   current ::
   *     The current glyph outline.
   *
   *   max_points ::
   *     maximum points in builder outline
   *
   *   max_contours ::
   *     Maximum number of contours in builder outline.
   *
   *   pos_x ::
   *     The horizontal translation (if composite glyph).
   *
   *   pos_y ::
   *     The vertical translation (if composite glyph).
   *
   *   left_bearing ::
   *     The left side bearing point.
   *
   *   advance ::
   *     The horizontal advance vector.
   *
   *   bbox ::
   *     Unused.
   *
   *   parse_state ::
   *     An enumeration which controls the charstring parsing state.
   *
   *   load_points ::
   *     If this flag is not set, no points are loaded.
   *
   *   no_recurse ::
   *     Set but not used.
   *
   *   metrics_only ::
   *     A boolean indicating that we only want to compute the metrics of a
   *     given glyph, not load all of its points.
   *
   *   funcs ::
   *     An array of function pointers for the builder.
   */
  T1_BuilderRec;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                         T1 DECODER                            *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

#if 0

  /**************************************************************************
   *
   * T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine
   * calls during glyph loading.
   */
#define T1_MAX_SUBRS_CALLS


  /**************************************************************************
   *
   * T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A
   * minimum of 16 is required.
   */
#define T1_MAX_CHARSTRINGS_OPERANDS

#endif /* 0 */


  T1_Decoder_Zone;


  T1_Decoder;
  T1_Decoder_Funcs;


  T1_Decoder_Callback;


  T1_Decoder_FuncsRec;


  T1_DecoderRec;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                        CFF BUILDER                            *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/


  CFF_Builder;


  CFF_Builder_Check_Points_Func;

  CFF_Builder_Add_Point_Func;
  CFF_Builder_Add_Point1_Func;
  CFF_Builder_Start_Point_Func;
  CFF_Builder_Close_Contour_Func;

  CFF_Builder_Add_Contour_Func;

  CFF_Builder_Funcs;

  CFF_Builder_FuncsRec;


  /**************************************************************************
   *
   * @struct:
   *   CFF_Builder
   *
   * @description:
   *    A structure used during glyph loading to store its outline.
   *
   * @fields:
   *   memory ::
   *     The current memory object.
   *
   *   face ::
   *     The current face object.
   *
   *   glyph ::
   *     The current glyph slot.
   *
   *   loader ::
   *     The current glyph loader.
   *
   *   base ::
   *     The base glyph outline.
   *
   *   current ::
   *     The current glyph outline.
   *
   *   pos_x ::
   *     The horizontal translation (if composite glyph).
   *
   *   pos_y ::
   *     The vertical translation (if composite glyph).
   *
   *   left_bearing ::
   *     The left side bearing point.
   *
   *   advance ::
   *     The horizontal advance vector.
   *
   *   bbox ::
   *     Unused.
   *
   *   path_begun ::
   *     A flag which indicates that a new path has begun.
   *
   *   load_points ::
   *     If this flag is not set, no points are loaded.
   *
   *   no_recurse ::
   *     Set but not used.
   *
   *   metrics_only ::
   *     A boolean indicating that we only want to compute the metrics of a
   *     given glyph, not load all of its points.
   *
   *   hints_funcs ::
   *     Auxiliary pointer for hinting.
   *
   *   hints_globals ::
   *     Auxiliary pointer for hinting.
   *
   *   funcs ::
   *     A table of method pointers for this object.
   */
  struct  CFF_Builder_
  {};


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                        CFF DECODER                            *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/


#define CFF_MAX_OPERANDS
#define CFF_MAX_SUBRS_CALLS
                                    /* only 10 are allowed but there exist */
                                    /* fonts like `HiraKakuProN-W3.ttf'    */
                                    /* (Hiragino Kaku Gothic ProN W3;      */
                                    /* 8.2d6e1; 2014-12-19) that exceed    */
                                    /* this limit                          */
#define CFF_MAX_TRANS_ELEMENTS

  /* execution context charstring zone */

  CFF_Decoder_Zone;


  CFF_Decoder;


  CFF_Decoder_Funcs;

  CFF_Decoder_FuncsRec;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                            AFM PARSER                         *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

  AFM_Parser;

  AFM_Parser_FuncsRec;


  AFM_Stream;


  /**************************************************************************
   *
   * @struct:
   *   AFM_ParserRec
   *
   * @description:
   *   An AFM_Parser is a parser for the AFM files.
   *
   * @fields:
   *   memory ::
   *     The object used for memory operations (alloc and realloc).
   *
   *   stream ::
   *     This is an opaque object.
   *
   *   FontInfo ::
   *     The result will be stored here.
   *
   *   get_index ::
   *     A user provided function to get a glyph index by its name.
   */
  AFM_ParserRec;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                     TYPE1 CHARMAPS                            *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

  T1_CMap_Classes;

  T1_CMap_ClassesRec;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                        PSAux Module Interface                 *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

  PSAux_Service;

  /* backward compatible type definition */
  PSAux_Interface;


  /*************************************************************************/
  /*************************************************************************/
  /*****                                                               *****/
  /*****                 Some convenience functions                    *****/
  /*****                                                               *****/
  /*************************************************************************/
  /*************************************************************************/

#define IS_PS_NEWLINE( ch )

#define IS_PS_SPACE( ch )

#define IS_PS_SPECIAL( ch )

#define IS_PS_DELIM( ch )

#define IS_PS_DIGIT( ch )

#define IS_PS_XDIGIT( ch )

#define IS_PS_BASE85( ch )

#define IS_PS_TOKEN( cur, limit, token )


FT_END_HEADER

#endif /* PSAUX_H_ */


/* END */