From 02280535bea08395871722f733aaaed70c992260 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 10 Dec 2018 14:59:49 +0100 Subject: 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 --- src/3rdparty/freetype/src/sfnt/ttpost.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/3rdparty/freetype/src/sfnt/ttpost.c') diff --git a/src/3rdparty/freetype/src/sfnt/ttpost.c b/src/3rdparty/freetype/src/sfnt/ttpost.c index 8d29d1e9f6..6de99ef977 100644 --- a/src/3rdparty/freetype/src/sfnt/ttpost.c +++ b/src/3rdparty/freetype/src/sfnt/ttpost.c @@ -2,10 +2,10 @@ /* */ /* ttpost.c */ /* */ -/* Postcript name table processing for TrueType and OpenType fonts */ +/* PostScript name table processing for TrueType and OpenType 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, */ @@ -29,6 +29,10 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_TRUETYPE_TAGS_H + + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES + #include "ttpost.h" #include "sferrors.h" @@ -321,12 +325,13 @@ FT_UNUSED( post_limit ); - /* UNDOCUMENTED! This value appears only in the Apple TT specs. */ if ( FT_READ_USHORT( num_glyphs ) ) goto Exit; /* check the number of glyphs */ - if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 ) + if ( num_glyphs > face->max_profile.numGlyphs || + num_glyphs > 258 || + num_glyphs < 1 ) { error = FT_THROW( Invalid_File_Format ); goto Exit; @@ -402,7 +407,7 @@ /* now read postscript table */ if ( format == 0x00020000L ) error = load_format_20( face, stream, post_limit ); - else if ( format == 0x00028000L ) + else if ( format == 0x00025000L ) error = load_format_25( face, stream, post_limit ); else error = FT_THROW( Invalid_File_Format ); @@ -441,7 +446,7 @@ FT_FREE( table->glyph_names ); table->num_names = 0; } - else if ( format == 0x00028000L ) + else if ( format == 0x00025000L ) { TT_Post_25 table = &names->names.format_25; @@ -468,8 +473,8 @@ /* idx :: The glyph index. */ /* */ /* */ - /* PSname :: The address of a string pointer. Will be NULL in case */ - /* of error, otherwise it is a pointer to the glyph name. */ + /* PSname :: The address of a string pointer. Undefined in case of */ + /* error, otherwise it is a pointer to the glyph name. */ /* */ /* You must not modify the returned string! */ /* */ @@ -537,7 +542,7 @@ *PSname = (FT_String*)table->glyph_names[name_index - 258]; } } - else if ( format == 0x00028000L ) + else if ( format == 0x00025000L ) { TT_Post_25 table = &names->names.format_25; @@ -559,5 +564,12 @@ return FT_Err_Ok; } +#else /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ + + /* ANSI C doesn't like empty source files */ + typedef int _tt_post_dummy; + +#endif /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ + /* END */ -- cgit v1.2.3