Change subfont synthesis for CID fonts. Change `t1_make_subfont' to take in the Private dict record as an argument. This is because Type 1 and CID font records in FreeType have this in different places. * src/psaux/psobjs.c (t1_make_subfont): Change `T1_Face' to `FT_Face' so that CID is also accepted. Take `PS_Private' as an argument and let caller figure out where the Private dict actually is. Update references. * include/freetype/internal/psaux.h, src/psaux/psobjs.h: Update declaration. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Update call.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
diff --git a/ChangeLog b/ChangeLog
index c7288c3..09cd993 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
2017-09-25 Ewald Hew <ewaldhew@gmail.com>
+ [psaux] Change subfont synthesis for CID fonts.
+
+ Change `t1_make_subfont' to take in the Private dict record as an
+ argument. This is because Type 1 and CID font records in FreeType
+ have this in different places.
+
+ * src/psaux/psobjs.c (t1_make_subfont): Change `T1_Face' to
+ `FT_Face' so that CID is also accepted.
+ Take `PS_Private' as an argument and let caller figure out where the
+ Private dict actually is.
+ Update references.
+
+ * include/freetype/internal/psaux.h, src/psaux/psobjs.h: Update
+ declaration.
+
+ * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Update
+ call.
+
+2017-09-25 Ewald Hew <ewaldhew@gmail.com>
+
[type1] Switch to Adobe engine.
* src/type1/t1objs.c (T1_Driver_Init): Set default to Adobe engine.
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index 9748368..7357da4 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -1291,10 +1291,10 @@ FT_BEGIN_HEADER
PS_Decoder* ps_decoder );
void
- (*t1_make_subfont)( T1_Face face,
+ (*t1_make_subfont)( FT_Face face,
+ PS_Private priv,
CFF_SubFont subfont );
-
T1_CMap_Classes t1_cmap_classes;
/* fields after this comment line were added after version 2.1.10 */
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 3fd2fda..b592163 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -2329,10 +2329,10 @@
FT_LOCAL_DEF( void )
- t1_make_subfont( T1_Face face,
+ t1_make_subfont( FT_Face face,
+ PS_Private priv,
CFF_SubFont subfont )
{
- PS_Private priv = &face->type1.private_dict;
CFF_Private cpriv = &subfont->private_dict;
FT_UInt n, count;
@@ -2379,20 +2379,18 @@
/* Initialize the random number generator. */
- if ( face->root.internal->random_seed != -1 )
+ if ( face->internal->random_seed != -1 )
{
/* . If we have a face-specific seed, use it. */
/* If non-zero, update it to a positive value. */
- subfont->random = (FT_UInt32)face->root.internal->random_seed;
- if ( face->root.internal->random_seed )
+ subfont->random = (FT_UInt32)face->internal->random_seed;
+ if ( face->internal->random_seed )
{
do
{
- face->root.internal->random_seed =
- (FT_Int32)((PSAux_Service)face->psaux)->cff_random(
- (FT_UInt32)face->root.internal->random_seed );
-
- } while ( face->root.internal->random_seed < 0 );
+ face->internal->random_seed = (FT_Int32)cff_random(
+ (FT_UInt32)face->internal->random_seed );
+ } while ( face->internal->random_seed < 0 );
}
}
if ( !subfont->random )
diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h
index 2fed988..aed19de 100644
--- a/src/psaux/psobjs.h
+++ b/src/psaux/psobjs.h
@@ -285,7 +285,8 @@ FT_BEGIN_HEADER
/*************************************************************************/
FT_LOCAL( void )
- t1_make_subfont( T1_Face face,
+ t1_make_subfont( FT_Face face,
+ PS_Private priv,
CFF_SubFont subfont );
FT_LOCAL( void )
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index b1020e9..6e5d3e8 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -112,7 +112,7 @@
psaux->ps_decoder_init( decoder, TRUE, &psdecoder );
- psaux->t1_make_subfont( face, &subfont );
+ psaux->t1_make_subfont( FT_FACE( face ), &face->type1.private_dict, &subfont );
psdecoder.current_subfont = &subfont;
error = decoder_funcs->parse_charstrings( &psdecoder,