commit 550961fe92a37430acca749577b87f613505ea48
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Tue Sep 4 00:08:34 2018 +0100
Update to 2.9.1 to sync with Fedora (rhbz #1575687)
patch0 rebased
patch1 rebased
patch4 upstreamed
patch5 upstreamed
patch6 upstreamed but with diffrences
patch7 upstreamed
patch9 upstreamed
add BuildRequires: gcc
Switch to %ldconfig_scriptlets
Add patch5 from Fedora
freetype-2.2.1-enable-valid.patch | 12 ++---
freetype-2.3.0-enable-spr.patch | 10 ++--
freetype-2.9-ftsmooth.patch | 101 ++++++++++++++++++++++++++++++++++++++
freetype-freeworld.spec | 45 +++++++----------
4 files changed, 131 insertions(+), 37 deletions(-)
---
diff --git a/freetype-2.2.1-enable-valid.patch b/freetype-2.2.1-enable-valid.patch
index 21d80da..4f595a6 100644
--- a/freetype-2.2.1-enable-valid.patch
+++ b/freetype-2.2.1-enable-valid.patch
@@ -1,7 +1,7 @@
---- freetype-2.2.1/modules.cfg.orig 2006-07-07 21:01:09.000000000 -0400
-+++ freetype-2.2.1/modules.cfg 2006-07-07 21:01:54.000000000 -0400
-@@ -110,7 +110,7 @@
- # TrueType GX/AAT table validation. Needs ftgxval.c below.
+--- ./modules.cfg.orig 2018-04-22 10:41:36.000000000 +0100
++++ ./modules.cfg 2018-09-03 23:20:13.727027428 +0100
+@@ -120,7 +120,7 @@ AUX_MODULES += cache
+ # TrueType GX/AAT table validation. Needs `ftgxval.c' below.
#
# No FT_CONFIG_OPTION_PIC support.
-# AUX_MODULES += gxvalid
@@ -9,8 +9,8 @@
# Support for streams compressed with gzip (files with suffix .gz).
#
-@@ -124,7 +124,7 @@
- # OpenType table validation. Needs ftotval.c below.
+@@ -143,7 +143,7 @@ AUX_MODULES += bzip2
+ # OpenType table validation. Needs `ftotval.c' below.
#
# No FT_CONFIG_OPTION_PIC support.
-# AUX_MODULES += otvalid
diff --git a/freetype-2.3.0-enable-spr.patch b/freetype-2.3.0-enable-spr.patch
index 8432e28..8712fd8 100644
--- a/freetype-2.3.0-enable-spr.patch
+++ b/freetype-2.3.0-enable-spr.patch
@@ -1,8 +1,8 @@
---- freetype-2.3.0/include/freetype/config/ftoption.h.spf 2007-01-18 14:27:34.000000000
-0500
-+++ freetype-2.3.0/include/freetype/config/ftoption.h 2007-01-18 14:27:48.000000000
-0500
-@@ -92,7 +92,7 @@
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
+--- ./include/freetype/config/ftoption.h.orig 2018-04-22 10:41:36.000000000 +0100
++++ ./include/freetype/config/ftoption.h 2018-09-03 23:16:41.840579577 +0100
+@@ -122,7 +122,7 @@ FT_BEGIN_HEADER
+ /* rendering technology that produces excellent output without LCD */
+ /* filtering. */
/* */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
diff --git a/freetype-2.9-ftsmooth.patch b/freetype-2.9-ftsmooth.patch
new file mode 100644
index 0000000..2735bd5
--- /dev/null
+++ b/freetype-2.9-ftsmooth.patch
@@ -0,0 +1,101 @@
+--- a/src/smooth/ftsmooth.c
++++ b/src/smooth/ftsmooth.c
+@@ -232,39 +232,13 @@
+ FT_UInt i, j;
+
+ unsigned int height = bitmap->rows;
+- unsigned int width = bitmap->width;
++ unsigned int width = bitmap->width / 3;
+ int pitch = bitmap->pitch;
+
+-
+- /* Render 3 separate monochrome bitmaps, shifting the outline */
+- /* by 1/3 pixel. */
+- width /= 3;
+-
+- bitmap->buffer += width;
+-
+- error = render->raster_render( render->raster, ¶ms );
+- if ( error )
+- goto Exit;
+-
+- FT_Outline_Translate( outline, -21, 0 );
+- x_shift -= 21;
+- bitmap->buffer += width;
+-
+ error = render->raster_render( render->raster, ¶ms );
+ if ( error )
+ goto Exit;
+
+- FT_Outline_Translate( outline, 42, 0 );
+- x_shift += 42;
+- bitmap->buffer -= 2 * width;
+-
+- error = render->raster_render( render->raster, ¶ms );
+- if ( error )
+- goto Exit;
+-
+- /* XXX: Rearrange the bytes according to FT_PIXEL_MODE_LCD. */
+- /* XXX: It is more efficient to render every third byte above. */
+-
+ if ( FT_ALLOC( temp, (FT_ULong)pitch ) )
+ goto Exit;
+
+@@ -272,11 +246,7 @@
+ {
+ line = bitmap->buffer + i * (FT_ULong)pitch;
+ for ( j = 0; j < width; j++ )
+- {
+- temp[3 * j ] = line[j];
+- temp[3 * j + 1] = line[j + width];
+- temp[3 * j + 2] = line[j + width + width];
+- }
++ temp[3 * j] = temp[3 * j + 1] = temp[3 * j + 2] = line[j];
+ FT_MEM_COPY( line, temp, pitch );
+ }
+
+@@ -284,35 +254,23 @@
+ }
+ else if ( vmul ) /* lcd_v */
+ {
+- int pitch = bitmap->pitch;
+-
++ FT_Byte* line;
++ FT_UInt i;
++ int original_pitch = bitmap->pitch;
+
+- /* Render 3 separate monochrome bitmaps, shifting the outline */
+- /* by 1/3 pixel. Triple the pitch to render on each third row. */
+ bitmap->pitch *= 3;
+ bitmap->rows /= 3;
+
+- bitmap->buffer += pitch;
+-
+- error = render->raster_render( render->raster, ¶ms );
+- if ( error )
+- goto Exit;
+-
+- FT_Outline_Translate( outline, 0, 21 );
+- y_shift += 21;
+- bitmap->buffer += pitch;
+-
+ error = render->raster_render( render->raster, ¶ms );
+ if ( error )
+ goto Exit;
+
+- FT_Outline_Translate( outline, 0, -42 );
+- y_shift -= 42;
+- bitmap->buffer -= 2 * pitch;
+-
+- error = render->raster_render( render->raster, ¶ms );
+- if ( error )
+- goto Exit;
++ for ( i = 0; i < bitmap->rows; i++ )
++ {
++ line = bitmap->buffer + i * bitmap->pitch;
++ FT_MEM_COPY( line + original_pitch, line, bitmap->width );
++ FT_MEM_COPY( line + 2 * original_pitch, line, bitmap->width );
++ }
+
+ bitmap->pitch /= 3;
+ bitmap->rows *= 3;
diff --git a/freetype-freeworld.spec b/freetype-freeworld.spec
index 2f3673c..12346a5 100644
--- a/freetype-freeworld.spec
+++ b/freetype-freeworld.spec
@@ -1,7 +1,7 @@
Summary: A free and portable font rendering engine
Name: freetype-freeworld
-Version: 2.8
-Release: 8%{?dist}
+Version: 2.9.1
+Release: 1%{?dist}
License: (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement
URL:
http://www.freetype.org
Source:
http://download.savannah.gnu.org/releases/freetype/freetype-%{version}.ta...
@@ -11,25 +11,13 @@ Patch0: freetype-2.3.0-enable-spr.patch
# Enable otvalid and gxvalid modules
Patch1: freetype-2.2.1-enable-valid.patch
-# Accept ISO646.1991-IRV as a Unicode charmap in PCF and BDF drivers
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1451795
-Patch4: freetype-2.8-pcf-encoding.patch
-
-# Adjust loop counter maximum for TrueType fonts
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1456585
-Patch5: freetype-2.8-loop-counter.patch
-
-Patch6: 0077-truetype-Fix-loading-of-named-instances.patch
-Patch7: 0079-src-truetype-ttgxvar.c-TT_Get_MM_Var-Fix-thinko.patch
-
-## Security fixes:
-# CVE-2018-6942 NULL pointer dereference in the Ins_GETVARIATION() function
-Patch9: freetype-2.8-getvariation.patch
+Patch5: freetype-2.9-ftsmooth.patch
Provides: freetype-bytecode
Provides: freetype-subpixel
Requires: /etc/ld.so.conf.d
+BuildRequires: gcc
BuildRequires: libX11-devel
BuildRequires: libpng-devel
BuildRequires: zlib-devel
@@ -60,13 +48,7 @@ It transparently overrides the system library using ld.so.conf.d.
%patch1 -p1 -b .enable-valid
-%patch4 -p1 -b .pcf-encoding
-%patch5 -p1 -b .loop-counter
-%patch6 -p1 -b .named-instances
-%patch7 -p1 -b .named-instances2
-
-# Security fixes:
-%patch9 -p1 -b .getvariation
+%patch5 -p1 -b .ftsmooth
%build
%configure --disable-static \
@@ -99,9 +81,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo "%{_libdir}/%{name}" \
%{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
+%ldconfig_scriptlets
%files
%{_libdir}/%{name}
@@ -110,6 +90,19 @@ echo "%{_libdir}/%{name}" \
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%changelog
+* Mon Sep 03 2018 Sérgio Basto <sergio(a)serjux.com> - 2.9.1-1
+- Update to 2.9.1 to sync with Fedora (rhbz #1575687)
+- patch0 rebased
+- patch1 rebased
+- patch4 upstreamed
+- patch5 upstreamed
+- patch6 upstreamed but with diffrences
+- patch7 upstreamed
+- patch9 upstreamed
+- add BuildRequires: gcc
+- Switch to %%ldconfig_scriptlets
+- Add patch5 from Fedora
+
* Thu Jul 26 2018 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> - 2.8-8
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild