summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:29 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2009-07-03 18:01:29 +0900
commit2faa635ce6324ef825256580f237b6d9e68b1765 (patch)
tree85b2c63cd8e8ae557c8b6a66d6e7bbc0f1c4a952
parent9a3c169704ee7d6c6e379fe43e7e27460096d569 (diff)
downloadfreetype2-2faa635ce6324ef825256580f237b6d9e68b1765.tar.gz
truetype: Extend TT_Face->num_locations for broken TTFs.
-rw-r--r--ChangeLog13
-rw-r--r--include/freetype/internal/tttypes.h2
-rw-r--r--src/truetype/ttpload.c10
3 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2717d728c..b5d4f5b13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+ truetype: Extend TT_Face->num_locations for broken TTFs.
+
+ * include/freetype/internal/tttypes.h:
+ TT_Face->num_locations are extended from FT_UInt
+ to FT_ULong, to stand with broken huge loca table.
+ Some people insists there are broken TTF including
+ the glyphs over 16-bit limitation, in PRC market.
+ * src/truetype/ttpload.c (tt_face_load_loca):
+ Remove unrequired 16-bit truncation for FT_UInt
+ TT_Face->num_locations.
+
+2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
smooth: Fix some data types mismatching with their sources.
* src/smooth/ftgrays.c: The type of `TCoord' is
diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h
index 85fc27f74..737d9329b 100644
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -1401,7 +1401,7 @@ FT_BEGIN_HEADER
FT_Byte* vert_metrics;
FT_ULong vert_metrics_size;
- FT_UInt num_locations;
+ FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
FT_Byte* glyph_locations;
FT_Byte* hdmx_table;
diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c
index f691269d2..a311b03c0 100644
--- a/src/truetype/ttpload.c
+++ b/src/truetype/ttpload.c
@@ -95,7 +95,7 @@
error = TT_Err_Invalid_Table;
goto Exit;
}
- face->num_locations = (FT_UInt)( table_len >> shift );
+ face->num_locations = table_len >> shift;
}
else
{
@@ -107,16 +107,16 @@
error = TT_Err_Invalid_Table;
goto Exit;
}
- face->num_locations = (FT_UInt)( table_len >> shift );
+ face->num_locations = table_len >> shift;
}
- if ( face->num_locations != (FT_UInt)face->root.num_glyphs )
+ if ( face->num_locations != (FT_ULong)face->root.num_glyphs )
{
FT_TRACE2(( "glyph count mismatch! loca: %d, maxp: %d\n",
face->num_locations, face->root.num_glyphs ));
/* we only handle the case where `maxp' gives a larger value */
- if ( face->num_locations < (FT_UInt)face->root.num_glyphs )
+ if ( face->num_locations < (FT_ULong)face->root.num_glyphs )
{
FT_Long new_loca_len = (FT_Long)face->root.num_glyphs << shift;
@@ -139,7 +139,7 @@
if ( new_loca_len <= dist )
{
- face->num_locations = (FT_Long)face->root.num_glyphs;
+ face->num_locations = face->root.num_glyphs;
table_len = new_loca_len;
FT_TRACE2(( "adjusting num_locations to %d\n",