summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/type1/t1afm.c
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2018-12-10 14:59:49 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-01-31 10:40:41 +0000
commit02280535bea08395871722f733aaaed70c992260 (patch)
tree8ff7fd6a26710645d18887fad6299ae7debfded1 /src/3rdparty/freetype/src/type1/t1afm.c
parent93a803a6de27d9eb57931c431b5f3d074914f693 (diff)
Update bundled Freetype to 2.9.1
This is required to support the new emoji font on Android 9. [ChangeLog][Freetype] Upgraded bundled Freetype version to 2.9.1. This also adds support for the latest emoji font in use on Android 9. Fixes: QTBUG-70657 Change-Id: I99be72f0d23c20aca122b8fdadd4ded87b2edce1 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/3rdparty/freetype/src/type1/t1afm.c')
-rw-r--r--src/3rdparty/freetype/src/type1/t1afm.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/3rdparty/freetype/src/type1/t1afm.c b/src/3rdparty/freetype/src/type1/t1afm.c
index 7f32059f85..61053d9a64 100644
--- a/src/3rdparty/freetype/src/type1/t1afm.c
+++ b/src/3rdparty/freetype/src/type1/t1afm.c
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,6 +24,8 @@
#include "t1errors.h"
+#ifndef T1_CONFIG_OPTION_NO_AFM
+
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@@ -197,7 +199,7 @@
/* encoding of first glyph (1 byte) */
/* encoding of second glyph (1 byte) */
/* offset (little-endian short) */
- for ( ; p < limit ; p += 4 )
+ for ( ; p < limit; p += 4 )
{
kp->index1 = FT_Get_Char_Index( t1_face, p[0] );
kp->index2 = FT_Get_Char_Index( t1_face, p[1] );
@@ -208,7 +210,7 @@
kp++;
}
- if ( oldcharmap != NULL )
+ if ( oldcharmap )
error = FT_Set_Charmap( t1_face, oldcharmap );
if ( error )
goto Exit;
@@ -239,8 +241,18 @@
AFM_ParserRec parser;
AFM_FontInfo fi = NULL;
FT_Error error = FT_ERR( Unknown_File_Format );
- T1_Font t1_font = &( (T1_Face)t1_face )->type1;
+ T1_Face face = (T1_Face)t1_face;
+ T1_Font t1_font = &face->type1;
+
+
+ if ( face->afm_data )
+ {
+ FT_TRACE1(( "T1_Read_Metrics:"
+ " Freeing previously attached metrics data.\n" ));
+ T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data );
+ face->afm_data = NULL;
+ }
if ( FT_NEW( fi ) ||
FT_FRAME_ENTER( stream->size ) )
@@ -250,7 +262,7 @@
fi->Ascender = t1_font->font_bbox.yMax;
fi->Descender = t1_font->font_bbox.yMin;
- psaux = (PSAux_Service)( (T1_Face)t1_face )->psaux;
+ psaux = (PSAux_Service)face->psaux;
if ( psaux->afm_parser_funcs )
{
error = psaux->afm_parser_funcs->init( &parser,
@@ -298,15 +310,15 @@
if ( fi->NumKernPair )
{
t1_face->face_flags |= FT_FACE_FLAG_KERNING;
- ( (T1_Face)t1_face )->afm_data = fi;
- fi = NULL;
+ face->afm_data = fi;
+ fi = NULL;
}
}
FT_FRAME_EXIT();
Exit:
- if ( fi != NULL )
+ if ( fi )
T1_Done_Metrics( memory, fi );
return error;
@@ -392,5 +404,12 @@
return FT_Err_Ok;
}
+#else /* T1_CONFIG_OPTION_NO_AFM */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _t1_afm_dummy;
+
+#endif /* T1_CONFIG_OPTION_NO_AFM */
+
/* END */