From 75aae7db173c60bc2c75fe2f191806d53e10a78b Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 12 Jun 2003 07:11:05 +0000 Subject: [PATCH] * src/cid/cidload.c (cid_decrypt): Removed. (cid_read_subrs): Use t1_decrypt from psaux module. * src/cid/cidload.h: Updated. * src/cid/cidgload.c (cid_load_glyph): Use t1_decrypt from psaux module. --- ChangeLog | 8 ++++++++ src/cid/cidgload.c | 21 +++++++++++---------- src/cid/cidload.c | 37 ++++++++++--------------------------- src/cid/cidload.h | 7 +------ 4 files changed, 30 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55540898a..cbab9d47e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2003-06-11 Werner Lemberg + * src/cid/cidload.c (cid_decrypt): Removed. + (cid_read_subrs): Use t1_decrypt from psaux module. + * src/cid/cidload.h: Updated. + * src/cid/cidgload.c (cid_load_glyph): Use t1_decrypt from psaux + module. + +2003-06-10 Werner Lemberg + * src/cid/cidobjs.c: Apply change 2003-05-31 from . Compute style flags. Fix computation of root->height. diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c index 59c2276fc..9d1881092 100644 --- a/src/cid/cidgload.c +++ b/src/cid/cidgload.c @@ -40,15 +40,16 @@ cid_load_glyph( T1_Decoder decoder, FT_UInt glyph_index ) { - CID_Face face = (CID_Face)decoder->builder.face; - CID_FaceInfo cid = &face->cid; - FT_Byte* p; - FT_UInt fd_select; - FT_Stream stream = face->root.stream; - FT_Error error = 0; - FT_Byte* charstring = 0; - FT_Memory memory = face->root.memory; - FT_ULong glyph_length = 0; + CID_Face face = (CID_Face)decoder->builder.face; + CID_FaceInfo cid = &face->cid; + FT_Byte* p; + FT_UInt fd_select; + FT_Stream stream = face->root.stream; + FT_Error error = 0; + FT_Byte* charstring = 0; + FT_Memory memory = face->root.memory; + FT_ULong glyph_length = 0; + PSAux_Service psaux = (PSAux_Service)face->psaux; #ifdef FT_CONFIG_OPTION_INCREMENTAL @@ -145,7 +146,7 @@ /* Decrypt only if lenIV >= 0. */ if ( decoder->lenIV >= 0 ) - cid_decrypt( charstring, glyph_length, 4330 ); + psaux->t1_decrypt( charstring, glyph_length, 4330 ); error = decoder->funcs.parse_charstrings( decoder, charstring + cs_offset, diff --git a/src/cid/cidload.c b/src/cid/cidload.c index 77d76a8fa..14580251b 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -57,24 +57,6 @@ } - FT_LOCAL_DEF( void ) - cid_decrypt( FT_Byte* buffer, - FT_Offset length, - FT_UShort seed ) - { - while ( length > 0 ) - { - FT_Byte plain; - - - plain = (FT_Byte)( *buffer ^ ( seed >> 8 ) ); - seed = (FT_UShort)( ( *buffer + seed ) * 52845U + 22719 ); - *buffer++ = plain; - length--; - } - } - - /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -385,14 +367,15 @@ static FT_Error cid_read_subrs( CID_Face face ) { - CID_FaceInfo cid = &face->cid; - FT_Memory memory = face->root.memory; - FT_Stream stream = face->root.stream; - FT_Error error; - FT_Int n; - CID_Subrs subr; - FT_UInt max_offsets = 0; - FT_ULong* offsets = 0; + CID_FaceInfo cid = &face->cid; + FT_Memory memory = face->root.memory; + FT_Stream stream = face->root.stream; + FT_Error error; + FT_Int n; + CID_Subrs subr; + FT_UInt max_offsets = 0; + FT_ULong* offsets = 0; + PSAux_Service psaux = (PSAux_Service)face->psaux; if ( FT_NEW_ARRAY( face->subrs, cid->num_dicts ) ) @@ -462,7 +445,7 @@ len = offsets[count + 1] - offsets[count]; - cid_decrypt( subr->code[count], len, 4330 ); + psaux->t1_decrypt( subr->code[count], len, 4330 ); } } diff --git a/src/cid/cidload.h b/src/cid/cidload.h index 8fc577db5..a7f4bceab 100644 --- a/src/cid/cidload.h +++ b/src/cid/cidload.h @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 font loader (specification). */ /* */ -/* Copyright 1996-2001, 2002 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -40,11 +40,6 @@ FT_BEGIN_HEADER cid_get_offset( FT_Byte** start, FT_Byte offsize ); - FT_LOCAL( void ) - cid_decrypt( FT_Byte* buffer, - FT_Offset length, - FT_UShort seed ); - FT_LOCAL( FT_Error ) cid_face_open( CID_Face face );