[cff, truetype] Another try for #49829. * src/cff/cffdrivr.c: Don't include `FT_SERVICE_METRICS_VARIATIONS_H'. (cff_get_advances): Use `ttface->variation_support'. * src/truetype/ttdriver.c (tt_get_advances): Use `ttface->variation_support'. * src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph): Use `ttface->variation_support'.
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
diff --git a/ChangeLog b/ChangeLog
index 93397fd..8b71086 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2016-12-21 Werner Lemberg <wl@gnu.org>
+ [cff, truetype] Another try for #49829.
+
+ * src/cff/cffdrivr.c: Don't include
+ `FT_SERVICE_METRICS_VARIATIONS_H'.
+ (cff_get_advances): Use `ttface->variation_support'.
+
+ * src/truetype/ttdriver.c (tt_get_advances): Use
+ `ttface->variation_support'.
+
+ * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
+ load_truetype_glyph): Use `ttface->variation_support'.
+
+2016-12-21 Werner Lemberg <wl@gnu.org>
+
[truetype, sfnt] Introduce font variation flags to `TT_Face'.
* include/freetype/internal/tttypes.h (TT_FACE_FLAG_VAR_XXX):
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 3f426c6..05d5fb8 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -34,7 +34,6 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_SERVICE_MULTIPLE_MASTERS_H
-#include FT_SERVICE_METRICS_VARIATIONS_H
#endif
#include "cfferrs.h"
@@ -209,18 +208,13 @@
TT_Face ttface = (TT_Face)face;
FT_Short dummy;
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_Service_MetricsVariations var =
- (FT_Service_MetricsVariations)ttface->var;
-#endif
-
if ( flags & FT_LOAD_VERTICAL_LAYOUT )
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without VVAR table */
- if ( !ttface->is_default_instance &&
- !( var && var->vadvance_adjust ) )
+ if ( !ttface->is_default_instance &&
+ !( ttface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
@@ -251,8 +245,8 @@
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without HVAR table */
- if ( !ttface->is_default_instance &&
- !( var && var->hadvance_adjust ) )
+ if ( !ttface->is_default_instance &&
+ !( ttface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 91ddff5..e7f3c0e 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -226,11 +226,6 @@
FT_UInt nn;
TT_Face face = (TT_Face)ttface;
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_Service_MetricsVariations var =
- (FT_Service_MetricsVariations)face->var;
-#endif
-
/* XXX: TODO: check for sbits */
@@ -238,8 +233,8 @@
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without VVAR table */
- if ( !face->is_default_instance &&
- !( var && var->vadvance_adjust ) )
+ if ( !face->is_default_instance &&
+ !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
@@ -258,8 +253,8 @@
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without HVAR table */
- if ( !face->is_default_instance &&
- !( var && var->hadvance_adjust ) )
+ if ( !face->is_default_instance &&
+ !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 06e8621..ce53983 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -888,10 +888,6 @@
if ( loader->face->doblend && !loader->face->is_default_instance )
{
- FT_Service_MetricsVariations var =
- (FT_Service_MetricsVariations)loader->face->var;
-
-
/* Deltas apply to the unscaled data. */
error = TT_Vary_Apply_Glyph_Deltas( loader->face,
loader->glyph_index,
@@ -900,10 +896,10 @@
/* recalculate linear horizontal and vertical advances */
/* if we don't have HVAR and VVAR, respectively */
- if ( !( var && var->hadvance_adjust ) )
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
loader->linear = outline->points[n_points - 3].x -
outline->points[n_points - 4].x;
- if ( !( var && var->vadvance_adjust ) )
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
loader->vadvance = outline->points[n_points - 1].x -
outline->points[n_points - 2].x;
@@ -1580,10 +1576,6 @@
if ( loader->face->doblend && !loader->face->is_default_instance )
{
- FT_Service_MetricsVariations var =
- (FT_Service_MetricsVariations)loader->face->var;
-
-
/* a small outline structure with four elements for */
/* communication with `TT_Vary_Apply_Glyph_Deltas' */
FT_Vector points[4];
@@ -1629,9 +1621,9 @@
/* recalculate linear horizontal and vertical advances */
/* if we don't have HVAR and VVAR, respectively */
- if ( !( var && var->hadvance_adjust ) )
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
loader->linear = loader->pp2.x - loader->pp1.x;
- if ( !( var && var->vadvance_adjust ) )
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
loader->vadvance = loader->pp4.x - loader->pp3.x;
}
@@ -1755,10 +1747,6 @@
if ( face->doblend && !face->is_default_instance )
{
- FT_Service_MetricsVariations var =
- (FT_Service_MetricsVariations)face->var;
-
-
short i, limit;
FT_SubGlyph subglyph;
@@ -1856,9 +1844,9 @@
/* recalculate linear horizontal and vertical advances */
/* if we don't have HVAR and VVAR, respectively */
- if ( !( var && var->hadvance_adjust ) )
+ if ( !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
loader->linear = loader->pp2.x - loader->pp1.x;
- if ( !( var && var->vadvance_adjust ) )
+ if ( !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
loader->vadvance = loader->pp4.x - loader->pp3.x;
Exit1: