2018-06-03 22:00:42 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* psaux.h
|
|
|
|
*
|
|
|
|
* Auxiliary functions and data structures related to PostScript fonts
|
|
|
|
* (specification).
|
|
|
|
*
|
2020-01-19 17:05:19 +01:00
|
|
|
* Copyright (C) 1996-2020 by
|
2018-06-03 22:00:42 +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-08-17 09:18:04 +02:00
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef PSAUX_H_
|
|
|
|
#define PSAUX_H_
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
2020-06-08 13:31:55 +02:00
|
|
|
#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>
|
Move struct declarations to `freetype/internal'.
NOTE: Does not compile!
This is so that the CFF functions moved to `psaux' can access the
same structs that they need.
* src/cff/cfftypes.h: Moved to...
* include/freetype/internal/cfftypes.h: ...Here.
* src/cff/cffobjs.h: Moved the struct declarations to...
* include/freetype/internal/cffotypes.h: ... this new file.
* include/freetype/internal/internal.h (FT_INTERNAL_CFF_TYPES_H,
FT_INTERNAL_CFF_OBJECT_TYPES_H): New macros.
* src/cff/cffcmap.h, src/cff/cffdrivr.c, src/cff/cffgload.c,
src/cff/cffgload.h, src/cff/cffload.h, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/cff/cffparse.h, src/psaux/psobjs.h,
include/freetype/internal/psaux.h,
include/freetype/internal/services/svcfftl.h: Update includes.
* src/cff/rules.mk (CFF_DRV_H): Updated.
2017-09-24 22:28:07 +02:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
2000-08-17 09:18:04 +02:00
|
|
|
|
|
|
|
|
2018-09-04 08:00:58 +02:00
|
|
|
/**************************************************************************
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* PostScript modules driver class.
|
|
|
|
*/
|
2017-09-25 06:28:25 +02:00
|
|
|
typedef struct PS_DriverRec_
|
|
|
|
{
|
|
|
|
FT_DriverRec root;
|
|
|
|
|
|
|
|
FT_UInt hinting_engine;
|
|
|
|
FT_Bool no_stem_darkening;
|
|
|
|
FT_Int darken_params[8];
|
|
|
|
FT_Int32 random_seed;
|
|
|
|
|
|
|
|
} PS_DriverRec, *PS_Driver;
|
|
|
|
|
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** T1_TABLE *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
|
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
* src/base/ftcalc.c (FT_MulFix): Ditto.
* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
CFF_GlyphSlot_Init): Ditto.
* src/cid/cidobjs.c (CID_GlyphSlot_Init,
CID_Size_Get_Globals_Funcs): Ditto.
* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
Ditto.
* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
variables.
* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
to...
(T1_Builder_FuncsRec): This.
(T1_Builder_Funcs): New typedef.
(PSAux_Interface): Remove compiler warnings.
* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
(t1_builder_funcs): Updated.
* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
(PSH_AlignmentRec): Updated.
* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
typo.
* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
* src/base/ftstream (FT_Get_Char): Rename to...
(FT_Stream_Get_Char): This.
* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
a built-in function in gcc, causing warning messages with gcc 3.0.
* src/autohint/ahglyph.c (ah_outline_load): Ditto.
* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
Ditto.
* src/cff/cffload.c (cff_new_index, cff_done_index,
cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
CFF_Done_Font): Ditto.
* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
* src/pshinter/pshalgo1.c (psh1_hint_table_record,
psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
* src/pshinter/pshalgo2.c (psh2_hint_table_record,
psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
TT_Get_PS_Name): Ditto.
* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
load_truetype_glyph): Ditto.
* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
|
|
|
typedef struct PS_TableRec_* PS_Table;
|
|
|
|
typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* PS_Table_FuncsRec
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A set of function pointers to manage PS_Table objects.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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.
|
|
|
|
*/
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct PS_Table_FuncsRec_
|
2000-08-23 04:47:57 +02:00
|
|
|
{
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Error
|
2002-02-28 17:10:29 +01:00
|
|
|
(*init)( PS_Table table,
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Int count,
|
|
|
|
FT_Memory memory );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
void
|
2002-02-28 17:10:29 +01:00
|
|
|
(*done)( PS_Table table );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Error
|
2019-06-11 05:09:49 +02:00
|
|
|
(*add)( PS_Table table,
|
|
|
|
FT_Int idx,
|
|
|
|
const void* object,
|
|
|
|
FT_UInt length );
|
2000-08-23 04:47:57 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
void
|
2002-02-28 17:10:29 +01:00
|
|
|
(*release)( PS_Table table );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} PS_Table_FuncsRec;
|
2000-08-23 04:47:57 +02:00
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* PS_TableRec
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* A PS_Table is a simple object used to store an array of objects in a
|
|
|
|
* single memory block.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* block ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* The address in memory of the growheap's block. This can change
|
|
|
|
* between two object adds, due to reallocation.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* cursor ::
|
|
|
|
* The current top of the grow heap within its block.
|
|
|
|
*
|
|
|
|
* capacity ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* The current size of the heap block. Increments by 1kByte chunks.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* init ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* Set to 0xDEADBEEF if 'elements' and 'lengths' have been allocated.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* max_elems ::
|
|
|
|
* The maximum number of elements in table.
|
|
|
|
*
|
|
|
|
* num_elems ::
|
|
|
|
* The current number of elements in table.
|
|
|
|
*
|
|
|
|
* elements ::
|
|
|
|
* A table of element addresses within the block.
|
|
|
|
*
|
|
|
|
* lengths ::
|
|
|
|
* A table of element sizes within the block.
|
|
|
|
*
|
|
|
|
* memory ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* The object used for memory operations (alloc/realloc).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* funcs ::
|
|
|
|
* A table of method pointers for this object.
|
|
|
|
*/
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct PS_TableRec_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2002-03-14 11:09:35 +01:00
|
|
|
FT_Byte* block; /* current memory block */
|
|
|
|
FT_Offset cursor; /* current cursor in memory block */
|
|
|
|
FT_Offset capacity; /* current size of memory block */
|
2015-02-25 11:20:20 +01:00
|
|
|
FT_ULong init;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
FT_Int max_elems;
|
|
|
|
FT_Int num_elems;
|
|
|
|
FT_Byte** elements; /* addresses of table elements */
|
2015-02-18 09:22:06 +01:00
|
|
|
FT_UInt* lengths; /* lengths of table elements */
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
FT_Memory memory;
|
|
|
|
PS_Table_FuncsRec funcs;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} PS_TableRec;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** T1 FIELDS & TOKENS *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct PS_ParserRec_* PS_Parser;
|
|
|
|
|
|
|
|
typedef struct T1_TokenRec_* T1_Token;
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct T1_FieldRec_* T1_Field;
|
2000-08-23 19:32:42 +02:00
|
|
|
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
/* simple enumeration type used to identify token types */
|
2002-03-14 11:09:35 +01:00
|
|
|
typedef enum T1_TokenType_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_TOKEN_TYPE_NONE = 0,
|
|
|
|
T1_TOKEN_TYPE_ANY,
|
|
|
|
T1_TOKEN_TYPE_STRING,
|
|
|
|
T1_TOKEN_TYPE_ARRAY,
|
2006-08-13 14:14:36 +02:00
|
|
|
T1_TOKEN_TYPE_KEY, /* aka `name' */
|
2000-08-17 03:09:06 +02:00
|
|
|
|
|
|
|
/* do not remove */
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_TOKEN_TYPE_MAX
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
} T1_TokenType;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* a simple structure used to identify tokens */
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct T1_TokenRec_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Byte* start; /* first character of token in input stream */
|
|
|
|
FT_Byte* limit; /* first character after the token */
|
2002-03-14 11:09:35 +01:00
|
|
|
T1_TokenType type; /* type of token */
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} T1_TokenRec;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* enumeration type used to identify object fields */
|
2002-03-14 11:09:35 +01:00
|
|
|
typedef enum T1_FieldType_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_FIELD_TYPE_NONE = 0,
|
|
|
|
T1_FIELD_TYPE_BOOL,
|
|
|
|
T1_FIELD_TYPE_INTEGER,
|
|
|
|
T1_FIELD_TYPE_FIXED,
|
2003-06-06 07:07:53 +02:00
|
|
|
T1_FIELD_TYPE_FIXED_1000,
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_FIELD_TYPE_STRING,
|
2003-06-12 15:14:15 +02:00
|
|
|
T1_FIELD_TYPE_KEY,
|
2002-07-11 13:26:21 +02:00
|
|
|
T1_FIELD_TYPE_BBOX,
|
2012-12-23 21:14:37 +01:00
|
|
|
T1_FIELD_TYPE_MM_BBOX,
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_FIELD_TYPE_INTEGER_ARRAY,
|
|
|
|
T1_FIELD_TYPE_FIXED_ARRAY,
|
|
|
|
T1_FIELD_TYPE_CALLBACK,
|
2000-08-17 03:09:06 +02:00
|
|
|
|
|
|
|
/* do not remove */
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_FIELD_TYPE_MAX
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
} T1_FieldType;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
typedef enum T1_FieldLocation_
|
2000-08-24 00:47:44 +02:00
|
|
|
{
|
2002-03-14 11:09:35 +01:00
|
|
|
T1_FIELD_LOCATION_CID_INFO,
|
|
|
|
T1_FIELD_LOCATION_FONT_DICT,
|
2009-03-03 14:28:59 +01:00
|
|
|
T1_FIELD_LOCATION_FONT_EXTRA,
|
2002-03-14 11:09:35 +01:00
|
|
|
T1_FIELD_LOCATION_FONT_INFO,
|
|
|
|
T1_FIELD_LOCATION_PRIVATE,
|
2002-07-11 13:26:21 +02:00
|
|
|
T1_FIELD_LOCATION_BBOX,
|
* freetype2/include/freetype/internal/psaux.h: New macros
IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT,
IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h).
(T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
(T1_DecoderRec): New fields `buildchar' and `face'.
(IS_PS_TOKEN): New macro.
* freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New
fields `ndv_idx', `cdv_idx', and `len_buildchar'.
* freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields
`default_design_vector' and `num_default_design_vector'.
* freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE,
IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h.
* freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow
`token' argument to be NULL if we want only to count the number of
tokens.
(ps_tocoordarray): Allow `coords' argument to be NULL if we just
want to skip the array.
(ps_tofixedarray): Allow `values' argument to be NULL if we just
want to skip the array.
* freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add
support for (partially commented out) othersubrs 19-25, 27, and 28.
(t1_decoder_init): Initialize new fields `face' and `buildchar'.
(t1_decoder_done): Release new field `buildchar'.
* freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New
functions.
(t1_keywords): Register them.
(t1_allocate_blend): Updated.
(t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
(parse_dict): Remove `keyword_flags' argument.
Use new macro IS_PS_TOKEN.
Changed function so that later PostScript definitions override
earlier ones.
(t1_init_loader): Initialize new field `keywords_encountered'.
(T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
`len_buildchar'.
Remove `keywords_flags'.
* freetype2/src/type1/t1load.h (T1_LoaderRect): New field
`keywords_encountered'.
(T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
* freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]:
New entries for parsing /NDV, /CDV, and /DesignVector.
2006-07-14 20:28:08 +02:00
|
|
|
T1_FIELD_LOCATION_LOADER,
|
|
|
|
T1_FIELD_LOCATION_FACE,
|
|
|
|
T1_FIELD_LOCATION_BLEND,
|
2000-08-24 00:47:44 +02:00
|
|
|
|
|
|
|
/* do not remove */
|
2002-03-14 11:09:35 +01:00
|
|
|
T1_FIELD_LOCATION_MAX
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
} T1_FieldLocation;
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2000-08-24 18:29:15 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef void
|
2002-03-14 11:09:35 +01:00
|
|
|
(*T1_Field_ParseFunc)( FT_Face face,
|
|
|
|
FT_Pointer parser );
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
|
|
|
|
/* structure type used to model object fields */
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct T1_FieldRec_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2002-03-14 11:09:35 +01:00
|
|
|
const char* ident; /* field identifier */
|
|
|
|
T1_FieldLocation location;
|
|
|
|
T1_FieldType type; /* type of field */
|
|
|
|
T1_Field_ParseFunc reader;
|
|
|
|
FT_UInt offset; /* offset of field in object */
|
|
|
|
FT_Byte size; /* size of field in bytes */
|
2012-03-11 13:48:25 +01:00
|
|
|
FT_UInt array_max; /* maximum number of elements for */
|
2002-03-14 11:09:35 +01:00
|
|
|
/* array */
|
|
|
|
FT_UInt count_offset; /* offset of element count for */
|
2009-01-09 08:58:08 +01:00
|
|
|
/* arrays; must not be zero if in */
|
|
|
|
/* use -- in other words, a */
|
|
|
|
/* `num_FOO' element must not */
|
|
|
|
/* start the used structure if we */
|
|
|
|
/* parse a `FOO' array */
|
2006-08-13 14:14:36 +02:00
|
|
|
FT_UInt dict; /* where we expect it */
|
2002-02-28 17:10:29 +01:00
|
|
|
} T1_FieldRec;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */
|
|
|
|
#define T1_FIELD_DICT_PRIVATE ( 1 << 1 )
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \
|
|
|
|
{ \
|
|
|
|
_ident, T1CODE, _type, \
|
|
|
|
0, \
|
|
|
|
FT_FIELD_OFFSET( _fname ), \
|
|
|
|
FT_FIELD_SIZE( _fname ), \
|
|
|
|
0, 0, \
|
|
|
|
_dict \
|
2000-08-24 00:47:44 +02:00
|
|
|
},
|
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \
|
|
|
|
{ \
|
|
|
|
_ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
|
|
|
|
(T1_Field_ParseFunc)_reader, \
|
|
|
|
0, 0, \
|
|
|
|
0, 0, \
|
|
|
|
_dict \
|
2000-08-24 00:47:44 +02:00
|
|
|
},
|
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \
|
|
|
|
{ \
|
|
|
|
_ident, T1CODE, _type, \
|
|
|
|
0, \
|
|
|
|
FT_FIELD_OFFSET( _fname ), \
|
|
|
|
FT_FIELD_SIZE_DELTA( _fname ), \
|
|
|
|
_max, \
|
|
|
|
FT_FIELD_OFFSET( num_ ## _fname ), \
|
|
|
|
_dict \
|
2000-08-24 18:29:15 +02:00
|
|
|
},
|
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \
|
|
|
|
{ \
|
|
|
|
_ident, T1CODE, _type, \
|
|
|
|
0, \
|
|
|
|
FT_FIELD_OFFSET( _fname ), \
|
|
|
|
FT_FIELD_SIZE_DELTA( _fname ), \
|
|
|
|
_max, 0, \
|
|
|
|
_dict \
|
2000-08-24 00:47:44 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_BOOL( _ident, _fname, _dict ) \
|
|
|
|
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_NUM( _ident, _fname, _dict ) \
|
|
|
|
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_FIXED( _ident, _fname, _dict ) \
|
|
|
|
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_FIXED_1000( _ident, _fname, _dict ) \
|
|
|
|
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \
|
|
|
|
_dict )
|
2003-06-06 07:07:53 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_STRING( _ident, _fname, _dict ) \
|
|
|
|
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_KEY( _ident, _fname, _dict ) \
|
|
|
|
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )
|
2003-06-12 15:14:15 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_BBOX( _ident, _fname, _dict ) \
|
|
|
|
T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )
|
2002-07-11 13:26:21 +02:00
|
|
|
|
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict ) \
|
2002-03-30 00:23:28 +01:00
|
|
|
T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
|
2006-08-13 14:14:36 +02:00
|
|
|
_fname, _fmax, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict ) \
|
2002-03-30 00:23:28 +01:00
|
|
|
T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
|
2006-08-13 14:14:36 +02:00
|
|
|
_fname, _fmax, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict ) \
|
2002-03-30 00:23:28 +01:00
|
|
|
T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
|
2006-08-13 14:14:36 +02:00
|
|
|
_fname, _fmax, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict ) \
|
2002-03-30 00:23:28 +01:00
|
|
|
T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
|
2006-08-13 14:14:36 +02:00
|
|
|
_fname, _fmax, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
2006-08-13 14:14:36 +02:00
|
|
|
#define T1_FIELD_CALLBACK( _ident, _name, _dict ) \
|
|
|
|
T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )
|
2000-08-24 00:47:44 +02:00
|
|
|
|
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** T1 PARSER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef const struct PS_Parser_FuncsRec_* PS_Parser_Funcs;
|
|
|
|
|
|
|
|
typedef struct PS_Parser_FuncsRec_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2001-06-28 19:49:10 +02:00
|
|
|
void
|
2002-02-28 17:10:29 +01:00
|
|
|
(*init)( PS_Parser parser,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Byte* base,
|
|
|
|
FT_Byte* limit,
|
|
|
|
FT_Memory memory );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
|
|
|
void
|
2002-02-28 17:10:29 +01:00
|
|
|
(*done)( PS_Parser parser );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
|
|
|
void
|
2002-02-28 17:10:29 +01:00
|
|
|
(*skip_spaces)( PS_Parser parser );
|
2001-06-28 19:49:10 +02:00
|
|
|
void
|
2003-10-07 07:49:41 +02:00
|
|
|
(*skip_PS_token)( PS_Parser parser );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
|
|
|
FT_Long
|
2002-02-28 17:10:29 +01:00
|
|
|
(*to_int)( PS_Parser parser );
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Fixed
|
2002-02-28 17:10:29 +01:00
|
|
|
(*to_fixed)( PS_Parser parser,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Int power_ten );
|
2003-10-07 07:49:41 +02:00
|
|
|
|
2003-07-24 08:16:21 +02:00
|
|
|
FT_Error
|
|
|
|
(*to_bytes)( PS_Parser parser,
|
|
|
|
FT_Byte* bytes,
|
2009-07-31 17:30:17 +02:00
|
|
|
FT_Offset max_bytes,
|
2015-02-18 11:45:22 +01:00
|
|
|
FT_ULong* pnum_bytes,
|
2003-10-07 07:49:41 +02:00
|
|
|
FT_Bool delimiters );
|
2003-07-24 08:16:21 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Int
|
2002-02-28 17:10:29 +01:00
|
|
|
(*to_coord_array)( PS_Parser parser,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Int max_coords,
|
|
|
|
FT_Short* coords );
|
2001-06-28 19:49:10 +02:00
|
|
|
FT_Int
|
2002-02-28 17:10:29 +01:00
|
|
|
(*to_fixed_array)( PS_Parser parser,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Int max_values,
|
|
|
|
FT_Fixed* values,
|
|
|
|
FT_Int power_ten );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
|
|
|
void
|
2002-02-28 17:10:29 +01:00
|
|
|
(*to_token)( PS_Parser parser,
|
|
|
|
T1_Token token );
|
2001-06-28 19:49:10 +02:00
|
|
|
void
|
2002-02-28 17:10:29 +01:00
|
|
|
(*to_token_array)( PS_Parser parser,
|
|
|
|
T1_Token tokens,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_UInt max_tokens,
|
|
|
|
FT_Int* pnum_tokens );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
|
|
|
FT_Error
|
2002-02-28 17:10:29 +01:00
|
|
|
(*load_field)( PS_Parser parser,
|
|
|
|
const T1_Field field,
|
2002-03-30 00:23:28 +01:00
|
|
|
void** objects,
|
|
|
|
FT_UInt max_objects,
|
|
|
|
FT_ULong* pflags );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
|
|
|
FT_Error
|
2002-02-28 17:10:29 +01:00
|
|
|
(*load_field_table)( PS_Parser parser,
|
|
|
|
const T1_Field field,
|
2002-03-30 00:23:28 +01:00
|
|
|
void** objects,
|
|
|
|
FT_UInt max_objects,
|
|
|
|
FT_ULong* pflags );
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} PS_Parser_FuncsRec;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* PS_ParserRec
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A PS_Parser is an object used to parse a Type 1 font very quickly.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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.
|
|
|
|
*/
|
2002-03-30 00:23:28 +01:00
|
|
|
typedef struct PS_ParserRec_
|
2000-08-23 04:47:57 +02:00
|
|
|
{
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Byte* cursor;
|
|
|
|
FT_Byte* base;
|
|
|
|
FT_Byte* limit;
|
|
|
|
FT_Error error;
|
|
|
|
FT_Memory memory;
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
PS_Parser_FuncsRec funcs;
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} PS_ParserRec;
|
2000-08-23 04:47:57 +02:00
|
|
|
|
|
|
|
|
2017-09-24 22:49:56 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** PS BUILDER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
|
2017-09-24 22:49:56 +02:00
|
|
|
typedef struct PS_Builder_ PS_Builder;
|
|
|
|
typedef const struct PS_Builder_FuncsRec_* PS_Builder_Funcs;
|
|
|
|
|
|
|
|
typedef struct PS_Builder_FuncsRec_
|
|
|
|
{
|
|
|
|
void
|
2017-09-25 08:31:52 +02:00
|
|
|
(*init)( PS_Builder* ps_builder,
|
|
|
|
void* builder,
|
|
|
|
FT_Bool is_t1 );
|
2017-09-24 22:49:56 +02:00
|
|
|
|
|
|
|
void
|
2017-09-26 12:53:41 +02:00
|
|
|
(*done)( PS_Builder* builder );
|
2017-09-24 22:49:56 +02:00
|
|
|
|
|
|
|
} PS_Builder_FuncsRec;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* PS_Builder
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A structure used during glyph loading to store its outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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 ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A boolean indicating that we only want to compute the metrics of a
|
|
|
|
* given glyph, not load all of its points.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* is_t1 ::
|
|
|
|
* Set if current font type is Type 1.
|
|
|
|
*
|
|
|
|
* funcs ::
|
|
|
|
* An array of function pointers for the builder.
|
|
|
|
*/
|
2017-09-24 22:49:56 +02:00
|
|
|
struct PS_Builder_
|
|
|
|
{
|
|
|
|
FT_Memory memory;
|
2017-09-25 06:22:52 +02:00
|
|
|
FT_Face face;
|
2017-09-24 22:49:56 +02:00
|
|
|
CFF_GlyphSlot glyph;
|
|
|
|
FT_GlyphLoader loader;
|
|
|
|
FT_Outline* base;
|
|
|
|
FT_Outline* current;
|
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Pos* pos_x;
|
|
|
|
FT_Pos* pos_y;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Vector* left_bearing;
|
|
|
|
FT_Vector* advance;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_BBox* bbox; /* bounding box */
|
|
|
|
FT_Bool path_begun;
|
|
|
|
FT_Bool load_points;
|
|
|
|
FT_Bool no_recurse;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Bool metrics_only;
|
|
|
|
FT_Bool is_t1;
|
2017-09-24 23:00:36 +02:00
|
|
|
|
2017-09-24 22:49:56 +02:00
|
|
|
PS_Builder_FuncsRec funcs;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** PS DECODER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
#define PS_MAX_OPERANDS 48
|
|
|
|
#define PS_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
|
|
|
|
/* 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 */
|
|
|
|
|
|
|
|
typedef struct PS_Decoder_Zone_
|
|
|
|
{
|
|
|
|
FT_Byte* base;
|
|
|
|
FT_Byte* limit;
|
|
|
|
FT_Byte* cursor;
|
|
|
|
|
|
|
|
} PS_Decoder_Zone;
|
|
|
|
|
|
|
|
|
|
|
|
typedef FT_Error
|
2017-09-24 23:00:36 +02:00
|
|
|
(*CFF_Decoder_Get_Glyph_Callback)( TT_Face face,
|
|
|
|
FT_UInt glyph_index,
|
|
|
|
FT_Byte** pointer,
|
|
|
|
FT_ULong* length );
|
2017-09-24 22:49:56 +02:00
|
|
|
|
|
|
|
typedef void
|
2017-09-24 23:00:36 +02:00
|
|
|
(*CFF_Decoder_Free_Glyph_Callback)( TT_Face face,
|
|
|
|
FT_Byte** pointer,
|
|
|
|
FT_ULong length );
|
|
|
|
|
2017-09-24 22:49:56 +02:00
|
|
|
|
|
|
|
typedef struct PS_Decoder_
|
|
|
|
{
|
2017-09-26 12:53:41 +02:00
|
|
|
PS_Builder builder;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Fixed stack[PS_MAX_OPERANDS + 1];
|
|
|
|
FT_Fixed* top;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
PS_Decoder_Zone zones[PS_MAX_SUBRS_CALLS + 1];
|
|
|
|
PS_Decoder_Zone* zone;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Int flex_state;
|
|
|
|
FT_Int num_flex_vectors;
|
|
|
|
FT_Vector flex_vectors[7];
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
CFF_Font cff;
|
|
|
|
CFF_SubFont current_subfont; /* for current glyph_index */
|
|
|
|
FT_Generic* cf2_instance;
|
2017-09-25 06:44:51 +02:00
|
|
|
|
2017-11-22 05:32:47 +01:00
|
|
|
FT_Pos* glyph_width;
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Bool width_only;
|
|
|
|
FT_Int num_hints;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_UInt num_locals;
|
|
|
|
FT_UInt num_globals;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Int locals_bias;
|
|
|
|
FT_Int globals_bias;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Byte** locals;
|
|
|
|
FT_Byte** globals;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Byte** glyph_names; /* for pure CFF fonts only */
|
|
|
|
FT_UInt num_glyphs; /* number of glyphs in font */
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Render_Mode hint_mode;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Bool seac;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-24 23:00:36 +02:00
|
|
|
CFF_Decoder_Get_Glyph_Callback get_glyph_callback;
|
|
|
|
CFF_Decoder_Free_Glyph_Callback free_glyph_callback;
|
2017-09-25 06:44:51 +02:00
|
|
|
|
2017-09-24 22:49:56 +02:00
|
|
|
/* Type 1 stuff */
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Service_PsCMaps psnames; /* for seac */
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Int lenIV; /* internal for sub routine calls */
|
|
|
|
FT_UInt* locals_len; /* array of subrs length (optional) */
|
|
|
|
FT_Hash locals_hash; /* used if `num_subrs' was massaged */
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Matrix font_matrix;
|
|
|
|
FT_Vector font_offset;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
PS_Blend blend; /* for multiple master support */
|
2017-09-24 22:49:56 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Long* buildchar;
|
|
|
|
FT_UInt len_buildchar;
|
2017-09-24 22:49:56 +02:00
|
|
|
|
|
|
|
} PS_Decoder;
|
|
|
|
|
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
2000-08-17 09:18:04 +02:00
|
|
|
/***** T1 BUILDER *****/
|
2000-08-17 03:09:06 +02:00
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
typedef struct T1_BuilderRec_* T1_Builder;
|
2000-08-23 04:47:57 +02:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef FT_Error
|
2002-03-14 11:09:35 +01:00
|
|
|
(*T1_Builder_Check_Points_Func)( T1_Builder builder,
|
|
|
|
FT_Int count );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef void
|
2002-03-14 11:09:35 +01:00
|
|
|
(*T1_Builder_Add_Point_Func)( T1_Builder builder,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Pos x,
|
|
|
|
FT_Pos y,
|
|
|
|
FT_Byte flag );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef FT_Error
|
2002-03-14 11:09:35 +01:00
|
|
|
(*T1_Builder_Add_Point1_Func)( T1_Builder builder,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Pos x,
|
|
|
|
FT_Pos y );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef FT_Error
|
2002-03-14 11:09:35 +01:00
|
|
|
(*T1_Builder_Add_Contour_Func)( T1_Builder builder );
|
2000-08-23 04:47:57 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef FT_Error
|
2002-03-14 11:09:35 +01:00
|
|
|
(*T1_Builder_Start_Point_Func)( T1_Builder builder,
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Pos x,
|
|
|
|
FT_Pos y );
|
2000-08-23 04:47:57 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef void
|
2002-03-14 11:09:35 +01:00
|
|
|
(*T1_Builder_Close_Contour_Func)( T1_Builder builder );
|
2000-08-23 04:47:57 +02:00
|
|
|
|
|
|
|
|
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
* src/base/ftcalc.c (FT_MulFix): Ditto.
* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
CFF_GlyphSlot_Init): Ditto.
* src/cid/cidobjs.c (CID_GlyphSlot_Init,
CID_Size_Get_Globals_Funcs): Ditto.
* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
Ditto.
* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
variables.
* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
to...
(T1_Builder_FuncsRec): This.
(T1_Builder_Funcs): New typedef.
(PSAux_Interface): Remove compiler warnings.
* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
(t1_builder_funcs): Updated.
* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
(PSH_AlignmentRec): Updated.
* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
typo.
* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
* src/base/ftstream (FT_Get_Char): Rename to...
(FT_Stream_Get_Char): This.
* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
a built-in function in gcc, causing warning messages with gcc 3.0.
* src/autohint/ahglyph.c (ah_outline_load): Ditto.
* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
Ditto.
* src/cff/cffload.c (cff_new_index, cff_done_index,
cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
CFF_Done_Font): Ditto.
* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
* src/pshinter/pshalgo1.c (psh1_hint_table_record,
psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
* src/pshinter/pshalgo2.c (psh2_hint_table_record,
psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
TT_Get_PS_Name): Ditto.
* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
load_truetype_glyph): Ditto.
* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
|
|
|
typedef const struct T1_Builder_FuncsRec_* T1_Builder_Funcs;
|
|
|
|
|
|
|
|
typedef struct T1_Builder_FuncsRec_
|
2000-08-23 04:47:57 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
void
|
2002-03-14 11:09:35 +01:00
|
|
|
(*init)( T1_Builder builder,
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_Face face,
|
|
|
|
FT_Size size,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
FT_Bool hinting );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
void
|
2002-03-14 11:09:35 +01:00
|
|
|
(*done)( T1_Builder builder );
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-08-23 04:47:57 +02:00
|
|
|
T1_Builder_Check_Points_Func check_points;
|
|
|
|
T1_Builder_Add_Point_Func add_point;
|
|
|
|
T1_Builder_Add_Point1_Func add_point1;
|
|
|
|
T1_Builder_Add_Contour_Func add_contour;
|
|
|
|
T1_Builder_Start_Point_Func start_point;
|
|
|
|
T1_Builder_Close_Contour_Func close_contour;
|
2000-10-31 21:42:18 +01:00
|
|
|
|
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
* src/base/ftcalc.c (FT_MulFix): Ditto.
* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
CFF_GlyphSlot_Init): Ditto.
* src/cid/cidobjs.c (CID_GlyphSlot_Init,
CID_Size_Get_Globals_Funcs): Ditto.
* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
Ditto.
* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
variables.
* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
to...
(T1_Builder_FuncsRec): This.
(T1_Builder_Funcs): New typedef.
(PSAux_Interface): Remove compiler warnings.
* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
(t1_builder_funcs): Updated.
* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
(PSH_AlignmentRec): Updated.
* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
typo.
* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
* src/base/ftstream (FT_Get_Char): Rename to...
(FT_Stream_Get_Char): This.
* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
a built-in function in gcc, causing warning messages with gcc 3.0.
* src/autohint/ahglyph.c (ah_outline_load): Ditto.
* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
Ditto.
* src/cff/cffload.c (cff_new_index, cff_done_index,
cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
CFF_Done_Font): Ditto.
* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
* src/pshinter/pshalgo1.c (psh1_hint_table_record,
psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
* src/pshinter/pshalgo2.c (psh2_hint_table_record,
psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
TT_Get_PS_Name): Ditto.
* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
load_truetype_glyph): Ditto.
* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
|
|
|
} T1_Builder_FuncsRec;
|
2000-08-23 04:47:57 +02:00
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2004-05-13 14:59:59 +02:00
|
|
|
/* an enumeration type to handle charstring parsing states */
|
|
|
|
typedef enum T1_ParseState_
|
|
|
|
{
|
|
|
|
T1_Parse_Start,
|
|
|
|
T1_Parse_Have_Width,
|
|
|
|
T1_Parse_Have_Moveto,
|
|
|
|
T1_Parse_Have_Path
|
|
|
|
|
|
|
|
} T1_ParseState;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* T1_BuilderRec
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A structure used during glyph loading to store its outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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 ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* An enumeration which controls the charstring parsing state.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* load_points ::
|
|
|
|
* If this flag is not set, no points are loaded.
|
|
|
|
*
|
|
|
|
* no_recurse ::
|
|
|
|
* Set but not used.
|
|
|
|
*
|
|
|
|
* metrics_only ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A boolean indicating that we only want to compute the metrics of a
|
|
|
|
* given glyph, not load all of its points.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* funcs ::
|
|
|
|
* An array of function pointers for the builder.
|
|
|
|
*/
|
2002-03-14 11:09:35 +01:00
|
|
|
typedef struct T1_BuilderRec_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Memory memory;
|
|
|
|
FT_Face face;
|
|
|
|
FT_GlyphSlot glyph;
|
|
|
|
FT_GlyphLoader loader;
|
|
|
|
FT_Outline* base;
|
|
|
|
FT_Outline* current;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Pos pos_x;
|
|
|
|
FT_Pos pos_y;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Vector left_bearing;
|
|
|
|
FT_Vector advance;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_BBox bbox; /* bounding box */
|
2004-05-13 14:59:59 +02:00
|
|
|
T1_ParseState parse_state;
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Bool load_points;
|
|
|
|
FT_Bool no_recurse;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_Bool metrics_only;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
void* hints_funcs; /* hinter-specific */
|
|
|
|
void* hints_globals; /* hinter-specific */
|
2001-10-18 13:46:25 +02:00
|
|
|
|
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
* src/base/ftcalc.c (FT_MulFix): Ditto.
* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
CFF_GlyphSlot_Init): Ditto.
* src/cid/cidobjs.c (CID_GlyphSlot_Init,
CID_Size_Get_Globals_Funcs): Ditto.
* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
Ditto.
* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
variables.
* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
to...
(T1_Builder_FuncsRec): This.
(T1_Builder_Funcs): New typedef.
(PSAux_Interface): Remove compiler warnings.
* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
(t1_builder_funcs): Updated.
* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
(PSH_AlignmentRec): Updated.
* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
typo.
* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
* src/base/ftstream (FT_Get_Char): Rename to...
(FT_Stream_Get_Char): This.
* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
a built-in function in gcc, causing warning messages with gcc 3.0.
* src/autohint/ahglyph.c (ah_outline_load): Ditto.
* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
Ditto.
* src/cff/cffload.c (cff_new_index, cff_done_index,
cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
CFF_Done_Font): Ditto.
* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
* src/pshinter/pshalgo1.c (psh1_hint_table_record,
psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
* src/pshinter/pshalgo2.c (psh2_hint_table_record,
psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
TT_Get_PS_Name): Ditto.
* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
load_truetype_glyph): Ditto.
* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 22:59:59 +01:00
|
|
|
T1_Builder_FuncsRec funcs;
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
} T1_BuilderRec;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2000-08-23 00:36:33 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** T1 DECODER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
#if 0
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine
|
|
|
|
* calls during glyph loading.
|
|
|
|
*/
|
2000-08-23 00:36:33 +02:00
|
|
|
#define T1_MAX_SUBRS_CALLS 8
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A
|
|
|
|
* minimum of 16 is required.
|
|
|
|
*/
|
2000-08-23 00:36:33 +02:00
|
|
|
#define T1_MAX_CHARSTRINGS_OPERANDS 32
|
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
#endif /* 0 */
|
2000-08-23 00:36:33 +02:00
|
|
|
|
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct T1_Decoder_ZoneRec_
|
2000-08-23 00:36:33 +02:00
|
|
|
{
|
|
|
|
FT_Byte* cursor;
|
|
|
|
FT_Byte* base;
|
|
|
|
FT_Byte* limit;
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} T1_Decoder_ZoneRec, *T1_Decoder_Zone;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct T1_DecoderRec_* T1_Decoder;
|
|
|
|
typedef const struct T1_Decoder_FuncsRec_* T1_Decoder_Funcs;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
typedef FT_Error
|
2002-02-28 17:10:29 +01:00
|
|
|
(*T1_Decoder_Callback)( T1_Decoder decoder,
|
|
|
|
FT_UInt glyph_index );
|
2000-08-23 04:47:57 +02:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct T1_Decoder_FuncsRec_
|
2000-08-23 04:47:57 +02:00
|
|
|
{
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_Error
|
2002-03-30 00:23:28 +01:00
|
|
|
(*init)( T1_Decoder decoder,
|
|
|
|
FT_Face face,
|
|
|
|
FT_Size size,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
FT_Byte** glyph_names,
|
|
|
|
PS_Blend blend,
|
|
|
|
FT_Bool hinting,
|
2002-08-28 00:34:20 +02:00
|
|
|
FT_Render_Mode hint_mode,
|
2002-03-30 00:23:28 +01:00
|
|
|
T1_Decoder_Callback callback );
|
2001-12-05 02:22:05 +01:00
|
|
|
|
|
|
|
void
|
2002-03-30 00:23:28 +01:00
|
|
|
(*done)( T1_Decoder decoder );
|
2001-12-05 02:22:05 +01:00
|
|
|
|
Add T1_CONFIG_OPTION_OLD_ENGINE configuration option.
This controls whether the old Type 1 engine gets compiled into FreeType.
It is disabled by default.
* devel/ftoption.h, include/freetype/config/ftoption.h
(T1_CONFIG_OPTION_OLD_ENGINE): New macro.
* include/freetype/internal/psaux.h (PS_Decoder): Remove unused field.
* include/freetype/internal/psaux.h, src/cid/cidgload.c
(cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c
(ps_builder_add_point), src/psaux/t1decode.c
(t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph,
t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h,
src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround
relevant code with macro.
Minor code changes.
2017-10-12 12:13:21 +02:00
|
|
|
#ifdef T1_CONFIG_OPTION_OLD_ENGINE
|
2001-12-05 02:22:05 +01:00
|
|
|
FT_Error
|
2017-09-25 06:40:32 +02:00
|
|
|
(*parse_charstrings_old)( T1_Decoder decoder,
|
|
|
|
FT_Byte* base,
|
|
|
|
FT_UInt len );
|
Add T1_CONFIG_OPTION_OLD_ENGINE configuration option.
This controls whether the old Type 1 engine gets compiled into FreeType.
It is disabled by default.
* devel/ftoption.h, include/freetype/config/ftoption.h
(T1_CONFIG_OPTION_OLD_ENGINE): New macro.
* include/freetype/internal/psaux.h (PS_Decoder): Remove unused field.
* include/freetype/internal/psaux.h, src/cid/cidgload.c
(cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c
(ps_builder_add_point), src/psaux/t1decode.c
(t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph,
t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h,
src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround
relevant code with macro.
Minor code changes.
2017-10-12 12:13:21 +02:00
|
|
|
#else
|
2017-10-12 12:13:08 +02:00
|
|
|
FT_Error
|
|
|
|
(*parse_metrics)( T1_Decoder decoder,
|
|
|
|
FT_Byte* base,
|
|
|
|
FT_UInt len );
|
Add T1_CONFIG_OPTION_OLD_ENGINE configuration option.
This controls whether the old Type 1 engine gets compiled into FreeType.
It is disabled by default.
* devel/ftoption.h, include/freetype/config/ftoption.h
(T1_CONFIG_OPTION_OLD_ENGINE): New macro.
* include/freetype/internal/psaux.h (PS_Decoder): Remove unused field.
* include/freetype/internal/psaux.h, src/cid/cidgload.c
(cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c
(ps_builder_add_point), src/psaux/t1decode.c
(t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph,
t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h,
src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround
relevant code with macro.
Minor code changes.
2017-10-12 12:13:21 +02:00
|
|
|
#endif
|
2017-10-12 12:13:08 +02:00
|
|
|
|
2017-09-25 06:40:32 +02:00
|
|
|
FT_Error
|
|
|
|
(*parse_charstrings)( PS_Decoder* decoder,
|
|
|
|
FT_Byte* charstring_base,
|
|
|
|
FT_ULong charstring_len );
|
|
|
|
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} T1_Decoder_FuncsRec;
|
2000-08-23 04:47:57 +02:00
|
|
|
|
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
typedef struct T1_DecoderRec_
|
2000-08-23 00:36:33 +02:00
|
|
|
{
|
2002-03-14 11:09:35 +01:00
|
|
|
T1_BuilderRec builder;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
FT_Long stack[T1_MAX_CHARSTRINGS_OPERANDS];
|
|
|
|
FT_Long* top;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_Decoder_ZoneRec zones[T1_MAX_SUBRS_CALLS + 1];
|
|
|
|
T1_Decoder_Zone zone;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
* 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
|
|
|
FT_Service_PsCMaps psnames; /* for seac */
|
2000-08-23 19:32:42 +02:00
|
|
|
FT_UInt num_glyphs;
|
|
|
|
FT_Byte** glyph_names;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2001-03-12 13:04:29 +01:00
|
|
|
FT_Int lenIV; /* internal for sub routine calls */
|
2015-02-18 11:45:22 +01:00
|
|
|
FT_Int num_subrs;
|
2000-08-23 19:32:42 +02:00
|
|
|
FT_Byte** subrs;
|
2015-02-18 09:22:06 +01:00
|
|
|
FT_UInt* subrs_len; /* array of subrs length (optional) */
|
2015-12-20 19:36:04 +01:00
|
|
|
FT_Hash subrs_hash; /* used if `num_subrs' was massaged */
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
FT_Matrix font_matrix;
|
2000-08-24 00:47:44 +02:00
|
|
|
FT_Vector font_offset;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
FT_Int flex_state;
|
|
|
|
FT_Int num_flex_vectors;
|
|
|
|
FT_Vector flex_vectors[7];
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2002-03-14 11:09:35 +01:00
|
|
|
PS_Blend blend; /* for multiple master support */
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2002-08-28 00:34:20 +02:00
|
|
|
FT_Render_Mode hint_mode;
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2000-08-23 19:32:42 +02:00
|
|
|
T1_Decoder_Callback parse_callback;
|
2002-02-28 17:10:29 +01:00
|
|
|
T1_Decoder_FuncsRec funcs;
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2009-07-31 17:32:19 +02:00
|
|
|
FT_Long* buildchar;
|
2006-07-19 11:54:56 +02:00
|
|
|
FT_UInt len_buildchar;
|
* freetype2/include/freetype/internal/psaux.h: New macros
IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT,
IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h).
(T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
(T1_DecoderRec): New fields `buildchar' and `face'.
(IS_PS_TOKEN): New macro.
* freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New
fields `ndv_idx', `cdv_idx', and `len_buildchar'.
* freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields
`default_design_vector' and `num_default_design_vector'.
* freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE,
IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h.
* freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow
`token' argument to be NULL if we want only to count the number of
tokens.
(ps_tocoordarray): Allow `coords' argument to be NULL if we just
want to skip the array.
(ps_tofixedarray): Allow `values' argument to be NULL if we just
want to skip the array.
* freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add
support for (partially commented out) othersubrs 19-25, 27, and 28.
(t1_decoder_init): Initialize new fields `face' and `buildchar'.
(t1_decoder_done): Release new field `buildchar'.
* freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New
functions.
(t1_keywords): Register them.
(t1_allocate_blend): Updated.
(t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
(parse_dict): Remove `keyword_flags' argument.
Use new macro IS_PS_TOKEN.
Changed function so that later PostScript definitions override
earlier ones.
(t1_init_loader): Initialize new field `keywords_encountered'.
(T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
`len_buildchar'.
Remove `keywords_flags'.
* freetype2/src/type1/t1load.h (T1_LoaderRect): New field
`keywords_encountered'.
(T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
* freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]:
New entries for parsing /NDV, /CDV, and /DesignVector.
2006-07-14 20:28:08 +02:00
|
|
|
|
2009-06-28 01:25:55 +02:00
|
|
|
FT_Bool seac;
|
|
|
|
|
2017-09-25 06:44:51 +02:00
|
|
|
FT_Generic cf2_instance;
|
|
|
|
|
2002-02-28 17:10:29 +01:00
|
|
|
} T1_DecoderRec;
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
|
2017-09-24 21:43:05 +02:00
|
|
|
/*************************************************************************/
|
2017-09-24 21:56:54 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** CFF BUILDER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
typedef struct CFF_Builder_ CFF_Builder;
|
2017-09-24 21:56:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef FT_Error
|
|
|
|
(*CFF_Builder_Check_Points_Func)( CFF_Builder* builder,
|
|
|
|
FT_Int count );
|
|
|
|
|
|
|
|
typedef void
|
|
|
|
(*CFF_Builder_Add_Point_Func)( CFF_Builder* builder,
|
|
|
|
FT_Pos x,
|
|
|
|
FT_Pos y,
|
|
|
|
FT_Byte flag );
|
|
|
|
typedef FT_Error
|
|
|
|
(*CFF_Builder_Add_Point1_Func)( CFF_Builder* builder,
|
|
|
|
FT_Pos x,
|
|
|
|
FT_Pos y );
|
|
|
|
typedef FT_Error
|
|
|
|
(*CFF_Builder_Start_Point_Func)( CFF_Builder* builder,
|
|
|
|
FT_Pos x,
|
|
|
|
FT_Pos y );
|
|
|
|
typedef void
|
|
|
|
(*CFF_Builder_Close_Contour_Func)( CFF_Builder* builder );
|
|
|
|
|
|
|
|
typedef FT_Error
|
|
|
|
(*CFF_Builder_Add_Contour_Func)( CFF_Builder* builder );
|
|
|
|
|
|
|
|
typedef const struct CFF_Builder_FuncsRec_* CFF_Builder_Funcs;
|
|
|
|
|
|
|
|
typedef struct CFF_Builder_FuncsRec_
|
|
|
|
{
|
|
|
|
void
|
|
|
|
(*init)( CFF_Builder* builder,
|
|
|
|
TT_Face face,
|
|
|
|
CFF_Size size,
|
|
|
|
CFF_GlyphSlot glyph,
|
|
|
|
FT_Bool hinting );
|
|
|
|
|
|
|
|
void
|
|
|
|
(*done)( CFF_Builder* builder );
|
|
|
|
|
|
|
|
CFF_Builder_Check_Points_Func check_points;
|
|
|
|
CFF_Builder_Add_Point_Func add_point;
|
|
|
|
CFF_Builder_Add_Point1_Func add_point1;
|
|
|
|
CFF_Builder_Add_Contour_Func add_contour;
|
|
|
|
CFF_Builder_Start_Point_Func start_point;
|
|
|
|
CFF_Builder_Close_Contour_Func close_contour;
|
|
|
|
|
|
|
|
} CFF_Builder_FuncsRec;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* CFF_Builder
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A structure used during glyph loading to store its outline.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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 ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A boolean indicating that we only want to compute the metrics of a
|
|
|
|
* given glyph, not load all of its points.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* hints_funcs ::
|
|
|
|
* Auxiliary pointer for hinting.
|
|
|
|
*
|
|
|
|
* hints_globals ::
|
|
|
|
* Auxiliary pointer for hinting.
|
|
|
|
*
|
|
|
|
* funcs ::
|
|
|
|
* A table of method pointers for this object.
|
|
|
|
*/
|
2017-09-24 21:56:54 +02:00
|
|
|
struct CFF_Builder_
|
2017-09-24 21:43:05 +02:00
|
|
|
{
|
|
|
|
FT_Memory memory;
|
|
|
|
TT_Face face;
|
|
|
|
CFF_GlyphSlot glyph;
|
|
|
|
FT_GlyphLoader loader;
|
|
|
|
FT_Outline* base;
|
|
|
|
FT_Outline* current;
|
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Pos pos_x;
|
|
|
|
FT_Pos pos_y;
|
2017-09-24 21:43:05 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Vector left_bearing;
|
|
|
|
FT_Vector advance;
|
2017-09-24 21:43:05 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_BBox bbox; /* bounding box */
|
2017-09-24 21:43:05 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Bool path_begun;
|
|
|
|
FT_Bool load_points;
|
|
|
|
FT_Bool no_recurse;
|
2017-09-24 21:43:05 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Bool metrics_only;
|
2017-09-24 21:56:54 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
void* hints_funcs; /* hinter-specific */
|
|
|
|
void* hints_globals; /* hinter-specific */
|
2017-09-24 21:56:54 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
CFF_Builder_FuncsRec funcs;
|
2017-09-24 21:56:54 +02:00
|
|
|
};
|
2017-09-24 21:43:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** CFF DECODER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
#define CFF_MAX_OPERANDS 48
|
|
|
|
#define CFF_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
|
|
|
|
/* 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 32
|
|
|
|
|
|
|
|
/* execution context charstring zone */
|
|
|
|
|
|
|
|
typedef struct CFF_Decoder_Zone_
|
|
|
|
{
|
|
|
|
FT_Byte* base;
|
|
|
|
FT_Byte* limit;
|
|
|
|
FT_Byte* cursor;
|
|
|
|
|
|
|
|
} CFF_Decoder_Zone;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct CFF_Decoder_
|
|
|
|
{
|
2017-09-26 12:53:41 +02:00
|
|
|
CFF_Builder builder;
|
|
|
|
CFF_Font cff;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Fixed stack[CFF_MAX_OPERANDS + 1];
|
|
|
|
FT_Fixed* top;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
|
|
|
CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
|
|
|
|
CFF_Decoder_Zone* zone;
|
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Int flex_state;
|
|
|
|
FT_Int num_flex_vectors;
|
|
|
|
FT_Vector flex_vectors[7];
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Pos glyph_width;
|
|
|
|
FT_Pos nominal_width;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Bool read_width;
|
|
|
|
FT_Bool width_only;
|
|
|
|
FT_Int num_hints;
|
|
|
|
FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS];
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_UInt num_locals;
|
|
|
|
FT_UInt num_globals;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Int locals_bias;
|
|
|
|
FT_Int globals_bias;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Byte** locals;
|
|
|
|
FT_Byte** globals;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Byte** glyph_names; /* for pure CFF fonts only */
|
|
|
|
FT_UInt num_glyphs; /* number of glyphs in font */
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Render_Mode hint_mode;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
FT_Bool seac;
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
CFF_SubFont current_subfont; /* for current glyph_index */
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
|
2017-09-24 22:05:32 +02:00
|
|
|
CFF_Decoder_Get_Glyph_Callback get_glyph_callback;
|
|
|
|
CFF_Decoder_Free_Glyph_Callback free_glyph_callback;
|
|
|
|
|
Move CFF decoder components into `psaux' module.
NOTE: Does not compile!
* src/cff/cffgload.c (CFF_Operator,
CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
cff_operator_seac, cff_compute_bias,
cff_lookup_glyph_by_stdcharcode,
cff_decoder_{parse_charstrings,init,prepare}): Move to...
* src/psaux/cffdecode.c: This new file.
* src/cff/cffgload.h: Move corresponding declarations to...
* src/psaux/cffdecode.h: This new file.
* src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
* include/freetype/internal/psaux.h: Here.
* src/psaux/cf2ft.h: Update include.
* src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
the new file.
2017-09-24 21:39:20 +02:00
|
|
|
} CFF_Decoder;
|
|
|
|
|
2017-09-26 12:53:41 +02:00
|
|
|
|
2017-09-24 21:56:54 +02:00
|
|
|
typedef const struct CFF_Decoder_FuncsRec_* CFF_Decoder_Funcs;
|
|
|
|
|
|
|
|
typedef struct CFF_Decoder_FuncsRec_
|
|
|
|
{
|
|
|
|
void
|
2017-09-26 12:53:41 +02:00
|
|
|
(*init)( CFF_Decoder* decoder,
|
|
|
|
TT_Face face,
|
|
|
|
CFF_Size size,
|
|
|
|
CFF_GlyphSlot slot,
|
|
|
|
FT_Bool hinting,
|
|
|
|
FT_Render_Mode hint_mode,
|
2017-09-24 22:05:32 +02:00
|
|
|
CFF_Decoder_Get_Glyph_Callback get_callback,
|
|
|
|
CFF_Decoder_Free_Glyph_Callback free_callback );
|
2017-09-24 21:56:54 +02:00
|
|
|
|
|
|
|
FT_Error
|
|
|
|
(*prepare)( CFF_Decoder* decoder,
|
|
|
|
CFF_Size size,
|
|
|
|
FT_UInt glyph_index );
|
|
|
|
|
|
|
|
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|
2017-09-25 06:10:20 +02:00
|
|
|
FT_Error
|
|
|
|
(*parse_charstrings_old)( CFF_Decoder* decoder,
|
|
|
|
FT_Byte* charstring_base,
|
|
|
|
FT_ULong charstring_len,
|
|
|
|
FT_Bool in_dict );
|
2017-09-24 21:56:54 +02:00
|
|
|
#endif
|
2017-09-25 06:10:20 +02:00
|
|
|
|
|
|
|
FT_Error
|
|
|
|
(*parse_charstrings)( PS_Decoder* decoder,
|
|
|
|
FT_Byte* charstring_base,
|
|
|
|
FT_ULong charstring_len );
|
2017-09-24 21:56:54 +02:00
|
|
|
|
|
|
|
} CFF_Decoder_FuncsRec;
|
2002-03-30 00:23:28 +01:00
|
|
|
|
2017-09-25 06:10:20 +02:00
|
|
|
|
* src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
implement an AFM parser. It is used to parse an AFM file.
* src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
conversion functions (e.g, PS real number => FT_Fixed) for the
PS_Parser and AFM_Parser. Some of the functions are taken, with some
modifications, from the psobjs.c
* src/psaux/psobjs.c: Use functions from psconv.c.
* include/freetype/internal/psaux.h, src/psaux/psauxmod.c:: Add
`AFM_Parser' to the `psaux' service.
* src/psaux/psaux.c, src/psaux/rules.mk: Include those new files.
* src/tools/test_afm.c: A test program for AFM parser.
* include/freetype/internal/services/svkern.h,
include/freetype/internal/ftserv.h: New service `Kerning'. It is
currently only used to get the track kerning information.
* src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
src/type1/t1afm.h: Update to use the AFM parser.
Provide the `Kerning' service.
* include/freetype/freetype.h, src/base/ftobjs.c: New API
`FT_Get_Track_Kerning'.
2006-01-16 16:35:56 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** AFM PARSER *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
typedef struct AFM_ParserRec_* AFM_Parser;
|
|
|
|
|
|
|
|
typedef struct AFM_Parser_FuncsRec_
|
|
|
|
{
|
|
|
|
FT_Error
|
|
|
|
(*init)( AFM_Parser parser,
|
|
|
|
FT_Memory memory,
|
|
|
|
FT_Byte* base,
|
|
|
|
FT_Byte* limit );
|
|
|
|
|
|
|
|
void
|
|
|
|
(*done)( AFM_Parser parser );
|
|
|
|
|
|
|
|
FT_Error
|
|
|
|
(*parse)( AFM_Parser parser );
|
|
|
|
|
|
|
|
} AFM_Parser_FuncsRec;
|
|
|
|
|
* freetype2/include/freetype/internal/psaux.h: New macros
IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT,
IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h).
(T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
(T1_DecoderRec): New fields `buildchar' and `face'.
(IS_PS_TOKEN): New macro.
* freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New
fields `ndv_idx', `cdv_idx', and `len_buildchar'.
* freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields
`default_design_vector' and `num_default_design_vector'.
* freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE,
IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h.
* freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow
`token' argument to be NULL if we want only to count the number of
tokens.
(ps_tocoordarray): Allow `coords' argument to be NULL if we just
want to skip the array.
(ps_tofixedarray): Allow `values' argument to be NULL if we just
want to skip the array.
* freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add
support for (partially commented out) othersubrs 19-25, 27, and 28.
(t1_decoder_init): Initialize new fields `face' and `buildchar'.
(t1_decoder_done): Release new field `buildchar'.
* freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New
functions.
(t1_keywords): Register them.
(t1_allocate_blend): Updated.
(t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
(parse_dict): Remove `keyword_flags' argument.
Use new macro IS_PS_TOKEN.
Changed function so that later PostScript definitions override
earlier ones.
(t1_init_loader): Initialize new field `keywords_encountered'.
(T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
`len_buildchar'.
Remove `keywords_flags'.
* freetype2/src/type1/t1load.h (T1_LoaderRect): New field
`keywords_encountered'.
(T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
* freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]:
New entries for parsing /NDV, /CDV, and /DesignVector.
2006-07-14 20:28:08 +02:00
|
|
|
|
* src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
implement an AFM parser. It is used to parse an AFM file.
* src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
conversion functions (e.g, PS real number => FT_Fixed) for the
PS_Parser and AFM_Parser. Some of the functions are taken, with some
modifications, from the psobjs.c
* src/psaux/psobjs.c: Use functions from psconv.c.
* include/freetype/internal/psaux.h, src/psaux/psauxmod.c:: Add
`AFM_Parser' to the `psaux' service.
* src/psaux/psaux.c, src/psaux/rules.mk: Include those new files.
* src/tools/test_afm.c: A test program for AFM parser.
* include/freetype/internal/services/svkern.h,
include/freetype/internal/ftserv.h: New service `Kerning'. It is
currently only used to get the track kerning information.
* src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
src/type1/t1afm.h: Update to use the AFM parser.
Provide the `Kerning' service.
* include/freetype/freetype.h, src/base/ftobjs.c: New API
`FT_Get_Track_Kerning'.
2006-01-16 16:35:56 +01:00
|
|
|
typedef struct AFM_StreamRec_* AFM_Stream;
|
|
|
|
|
* freetype2/include/freetype/internal/psaux.h: New macros
IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT,
IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h).
(T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
(T1_DecoderRec): New fields `buildchar' and `face'.
(IS_PS_TOKEN): New macro.
* freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New
fields `ndv_idx', `cdv_idx', and `len_buildchar'.
* freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields
`default_design_vector' and `num_default_design_vector'.
* freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE,
IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h.
* freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow
`token' argument to be NULL if we want only to count the number of
tokens.
(ps_tocoordarray): Allow `coords' argument to be NULL if we just
want to skip the array.
(ps_tofixedarray): Allow `values' argument to be NULL if we just
want to skip the array.
* freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add
support for (partially commented out) othersubrs 19-25, 27, and 28.
(t1_decoder_init): Initialize new fields `face' and `buildchar'.
(t1_decoder_done): Release new field `buildchar'.
* freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New
functions.
(t1_keywords): Register them.
(t1_allocate_blend): Updated.
(t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
(parse_dict): Remove `keyword_flags' argument.
Use new macro IS_PS_TOKEN.
Changed function so that later PostScript definitions override
earlier ones.
(t1_init_loader): Initialize new field `keywords_encountered'.
(T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
`len_buildchar'.
Remove `keywords_flags'.
* freetype2/src/type1/t1load.h (T1_LoaderRect): New field
`keywords_encountered'.
(T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
* freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]:
New entries for parsing /NDV, /CDV, and /DesignVector.
2006-07-14 20:28:08 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* AFM_ParserRec
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* An AFM_Parser is a parser for the AFM files.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* memory ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* The object used for memory operations (alloc and realloc).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* stream ::
|
|
|
|
* This is an opaque object.
|
|
|
|
*
|
|
|
|
* FontInfo ::
|
|
|
|
* The result will be stored here.
|
|
|
|
*
|
|
|
|
* get_index ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A user provided function to get a glyph index by its name.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
* src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
implement an AFM parser. It is used to parse an AFM file.
* src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
conversion functions (e.g, PS real number => FT_Fixed) for the
PS_Parser and AFM_Parser. Some of the functions are taken, with some
modifications, from the psobjs.c
* src/psaux/psobjs.c: Use functions from psconv.c.
* include/freetype/internal/psaux.h, src/psaux/psauxmod.c:: Add
`AFM_Parser' to the `psaux' service.
* src/psaux/psaux.c, src/psaux/rules.mk: Include those new files.
* src/tools/test_afm.c: A test program for AFM parser.
* include/freetype/internal/services/svkern.h,
include/freetype/internal/ftserv.h: New service `Kerning'. It is
currently only used to get the track kerning information.
* src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
src/type1/t1afm.h: Update to use the AFM parser.
Provide the `Kerning' service.
* include/freetype/freetype.h, src/base/ftobjs.c: New API
`FT_Get_Track_Kerning'.
2006-01-16 16:35:56 +01:00
|
|
|
typedef struct AFM_ParserRec_
|
|
|
|
{
|
|
|
|
FT_Memory memory;
|
|
|
|
AFM_Stream stream;
|
|
|
|
|
|
|
|
AFM_FontInfo FontInfo;
|
|
|
|
|
|
|
|
FT_Int
|
|
|
|
(*get_index)( const char* name,
|
2009-07-31 17:30:16 +02:00
|
|
|
FT_Offset len,
|
* src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
implement an AFM parser. It is used to parse an AFM file.
* src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
conversion functions (e.g, PS real number => FT_Fixed) for the
PS_Parser and AFM_Parser. Some of the functions are taken, with some
modifications, from the psobjs.c
* src/psaux/psobjs.c: Use functions from psconv.c.
* include/freetype/internal/psaux.h, src/psaux/psauxmod.c:: Add
`AFM_Parser' to the `psaux' service.
* src/psaux/psaux.c, src/psaux/rules.mk: Include those new files.
* src/tools/test_afm.c: A test program for AFM parser.
* include/freetype/internal/services/svkern.h,
include/freetype/internal/ftserv.h: New service `Kerning'. It is
currently only used to get the track kerning information.
* src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
src/type1/t1afm.h: Update to use the AFM parser.
Provide the `Kerning' service.
* include/freetype/freetype.h, src/base/ftobjs.c: New API
`FT_Get_Track_Kerning'.
2006-01-16 16:35:56 +01:00
|
|
|
void* user_data );
|
|
|
|
|
|
|
|
void* user_data;
|
|
|
|
|
|
|
|
} AFM_ParserRec;
|
|
|
|
|
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** TYPE1 CHARMAPS *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
typedef const struct T1_CMap_ClassesRec_* T1_CMap_Classes;
|
|
|
|
|
|
|
|
typedef struct T1_CMap_ClassesRec_
|
|
|
|
{
|
|
|
|
FT_CMap_Class standard;
|
|
|
|
FT_CMap_Class expert;
|
|
|
|
FT_CMap_Class custom;
|
|
|
|
FT_CMap_Class unicode;
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
} T1_CMap_ClassesRec;
|
* include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
and the new FT_Set_Hint_Flags high-level API
2002-07-09 00:26:11 +02:00
|
|
|
|
2000-08-23 00:36:33 +02:00
|
|
|
|
2000-08-17 03:09:06 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** PSAux Module Interface *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
typedef struct PSAux_ServiceRec_
|
2000-08-17 03:09:06 +02:00
|
|
|
{
|
2002-03-28 09:07:16 +01:00
|
|
|
/* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */
|
|
|
|
const PS_Table_FuncsRec* ps_table_funcs;
|
|
|
|
const PS_Parser_FuncsRec* ps_parser_funcs;
|
|
|
|
const T1_Builder_FuncsRec* t1_builder_funcs;
|
|
|
|
const T1_Decoder_FuncsRec* t1_decoder_funcs;
|
2000-08-23 19:32:42 +02:00
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
void
|
|
|
|
(*t1_decrypt)( FT_Byte* buffer,
|
|
|
|
FT_Offset length,
|
|
|
|
FT_UShort seed );
|
|
|
|
|
2017-09-24 22:32:40 +02:00
|
|
|
FT_UInt32
|
|
|
|
(*cff_random)( FT_UInt32 r );
|
|
|
|
|
2017-09-24 23:00:36 +02:00
|
|
|
void
|
2017-09-25 08:26:57 +02:00
|
|
|
(*ps_decoder_init)( PS_Decoder* ps_decoder,
|
|
|
|
void* decoder,
|
|
|
|
FT_Bool is_t1 );
|
2017-09-24 23:00:36 +02:00
|
|
|
|
2017-09-25 06:49:41 +02:00
|
|
|
void
|
2017-09-25 08:08:21 +02:00
|
|
|
(*t1_make_subfont)( FT_Face face,
|
|
|
|
PS_Private priv,
|
2017-09-25 06:49:41 +02:00
|
|
|
CFF_SubFont subfont );
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
T1_CMap_Classes t1_cmap_classes;
|
2002-03-21 16:02:54 +01:00
|
|
|
|
2006-02-17 09:07:09 +01:00
|
|
|
/* fields after this comment line were added after version 2.1.10 */
|
* builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
include/freetype/internal/ftdriver.h,
include/freetype/internal/ftmemory.h,
include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
massive changes to the internals to respect the internal object layouts
and exported functions of FreeType 2.1.7. Note that the cache sub-system
cannot be fully retrofitted, unfortunately.
2006-02-16 23:45:31 +01:00
|
|
|
const AFM_Parser_FuncsRec* afm_parser_funcs;
|
2017-09-24 21:56:54 +02:00
|
|
|
|
|
|
|
const CFF_Decoder_FuncsRec* cff_decoder_funcs;
|
* builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
include/freetype/internal/ftdriver.h,
include/freetype/internal/ftmemory.h,
include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
massive changes to the internals to respect the internal object layouts
and exported functions of FreeType 2.1.7. Note that the cache sub-system
cannot be fully retrofitted, unfortunately.
2006-02-16 23:45:31 +01:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
} PSAux_ServiceRec, *PSAux_Service;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
2017-05-03 23:54:29 +02:00
|
|
|
/* backward compatible type definition */
|
2002-03-21 16:02:54 +01:00
|
|
|
typedef PSAux_ServiceRec PSAux_Interface;
|
2000-08-17 03:09:06 +02:00
|
|
|
|
* freetype2/include/freetype/internal/psaux.h: New macros
IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT,
IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h).
(T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
(T1_DecoderRec): New fields `buildchar' and `face'.
(IS_PS_TOKEN): New macro.
* freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New
fields `ndv_idx', `cdv_idx', and `len_buildchar'.
* freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields
`default_design_vector' and `num_default_design_vector'.
* freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE,
IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h.
* freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow
`token' argument to be NULL if we want only to count the number of
tokens.
(ps_tocoordarray): Allow `coords' argument to be NULL if we just
want to skip the array.
(ps_tofixedarray): Allow `values' argument to be NULL if we just
want to skip the array.
* freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add
support for (partially commented out) othersubrs 19-25, 27, and 28.
(t1_decoder_init): Initialize new fields `face' and `buildchar'.
(t1_decoder_done): Release new field `buildchar'.
* freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New
functions.
(t1_keywords): Register them.
(t1_allocate_blend): Updated.
(t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
(parse_dict): Remove `keyword_flags' argument.
Use new macro IS_PS_TOKEN.
Changed function so that later PostScript definitions override
earlier ones.
(t1_init_loader): Initialize new field `keywords_encountered'.
(T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
`len_buildchar'.
Remove `keywords_flags'.
* freetype2/src/type1/t1load.h (T1_LoaderRect): New field
`keywords_encountered'.
(T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
* freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]:
New entries for parsing /NDV, /CDV, and /DesignVector.
2006-07-14 20:28:08 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** Some convenience functions *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
#define IS_PS_NEWLINE( ch ) \
|
|
|
|
( (ch) == '\r' || \
|
|
|
|
(ch) == '\n' )
|
|
|
|
|
|
|
|
#define IS_PS_SPACE( ch ) \
|
|
|
|
( (ch) == ' ' || \
|
|
|
|
IS_PS_NEWLINE( ch ) || \
|
|
|
|
(ch) == '\t' || \
|
|
|
|
(ch) == '\f' || \
|
|
|
|
(ch) == '\0' )
|
|
|
|
|
|
|
|
#define IS_PS_SPECIAL( ch ) \
|
|
|
|
( (ch) == '/' || \
|
|
|
|
(ch) == '(' || (ch) == ')' || \
|
|
|
|
(ch) == '<' || (ch) == '>' || \
|
|
|
|
(ch) == '[' || (ch) == ']' || \
|
|
|
|
(ch) == '{' || (ch) == '}' || \
|
|
|
|
(ch) == '%' )
|
|
|
|
|
|
|
|
#define IS_PS_DELIM( ch ) \
|
|
|
|
( IS_PS_SPACE( ch ) || \
|
|
|
|
IS_PS_SPECIAL( ch ) )
|
|
|
|
|
|
|
|
#define IS_PS_DIGIT( ch ) \
|
|
|
|
( (ch) >= '0' && (ch) <= '9' )
|
|
|
|
|
|
|
|
#define IS_PS_XDIGIT( ch ) \
|
|
|
|
( IS_PS_DIGIT( ch ) || \
|
|
|
|
( (ch) >= 'A' && (ch) <= 'F' ) || \
|
|
|
|
( (ch) >= 'a' && (ch) <= 'f' ) )
|
|
|
|
|
|
|
|
#define IS_PS_BASE85( ch ) \
|
|
|
|
( (ch) >= '!' && (ch) <= 'u' )
|
|
|
|
|
|
|
|
#define IS_PS_TOKEN( cur, limit, token ) \
|
|
|
|
( (char)(cur)[0] == (token)[0] && \
|
|
|
|
( (cur) + sizeof ( (token) ) == (limit) || \
|
|
|
|
( (cur) + sizeof( (token) ) < (limit) && \
|
|
|
|
IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) ) && \
|
|
|
|
ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )
|
|
|
|
|
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
FT_END_HEADER
|
2000-08-17 09:18:04 +02:00
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* PSAUX_H_ */
|
2000-08-17 09:18:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|