forked from minhngoc25a/freetype2
[cff] Fix Savannah bug #36705.
Handle numbers like 2.001 correctly. * src/cff/cffparse.c (cff_parse_real): Avoid negative values for `shift'.
This commit is contained in:
parent
79e36baebb
commit
56751532d3
|
@ -1,3 +1,12 @@
|
||||||
|
2012-06-25 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[cff] Fix Savannah bug #36705.
|
||||||
|
|
||||||
|
Handle numbers like 2.001 correctly.
|
||||||
|
|
||||||
|
* src/cff/cffparse.c (cff_parse_real): Avoid negative values for
|
||||||
|
`shift'.
|
||||||
|
|
||||||
2012-06-18 Infinality <infinality@infinality.net>
|
2012-06-18 Infinality <infinality@infinality.net>
|
||||||
|
|
||||||
[truetype] Support subpixel hinting.
|
[truetype] Support subpixel hinting.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* CFF token stream parser (body) */
|
/* CFF token stream parser (body) */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 1996-2004, 2007-2011 by */
|
/* Copyright 1996-2004, 2007-2012 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
@ -286,9 +286,11 @@
|
||||||
|
|
||||||
/* Make `scaling' as small as possible. */
|
/* Make `scaling' as small as possible. */
|
||||||
new_fraction_length = FT_MIN( exponent, 5 );
|
new_fraction_length = FT_MIN( exponent, 5 );
|
||||||
exponent -= new_fraction_length;
|
|
||||||
shift = new_fraction_length - fraction_length;
|
shift = new_fraction_length - fraction_length;
|
||||||
|
|
||||||
|
if ( shift > 0 )
|
||||||
|
{
|
||||||
|
exponent -= new_fraction_length;
|
||||||
number *= power_tens[shift];
|
number *= power_tens[shift];
|
||||||
if ( number > 0x7FFFL )
|
if ( number > 0x7FFFL )
|
||||||
{
|
{
|
||||||
|
@ -298,6 +300,9 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
exponent -= fraction_length;
|
exponent -= fraction_length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
exponent -= fraction_length;
|
||||||
|
|
||||||
result = number << 16;
|
result = number << 16;
|
||||||
*scaling = exponent;
|
*scaling = exponent;
|
||||||
|
|
Loading…
Reference in New Issue