* src/psaux/t1cmap.c: s/index/idx/.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix debug messages.
This commit is contained in:
parent
1987fb2f72
commit
545a75fdd7
|
@ -5,6 +5,13 @@
|
|||
2002-03-31 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/otlayout/otlcommn.c, src/otlayout/otlcommn.h: s/index/idx/.
|
||||
* src/psaux/t1cmap.c: Ditto.
|
||||
|
||||
* include/freetype/internal/tttypes.h,
|
||||
include/freetype/internal/sfnt.h (TT_Goto_Table_Func): Renamed to ...
|
||||
(TT_Loader_GotoTableFunc): This.
|
||||
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix debug
|
||||
messages.
|
||||
|
||||
2002-03-30 David Turner <david@freetype.org>
|
||||
|
||||
|
|
|
@ -471,7 +471,7 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
typedef struct SFNT_Interface_
|
||||
{
|
||||
TT_Goto_Table_Func goto_table;
|
||||
TT_Loader_GotoTableFunc goto_table;
|
||||
|
||||
TT_Init_Face_Func init_face;
|
||||
TT_Load_Face_Func load_face;
|
||||
|
|
|
@ -1165,7 +1165,7 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Goto_Table_Func */
|
||||
/* TT_Loader_GotoTableFunc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Seeks a stream to the start of a given TrueType table. */
|
||||
|
@ -1188,7 +1188,7 @@ FT_BEGIN_HEADER
|
|||
/* The stream cursor must be at the font file's origin. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Goto_Table_Func)( TT_Face face,
|
||||
(*TT_Loader_GotoTableFunc)( TT_Face face,
|
||||
FT_ULong tag,
|
||||
FT_Stream stream,
|
||||
FT_ULong* length );
|
||||
|
@ -1493,7 +1493,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
#endif /* !FT_CONFIG_OPTION_USE_CMAPS */
|
||||
|
||||
TT_Goto_Table_Func goto_table;
|
||||
TT_Loader_GotoTableFunc goto_table;
|
||||
|
||||
TT_Loader_StartGlyphFunc access_glyph_frame;
|
||||
TT_Loader_EndGlyphFunc forget_glyph_frame;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# FreeType 2 src/psaux Jamfile (c) 2001 David Turner
|
||||
# FreeType 2 src/psaux Jamfile (c) 2001, 2002 David Turner
|
||||
#
|
||||
|
||||
SubDir FT2_TOP src psaux ;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 2001 by
|
||||
# Copyright 2001, 2002 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType auxiliary PostScript driver component (body only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType auxiliary PostScript module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Auxiliary functions for PostScript fonts (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -200,7 +200,8 @@
|
|||
/* PS_Table_Done */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Finalizes a PS_TableRec (i.e., reallocate it to its current cursor). */
|
||||
/* Finalizes a PS_TableRec (i.e., reallocate it to its current */
|
||||
/* cursor). */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* table :: The target table. */
|
||||
|
@ -919,6 +920,7 @@
|
|||
FT_Byte* old_limit;
|
||||
T1_FieldRec fieldrec = *(T1_Field)field;
|
||||
|
||||
|
||||
#if 1
|
||||
fieldrec.type = T1_FIELD_TYPE_INTEGER;
|
||||
if ( field->type == T1_FIELD_TYPE_FIXED_ARRAY )
|
||||
|
@ -1070,6 +1072,8 @@
|
|||
/* */
|
||||
/* glyph :: The current glyph object. */
|
||||
/* */
|
||||
/* hinting :: Whether hinting should be applied. */
|
||||
/* */
|
||||
FT_LOCAL_DEF( void )
|
||||
T1_Builder_Init( T1_Builder builder,
|
||||
FT_Face face,
|
||||
|
@ -1143,7 +1147,7 @@
|
|||
}
|
||||
|
||||
|
||||
/* check that there is enough room for `count' more points */
|
||||
/* check that there is enough space for `count' more points */
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
T1_Builder_Check_Points( T1_Builder builder,
|
||||
FT_Int count )
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Auxiliary functions for PostScript fonts (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000 by
|
||||
# Copyright 1996-2000, 2002 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -1,15 +1,34 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* t1cmap.c */
|
||||
/* */
|
||||
/* Type 1 character map support (body). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include "t1cmap.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h> /* for qsort() */
|
||||
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/
|
||||
/***** *****/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
static void
|
||||
t1_cmap_std_init( T1_CMapStd cmap,
|
||||
|
@ -18,6 +37,7 @@
|
|||
T1_Face face = (T1_Face)FT_CMAP_FACE( cmap );
|
||||
PSNames_Service psnames = (PSNames_Service)face->psnames;
|
||||
|
||||
|
||||
cmap->num_glyphs = face->type1.num_glyphs;
|
||||
cmap->glyph_names = (const char* const*)face->type1.glyph_names;
|
||||
cmap->sid_to_string = psnames->adobe_std_strings;
|
||||
|
@ -44,13 +64,15 @@
|
|||
{
|
||||
FT_UInt result = 0;
|
||||
|
||||
|
||||
if ( char_code < 256 )
|
||||
{
|
||||
FT_UInt code, n;
|
||||
const char* glyph_name;
|
||||
|
||||
/* conver character code to Adobe SID string */
|
||||
code = cmap->code_to_sid[ char_code ];
|
||||
|
||||
/* convert character code to Adobe SID string */
|
||||
code = cmap->code_to_sid[char_code];
|
||||
glyph_name = cmap->sid_to_string( code );
|
||||
|
||||
/* look for the corresponding glyph name */
|
||||
|
@ -58,6 +80,7 @@
|
|||
{
|
||||
const char* gname = cmap->glyph_names[n];
|
||||
|
||||
|
||||
if ( gname && gname[0] == glyph_name[0] &&
|
||||
strcmp( gname, glyph_name ) == 0 )
|
||||
{
|
||||
|
@ -66,6 +89,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -77,6 +101,7 @@
|
|||
FT_UInt result = 0;
|
||||
FT_UInt32 char_code = *pchar_code + 1;
|
||||
|
||||
|
||||
while ( char_code < 256 )
|
||||
{
|
||||
result = t1_cmap_std_char_index( cmap, char_code );
|
||||
|
@ -104,17 +129,15 @@
|
|||
FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec
|
||||
t1_cmap_standard_class_rec =
|
||||
{
|
||||
sizeof( T1_CMapStdRec ),
|
||||
sizeof ( T1_CMapStdRec ),
|
||||
|
||||
(FT_CMap_InitFunc) t1_cmap_standard_init,
|
||||
(FT_CMap_DoneFunc) t1_cmap_std_done,
|
||||
(FT_CMap_CharIndexFunc) t1_cmap_std_char_index,
|
||||
(FT_CMap_CharIndexFunc)t1_cmap_std_char_index,
|
||||
(FT_CMap_CharNextFunc) t1_cmap_std_char_next
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
t1_cmap_expert_init( T1_CMapStd cmap )
|
||||
{
|
||||
|
@ -125,34 +148,33 @@
|
|||
FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec
|
||||
t1_cmap_expert_class_rec =
|
||||
{
|
||||
sizeof( T1_CMapStdRec ),
|
||||
sizeof ( T1_CMapStdRec ),
|
||||
|
||||
(FT_CMap_InitFunc) t1_cmap_expert_init,
|
||||
(FT_CMap_DoneFunc) t1_cmap_std_done,
|
||||
(FT_CMap_CharIndexFunc) t1_cmap_std_char_index,
|
||||
(FT_CMap_CharIndexFunc)t1_cmap_std_char_index,
|
||||
(FT_CMap_CharNextFunc) t1_cmap_std_char_next
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE1 CUSTOM ENCODING CMAP *****/
|
||||
/***** *****/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
t1_cmap_custom_init( T1_CMapCustom cmap )
|
||||
{
|
||||
T1_Face face = (T1_Face) FT_CMAP_FACE(cmap);
|
||||
T1_Face face = (T1_Face)FT_CMAP_FACE( cmap );
|
||||
T1_Encoding encoding = &face->type1.encoding;
|
||||
|
||||
|
||||
cmap->first = encoding->code_first;
|
||||
cmap->count = (FT_UInt)(encoding->code_last - cmap->first + 1);
|
||||
cmap->count = (FT_UInt)( encoding->code_last - cmap->first + 1 );
|
||||
cmap->indices = encoding->char_index;
|
||||
|
||||
FT_ASSERT( cmap->indices != NULL );
|
||||
|
@ -176,11 +198,12 @@
|
|||
FT_UInt32 char_code )
|
||||
{
|
||||
FT_UInt result = 0;
|
||||
FT_UInt32 index;
|
||||
FT_UInt32 idx;
|
||||
|
||||
index = (FT_UInt32)( char_code - cmap->first );
|
||||
if ( index < cmap->count )
|
||||
result = cmap->indices[ index ];
|
||||
|
||||
idx = (FT_UInt32)( char_code - cmap->first );
|
||||
if ( idx < cmap->count )
|
||||
result = cmap->indices[idx];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -192,17 +215,18 @@
|
|||
{
|
||||
FT_UInt result = 0;
|
||||
FT_UInt32 char_code = *pchar_code;
|
||||
FT_UInt32 index;
|
||||
FT_UInt32 idx;
|
||||
|
||||
|
||||
++char_code;
|
||||
|
||||
if ( char_code < cmap->first )
|
||||
char_code = cmap->first;
|
||||
|
||||
index = (FT_UInt32)( char_code - cmap->first );
|
||||
for ( ; index < cmap->count; index++, char_code++ )
|
||||
idx = (FT_UInt32)( char_code - cmap->first );
|
||||
for ( ; idx < cmap->count; idx++, char_code++ )
|
||||
{
|
||||
result = cmap->indices[index];
|
||||
result = cmap->indices[idx];
|
||||
if ( result != 0 )
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -218,23 +242,22 @@
|
|||
FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec
|
||||
t1_cmap_custom_class_rec =
|
||||
{
|
||||
sizeof( T1_CMapCustomRec ),
|
||||
sizeof ( T1_CMapCustomRec ),
|
||||
|
||||
(FT_CMap_InitFunc) t1_cmap_custom_init,
|
||||
(FT_CMap_DoneFunc) t1_cmap_custom_done,
|
||||
(FT_CMap_CharIndexFunc) t1_cmap_custom_char_index,
|
||||
(FT_CMap_CharIndexFunc)t1_cmap_custom_char_index,
|
||||
(FT_CMap_CharNextFunc) t1_cmap_custom_char_next
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/
|
||||
/***** *****/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
FT_CALLBACK_DEF( FT_Int )
|
||||
t1_cmap_uni_pair_compare( const void* pair1,
|
||||
|
@ -243,6 +266,7 @@
|
|||
FT_UInt32 u1 = ((T1_CMapUniPair)pair1)->unicode;
|
||||
FT_UInt32 u2 = ((T1_CMapUniPair)pair2)->unicode;
|
||||
|
||||
|
||||
if ( u1 < u2 )
|
||||
return -1;
|
||||
|
||||
|
@ -253,7 +277,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
t1_cmap_unicode_init( T1_CMapUnicode cmap )
|
||||
{
|
||||
|
@ -281,6 +304,7 @@
|
|||
{
|
||||
const char* gname = face->type1.glyph_names[n];
|
||||
|
||||
|
||||
/* build unsorted pair table by matching glyph names */
|
||||
if ( gname )
|
||||
{
|
||||
|
@ -298,15 +322,15 @@
|
|||
new_count = (FT_UInt)( pair - cmap->pairs );
|
||||
if ( new_count == 0 )
|
||||
{
|
||||
/* there are no unicode characters in here !! */
|
||||
/* there are no unicode characters in here! */
|
||||
FT_FREE( cmap->pairs );
|
||||
error = FT_Err_Invalid_Argument;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* re-allocate if the new array is much smaller than the original */
|
||||
/* one.. */
|
||||
if ( new_count != count && new_count < count/2 )
|
||||
/* one */
|
||||
if ( new_count != count && new_count < count / 2 )
|
||||
{
|
||||
(void)FT_RENEW_ARRAY( cmap->pairs, count, new_count );
|
||||
error = 0;
|
||||
|
@ -315,7 +339,7 @@
|
|||
/* sort the pairs table to allow efficient binary searches */
|
||||
qsort( cmap->pairs,
|
||||
new_count,
|
||||
sizeof(T1_CMapUniPairRec),
|
||||
sizeof ( T1_CMapUniPairRec ),
|
||||
t1_cmap_uni_pair_compare );
|
||||
|
||||
cmap->num_pairs = new_count;
|
||||
|
@ -337,7 +361,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_UInt )
|
||||
t1_cmap_unicode_char_index( T1_CMapUnicode cmap,
|
||||
FT_UInt32 char_code )
|
||||
|
@ -347,16 +370,17 @@
|
|||
FT_UInt mid;
|
||||
T1_CMapUniPair pair;
|
||||
|
||||
|
||||
while ( min < max )
|
||||
{
|
||||
mid = min + (max - min)/2;
|
||||
mid = min + ( max - min ) / 2;
|
||||
pair = cmap->pairs + mid;
|
||||
|
||||
if ( pair->unicode == char_code )
|
||||
return pair->gindex;
|
||||
|
||||
if ( pair->unicode < char_code )
|
||||
min = mid+1;
|
||||
min = mid + 1;
|
||||
else
|
||||
max = mid;
|
||||
}
|
||||
|
@ -371,6 +395,7 @@
|
|||
FT_UInt result = 0;
|
||||
FT_UInt32 char_code = *pchar_code + 1;
|
||||
|
||||
|
||||
Restart:
|
||||
{
|
||||
FT_UInt min = 0;
|
||||
|
@ -378,9 +403,10 @@
|
|||
FT_UInt mid;
|
||||
T1_CMapUniPair pair;
|
||||
|
||||
|
||||
while ( min < max )
|
||||
{
|
||||
mid = min + ((max - min) >> 1);
|
||||
mid = min + ( ( max - min ) >> 1 );
|
||||
pair = cmap->pairs + mid;
|
||||
|
||||
if ( pair->unicode == char_code )
|
||||
|
@ -420,12 +446,13 @@
|
|||
FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec
|
||||
t1_cmap_unicode_class_rec =
|
||||
{
|
||||
sizeof( T1_CMapUnicodeRec ),
|
||||
sizeof ( T1_CMapUnicodeRec ),
|
||||
|
||||
(FT_CMap_InitFunc) t1_cmap_unicode_init,
|
||||
(FT_CMap_DoneFunc) t1_cmap_unicode_done,
|
||||
(FT_CMap_CharIndexFunc) t1_cmap_unicode_char_index,
|
||||
(FT_CMap_CharIndexFunc)t1_cmap_unicode_char_index,
|
||||
(FT_CMap_CharNextFunc) t1_cmap_unicode_char_next
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1,5 +1,23 @@
|
|||
#ifndef __FT_TYPE1_CMAP_H__
|
||||
#define __FT_TYPE1_CMAP_H__
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* t1cmap.h */
|
||||
/* */
|
||||
/* Type 1 character map support (specification). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __T1CMAP_H__
|
||||
#define __T1CMAP_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
@ -8,13 +26,14 @@
|
|||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/
|
||||
/***** *****/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* standard (and expert) encoding cmaps */
|
||||
typedef struct T1_CMapStdRec_* T1_CMapStd;
|
||||
|
@ -38,13 +57,14 @@ FT_BEGIN_HEADER
|
|||
FT_CALLBACK_TABLE const FT_CMap_ClassRec
|
||||
t1_cmap_expert_class_rec;
|
||||
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE1 CUSTOM ENCODING CMAP *****/
|
||||
/***** *****/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct T1_CMapCustomRec_* T1_CMapCustom;
|
||||
|
||||
|
@ -57,16 +77,18 @@ FT_BEGIN_HEADER
|
|||
|
||||
} T1_CMapCustomRec;
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE const FT_CMap_ClassRec
|
||||
t1_cmap_custom_class_rec;
|
||||
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/
|
||||
/***** *****/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* unicode (syntehtic) cmaps */
|
||||
typedef struct T1_CMapUnicodeRec_* T1_CMapUnicode;
|
||||
|
@ -93,6 +115,10 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_TYPE1_CMAP_H__ */
|
||||
#endif /* __T1CMAP_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* PostScript Type 1 decoding routines (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -70,6 +70,7 @@
|
|||
|
||||
} T1_Operator;
|
||||
|
||||
|
||||
static
|
||||
const FT_Int t1_args_count[op_max] =
|
||||
{
|
||||
|
@ -289,7 +290,7 @@
|
|||
decoder->builder.left_bearing = left_bearing;
|
||||
decoder->builder.advance = advance;
|
||||
|
||||
/* XXX: old code doesn't work with postscript hinter */
|
||||
/* XXX: old code doesn't work with PostScript hinter */
|
||||
#if 0
|
||||
/* Finally, move the accent */
|
||||
if ( decoder->builder.load_points )
|
||||
|
@ -360,7 +361,7 @@
|
|||
|
||||
builder->path_begun = 0;
|
||||
|
||||
hinter = (T1_Hints_Funcs) builder->hints_funcs;
|
||||
hinter = (T1_Hints_Funcs)builder->hints_funcs;
|
||||
|
||||
zone->base = charstring_base;
|
||||
limit = zone->limit = charstring_base + charstring_len;
|
||||
|
@ -448,7 +449,7 @@
|
|||
case 12:
|
||||
if ( ip > limit )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invalid escape (12+EOF)\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -484,7 +485,7 @@
|
|||
break;
|
||||
|
||||
default:
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invalid escape (12+%d)\n",
|
||||
ip[-1] ));
|
||||
goto Syntax_Error;
|
||||
|
@ -494,7 +495,7 @@
|
|||
case 255: /* four bytes integer */
|
||||
if ( ip + 4 > limit )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"unexpected EOF in integer\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -515,7 +516,7 @@
|
|||
{
|
||||
if ( ++ip > limit )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: " ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: " ));
|
||||
FT_ERROR(( "unexpected EOF in integer\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -528,7 +529,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invalid byte (%d)\n", ip[-1] ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -543,7 +544,7 @@
|
|||
{
|
||||
if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: stack overflow!\n" ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: stack overflow!\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
|
@ -600,7 +601,7 @@
|
|||
if ( decoder->flex_state == 0 ||
|
||||
decoder->num_flex_vectors != 7 )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"unexpected flex end\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -611,7 +612,7 @@
|
|||
ip[2] != 12 || ip[3] != 17 || /* pop */
|
||||
ip[4] != 12 || ip[5] != 33 ) /* setcurpoint */
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invalid flex charstring\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -627,14 +628,14 @@
|
|||
/* eat the following `pop' */
|
||||
if ( ip + 2 > limit )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invalid escape (12+%d)\n", ip[-1] ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
if ( ip[0] != 12 || ip[1] != 17 )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: " ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: " ));
|
||||
FT_ERROR(( "`pop' expected, found (%d %d)\n", ip[0], ip[1] ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -665,7 +666,7 @@
|
|||
|
||||
if ( !blend )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: " ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: " ));
|
||||
FT_ERROR(( "unexpected multiple masters operator!\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -673,12 +674,12 @@
|
|||
num_points = top[1] - 13 + ( top[1] == 18 );
|
||||
if ( top[0] != (FT_Int)( num_points * blend->num_designs ) )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: " ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: " ));
|
||||
FT_ERROR(( "incorrect number of mm arguments\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
top -= blend->num_designs*num_points;
|
||||
top -= blend->num_designs * num_points;
|
||||
if ( top < decoder->stack )
|
||||
goto Stack_Underflow;
|
||||
|
||||
|
@ -715,7 +716,7 @@
|
|||
|
||||
default:
|
||||
Unexpected_OtherSubr:
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invalid othersubr [%d %d]!\n", top[0], top[1] ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -927,7 +928,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: division by 0\n" ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: division by 0\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
break;
|
||||
|
@ -942,14 +943,14 @@
|
|||
idx = top[0];
|
||||
if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invalid subrs index\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"too many nested subrs\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -977,7 +978,7 @@
|
|||
|
||||
if ( !zone->base )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"invoking empty subrs!\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -1000,7 +1001,7 @@
|
|||
|
||||
if ( zone <= decoder->zones )
|
||||
{
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: unexpected return\n" ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: unexpected return\n" ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
||||
|
@ -1056,6 +1057,7 @@
|
|||
{
|
||||
FT_Pos dx = orig_x;
|
||||
|
||||
|
||||
top[0] += dx;
|
||||
top[2] += dx;
|
||||
top[4] += dx;
|
||||
|
@ -1066,12 +1068,12 @@
|
|||
case op_setcurrentpoint:
|
||||
FT_TRACE4(( " setcurrentpoint" ));
|
||||
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: " ));
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: " ));
|
||||
FT_ERROR(( "unexpected `setcurrentpoint'\n" ));
|
||||
goto Syntax_Error;
|
||||
|
||||
default:
|
||||
FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
|
||||
FT_ERROR(( "T1_Decoder_Parse_Charstrings: "
|
||||
"unhandled opcode %d\n", op ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -1106,7 +1108,7 @@
|
|||
}
|
||||
|
||||
|
||||
/* initialise T1 decoder */
|
||||
/* initialize T1 decoder */
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
T1_Decoder_Init( T1_Decoder decoder,
|
||||
FT_Face face,
|
||||
|
@ -1135,6 +1137,7 @@
|
|||
|
||||
decoder->psnames = psnames;
|
||||
}
|
||||
|
||||
T1_Builder_Init( &decoder->builder, face, size, slot, hinting );
|
||||
|
||||
decoder->num_glyphs = face->num_glyphs;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* PostScript Type 1 decoding routines (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
Loading…
Reference in New Issue