[cff] fix incremental interface with new cff code. * src/cff/cf2ft.c (cf2_getSeacComponent): When using the incremental interface to retrieve glyph data for a SEAC, it be left to the incremental interface callback to apply the encoding to raw character index (as it was in the previous code).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/ChangeLog b/ChangeLog
index 32d2174..79e6b36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-05-12 Chris Liddell <chris.liddell@artifex.com>
+
+ [cff] fix incremental interface with new cff code.
+
+ * src/cff/cf2ft.c (cf2_getSeacComponent): When using the incremental
+ interface to retrieve glyph data for a SEAC, it be left to the
+ incremental interface callback to apply the encoding to raw
+ character index (as it was in the previous code).
+
2015-04-29 Alexei Podtelezhnikov <apodtele@gmail.com>
[autofit] Speed up IUP.
diff --git a/src/cff/cf2ft.c b/src/cff/cf2ft.c
index 2bb646e..d2544a2 100644
--- a/src/cff/cf2ft.c
+++ b/src/cff/cf2ft.c
@@ -582,9 +582,18 @@
FT_ZERO( buf );
- gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
- if ( gid < 0 )
- return FT_THROW( Invalid_Glyph_Format );
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ /* Incremental fonts don't necessarily have valid charsets. */
+ /* They use the character code, not the glyph index, in this case. */
+ if ( decoder->builder.face->root.internal->incremental_interface )
+ gid = code;
+ else
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+ {
+ gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
+ if ( gid < 0 )
+ return FT_THROW( Invalid_Glyph_Format );
+ }
error = cff_get_glyph_data( decoder->builder.face,
(CF2_UInt)gid,