summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wagner <bungeman@google.com>2018-09-21 11:26:37 +0200
committerWerner Lemberg <wl@gnu.org>2018-09-21 11:27:50 +0200
commit335528e11e690fb38042d7edcda209d500c05d3c (patch)
tree4b1784a3c066e4c703e0d9e8cc5ad76d68116815
parentc168cc3b1bf13e5f3ca77c238dcb204ea821c56d (diff)
downloadfreetype2-335528e11e690fb38042d7edcda209d500c05d3c.tar.gz
Improve auto-hinter handling of bitmap fonts (#54681).
For bitmap fonts, `FT_Load_Glyph' should either return an error or not set the format to `FT_GLYPH_FORMAT_OUTLINE'. However, in this case `FT_Load_Glyph' calls into the auto-hinter which calls back into `FT_Load_Glyph' with `FT_LOAD_NO_SCALE' in the flags, which marks the glyph as `FT_GLYPH_FORMAT_OUTLINE' with an empty path (even though it doesn't have any path). It appears that the auto-hinter should not be called when the face doesn't have outlines. The current test for using the auto-hinter in `FT_Load_Glyph' checks if the driver supports scalable outlines, but not if the face supports scalable outlines. * src/base/ftobjs.c (FT_Load_Glyph): Directly check whether we have scalable outlines.
-rw-r--r--ChangeLog18
-rw-r--r--src/base/ftobjs.c5
2 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b89e83822..584f86029 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2018-09-21 Ben Wagner <bungeman@google.com>
+
+ Improve auto-hinter handling of bitmap fonts (#54681).
+
+ For bitmap fonts, `FT_Load_Glyph' should either return an error or
+ not set the format to `FT_GLYPH_FORMAT_OUTLINE'. However, in this
+ case `FT_Load_Glyph' calls into the auto-hinter which calls back
+ into `FT_Load_Glyph' with `FT_LOAD_NO_SCALE' in the flags, which
+ marks the glyph as `FT_GLYPH_FORMAT_OUTLINE' with an empty path
+ (even though it doesn't have any path). It appears that the
+ auto-hinter should not be called when the face doesn't have
+ outlines. The current test for using the auto-hinter in
+ `FT_Load_Glyph' checks whether the driver supports scalable
+ outlines, but not if the face supports scalable outlines.
+
+ * src/base/ftobjs.c (FT_Load_Glyph): Directly check whether we have
+ scalable outlines.
+
2018-09-21 Werner Lemberg <wl@gnu.org>
[raster] Fix disappearing vertical lines (#54589).
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 608c4783b..34aedbf3b 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -846,7 +846,7 @@
* - Do only auto-hinting if we have
*
* - a hinter module,
- * - a scalable font format dealing with outlines,
+ * - a scalable font,
* - not a tricky font, and
* - no transforms except simple slants and/or rotations by
* integer multiples of 90 degrees.
@@ -864,8 +864,7 @@
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_SCALABLE( face ) &&
!FT_IS_TRICKY( face ) &&
( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) ||
( face->internal->transform_matrix.yx == 0 &&