aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/type1
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-06-15 14:13:55 +0200
committermarha <marha@users.sourceforge.net>2012-06-15 14:13:55 +0200
commit1501699f035761714a1d4540d65a1afb7c567abe (patch)
tree4dd4d15583d9d542a699833331f34ceb10bbd6c3 /freetype/src/type1
parent38c18d1733e4eb5cc560a34bfe2470e01a06205d (diff)
parenta33de30073bfa0ee1abba186dba9fa52cf0aa23a (diff)
downloadvcxsrv-1501699f035761714a1d4540d65a1afb7c567abe.tar.gz
vcxsrv-1501699f035761714a1d4540d65a1afb7c567abe.tar.bz2
vcxsrv-1501699f035761714a1d4540d65a1afb7c567abe.zip
Merge remote-tracking branch 'origin/released'
Conflicts: freetype/src/raster/ftraster.c openssl/Makefile
Diffstat (limited to 'freetype/src/type1')
-rw-r--r--freetype/src/type1/t1driver.h2
-rw-r--r--freetype/src/type1/t1load.c64
-rw-r--r--freetype/src/type1/t1tokens.h2
3 files changed, 45 insertions, 23 deletions
diff --git a/freetype/src/type1/t1driver.h b/freetype/src/type1/t1driver.h
index 7b2d49539..e23a140c7 100644
--- a/freetype/src/type1/t1driver.h
+++ b/freetype/src/type1/t1driver.h
@@ -28,7 +28,7 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC
#error "this module does not support PIC yet"
-#endif
+#endif
FT_EXPORT_VAR( const FT_Driver_ClassRec ) t1_driver_class;
diff --git a/freetype/src/type1/t1load.c b/freetype/src/type1/t1load.c
index ff26729e5..1a5fcdcd4 100644
--- a/freetype/src/type1/t1load.c
+++ b/freetype/src/type1/t1load.c
@@ -71,6 +71,13 @@
#include "t1errors.h"
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+#define IS_INCREMENTAL ( face->root.internal->incremental_interface != 0 )
+#else
+#define IS_INCREMENTAL 0
+#endif
+
+
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@@ -1004,13 +1011,24 @@
max_objects = 0;
}
- if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
- field->type == T1_FIELD_TYPE_FIXED_ARRAY )
- error = T1_Load_Field_Table( &loader->parser, field,
- objects, max_objects, 0 );
+ if ( *objects )
+ {
+ if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
+ field->type == T1_FIELD_TYPE_FIXED_ARRAY )
+ error = T1_Load_Field_Table( &loader->parser, field,
+ objects, max_objects, 0 );
+ else
+ error = T1_Load_Field( &loader->parser, field,
+ objects, max_objects, 0 );
+ }
else
- error = T1_Load_Field( &loader->parser, field,
- objects, max_objects, 0 );
+ {
+ FT_TRACE1(( "t1_load_keyword: ignoring keyword `%s'"
+ " which is not valid at this point\n"
+ " (probably due to missing keywords)\n",
+ field->ident ));
+ error = T1_Err_Ok;
+ }
Exit:
return error;
@@ -1030,7 +1048,8 @@
static int
read_binary_data( T1_Parser parser,
FT_Long* size,
- FT_Byte** base )
+ FT_Byte** base,
+ FT_Bool incremental )
{
FT_Byte* cur;
FT_Byte* limit = parser->root.limit;
@@ -1065,8 +1084,12 @@
}
}
- FT_ERROR(( "read_binary_data: invalid size field\n" ));
- parser->root.error = T1_Err_Invalid_File_Format;
+ if( !incremental )
+ {
+ FT_ERROR(( "read_binary_data: invalid size field\n" ));
+ parser->root.error = T1_Err_Invalid_File_Format;
+ }
+
return 0;
}
@@ -1387,16 +1410,17 @@
FT_Byte* base;
- /* If the next token isn't `dup' we are done. */
- if ( parser->root.cursor + 4 < parser->root.limit &&
- ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
+ /* If we are out of data, or if the next token isn't `dup', */
+ /* we are done. */
+ if ( parser->root.cursor + 4 >= parser->root.limit ||
+ ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
break;
T1_Skip_PS_Token( parser ); /* `dup' */
idx = T1_ToInt( parser );
- if ( !read_binary_data( parser, &size, &base ) )
+ if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
return;
/* The binary string is followed by one token, e.g. `NP' */
@@ -1582,7 +1606,7 @@
cur++; /* skip `/' */
len = parser->root.cursor - cur;
- if ( !read_binary_data( parser, &size, &base ) )
+ if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
return;
/* for some non-standard fonts like `Optima' which provides */
@@ -1871,7 +1895,7 @@
parser->root.cursor = start_binary;
- if ( !read_binary_data( parser, &s, &b ) )
+ if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
return T1_Err_Invalid_File_Format;
have_integer = 0;
}
@@ -1884,7 +1908,7 @@
parser->root.cursor = start_binary;
- if ( !read_binary_data( parser, &s, &b ) )
+ if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
return T1_Err_Invalid_File_Format;
have_integer = 0;
}
@@ -1957,8 +1981,8 @@
if ( !( dict & keyword->dict ) )
{
- FT_TRACE1(( "parse_dict: found %s but ignoring it "
- "since it is in the wrong dictionary\n",
+ FT_TRACE1(( "parse_dict: found `%s' but ignoring it"
+ " since it is in the wrong dictionary\n",
keyword->ident ));
break;
}
@@ -2160,9 +2184,7 @@
type1->subrs_len = loader.subrs.lengths;
}
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
- if ( !face->root.internal->incremental_interface )
-#endif
+ if ( !IS_INCREMENTAL )
if ( !loader.charstrings.init )
{
FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" ));
diff --git a/freetype/src/type1/t1tokens.h b/freetype/src/type1/t1tokens.h
index 2d692f0e6..e37276b90 100644
--- a/freetype/src/type1/t1tokens.h
+++ b/freetype/src/type1/t1tokens.h
@@ -96,7 +96,7 @@
T1_FIELD_DICT_PRIVATE )
T1_FIELD_BOOL ( "ForceBold", force_bold,
T1_FIELD_DICT_PRIVATE )
-
+
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FontRec