* 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.
This commit is contained in:
Werner Lemberg 2003-06-12 07:11:05 +00:00
parent e398340da1
commit 3064272c4c
4 changed files with 30 additions and 43 deletions

View File

@ -1,5 +1,13 @@
2003-06-11 Werner Lemberg <wl@gnu.org>
* 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 <wl@gnu.org>
* src/cid/cidobjs.c: Apply change 2003-05-31 from <Ron.Dev@gmx.de>.
Compute style flags.
Fix computation of root->height.

View File

@ -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,

View File

@ -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 );
}
}

View File

@ -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 );