summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c118
1 files changed, 12 insertions, 106 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c b/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c
index eeda69c3ed8..883f1a8970c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftobjs.c
@@ -4,7 +4,7 @@
*
* The FreeType private base classes (body).
*
- * Copyright (C) 1996-2022 by
+ * Copyright (C) 1996-2021 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -19,7 +19,6 @@
#include <freetype/ftlist.h>
#include <freetype/ftoutln.h>
#include <freetype/ftfntfmt.h>
-#include <freetype/otsvg.h>
#include <freetype/internal/ftvalid.h>
#include <freetype/internal/ftobjs.h>
@@ -28,7 +27,6 @@
#include <freetype/internal/ftstream.h>
#include <freetype/internal/sfnt.h> /* for SFNT_Load_Table_Func */
#include <freetype/internal/psaux.h> /* for PS_Driver */
-#include <freetype/internal/svginterface.h>
#include <freetype/tttables.h>
#include <freetype/tttags.h>
@@ -330,19 +328,6 @@
if ( !error && clazz->init_slot )
error = clazz->init_slot( slot );
-#ifdef FT_CONFIG_OPTION_SVG
- /* if SVG table exists, allocate the space in `slot->other` */
- if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
- {
- FT_SVG_Document document = NULL;
-
-
- if ( FT_NEW( document ) )
- goto Exit;
- slot->other = document;
- }
-#endif
-
Exit:
return error;
}
@@ -387,18 +372,7 @@
FT_Pos width, height, pitch;
- if ( slot->format == FT_GLYPH_FORMAT_SVG )
- {
- FT_Module module;
- SVG_Service svg_service;
-
-
- module = FT_Get_Module( slot->library, "ot-svg" );
- svg_service = (SVG_Service)module->clazz->module_interface;
-
- return (FT_Bool)svg_service->preset_slot( module, slot, FALSE );
- }
- else if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
+ if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
return 1;
if ( origin )
@@ -590,27 +564,8 @@
slot->subglyphs = NULL;
slot->control_data = NULL;
slot->control_len = 0;
-
-#ifndef FT_CONFIG_OPTION_SVG
- slot->other = NULL;
-#else
- if ( !( slot->face->face_flags & FT_FACE_FLAG_SVG ) )
- slot->other = NULL;
- else
- {
- if ( slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG )
- {
- FT_Memory memory = slot->face->memory;
- FT_SVG_Document doc = (FT_SVG_Document)slot->other;
-
-
- FT_FREE( doc->svg_document );
- slot->internal->load_flags &= ~FT_GLYPH_OWN_GZIP_SVG;
- }
- }
-#endif
-
- slot->format = FT_GLYPH_FORMAT_NONE;
+ slot->other = NULL;
+ slot->format = FT_GLYPH_FORMAT_NONE;
slot->linearHoriAdvance = 0;
slot->linearVertAdvance = 0;
@@ -628,23 +583,6 @@
FT_Driver_Class clazz = driver->clazz;
FT_Memory memory = driver->root.memory;
-#ifdef FT_CONFIG_OPTION_SVG
- if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
- {
- /* free memory in case SVG was there */
- if ( slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG )
- {
- FT_SVG_Document doc = (FT_SVG_Document)slot->other;
-
-
- FT_FREE( doc->svg_document );
-
- slot->internal->flags &= ~FT_GLYPH_OWN_GZIP_SVG;
- }
-
- FT_FREE( slot->other );
- }
-#endif
if ( clazz->done_slot )
clazz->done_slot( slot );
@@ -920,11 +858,6 @@
library = driver->root.library;
hinter = library->auto_hinter;
- /* undefined scale means no scale */
- if ( face->size->metrics.x_ppem == 0 ||
- face->size->metrics.y_ppem == 0 )
- load_flags |= FT_LOAD_NO_SCALE;
-
/* resolve load flags dependencies */
if ( load_flags & FT_LOAD_NO_RECURSE )
@@ -1014,21 +947,11 @@
FT_AutoHinter_Interface hinting;
- /* XXX: The use of the `FT_LOAD_XXX_ONLY` flags is not very */
- /* elegant. */
-
- /* try to load SVG documents if available */
- if ( FT_HAS_SVG( face ) )
- {
- error = driver->clazz->load_glyph( slot, face->size,
- glyph_index,
- load_flags | FT_LOAD_SVG_ONLY );
-
- if ( !error && slot->format == FT_GLYPH_FORMAT_SVG )
- goto Load_Ok;
- }
-
- /* try to load embedded bitmaps if available */
+ /* try to load embedded bitmaps first if available */
+ /* */
+ /* XXX: This is really a temporary hack that should disappear */
+ /* promptly with FreeType 2.1! */
+ /* */
if ( FT_HAS_FIXED_SIZES( face ) &&
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
{
@@ -1674,6 +1597,7 @@
FT_FREE( stream->base );
stream->size = 0;
+ stream->base = NULL;
stream->close = NULL;
}
@@ -2527,16 +2451,6 @@
#endif
- /* only use lower 31 bits together with sign bit */
- if ( face_index > 0 )
- face_index &= 0x7FFFFFFFL;
- else
- {
- face_index = -face_index;
- face_index &= 0x7FFFFFFFL;
- face_index = -face_index;
- }
-
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE3(( "FT_Open_Face: " ));
if ( face_index < 0 )
@@ -3409,9 +3323,6 @@
if ( !face )
return FT_THROW( Invalid_Face_Handle );
- if ( !face->size )
- return FT_THROW( Invalid_Size_Handle );
-
if ( !req || req->width < 0 || req->height < 0 ||
req->type >= FT_SIZE_REQUEST_TYPE_MAX )
return FT_THROW( Invalid_Argument );
@@ -4563,7 +4474,7 @@
render->glyph_format = clazz->glyph_format;
/* allocate raster object if needed */
- if ( clazz->raster_class && clazz->raster_class->raster_new )
+ if ( clazz->raster_class->raster_new )
{
error = clazz->raster_class->raster_new( memory, &render->raster );
if ( error )
@@ -4573,11 +4484,6 @@
render->render = clazz->render_glyph;
}
-#ifdef FT_CONFIG_OPTION_SVG
- if ( clazz->glyph_format == FT_GLYPH_FORMAT_SVG )
- render->render = clazz->render_glyph;
-#endif
-
/* add to list */
node->data = module;
FT_List_Add( &library->renderers, node );
@@ -5823,7 +5729,7 @@
SFNT_Service sfnt;
- if ( !face || !paint )
+ if ( !face || !paint || !paint )
return 0;
if ( !FT_IS_SFNT( face ) )