summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/sfnt/sfdriver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/sfnt/sfdriver.c')
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfdriver.c95
1 files changed, 61 insertions, 34 deletions
diff --git a/src/3rdparty/freetype/src/sfnt/sfdriver.c b/src/3rdparty/freetype/src/sfnt/sfdriver.c
index 2611685284..cc121e5790 100644
--- a/src/3rdparty/freetype/src/sfnt/sfdriver.c
+++ b/src/3rdparty/freetype/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
*
* High-level SFNT driver interface (body).
*
- * Copyright (C) 1996-2019 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -16,11 +16,10 @@
*/
-#include <ft2build.h>
-#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_SFNT_H
-#include FT_INTERNAL_OBJECTS_H
-#include FT_TRUETYPE_IDS_H
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/sfnt.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/ttnameid.h>
#include "sfdriver.h"
#include "ttload.h"
@@ -37,27 +36,31 @@
#include "ttcpal.h"
#endif
+#ifdef FT_CONFIG_OPTION_SVG
+#include "ttsvg.h"
+#endif
+
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include "ttpost.h"
#endif
#ifdef TT_CONFIG_OPTION_BDF
#include "ttbdf.h"
-#include FT_SERVICE_BDF_H
+#include <freetype/internal/services/svbdf.h>
#endif
#include "ttcmap.h"
#include "ttkern.h"
#include "ttmtx.h"
-#include FT_SERVICE_GLYPH_DICT_H
-#include FT_SERVICE_POSTSCRIPT_NAME_H
-#include FT_SERVICE_SFNT_H
-#include FT_SERVICE_TT_CMAP_H
+#include <freetype/internal/services/svgldict.h>
+#include <freetype/internal/services/svpostnm.h>
+#include <freetype/internal/services/svsfnt.h>
+#include <freetype/internal/services/svttcmap.h>
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-#include FT_MULTIPLE_MASTERS_H
-#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include <freetype/ftmm.h>
+#include <freetype/internal/services/svmm.h>
#endif
@@ -195,7 +198,7 @@
else if ( (FT_ULong)face->num_glyphs < FT_UINT_MAX )
max_gid = (FT_UInt)face->num_glyphs;
else
- FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
+ FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08lx\n",
FT_UINT_MAX, face->num_glyphs ));
for ( i = 0; i < max_gid; i++ )
@@ -492,17 +495,15 @@
char_type_func char_type,
FT_Bool report_invalid_characters )
{
- FT_Error error = FT_Err_Ok;
+ FT_Error error;
char* result = NULL;
FT_String* r;
FT_Char* p;
FT_UInt len;
- FT_UNUSED( error );
-
- if ( FT_ALLOC( result, entry->stringLength / 2 + 1 ) )
+ if ( FT_QALLOC( result, entry->stringLength / 2 + 1 ) )
return NULL;
if ( FT_STREAM_SEEK( entry->stringOffset ) ||
@@ -551,17 +552,15 @@
char_type_func char_type,
FT_Bool report_invalid_characters )
{
- FT_Error error = FT_Err_Ok;
+ FT_Error error;
char* result = NULL;
FT_String* r;
FT_Char* p;
FT_UInt len;
- FT_UNUSED( error );
-
- if ( FT_ALLOC( result, entry->stringLength + 1 ) )
+ if ( FT_QALLOC( result, entry->stringLength + 1 ) )
return NULL;
if ( FT_STREAM_SEEK( entry->stringOffset ) ||
@@ -869,8 +868,8 @@
result[len] = '\0';
FT_TRACE0(( "sfnt_get_var_ps_name:"
- " Shortening variation PS name prefix\n"
- " "
+ " Shortening variation PS name prefix\n" ));
+ FT_TRACE0(( " "
" to %d characters\n", len ));
}
@@ -921,16 +920,16 @@
if ( !subfamily_name )
{
FT_TRACE1(( "sfnt_get_var_ps_name:"
- " can't construct named instance PS name;\n"
- " "
+ " can't construct named instance PS name;\n" ));
+ FT_TRACE1(( " "
" trying to construct normal instance PS name\n" ));
goto construct_instance_name;
}
/* after the prefix we have character `-' followed by the */
/* subfamily name (using only characters a-z, A-Z, and 0-9) */
- if ( FT_ALLOC( result, face->var_postscript_prefix_len +
- 1 + ft_strlen( subfamily_name ) + 1 ) )
+ if ( FT_QALLOC( result, face->var_postscript_prefix_len +
+ 1 + ft_strlen( subfamily_name ) + 1 ) )
return NULL;
ft_strcpy( result, face->var_postscript_prefix );
@@ -958,9 +957,9 @@
construct_instance_name:
axis = mm_var->axis;
- if ( FT_ALLOC( result,
- face->var_postscript_prefix_len +
- num_coords * MAX_VALUE_DESCRIPTOR_LEN + 1 ) )
+ if ( FT_QALLOC( result,
+ face->var_postscript_prefix_len +
+ num_coords * MAX_VALUE_DESCRIPTOR_LEN + 1 ) )
return NULL;
p = result;
@@ -994,6 +993,7 @@
if ( t != ' ' && ft_isalnum( t ) )
*p++ = t;
}
+ *p++ = '\0';
}
check_length:
@@ -1214,6 +1214,14 @@
#define PUT_COLOR_LAYERS( a ) NULL
#endif
+#ifdef FT_CONFIG_OPTION_SVG
+#define PUT_SVG_SUPPORT( a ) a
+#else
+#define PUT_SVG_SUPPORT( a ) NULL
+#endif
+
+#define PUT_COLOR_LAYERS_V1( a ) PUT_COLOR_LAYERS( a )
+
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#define PUT_PS_NAMES( a ) a
#else
@@ -1272,9 +1280,9 @@
/* TT_Free_Table_Func free_eblc */
PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ),
- /* TT_Set_SBit_Strike_Func set_sbit_strike */
+ /* TT_Set_SBit_Strike_Func set_sbit_strike */
PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
- /* TT_Load_Strike_Metrics_Func load_strike_metrics */
+ /* TT_Load_Strike_Metrics_Func load_strike_metrics */
PUT_COLOR_LAYERS( tt_face_load_cpal ),
/* TT_Load_Table_Func load_cpal */
@@ -1288,13 +1296,32 @@
/* TT_Set_Palette_Func set_palette */
PUT_COLOR_LAYERS( tt_face_get_colr_layer ),
/* TT_Get_Colr_Layer_Func get_colr_layer */
+
+ PUT_COLOR_LAYERS_V1( tt_face_get_colr_glyph_paint ),
+ /* TT_Get_Color_Glyph_Paint_Func get_colr_glyph_paint */
+ PUT_COLOR_LAYERS_V1( tt_face_get_color_glyph_clipbox ),
+ /* TT_Get_Color_Glyph_ClipBox_Func get_clipbox */
+ PUT_COLOR_LAYERS_V1( tt_face_get_paint_layers ),
+ /* TT_Get_Paint_Layers_Func get_paint_layers */
+ PUT_COLOR_LAYERS_V1( tt_face_get_colorline_stops ),
+ /* TT_Get_Paint get_paint */
+ PUT_COLOR_LAYERS_V1( tt_face_get_paint ),
+ /* TT_Get_Colorline_Stops_Func get_colorline_stops */
+
PUT_COLOR_LAYERS( tt_face_colr_blend_layer ),
/* TT_Blend_Colr_Func colr_blend */
tt_face_get_metrics, /* TT_Get_Metrics_Func get_metrics */
tt_face_get_name, /* TT_Get_Name_Func get_name */
- sfnt_get_name_id /* TT_Get_Name_ID_Func get_name_id */
+ sfnt_get_name_id, /* TT_Get_Name_ID_Func get_name_id */
+
+ PUT_SVG_SUPPORT( tt_face_load_svg ),
+ /* TT_Load_Table_Func load_svg */
+ PUT_SVG_SUPPORT( tt_face_free_svg ),
+ /* TT_Free_Table_Func free_svg */
+ PUT_SVG_SUPPORT( tt_face_load_svg_doc )
+ /* TT_Load_Svg_Doc_Func load_svg_doc */
)