2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* cidparse.h
|
|
|
|
*
|
|
|
|
* CID-keyed Type1 parser (specification).
|
|
|
|
*
|
2022-01-11 10:54:10 +01:00
|
|
|
* Copyright (C) 1996-2022 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-06-16 08:49:56 +02:00
|
|
|
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef CIDPARSE_H_
|
|
|
|
#define CIDPARSE_H_
|
2000-06-01 05:27:48 +02: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>
|
|
|
|
#include <freetype/internal/psaux.h>
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_BEGIN_HEADER
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2018-06-03 09:01:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @Struct:
|
|
|
|
* CID_Parser
|
|
|
|
*
|
|
|
|
* @Description:
|
|
|
|
* A CID_Parser is an object used to parse a Type 1 fonts very
|
|
|
|
* quickly.
|
|
|
|
*
|
|
|
|
* @Fields:
|
|
|
|
* root ::
|
|
|
|
* The root PS_ParserRec fields.
|
|
|
|
*
|
|
|
|
* stream ::
|
|
|
|
* The current input stream.
|
|
|
|
*
|
|
|
|
* postscript ::
|
|
|
|
* A pointer to the data to be parsed.
|
|
|
|
*
|
|
|
|
* postscript_len ::
|
|
|
|
* The length of the data to be parsed.
|
|
|
|
*
|
|
|
|
* data_offset ::
|
|
|
|
* The start position of the binary data (i.e., the
|
|
|
|
* end of the data to be parsed.
|
|
|
|
*
|
|
|
|
* binary_length ::
|
|
|
|
* The length of the data after the `StartData'
|
|
|
|
* command if the data format is hexadecimal.
|
|
|
|
*
|
|
|
|
* cid ::
|
|
|
|
* A structure which holds the information about
|
|
|
|
* the current font.
|
|
|
|
*
|
|
|
|
* num_dict ::
|
|
|
|
* The number of font dictionaries.
|
|
|
|
*/
|
2001-06-27 21:46:12 +02:00
|
|
|
typedef struct CID_Parser_
|
2000-06-01 05:27:48 +02:00
|
|
|
{
|
2002-02-28 17:10:29 +01:00
|
|
|
PS_ParserRec root;
|
|
|
|
FT_Stream stream;
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
FT_Byte* postscript;
|
2015-02-20 20:14:11 +01:00
|
|
|
FT_ULong postscript_len;
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
FT_ULong data_offset;
|
2004-01-23 20:52:40 +01:00
|
|
|
|
2015-02-20 20:14:11 +01:00
|
|
|
FT_ULong binary_length;
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2002-03-30 18:08:04 +01:00
|
|
|
CID_FaceInfo cid;
|
2021-10-11 05:11:10 +02:00
|
|
|
FT_UInt num_dict;
|
2000-06-01 05:27:48 +02:00
|
|
|
|
|
|
|
} CID_Parser;
|
|
|
|
|
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
cid_parser_new( CID_Parser* parser,
|
2002-03-30 18:08:04 +01:00
|
|
|
FT_Stream stream,
|
|
|
|
FT_Memory memory,
|
2002-02-28 17:10:29 +01:00
|
|
|
PSAux_Service psaux );
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
cid_parser_done( CID_Parser* parser );
|
2000-06-01 05:27:48 +02:00
|
|
|
|
|
|
|
|
2018-06-03 09:01:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* PARSING ROUTINES
|
|
|
|
*
|
|
|
|
*/
|
2000-06-01 05:27:48 +02:00
|
|
|
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_skip_spaces( p ) \
|
2003-10-07 07:49:41 +02:00
|
|
|
(p)->root.funcs.skip_spaces( &(p)->root )
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_skip_PS_token( p ) \
|
2003-10-07 07:49:41 +02:00
|
|
|
(p)->root.funcs.skip_PS_token( &(p)->root )
|
2000-08-24 18:29:15 +02:00
|
|
|
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root )
|
|
|
|
#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
|
2000-08-24 18:29:15 +02:00
|
|
|
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_to_coord_array( p, m, c ) \
|
2000-08-24 18:29:15 +02:00
|
|
|
(p)->root.funcs.to_coord_array( &(p)->root, m, c )
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_to_fixed_array( p, m, f, t ) \
|
2000-08-24 18:29:15 +02:00
|
|
|
(p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_to_token( p, t ) \
|
2000-08-24 18:29:15 +02:00
|
|
|
(p)->root.funcs.to_token( &(p)->root, t )
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_to_token_array( p, t, m, c ) \
|
2000-08-24 18:29:15 +02:00
|
|
|
(p)->root.funcs.to_token_array( &(p)->root, t, m, c )
|
|
|
|
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_load_field( p, f, o ) \
|
2000-08-24 18:29:15 +02:00
|
|
|
(p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 )
|
2014-01-23 07:48:23 +01:00
|
|
|
#define cid_parser_load_field_table( p, f, o ) \
|
2000-08-24 18:29:15 +02:00
|
|
|
(p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 )
|
2000-06-01 05:27:48 +02:00
|
|
|
|
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_END_HEADER
|
2000-06-16 08:49:56 +02:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* CIDPARSE_H_ */
|
2000-06-01 05:27:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|