summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:30 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:30 +0900
commitd22f5a532a892c277605528c3dc1879bf05ce183 (patch)
treee631cda849802af047c614d02111ab1fce994f3a
parent2faa635ce6324ef825256580f237b6d9e68b1765 (diff)
downloadfreetype2-d22f5a532a892c277605528c3dc1879bf05ce183.tar.gz
XXX_cmap_encoding_char_next() return FT_UInt32 values.
-rw-r--r--ChangeLog36
-rw-r--r--include/freetype/internal/services/svpscmap.h2
-rw-r--r--src/cff/cffcmap.c4
-rw-r--r--src/pfr/pfrcmap.c2
-rw-r--r--src/psaux/t1cmap.c6
-rw-r--r--src/psnames/psmodule.c2
-rw-r--r--src/sfnt/ttcmap.c36
-rw-r--r--src/winfonts/winfnt.c2
8 files changed, 63 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index b5d4f5b13..95eafbce3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,41 @@
2009-07-03 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-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
truetype: Extend TT_Face->num_locations for broken TTFs.
* include/freetype/internal/tttypes.h:
diff --git a/include/freetype/internal/services/svpscmap.h b/include/freetype/internal/services/svpscmap.h
index 60f4079b6..961030cc3 100644
--- a/include/freetype/internal/services/svpscmap.h
+++ b/include/freetype/internal/services/svpscmap.h
@@ -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 );
diff --git a/src/cff/cffcmap.c b/src/cff/cffcmap.c
index 297e4dbdd..46d603e3a 100644
--- a/src/cff/cffcmap.c
+++ b/src/cff/cffcmap.c
@@ -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 )
{
diff --git a/src/pfr/pfrcmap.c b/src/pfr/pfrcmap.c
index 7046b391e..9c8f9ed8e 100644
--- a/src/pfr/pfrcmap.c
+++ b/src/pfr/pfrcmap.c
@@ -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 )
{
diff --git a/src/psaux/t1cmap.c b/src/psaux/t1cmap.c
index 67a23db56..bbe75cb36 100644
--- a/src/psaux/t1cmap.c
+++ b/src/psaux/t1cmap.c
@@ -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 )
{
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c
index 3a7d27ee4..351885049 100644
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -437,7 +437,7 @@
}
- static FT_ULong
+ static FT_UInt32
ps_unicodes_char_next( PS_Unicodes table,
FT_UInt32 *unicode )
{
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 07fe318eb..a111741c7 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -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;
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 0f254e9dc..6b3a4e17f 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -619,7 +619,7 @@
}
- static FT_UInt
+ static FT_UInt32
fnt_cmap_char_next( FNT_CMap cmap,
FT_UInt32 *pchar_code )
{