Update freetype2 to 2.7

This commit is contained in:
Martchus 2016-09-23 17:21:14 +02:00
parent e75141e702
commit 01cdfd9836
6 changed files with 49 additions and 147 deletions

View File

@ -1,34 +1,34 @@
From a7e32953f291c39a8286b87516cd0c0516c2c89b Mon Sep 17 00:00:00 2001
From c3680bf8d38cf759c1e33dcc2d2d51e0a4fea2f9 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Tue, 23 Jun 2015 08:40:29 +0200
Subject: [PATCH 1/4] Enable table validation modules
Subject: [PATCH 1/3] Enable table validation modules
---
modules.cfg | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.cfg b/modules.cfg
index d677565a2bc2b5a2..f19cbec33384a86f 100644
index f30049c38cc45159..7b8e50fe1b34584a 100644
--- a/modules.cfg
+++ b/modules.cfg
@@ -110,7 +110,7 @@ RASTER_MODULES += smooth
AUX_MODULES += cache
@@ -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
+AUX_MODULES += gxvalid
# Support for streams compressed with gzip (files with suffix .gz).
#
@@ -129,7 +129,7 @@ AUX_MODULES += bzip2
@@ -143,7 +143,7 @@ AUX_MODULES += bzip2
# OpenType table validation. Needs ftotval.c below.
#
# No FT_CONFIG_OPTION_PIC support.
-# AUX_MODULES += otvalid
+AUX_MODULES += otvalid
# Auxiliary PostScript driver component to share common code.
#
--
2.9.0
2.9.3

View File

@ -1,17 +1,17 @@
From 6a8bbe968954bcc54fdfcd5a71c7632370e3066a Mon Sep 17 00:00:00 2001
From 96f09f08417887b2618c177bccfb6da2906568d9 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Tue, 23 Jun 2015 08:43:07 +0200
Subject: [PATCH 2/4] Enable subpixel rendering
Subject: [PATCH 2/3] Enable subpixel rendering
---
include/freetype/config/ftoption.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 2556c64d9d6c0838..8e58403529f597e5 100644
index 90c123ef93e9ea04..67a361dd41e0b026 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
@@ -122,7 +122,7 @@ FT_BEGIN_HEADER
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
@ -21,5 +21,5 @@ index 2556c64d9d6c0838..8e58403529f597e5 100644
/*************************************************************************/
--
2.9.0
2.9.3

View File

@ -0,0 +1,27 @@
From 220e96a9a8d7aff6ad0f0f1aa12c79cdb563331c Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Mon, 29 Aug 2016 08:43:10 +0200
Subject: [PATCH 3/3] Enable infinality subpixel hinting
---
include/freetype/config/ftoption.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 67a361dd41e0b026..c4812862518b66a6 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -675,8 +675,8 @@ FT_BEGIN_HEADER
/* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
-#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
+/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 )
/*************************************************************************/
--
2.9.3

View File

@ -1,88 +0,0 @@
From be997becc28dfbf2077cca55dc9a6a090d13e22a Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Wed, 15 Jun 2016 14:10:20 +0200
Subject: [PATCH 3/4] Make subpixel hinting mode configurable
---
include/freetype/config/ftoption.h | 2 +-
src/truetype/ttobjs.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 8e58403529f597e5..197e15cdc3cc1e74 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -632,7 +632,7 @@ FT_BEGIN_HEADER
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 )
/*************************************************************************/
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index ed3be2dbee79427c..d89f92e94d0e816b 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -36,6 +36,9 @@
#include "ttgxvar.h"
#endif
+#include <stdlib.h>
+#include <errno.h>
+
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@@ -1286,6 +1289,7 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
TT_Driver driver = (TT_Driver)ttdriver;
+ const char *envval;
driver->interpreter_version = TT_INTERPRETER_VERSION_35;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -1295,6 +1299,39 @@
driver->interpreter_version = TT_INTERPRETER_VERSION_40;
#endif
+ errno = 0;
+ envval = getenv( "FT2_SUBPIXEL_HINTING" );
+ if ( envval )
+ {
+ char *endptr = NULL;
+ unsigned long value = strtoul( envval, &endptr, 10 );
+
+ if ( !errno && endptr && !*endptr )
+ {
+ switch( value )
+ {
+ case 0:
+ driver->interpreter_version = TT_INTERPRETER_VERSION_35;
+ break;
+
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
+ case 1:
+ driver->interpreter_version = TT_INTERPRETER_VERSION_38;
+ break;
+#endif
+
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ case 2:
+ driver->interpreter_version = TT_INTERPRETER_VERSION_40;
+ break;
+#endif
+
+ default:
+ break;
+ }
+ }
+ }
+
#else /* !TT_USE_BYTECODE_INTERPRETER */
FT_UNUSED( ttdriver );
--
2.9.0

View File

@ -1,29 +0,0 @@
From 88e7474320b8d2b5333e276b8b1771bc2690c43f Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Tue, 12 Jul 2016 12:47:57 +0200
Subject: [PATCH 4/4] Keep default interpreter version as 35
---
src/truetype/ttobjs.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index d89f92e94d0e816b..efca66fc21c0287a 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -1292,12 +1292,6 @@
const char *envval;
driver->interpreter_version = TT_INTERPRETER_VERSION_35;
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
- driver->interpreter_version = TT_INTERPRETER_VERSION_38;
-#endif
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- driver->interpreter_version = TT_INTERPRETER_VERSION_40;
-#endif
errno = 0;
envval = getenv( "FT2_SUBPIXEL_HINTING" );
--
2.9.0

View File

@ -4,7 +4,7 @@
# you also find the URL of a binary repository.
pkgname=mingw-w64-freetype2
pkgver=2.6.5
pkgver=2.7
pkgrel=1
pkgdesc="TrueType font rendering library (mingw-w64)"
arch=('any')
@ -18,15 +18,13 @@ conflicts=(mingw-w64-freetype)
source=(http://download.savannah.gnu.org/releases/freetype/freetype-${pkgver}.tar.bz2{,.sig}
0001-Enable-table-validation-modules.patch
0002-Enable-subpixel-rendering.patch
0003-Make-subpixel-hinting-mode-configurable.patch
0004-Keep-default-interpreter-version-as-35.patch)
0003-Enable-infinality-subpixel-hinting.patch)
options=(!strip !buildflags !libtool staticlibs)
sha1sums=('5db38ae2308c5a2c519c8e071e98b70d61585201'
sha1sums=('f251029d5ab542a96dd4531605fe577185077560'
'SKIP'
'e1fde7854d2a64868a5eef07415ad23c339fc630'
'7da3af8e1e002e39a247c37a05a10beb576007d6'
'c64ba9d37732fc75de7817d1d679a3e38efdb4cb'
'1f30feeba9c51c9ec745bd29ef07beccf9544338')
'b31882ef5e8447e761acee1c4a44c0630cd4d465'
'b1494810ed3aca25cdd8e8cedf634e5adfe6c09e'
'41d27140fd590945e22e012c9dce62de3d6f11e6')
validpgpkeys=('58E0C111E39F5408C5D3EC76C1A60EACE707FDA5')
if [[ $pkgname = "mingw-w64-freetype2-bootstrap" ]]; then
@ -45,16 +43,10 @@ _architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
cd "${srcdir}/freetype-${pkgver}"
patch -Np1 -i ../0001-Enable-table-validation-modules.patch
patch -Np1 -i ../0002-Enable-subpixel-rendering.patch
# Provide a way to set the default subpixel hinting mode
# at runtime, without depending on the application to do so.
patch -Np1 -i ../0003-Make-subpixel-hinting-mode-configurable.patch
# Keep the classic subpixel hinting mode as default, as expected
# by upstream for the 2.6 series
patch -Np1 -i ../0004-Keep-default-interpreter-version-as-35.patch
patch -Np1 -i ../0003-Enable-infinality-subpixel-hinting.patch
}
build() {