Commit f61f49fef7a958830be54ffbed801c1bfd18a0be

John Tytgat 2019-01-18T13:25:23

[sfnt] Handle TT fonts having two PostScript font names (#55471). * src/sfnt/sfdriver.c (sfnt_get_name_id): Prefer English over any other language found for PostScript font names.

diff --git a/ChangeLog b/ChangeLog
index df39ba6..5cd2480 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-01-18  John Tytgat  <John.Tytgat@esko.com>
+
+	[sfnt] Handle TT fonts having two PostScript font names (#55471).
+
+	* src/sfnt/sfdriver.c (sfnt_get_name_id): Prefer English over any
+	other language found for PostScript font names.
+
 2019-01-08  Chris Liddell <chris.liddell@artifex.com>
 
 	[psaux] Fix closepath (#55414).
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index a15560e..0c3c762 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -608,10 +608,10 @@
 
       if ( name->nameID == id && name->stringLength > 0 )
       {
-        if ( IS_WIN( name ) )
+        if ( IS_WIN( name ) && ( name->languageID == 0x409 || *win == -1 ) )
           *win = n;
 
-        if ( IS_APPLE( name ) )
+        if ( IS_APPLE( name ) && ( name->languageID == 0 || *apple == -1 ) )
           *apple = n;
       }
     }