shithub: freetype+ttf2subf

Download patch

ref: 7abf0cb758b4b470a0a0671e290669aeefbe0b90
parent: 785833d96eacab4af67dc6be53571441df6d8a5b
author: Werner Lemberg <wl@gnu.org>
date: Sun Apr 30 13:25:11 EDT 2017

[autofit] Fix metrics computation.

Problem reported by Markus Trippelsdorf <markus@trippelsdorf.de> and
Nikolaus Waxweiler <madigens@gmail.com>.

* src/base/ftobjs.c (FT_Request_Size): Trigger recomputation of
auto-hinter metrics.  Without this change, multiple size changing
calls for a single face fail.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-04-30  Werner Lemberg  <wl@gnu.org>
+
+	[autofit] Fix metrics computation.
+
+	Problem reported by Markus Trippelsdorf <markus@trippelsdorf.de> and
+	Nikolaus Waxweiler <madigens@gmail.com>.
+
+	* src/base/ftobjs.c (FT_Request_Size): Trigger recomputation of
+	auto-hinter metrics.  Without this change, multiple size changing
+	calls for a single face fail.
+
 2017-04-29  Werner Lemberg  <wl@gnu.org>
 
 	* src/truetype/ttdriver.c (tt_size_request): Properly check `error'.
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3061,6 +3061,10 @@
          req->type >= FT_SIZE_REQUEST_TYPE_MAX )
       return FT_THROW( Invalid_Argument );
 
+    /* signal the auto-hinter to recompute its size metrics */
+    /* (if requested)                                       */
+    face->size->internal->autohint_metrics.x_scale = 0;
+
     clazz = face->driver->clazz;
 
     if ( clazz->request_size )
--