Minor GX code shuffling. * include/freetype/internal/tttypes.h (TT_Face): Move `is_default_instance' into TT_CONFIG_OPTION_GX_VAR_SUPPORT block. * src/sfnt/sfobjs.c (sfnt_init_face): Updated. * src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): New macro. (TT_Load_Glyph): Use it.
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
diff --git a/ChangeLog b/ChangeLog
index 7011d05..35150c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2016-12-18 Werner Lemberg <wl@gnu.org>
+ Minor GX code shuffling.
+
+ * include/freetype/internal/tttypes.h (TT_Face): Move
+ `is_default_instance' into TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ block.
+
+ * src/sfnt/sfobjs.c (sfnt_init_face): Updated.
+ * src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): New macro.
+ (TT_Load_Glyph): Use it.
+
+2016-12-18 Werner Lemberg <wl@gnu.org>
+
[cff] Better handling of non-CFF font formats.
* src/cff/cffload.c (cff_font_load): Pure CFFs don't have a
diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h
index edaf113..5fca84d 100644
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -1230,6 +1230,10 @@ FT_BEGIN_HEADER
/* variation tables (rather like Multiple */
/* Master data). */
/* */
+ /* is_default_instance :: Set if the glyph outlines can be used */
+ /* unmodified (i.e., without applying glyph */
+ /* variation deltas). */
+ /* */
/* horz_metrics_size :: The size of the `hmtx' table. */
/* */
/* vert_metrics_size :: The size of the `vmtx' table. */
@@ -1304,10 +1308,6 @@ FT_BEGIN_HEADER
/* */
/* ebdt_size :: The size of the sbit data table. */
/* */
- /* is_default_instance :: Set if the glyph outlines can be used */
- /* unmodified (i.e., without applying glyph */
- /* variation deltas). */
- /* */
typedef struct TT_FaceRec_
{
FT_FaceRec root;
@@ -1424,6 +1424,8 @@ FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Bool doblend;
GX_Blend blend;
+
+ FT_Bool is_default_instance; /* since 2.7.1 */
#endif
/* since version 2.2 */
@@ -1473,9 +1475,6 @@ FT_BEGIN_HEADER
FT_ULong ebdt_size;
#endif
- /* since 2.7.1 */
- FT_Bool is_default_instance;
-
} TT_FaceRec;
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index efda0c1..fbb8a52 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -925,8 +925,6 @@
if ( error )
return error;
- face->is_default_instance = 1;
-
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
{
FT_ULong fvar_len;
@@ -942,6 +940,8 @@
FT_Int instance_index;
+ face->is_default_instance = 1;
+
instance_index = FT_ABS( face_instance_index ) >> 16;
/* test whether current face is a GX font with named instances */
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index fd7e2b6..6ada402 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2566,7 +2566,12 @@
{
FT_Error error;
TT_LoaderRec loader;
- TT_Face face = (TT_Face)glyph->face;
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#define IS_DEFAULT_INSTANCE ( ( (TT_Face)glyph->face )->is_default_instance )
+#else
+#define IS_DEFAULT_INSTANCE 1
+#endif
FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index ));
@@ -2576,7 +2581,7 @@
/* try to load embedded bitmap (if any) */
if ( size->strike_index != 0xFFFFFFFFUL &&
( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
- face->is_default_instance )
+ IS_DEFAULT_INSTANCE )
{
error = load_sbit_image( size, glyph, glyph_index, load_flags );
if ( !error )