2000-12-08 03:42:29 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* cffparse.h */
|
|
|
|
/* */
|
|
|
|
/* CFF token stream parser (specification) */
|
|
|
|
/* */
|
2015-01-17 20:41:43 +01:00
|
|
|
/* Copyright 1996-2015 by */
|
2000-12-08 03:42:29 +01: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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __CFF_PARSE_H__
|
|
|
|
#define __CFF_PARSE_H__
|
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
#include <ft2build.h>
|
* include/freetype/internal/bdftypes.h: removed obsolete header
* include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
'include/freetype/internal' to 'src/cff' since no other modules needs
to known about these types
* include/freetype/internal/t42types.h,
include/freetype/internal/internal.h, src/type42/t42objs.h,
src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
'include/freetype/internal' to 'src/type42' since no other modules needs
to known about these types
* src/gzip/infblock.c: removing compiler warning
* include/freetype/internal/services/svpsinfo.h,
include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
in "svpsinfo.h", removing some sad hacks.
2003-10-29 22:43:52 +01:00
|
|
|
#include "cfftypes.h"
|
2000-12-08 03:42:29 +01:00
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
#define CFF_MAX_STACK_DEPTH 96
|
|
|
|
|
|
|
|
#define CFF_CODE_TOPDICT 0x1000
|
|
|
|
#define CFF_CODE_PRIVATE 0x2000
|
|
|
|
|
|
|
|
|
2002-03-20 10:44:20 +01:00
|
|
|
typedef struct CFF_ParserRec_
|
2000-12-08 03:42:29 +01:00
|
|
|
{
|
2009-04-05 16:34:40 +02:00
|
|
|
FT_Library library;
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_Byte* start;
|
|
|
|
FT_Byte* limit;
|
|
|
|
FT_Byte* cursor;
|
|
|
|
|
|
|
|
FT_Byte* stack[CFF_MAX_STACK_DEPTH + 1];
|
|
|
|
FT_Byte** top;
|
|
|
|
|
|
|
|
FT_UInt object_code;
|
|
|
|
void* object;
|
|
|
|
|
2002-03-20 10:44:20 +01:00
|
|
|
} CFF_ParserRec, *CFF_Parser;
|
2000-12-08 03:42:29 +01:00
|
|
|
|
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( void )
|
* src/cff/cffcmap.c, src/cff/cffcmap.h, Jamfile, rules.mk: new files added
to support charmaps for CFF fonts
* src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/cff/cffparse.c, src/cffparse.h, src/cff/cffgload.c,
src/cff/cffgload.h: adding support for CFF charmaps, reformatting the
sources, and removing some bugs in the Encoding and Charset loaders
2002-07-10 18:52:06 +02:00
|
|
|
cff_parser_init( CFF_Parser parser,
|
2002-03-30 17:41:09 +01:00
|
|
|
FT_UInt code,
|
2009-04-05 16:34:40 +02:00
|
|
|
void* object,
|
|
|
|
FT_Library library);
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
* src/cff/cffcmap.c, src/cff/cffcmap.h, Jamfile, rules.mk: new files added
to support charmaps for CFF fonts
* src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/cff/cffparse.c, src/cffparse.h, src/cff/cffgload.c,
src/cff/cffgload.h: adding support for CFF charmaps, reformatting the
sources, and removing some bugs in the Encoding and Charset loaders
2002-07-10 18:52:06 +02:00
|
|
|
cff_parser_run( CFF_Parser parser,
|
2002-03-30 17:41:09 +01:00
|
|
|
FT_Byte* start,
|
|
|
|
FT_Byte* limit );
|
2000-12-08 03:42:29 +01:00
|
|
|
|
|
|
|
|
2009-04-05 16:34:40 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
cff_kind_none = 0,
|
|
|
|
cff_kind_num,
|
|
|
|
cff_kind_fixed,
|
|
|
|
cff_kind_fixed_thousand,
|
|
|
|
cff_kind_string,
|
|
|
|
cff_kind_bool,
|
|
|
|
cff_kind_delta,
|
|
|
|
cff_kind_callback,
|
|
|
|
|
|
|
|
cff_kind_max /* do not remove */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* now generate handlers for the most simple fields */
|
|
|
|
typedef FT_Error (*CFF_Field_Reader)( CFF_Parser parser );
|
|
|
|
|
|
|
|
typedef struct CFF_Field_Handler_
|
|
|
|
{
|
|
|
|
int kind;
|
|
|
|
int code;
|
|
|
|
FT_UInt offset;
|
|
|
|
FT_Byte size;
|
|
|
|
CFF_Field_Reader reader;
|
|
|
|
FT_UInt array_max;
|
|
|
|
FT_UInt count_offset;
|
|
|
|
|
[cff] Better tracing of the parsing process.
* src/cff/cffload.c (cff_subfont_load, cff_font_load): Decorate with
FT_TRACE.
* src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox,
cff_parse_private_dict, cff_parse_cid_ros): Updated.
(CFF_FIELD_NUM, CFF_FIELD_FIXED, CFF_FIELD_FIXED_1000,
CFF_FIELD_STRING, CFF_FIELD_BOOL, CFF_FIELD_CALLBACK, CFF_FIELD,
CFF_FIELD_DELTA): Add argument for ID.
(cff_parser_run): Decorate with FT_TRACE.
* src/cff/cffparse.h (CFF_Field_Handler) [FT_DEBUG_LEVEL_TRACE]: Add
`id' member.
* src/cff/cfftoken.h: Add IDs to all fields.
2011-08-25 13:41:16 +02:00
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
|
|
|
const char* id;
|
|
|
|
#endif
|
|
|
|
|
2009-04-05 16:34:40 +02:00
|
|
|
} CFF_Field_Handler;
|
|
|
|
|
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
FT_END_HEADER
|
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-12-08 03:42:29 +01:00
|
|
|
#endif /* __CFF_PARSE_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|