From 15e8e237e6f4d2145237d2977d93a155a08d118d Mon Sep 17 00:00:00 2001 From: James Cloos Date: Fri, 29 May 2009 12:59:42 +0200 Subject: [PATCH] =?UTF-8?q?Enable=20autohinting=20for=20glyphs=20rotated?= =?UTF-8?q?=20by=20multiples=20of=2090=C2=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted matrices to allow rotations by multiples of 90°, not only unrotated, possibly slanted matrices. --- ChangeLog | 8 ++++++++ src/base/ftobjs.c | 32 +++++++++++++++++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1eba3812..47d0a4ef5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-05-29 James Cloos + + Enable autohinting for glyphs rotated by multiples of 90°. + + * src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted + matrices to allow rotations by multiples of 90°, not only unrotated, + possibly slanted matrices. + 2009-05-28 Werner Lemberg Remove compiler warning. diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 613deef19..6e357bb0d 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -588,27 +588,29 @@ * Determine whether we need to auto-hint or not. * The general rules are: * - * - Do only auto-hinting if we have a hinter module, - * a scalable font format dealing with outlines, - * and no transforms except simple slants. + * - Do only auto-hinting if we have a hinter module, a scalable font + * format dealing with outlines, and no transforms except simple + * slants and/or rotations by integer multiples of 90 degrees. * - * - Then, autohint if FT_LOAD_FORCE_AUTOHINT is set - * or if we don't have a native font hinter. + * - 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. * - * - Exception: The font is `tricky' and requires - * the native hinter to load properly. + * - Exception: The font is `tricky' and requires the native hinter to + * load properly. */ - if ( hinter && - !( load_flags & FT_LOAD_NO_HINTING ) && - !( load_flags & FT_LOAD_NO_AUTOHINT ) && - FT_DRIVER_IS_SCALABLE( driver ) && - FT_DRIVER_USES_OUTLINES( driver ) && - !FT_IS_TRICKY( face ) && - face->internal->transform_matrix.yy > 0 && - face->internal->transform_matrix.yx == 0 ) + if ( hinter && + !( load_flags & FT_LOAD_NO_HINTING ) && + !( load_flags & FT_LOAD_NO_AUTOHINT ) && + FT_DRIVER_IS_SCALABLE( driver ) && + FT_DRIVER_USES_OUTLINES( driver ) && + !FT_IS_TRICKY( face ) && + ( ( face->internal->transform_matrix.yx == 0 && + face->internal->transform_matrix.xx != 0 ) || + ( face->internal->transform_matrix.xx == 0 && + face->internal->transform_matrix.yx != 0 ) ) ) { if ( ( load_flags & FT_LOAD_FORCE_AUTOHINT ) || !FT_DRIVER_HAS_HINTER( driver ) )