freetype2/src/type1/t1load.h

104 lines
3.2 KiB
C
Raw Normal View History

/***************************************************************************/
/* */
/* t1load.h */
/* */
/* Type 1 font loader (specification). */
/* */
2015-01-17 20:41:43 +01:00
/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef T1LOAD_H_
#define T1LOAD_H_
2000-12-08 17:17:16 +01:00
#include <ft2build.h>
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_MULTIPLE_MASTERS_H
#include "t1parse.h"
2000-12-08 17:17:16 +01:00
FT_BEGIN_HEADER
2000-12-08 17:17:16 +01:00
typedef struct T1_Loader_
{
T1_ParserRec parser; /* parser used to read the stream */
FT_Int num_chars; /* number of characters in encoding */
PS_TableRec encoding_table; /* PS_Table used to store the */
/* encoding character names */
2000-05-17 01:44:38 +02:00
FT_Int num_glyphs;
PS_TableRec glyph_names;
PS_TableRec charstrings;
PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */
2000-05-17 01:44:38 +02:00
FT_Int num_subrs;
PS_TableRec subrs;
FT_Hash subrs_hash;
FT_Bool fontdata;
2000-05-17 01:44:38 +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
FT_UInt keywords_encountered; /* T1_LOADER_ENCOUNTERED_XXX */
} T1_LoaderRec, *T1_Loader;
* 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
/* treatment of some keywords differs depending on whether */
2007-01-26 23:18:56 +01:00
/* they precede or follow certain other keywords */
* 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
#define T1_PRIVATE ( 1 << 0 )
#define T1_FONTDIR_AFTER_PRIVATE ( 1 << 1 )
FT_LOCAL( FT_Error )
2001-06-28 09:17:51 +02:00
T1_Open_Face( T1_Face face );
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
FT_LOCAL( FT_Error )
2001-06-28 09:17:51 +02:00
T1_Get_Multi_Master( T1_Face face,
FT_Multi_Master* master );
* src/pcf/pcfdrivr.c: Revert change from 2004-04-17. * src/pcf/pcfutil.c: Use FT_LOCAL_DEF. * src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H. Use FT_BEGIN_HEADER and FT_END_HEADER. Use FT_LOCAL. 2004-04-24 George Williams <gww@silcom.com> Add support for Apple's distortable font technology (in GX fonts). * devel/ftoption.h, include/freetype/config/ftoption.h (TT_CONFIG_OPTION_GX_VAR_SUPPORT): New macro. * include/freetype/ftmm.h (FT_Var_Axis, FT_Var_Named_Style, FT_MM_Var): New structures. (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates, FT_Set_Var_Blend_Coordinates): New function declarations. * include/freetype/internal/services/svmm.h (FT_Get_MM_Var_Func, FT_Set_Var_Design_Func): New typedefs. Update MultiMasters service. * include/freetype/internal/tttypes.h [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H. (GX_Blend) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New typedef. (TT_Face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New members `doblend' and `blend'. * include/freetype/tttags.h (TTAG_avar, TTAG_cvar, TTAG_gvar): New macros. * include/freetype/internal/fttrace.h: Add `ttgxvar'. * src/base/ftmm.c (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates, FT_Set_Var_Blend_Coordinates): New functions. * src/sfnt/sfobjs.c (sfnt_load_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Set FT_FACE_FLAG_MULTIPLE_MASTERS flag for GX var fonts. * src/truetype/ttgxvar.c, src/truetype/ttgxvar.h: New files. * src/truetype/truetype.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.c. * src/truetype/ttdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H, FT_SERVICE_MULTIPLE_MASTERS_H, and ttgxvar.h. (tt_service_gx_multi_masters) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New service. (tt_services) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated. * src/truetype/ttgload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.h. (TT_Process_Simple_Glyph, load_truetype_glyph) [TT_CONFIG_OPTION_GX_VAR_SUPPORT] :Support GX var fonts. * src/truetype/ttobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.h. (tt_done_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call tt_done_blend. * src/truetype/ttpload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.h. (tt_face_load_cvt) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call tt_face_vary_cvt. * src/truetype/rules.mk (TT_DRV_SRC): Add ttgxvar.c. * src/type1/t1driver.c (t1_service_multi_masters): Add T1_Get_MM_Var and T1_Set_Var_Design. * src/type1/t1load.c (FT_INT_TO_FIXED, FT_FIXED_TO_INT): New macros. (T1_Get_MM_Var, T1_Set_Var_Design): New functions. * src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New function declarations.
2004-04-25 22:15:11 +02:00
FT_LOCAL_DEF( FT_Error )
T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master );
FT_LOCAL( FT_Error )
2001-06-28 09:17:51 +02:00
T1_Set_MM_Blend( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
FT_LOCAL( FT_Error )
2001-06-28 09:17:51 +02:00
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords );
* src/pcf/pcfdrivr.c: Revert change from 2004-04-17. * src/pcf/pcfutil.c: Use FT_LOCAL_DEF. * src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H. Use FT_BEGIN_HEADER and FT_END_HEADER. Use FT_LOCAL. 2004-04-24 George Williams <gww@silcom.com> Add support for Apple's distortable font technology (in GX fonts). * devel/ftoption.h, include/freetype/config/ftoption.h (TT_CONFIG_OPTION_GX_VAR_SUPPORT): New macro. * include/freetype/ftmm.h (FT_Var_Axis, FT_Var_Named_Style, FT_MM_Var): New structures. (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates, FT_Set_Var_Blend_Coordinates): New function declarations. * include/freetype/internal/services/svmm.h (FT_Get_MM_Var_Func, FT_Set_Var_Design_Func): New typedefs. Update MultiMasters service. * include/freetype/internal/tttypes.h [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H. (GX_Blend) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New typedef. (TT_Face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New members `doblend' and `blend'. * include/freetype/tttags.h (TTAG_avar, TTAG_cvar, TTAG_gvar): New macros. * include/freetype/internal/fttrace.h: Add `ttgxvar'. * src/base/ftmm.c (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates, FT_Set_Var_Blend_Coordinates): New functions. * src/sfnt/sfobjs.c (sfnt_load_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Set FT_FACE_FLAG_MULTIPLE_MASTERS flag for GX var fonts. * src/truetype/ttgxvar.c, src/truetype/ttgxvar.h: New files. * src/truetype/truetype.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.c. * src/truetype/ttdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H, FT_SERVICE_MULTIPLE_MASTERS_H, and ttgxvar.h. (tt_service_gx_multi_masters) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New service. (tt_services) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated. * src/truetype/ttgload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.h. (TT_Process_Simple_Glyph, load_truetype_glyph) [TT_CONFIG_OPTION_GX_VAR_SUPPORT] :Support GX var fonts. * src/truetype/ttobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.h. (tt_done_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call tt_done_blend. * src/truetype/ttpload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include ttgxvar.h. (tt_face_load_cvt) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call tt_face_vary_cvt. * src/truetype/rules.mk (TT_DRV_SRC): Add ttgxvar.c. * src/type1/t1driver.c (t1_service_multi_masters): Add T1_Get_MM_Var and T1_Set_Var_Design. * src/type1/t1load.c (FT_INT_TO_FIXED, FT_FIXED_TO_INT): New macros. (T1_Get_MM_Var, T1_Set_Var_Design): New functions. * src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New function declarations.
2004-04-25 22:15:11 +02:00
FT_LOCAL_DEF( FT_Error )
T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
FT_LOCAL( void )
2001-06-28 09:17:51 +02:00
T1_Done_Blend( T1_Face face );
#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */
FT_END_HEADER
#endif /* T1LOAD_H_ */
/* END */