Move `psdecode' into `psobjs'. As the former only contains a single procedure, move it into `psobjs' for simplicity. Also change the parameter order to the conventional one. * src/psaux/psdecode.c (ps_decoder_init): Moved to... * src/psaux/psobjs.c: ...Here. * src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto. * include/freetype/internal/psaux.h (PSAux_ServiceRec): Update `ps_decoder_init' function signature. * src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c: Update calls. * src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes. * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC): Update file references.
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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
diff --git a/ChangeLog b/ChangeLog
index 7961ebe..067ecbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,28 @@
2017-09-25 Ewald Hew <ewaldhew@gmail.com>
+ [psaux] Move `psdecode' into `psobjs'.
+
+ As the former only contains a single procedure, move it into
+ `psobjs' for simplicity. Also change the parameter order to the
+ conventional one.
+
+ * src/psaux/psdecode.c (ps_decoder_init): Moved to...
+ * src/psaux/psobjs.c: ...Here.
+ * src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto.
+
+ * include/freetype/internal/psaux.h (PSAux_ServiceRec): Update
+ `ps_decoder_init' function signature.
+
+ * src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c:
+ Update calls.
+
+ * src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes.
+
+ * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC):
+ Update file references.
+
+2017-09-25 Ewald Hew <ewaldhew@gmail.com>
+
[psaux] Fix Type 1 hinting.
Type 1 hinting breaks sometimes when mid-charstring hints should
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index 7357da4..c287974 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -1286,9 +1286,9 @@ FT_BEGIN_HEADER
(*cff_random)( FT_UInt32 r );
void
- (*ps_decoder_init)( void* decoder,
- FT_Bool is_t1,
- PS_Decoder* ps_decoder );
+ (*ps_decoder_init)( PS_Decoder* ps_decoder,
+ void* decoder,
+ FT_Bool is_t1 );
void
(*t1_make_subfont)( FT_Face face,
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 917fb3a..9a2080b 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -435,7 +435,7 @@
else
#endif
{
- psaux->ps_decoder_init( &decoder, FALSE, &psdecoder );
+ psaux->ps_decoder_init( &psdecoder, &decoder, FALSE );
error = decoder_funcs->parse_charstrings( &psdecoder,
charstring,
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 9f47dcd..2194151 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -187,7 +187,7 @@
CFF_SubFontRec subfont;
- psaux->ps_decoder_init( decoder, TRUE, &psdecoder );
+ psaux->ps_decoder_init( &psdecoder, decoder, TRUE );
psaux->t1_make_subfont( FT_FACE( face ), &dict->private_dict, &subfont );
psdecoder.current_subfont = &subfont;
diff --git a/src/psaux/Jamfile b/src/psaux/Jamfile
index ab861e6..0e5944d 100644
--- a/src/psaux/Jamfile
+++ b/src/psaux/Jamfile
@@ -23,7 +23,6 @@ SubDir FT2_TOP $(FT2_SRC_DIR) psaux ;
t1cmap
t1decode
cffdecode
- psdecode
psarrst
psblues
pserror
diff --git a/src/psaux/psaux.c b/src/psaux/psaux.c
index 8c9e633..e30c9b0 100644
--- a/src/psaux/psaux.c
+++ b/src/psaux/psaux.c
@@ -26,7 +26,6 @@
#include "t1cmap.c"
#include "t1decode.c"
#include "cffdecode.c"
-#include "psdecode.c"
#include "psarrst.c"
#include "psblues.c"
diff --git a/src/psaux/psauxmod.c b/src/psaux/psauxmod.c
index b071929..fea60ce 100644
--- a/src/psaux/psauxmod.c
+++ b/src/psaux/psauxmod.c
@@ -23,7 +23,6 @@
#include "t1cmap.h"
#include "psft.h"
#include "cffdecode.h"
-#include "psdecode.h"
#ifndef T1_CONFIG_OPTION_NO_AFM
#include "afmparse.h"
diff --git a/src/psaux/psdecode.c b/src/psaux/psdecode.c
deleted file mode 100644
index c8a5d01..0000000
--- a/src/psaux/psdecode.c
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_SERVICE_H
-
-#include "psdecode.h"
-#include "psobjs.h"
-
-#include "psauxerr.h"
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ps_decoder_init */
- /* */
- /* <Description> */
- /* Creates a decoder for the combined Type 1 / CFF interpreter. */
- /* */
- /* <InOut> */
- /* decoder :: A pointer to the glyph builder to initialize. */
- /* */
- /* <Input> */
- /* */
- /* */
- /* */
- /* */
- /* */
- FT_LOCAL_DEF( void )
- ps_decoder_init( void* decoder,
- FT_Bool is_t1,
- PS_Decoder* ps_decoder )
- {
- FT_ZERO( ps_decoder );
-
- if ( is_t1 )
- {
- T1_Decoder t1_decoder = (T1_Decoder)decoder;
-
- ps_builder_init( &t1_decoder->builder,
- is_t1,
- &ps_decoder->builder );
-
- ps_decoder->cf2_instance = &t1_decoder->cf2_instance;
- ps_decoder->psnames = t1_decoder->psnames;
-
- ps_decoder->num_glyphs = t1_decoder->num_glyphs;
- ps_decoder->glyph_names = t1_decoder->glyph_names;
- ps_decoder->hint_mode = t1_decoder->hint_mode;
- ps_decoder->blend = t1_decoder->blend;
-
- ps_decoder->num_locals = t1_decoder->num_subrs;
- ps_decoder->locals = t1_decoder->subrs;
- ps_decoder->locals_len = t1_decoder->subrs_len;
- ps_decoder->locals_hash = t1_decoder->subrs_hash;
-
- ps_decoder->buildchar = t1_decoder->buildchar;
- ps_decoder->len_buildchar = t1_decoder->len_buildchar;
-
- ps_decoder->lenIV = t1_decoder->lenIV;
- }
- else
- {
- CFF_Decoder* cff_decoder = (CFF_Decoder*)decoder;
-
- ps_builder_init( &cff_decoder->builder,
- is_t1,
- &ps_decoder->builder );
-
- ps_decoder->cff = cff_decoder->cff;
- ps_decoder->cf2_instance = &cff_decoder->cff->cf2_instance;
- ps_decoder->current_subfont = cff_decoder->current_subfont;
-
- ps_decoder->num_globals = cff_decoder->num_globals;
- ps_decoder->globals = cff_decoder->globals;
- ps_decoder->globals_bias = cff_decoder->globals_bias;
- ps_decoder->num_locals = cff_decoder->num_locals;
- ps_decoder->locals = cff_decoder->locals;
- ps_decoder->locals_bias = cff_decoder->locals_bias;
-
- ps_decoder->glyph_width = cff_decoder->glyph_width;
- ps_decoder->nominal_width = cff_decoder->nominal_width;
- ps_decoder->width_only = cff_decoder->width_only;
-
- ps_decoder->hint_mode = cff_decoder->hint_mode;
-
- ps_decoder->get_glyph_callback = cff_decoder->get_glyph_callback;
- ps_decoder->free_glyph_callback = cff_decoder->free_glyph_callback;
- }
- }
-
diff --git a/src/psaux/psdecode.h b/src/psaux/psdecode.h
deleted file mode 100644
index dd7e6f2..0000000
--- a/src/psaux/psdecode.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef PSDECODE_H_
-#define PSDECODE_H_
-
-
-#include <ft2build.h>
-#include FT_INTERNAL_POSTSCRIPT_AUX_H
-
-
-FT_BEGIN_HEADER
-
- FT_LOCAL( void )
- ps_decoder_init( void* decoder,
- FT_Bool is_t1,
- PS_Decoder* ps_decoder );
-
-
-FT_END_HEADER
-
-#endif
-
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index b592163..d643afe 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -2328,6 +2328,87 @@
/*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ps_decoder_init */
+ /* */
+ /* <Description> */
+ /* Creates a wrapper decoder for use in the combined */
+ /* Type 1 / CFF interpreter. */
+ /* */
+ /* <InOut> */
+ /* ps_decoder :: A pointer to the decoder to initialize. */
+ /* */
+ /* <Input> */
+ /* decoder :: A pointer to the original decoder. */
+ /* */
+ /* is_t1 :: Flag indicating Type 1 or CFF */
+ /* */
+ FT_LOCAL_DEF( void )
+ ps_decoder_init( PS_Decoder* ps_decoder,
+ void* decoder,
+ FT_Bool is_t1 )
+ {
+ FT_ZERO( ps_decoder );
+
+ if ( is_t1 )
+ {
+ T1_Decoder t1_decoder = (T1_Decoder)decoder;
+
+ ps_builder_init( &t1_decoder->builder,
+ is_t1,
+ &ps_decoder->builder );
+
+ ps_decoder->cf2_instance = &t1_decoder->cf2_instance;
+ ps_decoder->psnames = t1_decoder->psnames;
+
+ ps_decoder->num_glyphs = t1_decoder->num_glyphs;
+ ps_decoder->glyph_names = t1_decoder->glyph_names;
+ ps_decoder->hint_mode = t1_decoder->hint_mode;
+ ps_decoder->blend = t1_decoder->blend;
+
+ ps_decoder->num_locals = t1_decoder->num_subrs;
+ ps_decoder->locals = t1_decoder->subrs;
+ ps_decoder->locals_len = t1_decoder->subrs_len;
+ ps_decoder->locals_hash = t1_decoder->subrs_hash;
+
+ ps_decoder->buildchar = t1_decoder->buildchar;
+ ps_decoder->len_buildchar = t1_decoder->len_buildchar;
+
+ ps_decoder->lenIV = t1_decoder->lenIV;
+ }
+ else
+ {
+ CFF_Decoder* cff_decoder = (CFF_Decoder*)decoder;
+
+ ps_builder_init( &cff_decoder->builder,
+ is_t1,
+ &ps_decoder->builder );
+
+ ps_decoder->cff = cff_decoder->cff;
+ ps_decoder->cf2_instance = &cff_decoder->cff->cf2_instance;
+ ps_decoder->current_subfont = cff_decoder->current_subfont;
+
+ ps_decoder->num_globals = cff_decoder->num_globals;
+ ps_decoder->globals = cff_decoder->globals;
+ ps_decoder->globals_bias = cff_decoder->globals_bias;
+ ps_decoder->num_locals = cff_decoder->num_locals;
+ ps_decoder->locals = cff_decoder->locals;
+ ps_decoder->locals_bias = cff_decoder->locals_bias;
+
+ ps_decoder->glyph_width = cff_decoder->glyph_width;
+ ps_decoder->nominal_width = cff_decoder->nominal_width;
+ ps_decoder->width_only = cff_decoder->width_only;
+
+ ps_decoder->hint_mode = cff_decoder->hint_mode;
+
+ ps_decoder->get_glyph_callback = cff_decoder->get_glyph_callback;
+ ps_decoder->free_glyph_callback = cff_decoder->free_glyph_callback;
+ }
+ }
+
+
FT_LOCAL_DEF( void )
t1_make_subfont( FT_Face face,
PS_Private priv,
diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h
index aed19de..6773eac 100644
--- a/src/psaux/psobjs.h
+++ b/src/psaux/psobjs.h
@@ -285,6 +285,11 @@ FT_BEGIN_HEADER
/*************************************************************************/
FT_LOCAL( void )
+ ps_decoder_init( PS_Decoder* ps_decoder,
+ void* decoder,
+ FT_Bool is_t1 );
+
+ FT_LOCAL( void )
t1_make_subfont( FT_Face face,
PS_Private priv,
CFF_SubFont subfont );
diff --git a/src/psaux/rules.mk b/src/psaux/rules.mk
index 55a835f..266d446 100644
--- a/src/psaux/rules.mk
+++ b/src/psaux/rules.mk
@@ -36,7 +36,6 @@ PSAUX_DRV_SRC := $(PSAUX_DIR)/psobjs.c \
$(PSAUX_DIR)/psauxmod.c \
$(PSAUX_DIR)/psarrst.c \
$(PSAUX_DIR)/psblues.c \
- $(PSAUX_DIR)/psdecode.c \
$(PSAUX_DIR)/pserror.c \
$(PSAUX_DIR)/psfont.c \
$(PSAUX_DIR)/psft.c \
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 6e5d3e8..e5f88d0 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -110,7 +110,7 @@
CFF_SubFontRec subfont;
- psaux->ps_decoder_init( decoder, TRUE, &psdecoder );
+ psaux->ps_decoder_init( &psdecoder, decoder, TRUE );
psaux->t1_make_subfont( FT_FACE( face ), &face->type1.private_dict, &subfont );
psdecoder.current_subfont = &subfont;