Commit ee3f36f6b3880f7652488169dd27292c5e7c1a76

Werner Lemberg 2016-07-14T10:25:20

[sfnt] Fix `face_index' value in `FT_Face' for named instances. * src/sfnt/sfobjc.s (sfnt_init_face): Don't strip off higher 16bits.

diff --git a/ChangeLog b/ChangeLog
index a2dc613..e42f0cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2016-07-14  Werner Lemberg  <wl@gnu.org>
 
+	[sfnt] Fix `face_index' value in `FT_Face' for named instances.
+
+	* src/sfnt/sfobjc.s (sfnt_init_face): Don't strip off higher 16bits.
+
+2016-07-14  Werner Lemberg  <wl@gnu.org>
+
 	* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix tracing.
 
 2016-07-14  Behdad Esfahbod  <behdad@behdad.org>
diff --git a/docs/CHANGES b/docs/CHANGES
index 8e472f6..2d1b54c 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -1,4 +1,16 @@
 
+CHANGES BETWEEN 2.6.5 and 2.7
+
+  I. IMPORTANT BUG FIXES
+
+    - After  loading a  named instance  of  a GX  variation font,  the
+      `face_index'  value  in  the returned  `FT_Face'  structure  now
+      correctly holds the named instance  index in the upper 16bits as
+      documented.
+
+
+======================================================================
+
 CHANGES BETWEEN 2.6.4 and 2.6.5
 
   I. IMPORTANT BUG FIXES
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 2e8c1ec..4413bbc 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -977,7 +977,7 @@
 #endif
 
     face->root.num_faces  = face->ttc_header.count;
-    face->root.face_index = face_index;
+    face->root.face_index = face_instance_index;
 
     return error;
   }