summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/gxvalid/gxvmorx.c
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-03-19 17:34:42 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-03-20 13:42:29 +0000
commit2eaf0cf8fd6e7c290497fedb08134a89e7b49b1d (patch)
tree0a4f7bf528e87d0b0a71ce7fccf702b87f4cdec1 /src/3rdparty/freetype/src/gxvalid/gxvmorx.c
parent77c518a50334d4dcf2476a4f39edc1e3990c7f0b (diff)
Update bundled FreeType to 2.5.5
Removed everything, imported with help of import_from_tarball.sh script, and then added a pre-generated builds/unix/ftconfig.h Task-number: QTBUG-44648 Change-Id: Iea948e41f7761f1580382b3763d04c7a61383382 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/freetype/src/gxvalid/gxvmorx.c')
-rw-r--r--src/3rdparty/freetype/src/gxvalid/gxvmorx.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/src/3rdparty/freetype/src/gxvalid/gxvmorx.c b/src/3rdparty/freetype/src/gxvalid/gxvmorx.c
index f8ba5b985d..96dba631c4 100644
--- a/src/3rdparty/freetype/src/gxvalid/gxvmorx.c
+++ b/src/3rdparty/freetype/src/gxvalid/gxvmorx.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT morx table validation (body). */
/* */
-/* Copyright 2005, 2008 by */
+/* Copyright 2005, 2008, 2013 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -42,7 +42,7 @@
gxv_morx_subtables_validate( FT_Bytes table,
FT_Bytes limit,
FT_UShort nSubtables,
- GXV_Validator valid )
+ GXV_Validator gxvalid )
{
FT_Bytes p = table;
@@ -57,8 +57,6 @@
};
- GXV_Validate_Func func;
-
FT_UShort i;
@@ -66,9 +64,13 @@
for ( i = 0; i < nSubtables; i++ )
{
+ GXV_Validate_Func func;
+
FT_ULong length;
FT_ULong coverage;
+#ifdef GXV_LOAD_UNUSED_VARS
FT_ULong subFeatureFlags;
+#endif
FT_ULong type;
FT_ULong rest;
@@ -76,7 +78,11 @@
GXV_LIMIT_CHECK( 4 + 4 + 4 );
length = FT_NEXT_ULONG( p );
coverage = FT_NEXT_ULONG( p );
+#ifdef GXV_LOAD_UNUSED_VARS
subFeatureFlags = FT_NEXT_ULONG( p );
+#else
+ p += 4;
+#endif
GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
i + 1, nSubtables, length ));
@@ -87,7 +93,7 @@
/* morx coverage consists of mort_coverage & 16bit padding */
gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ),
- valid );
+ gxvalid );
if ( type > 5 )
FT_INVALID_FORMAT;
@@ -95,12 +101,13 @@
if ( func == NULL )
GXV_TRACE(( "morx type %d is reserved\n", type ));
- func( p, p + rest, valid );
+ func( p, p + rest, gxvalid );
+ /* TODO: subFeatureFlags should be unique in a table? */
p += rest;
}
- valid->subtable_length = p - table;
+ gxvalid->subtable_length = p - table;
GXV_EXIT;
}
@@ -109,10 +116,12 @@
static void
gxv_morx_chain_validate( FT_Bytes table,
FT_Bytes limit,
- GXV_Validator valid )
+ GXV_Validator gxvalid )
{
FT_Bytes p = table;
+#ifdef GXV_LOAD_UNUSED_VARS
FT_ULong defaultFlags;
+#endif
FT_ULong chainLength;
FT_ULong nFeatureFlags;
FT_ULong nSubtables;
@@ -121,22 +130,28 @@
GXV_NAME_ENTER( "morx chain header" );
GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );
+#ifdef GXV_LOAD_UNUSED_VARS
defaultFlags = FT_NEXT_ULONG( p );
+#else
+ p += 4;
+#endif
chainLength = FT_NEXT_ULONG( p );
nFeatureFlags = FT_NEXT_ULONG( p );
nSubtables = FT_NEXT_ULONG( p );
/* feature-array of morx is same with that of mort */
- gxv_mort_featurearray_validate( p, limit, nFeatureFlags, valid );
- p += valid->subtable_length;
+ gxv_mort_featurearray_validate( p, limit, nFeatureFlags, gxvalid );
+ p += gxvalid->subtable_length;
if ( nSubtables >= 0x10000L )
FT_INVALID_DATA;
gxv_morx_subtables_validate( p, table + chainLength,
- (FT_UShort)nSubtables, valid );
+ (FT_UShort)nSubtables, gxvalid );
+
+ gxvalid->subtable_length = chainLength;
- valid->subtable_length = chainLength;
+ /* TODO: defaultFlags should be compared with the flags in tables */
GXV_EXIT;
}
@@ -147,8 +162,8 @@
FT_Face face,
FT_Validator ftvalid )
{
- GXV_ValidatorRec validrec;
- GXV_Validator valid = &validrec;
+ GXV_ValidatorRec gxvalidrec;
+ GXV_Validator gxvalid = &gxvalidrec;
FT_Bytes p = table;
FT_Bytes limit = 0;
FT_ULong version;
@@ -156,8 +171,8 @@
FT_ULong i;
- valid->root = ftvalid;
- valid->face = face;
+ gxvalid->root = ftvalid;
+ gxvalid->face = face;
FT_TRACE3(( "validating `morx' table\n" ));
GXV_INIT;
@@ -173,8 +188,8 @@
{
GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
- gxv_morx_chain_validate( p, limit, valid );
- p += valid->subtable_length;
+ gxv_morx_chain_validate( p, limit, gxvalid );
+ p += gxvalid->subtable_length;
}
FT_TRACE4(( "\n" ));