XXX_cmap_encoding_char_next() return FT_UInt32 values.

This commit is contained in:
suzuki toshiya 2009-08-01 00:32:09 +09:00
parent 25dba9cfa8
commit 3f0f2e462b
8 changed files with 63 additions and 27 deletions

View File

@ -1,3 +1,39 @@
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
XXX_cmap_encoding_char_next() return FT_UInt32 values.
* include/freetype/internal/services/svpscmap.h:
The size of the charcode value returned by
the function typed PS_Unicodes_CharNextFunc is
matched with its input charcode value.
* src/cff/cffmap.c (cff_cmap_encoding_char_next,
cff_cmap_unicode_char_next): Ditto.
* src/pfr/pfrmap.c (pfr_cmap_encoding_char_next):
Ditto.
* src/psaux/t1cmap.c (t1_cmap_std_char_next,
t1_cmap_custom_char_next, t1_cmap_unicode_char_next):
Ditto.
* src/psnames/psmodule.c (ps_unicodes_char_next):
Ditto.
* src/winfonts/winfnt.c (fnt_cmap_char_next):
Ditto.
* src/sfnt/ttcmap.c (tt_cmap0_char_next,
tt_cmap2_char_next, tt_cmap4_char_next,
tt_cmap6_char_next, tt_cmap10_char_next,
tt_cmap12_char_next, tt_cmap13_char_next): Ditto.
(tt_cmap14_char_variants): Handle base unicode
codepoint by FT_UInt32 variable to avoid overflow
on 16-bit platforms.
(tt_cmap14_ensure): The type of `num_results' is
extend to FT_UInt32, to cover unsigned 32-bit
`numVarSelectorRecords' in cmap14 table header.
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
truetype: Extend TT_Face->num_locations for broken TTFs.

View File

@ -98,7 +98,7 @@ FT_BEGIN_HEADER
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
FT_UInt32 unicode );
typedef FT_ULong
typedef FT_UInt32
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
FT_UInt32 *unicode );

View File

@ -65,7 +65,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
cff_cmap_encoding_char_next( CFF_CMapStd cmap,
FT_UInt32 *pchar_code )
{
@ -192,7 +192,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
cff_cmap_unicode_char_next( PS_Unicodes unicodes,
FT_UInt32 *pchar_code )
{

View File

@ -88,7 +88,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
pfr_cmap_char_next( PFR_CMap cmap,
FT_UInt32 *pchar_code )
{

View File

@ -95,7 +95,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
t1_cmap_std_char_next( T1_CMapStd cmap,
FT_UInt32 *pchar_code )
{
@ -213,7 +213,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
t1_cmap_custom_char_next( T1_CMapCustom cmap,
FT_UInt32 *pchar_code )
{
@ -312,7 +312,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
t1_cmap_unicode_char_next( PS_Unicodes unicodes,
FT_UInt32 *pchar_code )
{

View File

@ -437,7 +437,7 @@
}
static FT_ULong
static FT_UInt32
ps_unicodes_char_next( PS_Unicodes table,
FT_UInt32 *unicode )
{

View File

@ -125,7 +125,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap0_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -460,7 +460,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap2_char_next( TT_CMap cmap,
FT_UInt32 *pcharcode )
{
@ -737,7 +737,7 @@
if ( cmap->cur_charcode >= 0xFFFFUL )
goto Fail;
charcode = cmap->cur_charcode + 1;
charcode = (FT_UInt)cmap->cur_charcode + 1;
if ( charcode < cmap->cur_start )
charcode = cmap->cur_start;
@ -1088,7 +1088,7 @@
FT_UInt num_segs2, start, end, offset;
FT_Int delta;
FT_UInt max, min, mid, num_segs;
FT_UInt charcode = *pcharcode;
FT_UInt charcode = (FT_UInt)*pcharcode;
FT_UInt gindex = 0;
FT_Byte* p;
@ -1330,7 +1330,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap4_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -1481,7 +1481,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap6_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -1734,7 +1734,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap8_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -1892,7 +1892,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap10_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -2210,7 +2210,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap12_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -2526,7 +2526,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap13_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -2664,7 +2664,7 @@
* cmap 14 query functions. The data is overwritten
* on each call to these functions.
*/
FT_UInt max_results;
FT_UInt32 max_results;
FT_UInt32* results;
FT_Memory memory;
@ -2685,10 +2685,10 @@
static FT_Error
tt_cmap14_ensure( TT_CMap14 cmap,
FT_UInt num_results,
FT_UInt32 num_results,
FT_Memory memory )
{
FT_UInt old_max = cmap->max_results;
FT_UInt32 old_max = cmap->max_results;
FT_Error error = 0;
@ -2834,7 +2834,7 @@
}
FT_CALLBACK_DEF( FT_UInt )
FT_CALLBACK_DEF( FT_UInt32 )
tt_cmap14_char_next( TT_CMap cmap,
FT_UInt32 *pchar_code )
{
@ -3027,10 +3027,10 @@
FT_Memory memory )
{
TT_CMap14 cmap14 = (TT_CMap14)cmap;
FT_UInt count = cmap14->num_selectors;
FT_UInt32 count = cmap14->num_selectors;
FT_Byte* p = cmap->data + 10;
FT_UInt32* result;
FT_UInt i;
FT_UInt32 i;
if ( tt_cmap14_ensure( cmap14, ( count + 1 ), memory ) )
@ -3054,7 +3054,7 @@
FT_ULong charCode )
{
TT_CMap14 cmap14 = (TT_CMap14) cmap;
FT_UInt count = cmap14->num_selectors;
FT_UInt32 count = cmap14->num_selectors;
FT_Byte* p = cmap->data + 10;
FT_UInt32* q;
@ -3123,7 +3123,7 @@
for ( q = cmap14->results; numRanges > 0; --numRanges )
{
FT_UInt uni = TT_NEXT_UINT24( p );
FT_UInt32 uni = TT_NEXT_UINT24( p );
cnt = FT_NEXT_BYTE( p ) + 1;

View File

@ -619,7 +619,7 @@
}
static FT_UInt
static FT_UInt32
fnt_cmap_char_next( FNT_CMap cmap,
FT_UInt32 *pchar_code )
{