* src/cid/cidload.c (cid_parse_dict): Skip token if no keyword is

found.

* src/type1/t1parse.c (IS_T1_WHITESPACE, IS_T1_LINESPACE,
IS_T1_SPACE): Removed.
(PFB_Tag): Removed.
(read_pfb_tag): Don't use PFB_Tag.

* src/type42/t42parse.c (t42_is_space): Handle `\f' also.
(t42_parse_encoding): Handle synthetic fonts.
This commit is contained in:
Werner Lemberg 2003-09-30 06:43:54 +00:00
parent f4c0b921a1
commit 3864f4eae9
4 changed files with 48 additions and 41 deletions

View File

@ -1,3 +1,16 @@
2003-09-30 Werner Lemberg <wl@gnu.org>
* src/cid/cidload.c (cid_parse_dict): Skip token if no keyword is
found.
* src/type1/t1parse.c (IS_T1_WHITESPACE, IS_T1_LINESPACE,
IS_T1_SPACE): Removed.
(PFB_Tag): Removed.
(read_pfb_tag): Don't use PFB_Tag.
* src/type42/t42parse.c (t42_is_space): Handle `\f' also.
(t42_parse_encoding): Handle synthetic fonts.
2003-09-29 Werner Lemberg <wl@gnu.org>
* include/freetype/internal/t1types.h: Don't include

View File

@ -191,7 +191,7 @@
offset->y = temp[5] >> 16;
}
return CID_Err_Ok; /* this is a callback function; */
return CID_Err_Ok; /* this is a callback function; */
/* we must return an error code */
}
@ -265,7 +265,7 @@
FT_Byte* limit = cur + size;
for ( ;cur < limit; cur++ )
for ( ; cur < limit; cur++ )
{
/* look for `%ADOBeginFontDict' */
if ( *cur == '%' && cur + 20 < limit &&
@ -281,7 +281,7 @@
/* look for immediates */
else if ( *cur == '/' && cur + 2 < limit )
{
FT_Int len;
FT_PtrDist len;
cur++;
@ -289,11 +289,11 @@
parser->root.cursor = cur;
cid_parser_skip_alpha( parser );
len = (FT_Int)( parser->root.cursor - cur );
len = parser->root.cursor - cur;
if ( len > 0 && len < 22 )
{
/* now compare the immediate name to the keyword table */
T1_Field keyword = (T1_Field) cid_field_records;
T1_Field keyword = (T1_Field)cid_field_records;
for (;;)
@ -303,12 +303,15 @@
name = (FT_Byte*)keyword->ident;
if ( !name )
break;
if ( cur[0] == name[0] &&
len == (FT_Int)ft_strlen( (const char*)name ) )
{
FT_Int n;
cid_parser_skip_alpha( parser );
break;
}
if ( cur[0] == name[0] &&
len == ft_strlen( (const char*)name ) )
{
FT_PtrDist n;
for ( n = 1; n < len; n++ )

View File

@ -65,41 +65,28 @@
/*************************************************************************/
#define IS_T1_WHITESPACE( c ) ( (c) == ' ' || (c) == '\t' )
#define IS_T1_LINESPACE( c ) ( (c) == '\r' || (c) == '\n' )
#define IS_T1_SPACE( c ) ( IS_T1_WHITESPACE( c ) || IS_T1_LINESPACE( c ) )
typedef struct PFB_Tag_
static FT_Error
read_pfb_tag( FT_Stream stream,
FT_UShort *atag,
FT_Long *asize )
{
FT_Error error;
FT_UShort tag;
FT_Long size;
} PFB_Tag;
*atag = 0;
*asize = 0;
static FT_Error
read_pfb_tag( FT_Stream stream,
FT_UShort* tag,
FT_Long* size )
{
FT_Error error;
PFB_Tag head;
*tag = 0;
*size = 0;
if ( !FT_READ_USHORT( head.tag ) )
if ( !FT_READ_USHORT( tag ) )
{
if ( head.tag == 0x8001U || head.tag == 0x8002U )
if ( tag == 0x8001U || tag == 0x8002U )
{
if ( !FT_READ_LONG_LE( head.size ) )
*size = head.size;
if ( !FT_READ_LONG_LE( size ) )
*asize = size;
}
*tag = head.tag;
*atag = tag;
}
return error;

View File

@ -158,8 +158,8 @@
/* When creating a new Type 42 parser, we try to locate and load */
/* the base dictionary, loading the whole font into memory. */
/* */
/* When `loading' the base dictionary, we only setup pointers in */
/* the case of a memory-based stream. Otherwise, we allocate */
/* When `loading' the base dictionary, we only set up pointers */
/* in the case of a memory-based stream. Otherwise, we allocate */
/* and load the base dictionary in it. */
/* */
/* parser->in_memory is set if we have a memory stream. */
@ -245,7 +245,7 @@
static int
t42_is_space( FT_Byte c )
{
return ( c == ' ' || c == '\t' || c == '\r' || c == '\n' );
return ( c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f' );
}
@ -327,6 +327,10 @@
FT_Error error;
if ( encode->char_index )
/* with synthetic fonts, it's possible we get here twice */
return;
/* read the number of entries in the encoding, should be 256 */
count = (FT_Int)T1_ToInt( parser );
if ( parser->root.error )
@ -407,14 +411,14 @@
{
/* bingo, we have an immediate name -- it must be a */
/* character name */
FT_Byte* cur2 = cur + 1;
FT_Int len;
FT_Byte* cur2 = cur + 1;
FT_PtrDist len;
while ( cur2 < limit && t42_is_alpha( *cur2 ) )
cur2++;
len = (FT_Int)( cur2 - cur - 1 );
len = cur2 - cur - 1;
parser->root.error = T1_Add_Table( char_table, charcode,
cur + 1, len + 1 );