2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* t1parse.h
|
|
|
|
*
|
|
|
|
* Type 1 parser (specification).
|
|
|
|
*
|
2021-01-17 07:18:48 +01:00
|
|
|
* Copyright (C) 1996-2021 by
|
2018-06-03 09:01:17 +02:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
2000-07-08 21:51:42 +02:00
|
|
|
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef T1PARSE_H_
|
|
|
|
#define T1PARSE_H_
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/internal/t1types.h>
|
|
|
|
#include <freetype/internal/ftstream.h>
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_BEGIN_HEADER
|
2000-05-24 00:16:27 +02:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2018-06-03 09:01:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @Struct:
|
|
|
|
* T1_ParserRec
|
|
|
|
*
|
|
|
|
* @Description:
|
|
|
|
* A PS_ParserRec is an object used to parse a Type 1 fonts very
|
|
|
|
* quickly.
|
|
|
|
*
|
|
|
|
* @Fields:
|
|
|
|
* root ::
|
|
|
|
* The root parser.
|
|
|
|
*
|
|
|
|
* stream ::
|
|
|
|
* The current input stream.
|
|
|
|
*
|
|
|
|
* base_dict ::
|
|
|
|
* A pointer to the top-level dictionary.
|
|
|
|
*
|
|
|
|
* base_len ::
|
|
|
|
* The length in bytes of the top dictionary.
|
|
|
|
*
|
|
|
|
* private_dict ::
|
|
|
|
* A pointer to the private dictionary.
|
|
|
|
*
|
|
|
|
* private_len ::
|
|
|
|
* The length in bytes of the private dictionary.
|
|
|
|
*
|
|
|
|
* in_pfb ::
|
|
|
|
* A boolean. Indicates that we are handling a PFB
|
|
|
|
* file.
|
|
|
|
*
|
|
|
|
* in_memory ::
|
|
|
|
* A boolean. Indicates a memory-based stream.
|
|
|
|
*
|
|
|
|
* single_block ::
|
|
|
|
* A boolean. Indicates that the private dictionary
|
|
|
|
* is stored in lieu of the base dictionary.
|
|
|
|
*/
|
2000-10-28 19:10:06 +02:00
|
|
|
typedef struct T1_ParserRec_
|
2000-01-27 15:02:04 +01:00
|
|
|
{
|
2002-02-28 17:10:29 +01:00
|
|
|
PS_ParserRec root;
|
|
|
|
FT_Stream stream;
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
FT_Byte* base_dict;
|
2008-06-09 22:49:29 +02:00
|
|
|
FT_ULong base_len;
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
FT_Byte* private_dict;
|
2008-06-09 22:49:29 +02:00
|
|
|
FT_ULong private_len;
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2003-10-07 07:49:41 +02:00
|
|
|
FT_Bool in_pfb;
|
|
|
|
FT_Bool in_memory;
|
|
|
|
FT_Bool single_block;
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} T1_ParserRec, *T1_Parser;
|
2000-01-27 15:02:04 +01:00
|
|
|
|
|
|
|
|
2000-10-28 19:10:06 +02:00
|
|
|
#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
|
|
|
|
#define T1_Release_Table( p ) \
|
2000-08-23 19:32:42 +02:00
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
if ( (p)->funcs.release ) \
|
|
|
|
(p)->funcs.release( p ); \
|
|
|
|
} while ( 0 )
|
|
|
|
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2003-10-07 07:49:41 +02:00
|
|
|
#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
|
|
|
|
#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root )
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2000-10-28 19:10:06 +02:00
|
|
|
#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
|
|
|
|
#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2002-04-02 00:01:46 +02:00
|
|
|
#define T1_ToCoordArray( p, m, c ) \
|
2000-08-23 19:32:42 +02:00
|
|
|
(p)->root.funcs.to_coord_array( &(p)->root, m, c )
|
2002-04-02 00:01:46 +02:00
|
|
|
#define T1_ToFixedArray( p, m, f, t ) \
|
2000-08-23 19:32:42 +02:00
|
|
|
(p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
|
2002-04-02 00:01:46 +02:00
|
|
|
#define T1_ToToken( p, t ) \
|
2000-08-23 19:32:42 +02:00
|
|
|
(p)->root.funcs.to_token( &(p)->root, t )
|
2002-04-02 00:01:46 +02:00
|
|
|
#define T1_ToTokenArray( p, t, m, c ) \
|
2000-08-23 19:32:42 +02:00
|
|
|
(p)->root.funcs.to_token_array( &(p)->root, t, m, c )
|
2000-01-27 15:02:04 +01:00
|
|
|
|
2002-04-02 00:01:46 +02:00
|
|
|
#define T1_Load_Field( p, f, o, m, pf ) \
|
2000-08-23 19:32:42 +02:00
|
|
|
(p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
|
2002-02-28 17:10:29 +01:00
|
|
|
|
2002-04-02 00:01:46 +02:00
|
|
|
#define T1_Load_Field_Table( p, f, o, m, pf ) \
|
2000-08-23 19:32:42 +02:00
|
|
|
(p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
|
2000-05-24 23:12:02 +02:00
|
|
|
|
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_New_Parser( T1_Parser parser,
|
|
|
|
FT_Stream stream,
|
|
|
|
FT_Memory memory,
|
|
|
|
PSAux_Service psaux );
|
2001-06-28 09:17:51 +02:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_Get_Private_Dict( T1_Parser parser,
|
|
|
|
PSAux_Service psaux );
|
2001-06-28 09:17:51 +02:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_Finalize_Parser( T1_Parser parser );
|
2000-03-17 12:51:33 +01:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_END_HEADER
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* T1PARSE_H_ */
|
2000-01-27 15:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|