Update to 2.4.12

Enable Adobe CFF engine
Resolves: #959771
This commit is contained in:
Marek Kasik 2013-05-09 15:40:34 +02:00
parent 3ab804cc16
commit 9d3d183967
6 changed files with 41 additions and 274 deletions

3
.gitignore vendored
View File

@ -31,3 +31,6 @@ ft2demos-2.4.2.tar.bz2
/freetype-2.4.11.tar.bz2
/freetype-doc-2.4.11.tar.bz2
/ft2demos-2.4.11.tar.bz2
/freetype-2.4.12.tar.bz2
/freetype-doc-2.4.12.tar.bz2
/ft2demos-2.4.12.tar.bz2

View File

@ -1,253 +0,0 @@
--- freetype-2.4.11/include/freetype/internal/ftcalc.h
+++ freetype-2.4.11/include/freetype/internal/ftcalc.h
@@ -156,6 +156,13 @@ FT_BEGIN_HEADER
FT_Pos out_y );
+ /*
+ * Return the most significant bit index.
+ */
+ FT_BASE( FT_Int )
+ FT_MSB( FT_UInt32 z );
+
+
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
--- freetype-2.4.11/src/base/ftcalc.c
+++ freetype-2.4.11/src/base/ftcalc.c
@@ -103,6 +103,42 @@
}
+ FT_BASE_DEF ( FT_Int )
+ FT_MSB( FT_UInt32 z )
+ {
+ FT_Int shift = 0;
+
+ /* determine msb bit index in `shift' */
+ if ( z >= ( 1L << 16 ) )
+ {
+ z >>= 16;
+ shift += 16;
+ }
+ if ( z >= ( 1L << 8 ) )
+ {
+ z >>= 8;
+ shift += 8;
+ }
+ if ( z >= ( 1L << 4 ) )
+ {
+ z >>= 4;
+ shift += 4;
+ }
+ if ( z >= ( 1L << 2 ) )
+ {
+ z >>= 2;
+ shift += 2;
+ }
+ if ( z >= ( 1L << 1 ) )
+ {
+ z >>= 1;
+ shift += 1;
+ }
+
+ return shift;
+ }
+
+
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
/* documentation is in ftcalc.h */
--- freetype-2.4.11/src/base/ftoutln.c
+++ freetype-2.4.11/src/base/ftoutln.c
@@ -930,10 +930,15 @@
v_prev = points[last];
v_cur = v_first;
- /* compute the incoming vector and its length */
+ /* compute the incoming normalized vector */
in.x = v_cur.x - v_prev.x;
in.y = v_cur.y - v_prev.y;
l_in = FT_Vector_Length( &in );
+ if ( l_in )
+ {
+ in.x = FT_DivFix( in.x, l_in );
+ in.y = FT_DivFix( in.y, l_in );
+ }
for ( n = first; n <= last; n++ )
{
@@ -942,20 +947,27 @@
else
v_next = v_first;
- /* compute the outgoing vector and its length */
+ /* compute the outgoing normalized vector */
out.x = v_next.x - v_cur.x;
out.y = v_next.y - v_cur.y;
l_out = FT_Vector_Length( &out );
+ if ( l_out )
+ {
+ out.x = FT_DivFix( out.x, l_out );
+ out.y = FT_DivFix( out.y, l_out );
+ }
- d = l_in * l_out + in.x * out.x + in.y * out.y;
+ d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );
/* shift only if turn is less then ~160 degrees */
- if ( 16 * d > l_in * l_out )
+ if ( d > -0xF000L )
{
+ d = d + 0x10000L;
+
/* shift components are aligned along bisector */
/* and directed according to the outline orientation. */
- shift.x = l_out * in.y + l_in * out.y;
- shift.y = l_out * in.x + l_in * out.x;
+ shift.x = in.y + out.y;
+ shift.y = in.x + out.x;
if ( orientation == FT_ORIENTATION_TRUETYPE )
shift.x = -shift.x;
@@ -963,18 +975,19 @@
shift.y = -shift.y;
/* threshold strength to better handle collapsing segments */
- l = FT_MIN( l_in, l_out );
- q = out.x * in.y - out.y * in.x;
+ q = FT_MulFix( out.x, in.y ) - FT_MulFix( out.y, in.x );
if ( orientation == FT_ORIENTATION_TRUETYPE )
q = -q;
- if ( FT_MulDiv( xstrength, q, l ) < d )
+ l = FT_MIN( l_in, l_out );
+
+ if ( FT_MulFix( xstrength, q ) <= FT_MulFix( d, l ) )
shift.x = FT_MulDiv( shift.x, xstrength, d );
else
shift.x = FT_MulDiv( shift.x, l, q );
- if ( FT_MulDiv( ystrength, q, l ) < d )
+ if ( FT_MulFix( ystrength, q ) <= FT_MulFix( d, l ) )
shift.y = FT_MulDiv( shift.y, ystrength, d );
else
shift.y = FT_MulDiv( shift.y, l, q );
@@ -1002,6 +1015,8 @@
FT_EXPORT_DEF( FT_Orientation )
FT_Outline_Get_Orientation( FT_Outline* outline )
{
+ FT_BBox cbox;
+ FT_Int xshift, yshift;
FT_Vector* points;
FT_Vector v_prev, v_cur;
FT_Int c, n, first;
@@ -1016,6 +1031,14 @@
/* cubic or quadratic curves, this test deals with the polygon */
/* only which is spanned up by the control points. */
+ FT_Outline_Get_CBox( outline, &cbox );
+
+ xshift = FT_MSB( FT_ABS( cbox.xMax ) | FT_ABS( cbox.xMin ) ) - 14;
+ xshift = FT_MAX( xshift, 0 );
+
+ yshift = FT_MSB( cbox.yMax - cbox.yMin ) - 14;
+ yshift = FT_MAX( yshift, 0 );
+
points = outline->points;
first = 0;
@@ -1029,7 +1052,8 @@
for ( n = first; n <= last; n++ )
{
v_cur = points[n];
- area += ( v_cur.y - v_prev.y ) * ( v_cur.x + v_prev.x );
+ area += ( ( v_cur.y - v_prev.y ) >> yshift ) *
+ ( ( v_cur.x + v_prev.x ) >> xshift );
v_prev = v_cur;
}
--- freetype-2.4.11/src/base/fttrigon.c
+++ freetype-2.4.11/src/base/fttrigon.c
@@ -104,43 +104,14 @@
static FT_Int
ft_trig_prenorm( FT_Vector* vec )
{
- FT_Fixed x, y, z;
+ FT_Fixed x, y;
FT_Int shift;
x = vec->x;
y = vec->y;
- z = ( ( x >= 0 ) ? x : - x ) | ( (y >= 0) ? y : -y );
- shift = 0;
-
-#if 1
- /* determine msb bit index in `shift' */
- if ( z >= ( 1L << 16 ) )
- {
- z >>= 16;
- shift += 16;
- }
- if ( z >= ( 1L << 8 ) )
- {
- z >>= 8;
- shift += 8;
- }
- if ( z >= ( 1L << 4 ) )
- {
- z >>= 4;
- shift += 4;
- }
- if ( z >= ( 1L << 2 ) )
- {
- z >>= 2;
- shift += 2;
- }
- if ( z >= ( 1L << 1 ) )
- {
- z >>= 1;
- shift += 1;
- }
+ shift = FT_MSB( FT_ABS( x ) | FT_ABS( y ) );
if ( shift <= 27 )
{
@@ -156,33 +127,6 @@
shift = -shift;
}
-#else /* 0 */
-
- if ( z < ( 1L << 27 ) )
- {
- do
- {
- shift++;
- z <<= 1;
- } while ( z < ( 1L << 27 ) );
- vec->x = x << shift;
- vec->y = y << shift;
- }
- else if ( z > ( 1L << 28 ) )
- {
- do
- {
- shift++;
- z >>= 1;
- } while ( z > ( 1L << 28 ) );
-
- vec->x = x >> shift;
- vec->y = y >> shift;
- shift = -shift;
- }
-
-#endif /* 0 */
-
return shift;
}

View File

@ -0,0 +1,11 @@
--- freetype-2.4.12/src/cff/cffobjs.c
+++ freetype-2.4.12/src/cff/cffobjs.c
@@ -1056,7 +1056,7 @@
/* set default property values */
- driver->hinting_engine = FT_CFF_HINTING_FREETYPE;
+ driver->hinting_engine = FT_CFF_HINTING_ADOBE;
driver->no_stem_darkening = FALSE;
return FT_Err_Ok;

View File

@ -1,18 +1,18 @@
--- freetype-2.2.1/builds/unix/freetype-config.in.multilib 2006-07-27 18:50:40.000000000 -0400
+++ freetype-2.2.1/builds/unix/freetype-config.in 2006-07-27 18:58:13.000000000 -0400
@@ -9,11 +9,11 @@
# indicate that you have read the license and understand and accept it
# fully.
--- freetype-2.4.12/builds/unix/freetype-config.in
+++ freetype-2.4.12/builds/unix/freetype-config.in
@@ -12,11 +12,11 @@
LC_ALL=C
export LC_ALL
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-prefix="%prefix%"
-exec_prefix="%exec_prefix%"
+prefix=`pkg-config --variable prefix freetype2`
+exec_prefix=`pkg-config --variable exec_prefix freetype2`
exec_prefix_set=no
-includedir=@includedir@
-libdir=@libdir@
exec_prefix_set="no"
-includedir="%includedir%"
-libdir="%libdir%"
+includedir=`pkg-config --variable includedir freetype2`
+libdir=`pkg-config --variable libdir freetype2`
enable_shared=@build_libtool_libs@
wl=@wl@
hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@'
enable_shared="%build_libtool_libs%"
usage()

View File

@ -6,8 +6,8 @@
Summary: A free and portable font rendering engine
Name: freetype
Version: 2.4.11
Release: 3%{?dist}
Version: 2.4.12
Release: 1%{?dist}
License: (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement
Group: System Environment/Libraries
URL: http://www.freetype.org
@ -25,8 +25,8 @@ Patch47: freetype-2.3.11-more-demos.patch
# Fix multilib conflicts
Patch88: freetype-multilib.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=891457
Patch89: freetype-2.4.11-fix-emboldening.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=959771
Patch89: freetype-2.4.12-enable-adobe-cff-engine.patch
Buildroot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
@ -87,7 +87,8 @@ pushd ft2demos-%{version}
popd
%patch88 -p1 -b .multilib
%patch89 -p1 -b .emboldening
%patch89 -p1 -b .adobe-cff
%build
@ -220,6 +221,11 @@ rm -rf $RPM_BUILD_ROOT
%doc docs/tutorial
%changelog
* Thu May 9 2013 Marek Kasik <mkasik@redhat.com> - 2.4.12-1
- Update to 2.4.12
- Enable Adobe CFF engine
- Resolves: #959771
* Tue Mar 19 2013 Marek Kasik <mkasik@redhat.com> - 2.4.11-3
- Fix emboldening:
- split out MSB function

View File

@ -1,3 +1,3 @@
b93435488942486c8d0ca22e8f768034 freetype-2.4.11.tar.bz2
20f148103e069093f53584ce5ba16581 freetype-doc-2.4.11.tar.bz2
4c751f2b02bd181102c377a6396d8454 ft2demos-2.4.11.tar.bz2
3463102764315eb86c0d3c2e1f3ffb7d freetype-2.4.12.tar.bz2
e3955ef324b2ceea74dc849e07fbfb7a freetype-doc-2.4.12.tar.bz2
79d2329da1a118d559ec6bd77fddb210 ft2demos-2.4.12.tar.bz2