Fix autohinting fallback

Ignore CFF-based OTFs (#547532).
This commit is contained in:
Marek Kasik 2011-03-08 17:21:59 +01:00
parent c34d9460d8
commit db8268417a
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From c9bdfa7e658f42f3faed2b426e3b1251a04938e4 Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Sun, 6 Mar 2011 18:35:37 +0100
Subject: Fix autohinting fallback.
* src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs,
ignoring CFF-based OTFs.
---
src/base/ftobjs.c | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 708055f..219ece4 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -627,9 +627,12 @@
FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
+ /* the check for `num_locations' assures that we actually */
+ /* test for instructions in a TTF and not in a CFF-based OTF */
if ( mode == FT_RENDER_MODE_LIGHT ||
face->internal->ignore_unpatented_hinter ||
( FT_IS_SFNT( face ) &&
+ ttface->num_locations &&
ttface->max_profile.maxSizeOfInstructions == 0 ) )
autohint = TRUE;
}

View File

@ -7,7 +7,7 @@
Summary: A free and portable font rendering engine
Name: freetype
Version: 2.4.4
Release: 3%{?dist}
Release: 4%{?dist}
License: FTL or GPLv2+
Group: System Environment/Libraries
URL: http://www.freetype.org
@ -28,6 +28,7 @@ Patch88: freetype-multilib.patch
Patch89: freetype-2.4.2-CVE-2010-3311.patch
Patch90: 0001-Fall-back-to-autohinting-if-a-TTF-OTF-doesn-t-contai.patch
Patch91: 0002-Fix-autohinting-fallback.patch
Buildroot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
@ -90,6 +91,7 @@ popd
%patch88 -p1 -b .multilib
%patch89 -p1 -b .CVE-2010-3311
%patch90 -p1 -b .auto-autohint
%patch91 -p1 -b .fix-autohint
%build
@ -222,6 +224,10 @@ rm -rf $RPM_BUILD_ROOT
%doc docs/tutorial
%changelog
* Tue Mar 8 2011 Marek Kasik <mkasik@redhat.com> 2.4.4-4
- Fix autohinting fallback (#547532).
- Ignore CFF-based OTFs.
* Sun Feb 20 2011 Marek Kasik <mkasik@redhat.com> 2.4.4-3
- Enable bytecode interpreter (#547532).
- Fall back to autohinting if a TTF/OTF doesn't contain any bytecode.