Package: libfreetype6
Version: 2.4.4-1
Severity: wishlist

Please apply the attached patch from the Fedora resp. RPM Fusion package which
is taken from upstream and enables fall back to autohinting if a TTF/OTF
doesn't contain any bytecode.



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (501, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libfreetype6 depends on:
ii  libc6                     2.11.2-11      Embedded GNU C Library: Shared lib
ii  zlib1g                    1:1.2.5.dfsg-1 compression library - runtime

libfreetype6 recommends no packages.

libfreetype6 suggests no packages.

-- no debconf information
>From ff8095077ce454246edb93c5bc672edb2b2c8f25 Mon Sep 17 00:00:00 2001
From: Kevin Kofler <[email protected]>
Date: Sat, 19 Feb 2011 23:09:26 +0100
Subject: [PATCH] Fall back to autohinting if a TTF/OTF doesn't contain any bytecode.
 This is Savannah patch #7471.

* src/base/ftobjs.c (FT_Load_Glyph): Implement it.
---
 src/base/ftobjs.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 6b01f43..708055f 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4,8 +4,7 @@
 /*                                                                         */
 /*    The FreeType private base classes (body).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */
-/*            2010 by                                                      */
+/*  Copyright 1996-2011 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -561,6 +560,7 @@
     FT_Library    library;
     FT_Bool       autohint = FALSE;
     FT_Module     hinter;
+    TT_Face       ttface = (TT_Face)face;
 
 
     if ( !face || !face->size || !face->glyph )
@@ -601,7 +601,8 @@
      * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
      *   have a native font hinter.
      *
-     * - Otherwise, auto-hint for LIGHT hinting mode.
+     * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't
+     *   any hinting bytecode in the TrueType/OpenType font.
      *
      * - Exception: The font is `tricky' and requires the native hinter to
      *   load properly.
@@ -626,8 +627,10 @@
         FT_Render_Mode  mode = FT_LOAD_TARGET_MODE( load_flags );
 
 
-        if ( mode == FT_RENDER_MODE_LIGHT             ||
-             face->internal->ignore_unpatented_hinter )
+        if ( mode == FT_RENDER_MODE_LIGHT                       ||
+             face->internal->ignore_unpatented_hinter           ||
+             ( FT_IS_SFNT( face )                             &&
+               ttface->max_profile.maxSizeOfInstructions == 0 ) )
           autohint = TRUE;
       }
     }
@@ -1869,7 +1872,7 @@
                     " is already checked and"
                     " no font is found\n", i ));
         continue;
-      }  
+      }
 
       if ( errors[i] )
       {
@@ -4151,7 +4154,7 @@
       FT_Renderer  renderer = FT_RENDERER( module );
 
 
-      if ( renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE && 
+      if ( renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
            renderer->raster                                         )
         renderer->clazz->raster_class->raster_done( renderer->raster );
     }
-- 
1.7.4

Reply via email to