Minor fixes. * include/freetype/internal/psaux.h, src/psaux/psobjs.{c,h}: Rearrange `ps_builder_init' arguments to conventional order. * src/psaux/psft.c (cf2_decoder_parse_charstrings): Add a check and notice for `SubFont' in Type 1 mode.
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
diff --git a/ChangeLog b/ChangeLog
index 067ecbe..6930a85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2017-09-25 Ewald Hew <ewaldhew@gmail.com>
+ [psaux] Minor fixes.
+
+ * include/freetype/internal/psaux.h, src/psaux/psobjs.{c,h}:
+ Rearrange `ps_builder_init' arguments to conventional order.
+
+ * src/psaux/psft.c (cf2_decoder_parse_charstrings): Add a check and
+ notice for `SubFont' in Type 1 mode.
+
+2017-09-25 Ewald Hew <ewaldhew@gmail.com>
+
[psaux] Move `psdecode' into `psobjs'.
As the former only contains a single procedure, move it into
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index d37b6e5..2553547 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -473,9 +473,9 @@ FT_BEGIN_HEADER
typedef struct PS_Builder_FuncsRec_
{
void
- (*init)( void* builder,
- FT_Bool is_t1,
- PS_Builder* ps_builder );
+ (*init)( PS_Builder* ps_builder,
+ void* builder,
+ FT_Bool is_t1 );
void
(*done)( PS_Builder* builder );
diff --git a/src/psaux/psft.c b/src/psaux/psft.c
index fd09414..89e168a 100644
--- a/src/psaux/psft.c
+++ b/src/psaux/psft.c
@@ -315,6 +315,13 @@
FT_ASSERT( decoder &&
( is_t1 || decoder->cff ) );
+ if ( is_t1 && !decoder->current_subfont )
+ {
+ FT_ERROR(( "cf2_decoder_parse_charstrings (Type 1): "
+ "SubFont missing. Use `t1_make_subfont' first\n" ));
+ return FT_THROW( Invalid_Table );
+ }
+
memory = decoder->builder.memory;
/* CF2 data is saved here across glyphs */
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index a62ee23..0baba7a 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -2054,9 +2054,9 @@
/* hinting :: Whether hinting should be applied. */
/* */
FT_LOCAL_DEF( void )
- ps_builder_init( void* builder,
- FT_Bool is_t1,
- PS_Builder* ps_builder )
+ ps_builder_init( PS_Builder* ps_builder,
+ void* builder,
+ FT_Bool is_t1 )
{
FT_ZERO( ps_builder );
@@ -2356,9 +2356,9 @@
{
T1_Decoder t1_decoder = (T1_Decoder)decoder;
- ps_builder_init( &t1_decoder->builder,
- is_t1,
- &ps_decoder->builder );
+ ps_builder_init( &ps_decoder->builder,
+ &t1_decoder->builder,
+ is_t1 );
ps_decoder->cf2_instance = &t1_decoder->cf2_instance;
ps_decoder->psnames = t1_decoder->psnames;
@@ -2382,9 +2382,9 @@
{
CFF_Decoder* cff_decoder = (CFF_Decoder*)decoder;
- ps_builder_init( &cff_decoder->builder,
- is_t1,
- &ps_decoder->builder );
+ ps_builder_init( &ps_decoder->builder,
+ &cff_decoder->builder,
+ is_t1 );
ps_decoder->cff = cff_decoder->cff;
ps_decoder->cf2_instance = &cff_decoder->cff->cf2_instance;
diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h
index 6773eac..e1f7240 100644
--- a/src/psaux/psobjs.h
+++ b/src/psaux/psobjs.h
@@ -242,9 +242,10 @@ FT_BEGIN_HEADER
/*************************************************************************/
FT_LOCAL( void )
- ps_builder_init( void* builder,
- FT_Bool is_t1,
- PS_Builder* ps_builder );
+ ps_builder_init( PS_Builder* ps_builder,
+ void* builder,
+ FT_Bool is_t1 );
+
FT_LOCAL( void )
ps_builder_done( PS_Builder* builder );