summaryrefslogtreecommitdiff
path: root/include/freetype/internal/psaux.h
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2006-07-14 18:28:08 +0000
committerWerner Lemberg <wl@gnu.org>2006-07-14 18:28:08 +0000
commit1a380e02d1668d559a073d75200e3866d37b8e4d (patch)
tree68f2aedf1f913443c444750d0a66c4c079a18507 /include/freetype/internal/psaux.h
parent4af3c4d7ee1de7d4e7591578092cac4f1a124d49 (diff)
downloadfreetype2-1a380e02d1668d559a073d75200e3866d37b8e4d.tar.gz
* 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.
Diffstat (limited to 'include/freetype/internal/psaux.h')
-rw-r--r--include/freetype/internal/psaux.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index d2e491000..4afd2b069 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -199,6 +199,9 @@ FT_BEGIN_HEADER
T1_FIELD_LOCATION_FONT_INFO,
T1_FIELD_LOCATION_PRIVATE,
T1_FIELD_LOCATION_BBOX,
+ T1_FIELD_LOCATION_LOADER,
+ T1_FIELD_LOCATION_FACE,
+ T1_FIELD_LOCATION_BLEND,
/* do not remove */
T1_FIELD_LOCATION_MAX
@@ -683,6 +686,10 @@ FT_BEGIN_HEADER
T1_Decoder_Callback parse_callback;
T1_Decoder_FuncsRec funcs;
+ FT_Int* buildchar;
+
+ T1_Face face;
+
} T1_DecoderRec;
@@ -712,8 +719,10 @@ FT_BEGIN_HEADER
} AFM_Parser_FuncsRec;
+
typedef struct AFM_StreamRec_* AFM_Stream;
+
/*************************************************************************/
/* */
/* <Struct> */
@@ -801,6 +810,57 @@ FT_BEGIN_HEADER
/* backwards-compatible type definition */
typedef PSAux_ServiceRec PSAux_Interface;
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** 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 )
+
+
FT_END_HEADER
#endif /* __PSAUX_H__ */