aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/cff/cffparse.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-08-06 10:14:25 +0000
committermarha <marha@users.sourceforge.net>2010-08-06 10:14:25 +0000
commit47ed6413ce8f2586b8d542dc46055e075a47022e (patch)
treeb814efb2655c444a4f63ac3cbb7d0cdf4bb3ef2f /freetype/src/cff/cffparse.c
parentc115795736eb99a8f2288a06c231b9386f4d011f (diff)
downloadvcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.tar.gz
vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.tar.bz2
vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.zip
Updated to freetype 2.4.1
Diffstat (limited to 'freetype/src/cff/cffparse.c')
-rw-r--r--freetype/src/cff/cffparse.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/freetype/src/cff/cffparse.c b/freetype/src/cff/cffparse.c
index 01266a193..0d11a7278 100644
--- a/freetype/src/cff/cffparse.c
+++ b/freetype/src/cff/cffparse.c
@@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (body) */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -137,26 +137,23 @@
FT_UInt nib;
FT_UInt phase;
- FT_Long result, number, rest, exponent;
+ FT_Long result, number, exponent;
FT_Int sign = 0, exponent_sign = 0;
FT_Long exponent_add, integer_length, fraction_length;
if ( scaling )
- *scaling = 0;
+ *scaling = 0;
result = 0;
number = 0;
- rest = 0;
exponent = 0;
exponent_add = 0;
integer_length = 0;
fraction_length = 0;
- FT_UNUSED( rest );
-
/* First of all, read the integer part. */
phase = 4;
@@ -332,11 +329,19 @@
goto Exit;
/* Remove non-significant digits. */
- if ( integer_length < 0 ) {
+ if ( integer_length < 0 )
+ {
number /= power_tens[-integer_length];
fraction_length += integer_length;
}
+ /* this can only happen if exponent was non-zero */
+ if ( fraction_length == 10 )
+ {
+ number /= 10;
+ fraction_length -= 1;
+ }
+
/* Convert into 16.16 format. */
if ( fraction_length > 0 )
{
@@ -702,7 +707,7 @@
clazz[i].count_offset = 0;
*output_class = clazz;
- return FT_Err_Ok;
+ return CFF_Err_Ok;
}