[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'.
This commit is contained in:
parent
64a91137f1
commit
e6a429e2c7
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
||||
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'.
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user