[sfnt] Remove temporary runtime flag for variable 'COLR' v1. Fixes #1187. * src/sfnt/ttcolr.c (top level, read_paint, tt_face_load_colr, tt_face_free_colr, get_deltas_for_var_index_base, tt_face_get_color_glyph_clipbox, tt_face_get_colorline_stops): Remove macro definition `VARIABLE_COLRV1_ENABLED` and its usage. * src/truetype/ttdriver.c (tt_property_set): Remove parsing of 'TEMPORARY-enable-variable-colrv1' property name. * src/truetype/ttobjs.h (TT_DriverRec): Remove `enable_variable_colrv1` flag.
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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
diff --git a/include/freetype/ftdriver.h b/include/freetype/ftdriver.h
index 3de6c6b..536b496 100644
--- a/include/freetype/ftdriver.h
+++ b/include/freetype/ftdriver.h
@@ -214,9 +214,9 @@ FT_BEGIN_HEADER
* itself, it is possible to control its behaviour with @FT_Property_Set
* and @FT_Property_Get.
*
- * The TrueType driver's module name is 'truetype'; two properties are
- * available, @interpreter-version and @TEMPORARY-enable-variable-colrv1, as
- * documented in the @properties section.
+ * The TrueType driver's module name is 'truetype'; a single property
+ * @interpreter-version is available, as documented in the @properties
+ * section.
*
* To help understand the differences between interpreter versions, we
* introduce a list of definitions, kindly provided by Greg Hitchcock.
@@ -823,49 +823,6 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @property:
- * TEMPORARY-enable-variable-colrv1
- *
- * @description:
- * Controls experimental support of variable COLRv1 and whether the COLRv1
- * implementation should take into account variation deltas. This tells the
- * COLRv1 API methods whether they should read from the font and apply
- * variable deltas to COLRv1 properties. The feature is default off. When
- * on, variable COLRv1 deltas are applied for COLRv1 features for which they
- * are already implemented. When off, variable deltas are ignored even if
- * the respective PaintVar* table may already be understood.
- *
- * WARNING: Temporary flag during development of variable COLRv1. This flag
- * will be removed, do not rely on it. Full variable COLRv1 support will be
- * announced separately.
- *
- * @note:
- * This property cannot be set via the `FREETYPE_PROPERTIES` environment
- * variable.
- *
- * @example:
- * The following example code demonstrates how to enable variable
- * COLRv1.
- *
- * ```
- * FT_Library library;
- * FT_Face face;
- * FT_Bool variable_colrv1 = TRUE;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "truetype",
- * "TEMPORARY-enable-variable-colrv1",
- * &variable_colr_v1 );
- * ```
- *
- * @since:
- * 2.12.2
- */
-
- /**************************************************************************
- *
- * @property:
* svg-hooks
*
* @description:
diff --git a/src/sfnt/ttcolr.c b/src/sfnt/ttcolr.c
index 3f8ba3b..d6693d7 100644
--- a/src/sfnt/ttcolr.c
+++ b/src/sfnt/ttcolr.c
@@ -38,13 +38,6 @@
#include <freetype/internal/services/svmm.h>
#endif
- /* the next two code lines are a temporary hack, to be removed together */
- /* with `VARIABLE_COLRV1_ENABLED` and related code as soon as variable */
- /* 'COLR' support is complete and tested */
-#include "../truetype/ttobjs.h"
-#include "../truetype/ttdriver.h"
-
-
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
#include "ttcolr.h"
@@ -65,11 +58,6 @@
#define COLRV1_HEADER_SIZE 34U
-#define VARIABLE_COLRV1_ENABLED \
- ( ((TT_Driver)FT_FACE_DRIVER( face ))->root.clazz == \
- &tt_driver_class && \
- ((TT_Driver)FT_FACE_DRIVER( face ))->enable_variable_colrv1 )
-
#define ENSURE_READ_BYTES( byte_size ) \
if ( p < colr->paints_start_v1 || \
p > (FT_Byte*)colr->table + colr->table_size - byte_size ) \
@@ -309,8 +297,7 @@
colr->delta_set_idx_map.outerIndex = NULL;
colr->delta_set_idx_map.innerIndex = NULL;
- if ( face->variation_support & TT_FACE_FLAG_VAR_FVAR &&
- VARIABLE_COLRV1_ENABLED )
+ if ( face->variation_support & TT_FACE_FLAG_VAR_FVAR )
{
FT_ULong var_idx_map_offset, var_store_offset;
@@ -370,7 +357,6 @@
InvalidTable:
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( VARIABLE_COLRV1_ENABLED )
{
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
@@ -404,7 +390,6 @@
if ( colr )
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( VARIABLE_COLRV1_ENABLED )
{
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
@@ -600,12 +585,6 @@
FT_UInt i = 0;
- if ( !VARIABLE_COLRV1_ENABLED )
- {
- FT_ASSERT( 0 );
- return 0;
- }
-
if ( var_index_base == 0xFFFFFFFF )
{
for ( i = 0; i < num_deltas; ++i )
@@ -710,8 +689,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
if ( (FT_PaintFormat_Internal)apaint->format ==
- FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID &&
- VARIABLE_COLRV1_ENABLED )
+ FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG( p );
@@ -772,7 +750,7 @@
apaint->u.linear_gradient.p2.y = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( do_read_var && VARIABLE_COLRV1_ENABLED )
+ if ( do_read_var )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG ( p );
@@ -830,7 +808,7 @@
apaint->u.radial_gradient.r1 = tmp < 0 ? FT_INT_MAX : tmp;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( do_read_var && VARIABLE_COLRV1_ENABLED )
+ if ( do_read_var )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG ( p );
@@ -881,7 +859,7 @@
F2DOT14_TO_FIXED( FT_NEXT_SHORT( p ) );
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( do_read_var && VARIABLE_COLRV1_ENABLED )
+ if ( do_read_var )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG ( p );
@@ -941,8 +919,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
if ( (FT_PaintFormat_Internal)apaint->format ==
- FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM &&
- VARIABLE_COLRV1_ENABLED )
+ FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG( p );
@@ -978,8 +955,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
if ( (FT_PaintFormat_Internal)apaint->format ==
- FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE &&
- VARIABLE_COLRV1_ENABLED )
+ FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG( p );
@@ -1055,8 +1031,7 @@
(FT_PaintFormat_Internal)apaint->format ==
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM ||
(FT_PaintFormat_Internal)apaint->format ==
- FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER ) &&
- VARIABLE_COLRV1_ENABLED )
+ FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER ) )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG( p );
@@ -1151,8 +1126,7 @@
if ( ( (FT_PaintFormat_Internal)apaint->format ==
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE ||
(FT_PaintFormat_Internal)apaint->format ==
- FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER ) &&
- VARIABLE_COLRV1_ENABLED )
+ FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER ) )
{
FT_UInt num_deltas = 0;
@@ -1225,8 +1199,7 @@
if ( ( (FT_PaintFormat_Internal)apaint->format ==
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW ||
(FT_PaintFormat_Internal)apaint->format ==
- FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER ) &&
- VARIABLE_COLRV1_ENABLED )
+ FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER ) )
{
ENSURE_READ_BYTES( 4 );
var_index_base = FT_NEXT_ULONG( p );
@@ -1471,7 +1444,7 @@
face->root.size->metrics.y_scale );
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( VARIABLE_COLRV1_ENABLED && format == 2 )
+ if ( format == 2 )
{
FT_ULong var_index_base = 0;
/* varIndexBase offset for clipbox is 3 at most. */
@@ -1661,7 +1634,6 @@
var_index_base = FT_NEXT_ULONG( p );
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( VARIABLE_COLRV1_ENABLED )
{
FT_Int item_deltas[2];
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index dc063bb..31dcb3c 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -108,23 +108,6 @@
return error;
}
- if ( !ft_strcmp( property_name, "TEMPORARY-enable-variable-colrv1" ) )
- {
- /* This flag is temporary and can't be set with environment variables. */
- if ( !value_is_string )
- {
- FT_Bool* bv = (FT_Bool*)value;
-
- if ( *bv == TRUE || *bv == FALSE)
- driver->enable_variable_colrv1 = *bv;
- else
- error = FT_ERR( Unimplemented_Feature );
- } else
- error = FT_ERR( Invalid_Argument );
-
- return error;
- }
-
FT_TRACE2(( "tt_property_set: missing property `%s'\n",
property_name ));
return FT_THROW( Missing_Property );
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index b1366fc..5fa239d 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -337,8 +337,6 @@ FT_BEGIN_HEADER
FT_UInt interpreter_version;
- FT_Bool enable_variable_colrv1;
-
} TT_DriverRec;