summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/type1
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-12-30 23:22:05 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-12-30 23:22:05 +0000
commitc1c7df45902c28d68a07508d11224cef86edcb0d (patch)
treef00af2d1129c70381279ba7db2c699ede0738f51 /Build/source/libs/freetype2/freetype-src/src/type1
parent770c1f2b994c43dfec555e1411995aa3700d406d (diff)
freetype2 2.7.1
git-svn-id: svn://tug.org/texlive/trunk@42811 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/type1')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c6
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c15
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1load.c98
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1load.h14
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c2
5 files changed, 109 insertions, 26 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c
index bbd843c1c33..5c7f389682a 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1afm.c
@@ -208,7 +208,7 @@
kp++;
}
- if ( oldcharmap != NULL )
+ if ( oldcharmap )
error = FT_Set_Charmap( t1_face, oldcharmap );
if ( error )
goto Exit;
@@ -309,14 +309,14 @@
{
t1_face->face_flags |= FT_FACE_FLAG_KERNING;
face->afm_data = fi;
- fi = NULL;
+ fi = NULL;
}
}
FT_FRAME_EXIT();
Exit:
- if ( fi != NULL )
+ if ( fi )
T1_Done_Metrics( memory, fi );
return error;
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c
index f1e60d4523a..fd9e13e11a4 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1driver.c
@@ -122,8 +122,13 @@
(FT_Get_MM_Func) T1_Get_Multi_Master, /* get_mm */
(FT_Set_MM_Design_Func) T1_Set_MM_Design, /* set_mm_design */
(FT_Set_MM_Blend_Func) T1_Set_MM_Blend, /* set_mm_blend */
+ (FT_Get_MM_Blend_Func) T1_Get_MM_Blend, /* get_mm_blend */
(FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */
- (FT_Set_Var_Design_Func)T1_Set_Var_Design /* set_var_design */
+ (FT_Set_Var_Design_Func)T1_Set_Var_Design, /* set_var_design */
+ (FT_Get_Var_Design_Func)T1_Get_Var_Design, /* get_var_design */
+
+ (FT_Get_Var_Blend_Func) NULL, /* get_var_blend */
+ (FT_Done_Blend_Func) T1_Done_Blend /* done_blend */
};
#endif
@@ -714,7 +719,7 @@
0x10000L,
0x20000L,
- 0, /* module-specific interface */
+ NULL, /* module-specific interface */
T1_Driver_Init, /* FT_Module_Constructor module_init */
T1_Driver_Done, /* FT_Module_Destructor module_done */
@@ -735,8 +740,8 @@
T1_Load_Glyph, /* FT_Slot_LoadFunc load_glyph */
#ifdef T1_CONFIG_OPTION_NO_AFM
- 0, /* FT_Face_GetKerningFunc get_kerning */
- 0, /* FT_Face_AttachFunc attach_file */
+ NULL, /* FT_Face_GetKerningFunc get_kerning */
+ NULL, /* FT_Face_AttachFunc attach_file */
#else
Get_Kerning, /* FT_Face_GetKerningFunc get_kerning */
T1_Read_Metrics, /* FT_Face_AttachFunc attach_file */
@@ -744,7 +749,7 @@
T1_Get_Advances, /* FT_Face_GetAdvancesFunc get_advances */
T1_Size_Request, /* FT_Size_RequestFunc request_size */
- 0 /* FT_Size_SelectFunc select_size */
+ NULL /* FT_Size_SelectFunc select_size */
};
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c
index e728cf4507b..f6b43dc2f62 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.c
@@ -237,7 +237,7 @@
if ( ncv <= axismap->blend_points[0] )
return INT_TO_FIXED( axismap->design_points[0] );
- for ( j = 1; j < axismap->num_points; ++j )
+ for ( j = 1; j < axismap->num_points; j++ )
{
if ( ncv <= axismap->blend_points[j] )
return INT_TO_FIXED( axismap->design_points[j - 1] ) +
@@ -326,7 +326,7 @@
/* Point to axes after MM_Var struct */
mmvar->namedstyle = NULL;
- for ( i = 0; i < mmaster.num_axis; ++i )
+ for ( i = 0; i < mmaster.num_axis; i++ )
{
mmvar->axis[i].name = mmaster.axis[i].name;
mmvar->axis[i].minimum = INT_TO_FIXED( mmaster.axis[i].minimum);
@@ -354,7 +354,7 @@
axiscoords,
blend->num_axis );
- for ( i = 0; i < mmaster.num_axis; ++i )
+ for ( i = 0; i < mmaster.num_axis; i++ )
mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i],
axiscoords[i] );
}
@@ -413,6 +413,41 @@
FT_LOCAL_DEF( FT_Error )
+ T1_Get_MM_Blend( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ PS_Blend blend = face->blend;
+
+ FT_Fixed axiscoords[4];
+ FT_UInt i, nc;
+
+
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+
+ mm_weights_unmap( blend->weight_vector,
+ axiscoords,
+ blend->num_axis );
+
+ nc = num_coords;
+ if ( num_coords > blend->num_axis )
+ {
+ FT_TRACE2(( "T1_Get_MM_Blend: only using first %d of %d coordinates\n",
+ blend->num_axis, num_coords ));
+ nc = blend->num_axis;
+ }
+
+ for ( i = 0; i < nc; i++ )
+ coords[i] = axiscoords[i];
+ for ( ; i < num_coords; i++ )
+ coords[i] = 0x8000;
+
+ return FT_Err_Ok;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords )
@@ -504,13 +539,49 @@
if ( num_coords > T1_MAX_MM_AXIS )
num_coords = T1_MAX_MM_AXIS;
- for ( i = 0; i < num_coords; ++i )
+ for ( i = 0; i < num_coords; i++ )
lcoords[i] = FIXED_TO_INT( coords[i] );
return T1_Set_MM_Design( face, num_coords, lcoords );
}
+ FT_LOCAL_DEF( FT_Error )
+ T1_Get_Var_Design( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ PS_Blend blend = face->blend;
+
+ FT_Fixed axiscoords[4];
+ FT_UInt i, nc;
+
+
+ if ( !blend )
+ return FT_THROW( Invalid_Argument );
+
+ mm_weights_unmap( blend->weight_vector,
+ axiscoords,
+ blend->num_axis );
+
+ nc = num_coords;
+ if ( num_coords > blend->num_axis )
+ {
+ FT_TRACE2(( "T1_Get_Var_Design:"
+ " only using first %d of %d coordinates\n",
+ blend->num_axis, num_coords ));
+ nc = blend->num_axis;
+ }
+
+ for ( i = 0; i < nc; i++ )
+ coords[i] = mm_axis_unmap( &blend->design_map[i], axiscoords[i] );
+ for ( ; i < num_coords; i++ )
+ coords[i] = 0;
+
+ return FT_Err_Ok;
+ }
+
+
FT_LOCAL_DEF( void )
T1_Done_Blend( T1_Face face )
{
@@ -1406,7 +1477,6 @@
FT_Error error;
FT_Int num_subrs;
FT_UInt count;
- FT_Hash hash = NULL;
PSAux_Service psaux = (PSAux_Service)face->psaux;
@@ -1433,7 +1503,7 @@
}
/* we certainly need more than 8 bytes per subroutine */
- if ( parser->root.limit > parser->root.cursor &&
+ if ( parser->root.limit >= parser->root.cursor &&
num_subrs > ( parser->root.limit - parser->root.cursor ) >> 3 )
{
/*
@@ -1457,14 +1527,12 @@
( parser->root.limit - parser->root.cursor ) >> 3 ));
num_subrs = ( parser->root.limit - parser->root.cursor ) >> 3;
- if ( !hash )
+ if ( !loader->subrs_hash )
{
- if ( FT_NEW( hash ) )
+ if ( FT_NEW( loader->subrs_hash ) )
goto Fail;
- loader->subrs_hash = hash;
-
- error = ft_hash_num_init( hash, memory );
+ error = ft_hash_num_init( loader->subrs_hash, memory );
if ( error )
goto Fail;
}
@@ -1527,9 +1595,9 @@
/* if we use a hash, the subrs index is the key, and a running */
/* counter specified for `T1_Add_Table' acts as the value */
- if ( hash )
+ if ( loader->subrs_hash )
{
- ft_hash_num_insert( idx, count, hash, memory );
+ ft_hash_num_insert( idx, count, loader->subrs_hash, memory );
idx = count;
}
@@ -2110,7 +2178,7 @@
parser->root.error = t1_load_keyword( face,
loader,
keyword );
- if ( parser->root.error != FT_Err_Ok )
+ if ( parser->root.error )
{
if ( FT_ERR_EQ( parser->root.error, Ignore ) )
parser->root.error = FT_Err_Ok;
@@ -2149,7 +2217,7 @@
{
FT_UNUSED( face );
- FT_MEM_ZERO( loader, sizeof ( *loader ) );
+ FT_ZERO( loader );
}
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h
index b96fe5a7460..72445c531b5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1load.h
@@ -70,7 +70,7 @@ FT_BEGIN_HEADER
T1_Get_Multi_Master( T1_Face face,
FT_Multi_Master* master );
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master );
@@ -80,11 +80,21 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
FT_LOCAL( FT_Error )
+ T1_Get_MM_Blend( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ FT_LOCAL( FT_Error )
T1_Set_MM_Design( T1_Face face,
FT_UInt num_coords,
FT_Long* coords );
- FT_LOCAL_DEF( FT_Error )
+ FT_LOCAL( FT_Error )
+ T1_Get_Var_Design( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+ FT_LOCAL( FT_Error )
T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
diff --git a/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c b/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c
index 563d9f37bb2..478c80bce35 100644
--- a/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c
+++ b/Build/source/libs/freetype2/freetype-src/src/type1/t1parse.c
@@ -437,7 +437,7 @@
*cur == '\t' ||
(test_cr && *cur == '\r' ) ||
*cur == '\n' ) )
- ++cur;
+ cur++;
if ( cur >= limit )
{
FT_ERROR(( "T1_Get_Private_Dict:"