freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master af40043: Fix return value of `FT_Set_Named_Instance'


From: Werner LEMBERG
Subject: [freetype2] master af40043: Fix return value of `FT_Set_Named_Instance' (#56186).
Date: Mon, 22 Apr 2019 01:44:29 -0400 (EDT)

branch: master
commit af400438b7da3f07afadc3a5b3a6b982b2bdb84e
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    Fix return value of `FT_Set_Named_Instance' (#56186).
    
    * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Correctly handle
    internal return value -1 of `TT_Set_Var_Design'.
---
 ChangeLog              | 7 +++++++
 docs/CHANGES           | 4 ++++
 src/truetype/ttgxvar.c | 5 +++++
 3 files changed, 16 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 3da7bca..290c865 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-04-22  Werner Lemberg  <address@hidden>
+
+       Fix return value of `FT_Set_Named_Instance' (#56186).
+
+       * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Correctly handle
+       internal return value -1 of `TT_Set_Var_Design'.
+
 2019-04-18  Werner Lemberg  <address@hidden>
 
        [pcf] Fix handling of undefined glyph (#56067).
diff --git a/docs/CHANGES b/docs/CHANGES
index 8616981..9f001a9 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -15,6 +15,10 @@ CHANGES BETWEEN 2.10.0 and 2.10.1
     in version 2.10.0 was partially broken, causing premature abortion
     of charmap iteration for many fonts.
 
+  - If  `FT_Set_Named_Instance' was  called  with  the same  arguments
+    twice in a row, the function  returned an incorrect error code the
+    second time.
+
 
 ======================================================================
 
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 020918f..6854d23 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -3080,7 +3080,12 @@
                                  mmvar->num_axis,
                                  named_style->coords );
       if ( error )
+      {
+        /* internal error code -1 means `no change' */
+        if ( error == -1 )
+          error = FT_Err_Ok;
         goto Exit;
+      }
     }
     else
       error = TT_Set_Var_Design( face, 0, NULL );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]