summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/autofit/afglobal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/autofit/afglobal.c')
-rw-r--r--src/3rdparty/freetype/src/autofit/afglobal.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/3rdparty/freetype/src/autofit/afglobal.c b/src/3rdparty/freetype/src/autofit/afglobal.c
index 6a9a1e5aaa..87a3fbfb0f 100644
--- a/src/3rdparty/freetype/src/autofit/afglobal.c
+++ b/src/3rdparty/freetype/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
*
* Auto-fitter routines to compute global hinting values (body).
*
- * Copyright (C) 2003-2019 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -19,7 +19,8 @@
#include "afglobal.h"
#include "afranges.h"
#include "afshaper.h"
-#include FT_INTERNAL_DEBUG_H
+#include "afws-decl.h"
+#include <freetype/internal/ftdebug.h>
/**************************************************************************
@@ -32,11 +33,6 @@
#define FT_COMPONENT afglobal
- /* get writing system specific header files */
-#undef WRITING_SYSTEM
-#define WRITING_SYSTEM( ws, WS ) /* empty */
-#include "afwrtsys.h"
-
#include "aferrors.h"
@@ -74,7 +70,7 @@
af_writing_system_classes[] =
{
-#include "afwrtsys.h"
+#include "afws-iter.h"
NULL /* do not remove */
};
@@ -285,10 +281,10 @@
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE4(( "\n"
- "style coverage\n"
- "==============\n"
- "\n" ));
+ FT_TRACE4(( "\n" ));
+ FT_TRACE4(( "style coverage\n" ));
+ FT_TRACE4(( "==============\n" ));
+ FT_TRACE4(( "\n" ));
for ( ss = 0; af_style_classes[ss]; ss++ )
{
@@ -306,7 +302,7 @@
if ( !( count % 10 ) )
FT_TRACE4(( " " ));
- FT_TRACE4(( " %d", idx ));
+ FT_TRACE4(( " %ld", idx ));
count++;
if ( !( count % 10 ) )
@@ -341,11 +337,13 @@
/* we allocate an AF_FaceGlobals structure together */
/* with the glyph_styles array */
- if ( FT_ALLOC( globals,
- sizeof ( *globals ) +
- (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
+ if ( FT_QALLOC( globals,
+ sizeof ( *globals ) +
+ (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
+ FT_ZERO( &globals->metrics );
+
globals->face = face;
globals->glyph_count = face->num_glyphs;
/* right after the globals structure come the glyph styles */
@@ -478,6 +476,10 @@
{
style = (AF_Style)( globals->glyph_styles[gindex] &
AF_STYLE_UNASSIGNED );
+ /* IMPORTANT: Clear the error code, see
+ * https://gitlab.freedesktop.org/freetype/freetype/-/issues/1063
+ */
+ error = FT_Err_Ok;
goto Again;
}