diff options
Diffstat (limited to 'thirdparty')
438 files changed, 3843 insertions, 807 deletions
diff --git a/thirdparty/README.md b/thirdparty/README.md index 1a3588e0e0..e51e7d7f24 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -140,7 +140,7 @@ Use UI font variant if available, because it has tight vertical metrics and good ## freetype - Upstream: https://www.freetype.org -- Version: 2.10.1 (2019) +- Version: 2.10.2 (2020) - License: FreeType License (BSD-like) Files extracted from upstream source: diff --git a/thirdparty/freetype/include/freetype/config/ftconfig.h b/thirdparty/freetype/include/freetype/config/ftconfig.h index 9466603377..14eecefc2a 100644 --- a/thirdparty/freetype/include/freetype/config/ftconfig.h +++ b/thirdparty/freetype/include/freetype/config/ftconfig.h @@ -4,7 +4,7 @@ * * ANSI-specific configuration file (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/config/ftheader.h b/thirdparty/freetype/include/freetype/config/ftheader.h index 696d6ba906..e91598e207 100644 --- a/thirdparty/freetype/include/freetype/config/ftheader.h +++ b/thirdparty/freetype/include/freetype/config/ftheader.h @@ -4,7 +4,7 @@ * * Build macros of the FreeType 2 library. * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/config/ftoption.h b/thirdparty/freetype/include/freetype/config/ftoption.h index 12f47a82e8..426806d2e4 100644 --- a/thirdparty/freetype/include/freetype/config/ftoption.h +++ b/thirdparty/freetype/include/freetype/config/ftoption.h @@ -4,7 +4,7 @@ * * User-selectable configuration macros (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -294,6 +294,22 @@ FT_BEGIN_HEADER /************************************************************************** * + * Brotli support. + * + * FreeType uses the Brotli library to provide support for decompressing + * WOFF2 streams. + * + * Define this macro if you want to enable this 'feature'. + * + * If you use a build system like cmake or the `configure` script, + * options set by those programs have precedence, overwriting the value + * here with the configured one. + */ +/* #define FT_CONFIG_OPTION_USE_BROTLI */ + + + /************************************************************************** + * * Glyph Postscript Names handling * * By default, FreeType 2 is compiled with the 'psnames' module. This @@ -871,9 +887,11 @@ FT_BEGIN_HEADER * * Compile 'autofit' module with fallback Indic script support, covering * some scripts that the 'latin' submodule of the 'autofit' module doesn't - * (yet) handle. + * (yet) handle. Currently, this needs option `AF_CONFIG_OPTION_CJK`. */ +#ifdef AF_CONFIG_OPTION_CJK #define AF_CONFIG_OPTION_INDIC +#endif /************************************************************************** diff --git a/thirdparty/freetype/include/freetype/config/ftstdlib.h b/thirdparty/freetype/include/freetype/config/ftstdlib.h index 438b6145d5..d6091f8b3d 100644 --- a/thirdparty/freetype/include/freetype/config/ftstdlib.h +++ b/thirdparty/freetype/include/freetype/config/ftstdlib.h @@ -5,7 +5,7 @@ * ANSI-specific library and header configuration file (specification * only). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/freetype.h b/thirdparty/freetype/include/freetype/freetype.h index a6bb667e3a..973264b125 100644 --- a/thirdparty/freetype/include/freetype/freetype.h +++ b/thirdparty/freetype/include/freetype/freetype.h @@ -4,7 +4,7 @@ * * FreeType high-level API and common types (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -1239,7 +1239,7 @@ FT_BEGIN_HEADER * */ #define FT_HAS_HORIZONTAL( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) + ( !!( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) ) /************************************************************************** @@ -1253,7 +1253,7 @@ FT_BEGIN_HEADER * */ #define FT_HAS_VERTICAL( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) + ( !!( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) ) /************************************************************************** @@ -1267,7 +1267,7 @@ FT_BEGIN_HEADER * */ #define FT_HAS_KERNING( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_KERNING ) + ( !!( (face)->face_flags & FT_FACE_FLAG_KERNING ) ) /************************************************************************** @@ -1282,7 +1282,7 @@ FT_BEGIN_HEADER * */ #define FT_IS_SCALABLE( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) + ( !!( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) ) /************************************************************************** @@ -1301,7 +1301,7 @@ FT_BEGIN_HEADER * */ #define FT_IS_SFNT( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_SFNT ) + ( !!( (face)->face_flags & FT_FACE_FLAG_SFNT ) ) /************************************************************************** @@ -1316,7 +1316,7 @@ FT_BEGIN_HEADER * */ #define FT_IS_FIXED_WIDTH( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) + ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) ) /************************************************************************** @@ -1331,7 +1331,7 @@ FT_BEGIN_HEADER * */ #define FT_HAS_FIXED_SIZES( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) + ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) ) /************************************************************************** @@ -1357,7 +1357,7 @@ FT_BEGIN_HEADER * */ #define FT_HAS_GLYPH_NAMES( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) + ( !!( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) ) /************************************************************************** @@ -1372,7 +1372,7 @@ FT_BEGIN_HEADER * */ #define FT_HAS_MULTIPLE_MASTERS( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) + ( !!( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) ) /************************************************************************** @@ -1394,7 +1394,7 @@ FT_BEGIN_HEADER * */ #define FT_IS_NAMED_INSTANCE( face ) \ - ( (face)->face_index & 0x7FFF0000L ) + ( !!( (face)->face_index & 0x7FFF0000L ) ) /************************************************************************** @@ -1412,7 +1412,7 @@ FT_BEGIN_HEADER * */ #define FT_IS_VARIATION( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_VARIATION ) + ( !!( (face)->face_flags & FT_FACE_FLAG_VARIATION ) ) /************************************************************************** @@ -1429,7 +1429,7 @@ FT_BEGIN_HEADER * */ #define FT_IS_CID_KEYED( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) + ( !!( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) ) /************************************************************************** @@ -1443,7 +1443,7 @@ FT_BEGIN_HEADER * */ #define FT_IS_TRICKY( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_TRICKY ) + ( !!( (face)->face_flags & FT_FACE_FLAG_TRICKY ) ) /************************************************************************** @@ -1460,7 +1460,7 @@ FT_BEGIN_HEADER * */ #define FT_HAS_COLOR( face ) \ - ( (face)->face_flags & FT_FACE_FLAG_COLOR ) + ( !!( (face)->face_flags & FT_FACE_FLAG_COLOR ) ) /************************************************************************** @@ -2078,7 +2078,8 @@ FT_BEGIN_HEADER * The size in bytes of the file in memory. * * pathname :: - * A pointer to an 8-bit file pathname. + * A pointer to an 8-bit file pathname. The pointer is not owned by + * FreeType. * * stream :: * A handle to a source stream object. @@ -4781,7 +4782,7 @@ FT_BEGIN_HEADER */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 10 -#define FREETYPE_PATCH 1 +#define FREETYPE_PATCH 2 /************************************************************************** diff --git a/thirdparty/freetype/include/freetype/ftadvanc.h b/thirdparty/freetype/include/freetype/ftadvanc.h index 95c38f92bd..c30472bfdb 100644 --- a/thirdparty/freetype/include/freetype/ftadvanc.h +++ b/thirdparty/freetype/include/freetype/ftadvanc.h @@ -4,7 +4,7 @@ * * Quick computation of advance widths (specification only). * - * Copyright (C) 2008-2019 by + * Copyright (C) 2008-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftbbox.h b/thirdparty/freetype/include/freetype/ftbbox.h index 22da70c0dc..294f996976 100644 --- a/thirdparty/freetype/include/freetype/ftbbox.h +++ b/thirdparty/freetype/include/freetype/ftbbox.h @@ -4,7 +4,7 @@ * * FreeType exact bbox computation (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftbdf.h b/thirdparty/freetype/include/freetype/ftbdf.h index 1c46da5985..61db27c8f8 100644 --- a/thirdparty/freetype/include/freetype/ftbdf.h +++ b/thirdparty/freetype/include/freetype/ftbdf.h @@ -4,7 +4,7 @@ * * FreeType API for accessing BDF-specific strings (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftbitmap.h b/thirdparty/freetype/include/freetype/ftbitmap.h index a6acdb9690..6c55455767 100644 --- a/thirdparty/freetype/include/freetype/ftbitmap.h +++ b/thirdparty/freetype/include/freetype/ftbitmap.h @@ -4,7 +4,7 @@ * * FreeType utility functions for bitmaps (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftbzip2.h b/thirdparty/freetype/include/freetype/ftbzip2.h index ae88cfdbdb..cb8e8458ef 100644 --- a/thirdparty/freetype/include/freetype/ftbzip2.h +++ b/thirdparty/freetype/include/freetype/ftbzip2.h @@ -4,7 +4,7 @@ * * Bzip2-compressed stream support. * - * Copyright (C) 2010-2019 by + * Copyright (C) 2010-2020 by * Joel Klinghed. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftcache.h b/thirdparty/freetype/include/freetype/ftcache.h index 0d589d0b34..d82c4815cf 100644 --- a/thirdparty/freetype/include/freetype/ftcache.h +++ b/thirdparty/freetype/include/freetype/ftcache.h @@ -4,7 +4,7 @@ * * FreeType Cache subsystem (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftcid.h b/thirdparty/freetype/include/freetype/ftcid.h index 8eafc1c78f..85b74e0047 100644 --- a/thirdparty/freetype/include/freetype/ftcid.h +++ b/thirdparty/freetype/include/freetype/ftcid.h @@ -4,7 +4,7 @@ * * FreeType API for accessing CID font information (specification). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * Dereg Clegg and Michael Toftdal. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftcolor.h b/thirdparty/freetype/include/freetype/ftcolor.h index cf18021953..b744939dd8 100644 --- a/thirdparty/freetype/include/freetype/ftcolor.h +++ b/thirdparty/freetype/include/freetype/ftcolor.h @@ -4,7 +4,7 @@ * * FreeType's glyph color management (specification). * - * Copyright (C) 2018-2019 by + * Copyright (C) 2018-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -125,9 +125,9 @@ FT_BEGIN_HEADER * The number of palettes. * * palette_name_ids :: - * A read-only array of palette name IDs with `num_palettes` elements, - * corresponding to entries like 'dark' or 'light' in the font's 'name' - * table. + * An optional read-only array of palette name IDs with `num_palettes` + * elements, corresponding to entries like 'dark' or 'light' in the + * font's 'name' table. * * An empty name ID in the 'CPAL' table gets represented as value * 0xFFFF. @@ -135,8 +135,8 @@ FT_BEGIN_HEADER * `NULL` if the font's 'CPAL' table doesn't contain appropriate data. * * palette_flags :: - * A read-only array of palette flags with `num_palettes` elements. - * Possible values are an ORed combination of + * An optional read-only array of palette flags with `num_palettes` + * elements. Possible values are an ORed combination of * @FT_PALETTE_FOR_LIGHT_BACKGROUND and * @FT_PALETTE_FOR_DARK_BACKGROUND. * @@ -147,7 +147,7 @@ FT_BEGIN_HEADER * same size. * * palette_entry_name_ids :: - * A read-only array of palette entry name IDs with + * An optional read-only array of palette entry name IDs with * `num_palette_entries`. In each palette, entries with the same index * have the same function. For example, index~0 might correspond to * string 'outline' in the font's 'name' table to indicate that this @@ -163,6 +163,9 @@ FT_BEGIN_HEADER * Use function @FT_Get_Sfnt_Name to map name IDs and entry name IDs to * name strings. * + * Use function @FT_Palette_Select to get the colors associated with a + * palette entry. + * * @since: * 2.10 */ diff --git a/thirdparty/freetype/include/freetype/ftdriver.h b/thirdparty/freetype/include/freetype/ftdriver.h index 497bde9f6e..19b666ecb0 100644 --- a/thirdparty/freetype/include/freetype/ftdriver.h +++ b/thirdparty/freetype/include/freetype/ftdriver.h @@ -4,7 +4,7 @@ * * FreeType API for controlling driver modules (specification only). * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/fterrdef.h b/thirdparty/freetype/include/freetype/fterrdef.h index 9bc7dc65e3..895d2d4dc8 100644 --- a/thirdparty/freetype/include/freetype/fterrdef.h +++ b/thirdparty/freetype/include/freetype/fterrdef.h @@ -4,7 +4,7 @@ * * FreeType error codes (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/fterrors.h b/thirdparty/freetype/include/freetype/fterrors.h index 2b47eb2096..771bc5db52 100644 --- a/thirdparty/freetype/include/freetype/fterrors.h +++ b/thirdparty/freetype/include/freetype/fterrors.h @@ -4,7 +4,7 @@ * * FreeType error code handling (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftfntfmt.h b/thirdparty/freetype/include/freetype/ftfntfmt.h index aae0b13264..ad5a1d4162 100644 --- a/thirdparty/freetype/include/freetype/ftfntfmt.h +++ b/thirdparty/freetype/include/freetype/ftfntfmt.h @@ -4,7 +4,7 @@ * * Support functions for font formats. * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftgasp.h b/thirdparty/freetype/include/freetype/ftgasp.h index 24673d8ce1..aca1a1329d 100644 --- a/thirdparty/freetype/include/freetype/ftgasp.h +++ b/thirdparty/freetype/include/freetype/ftgasp.h @@ -4,7 +4,7 @@ * * Access of TrueType's 'gasp' table (specification). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftglyph.h b/thirdparty/freetype/include/freetype/ftglyph.h index fedab8491e..ec515a3694 100644 --- a/thirdparty/freetype/include/freetype/ftglyph.h +++ b/thirdparty/freetype/include/freetype/ftglyph.h @@ -4,7 +4,7 @@ * * FreeType convenience functions to handle glyphs (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftgxval.h b/thirdparty/freetype/include/freetype/ftgxval.h index b14f637c56..691a73b94a 100644 --- a/thirdparty/freetype/include/freetype/ftgxval.h +++ b/thirdparty/freetype/include/freetype/ftgxval.h @@ -4,7 +4,7 @@ * * FreeType API for validating TrueTypeGX/AAT tables (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * Masatake YAMATO, Redhat K.K, * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/include/freetype/ftgzip.h b/thirdparty/freetype/include/freetype/ftgzip.h index 418c61228e..f588c8503b 100644 --- a/thirdparty/freetype/include/freetype/ftgzip.h +++ b/thirdparty/freetype/include/freetype/ftgzip.h @@ -4,7 +4,7 @@ * * Gzip-compressed stream support. * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftimage.h b/thirdparty/freetype/include/freetype/ftimage.h index face34fe49..185967c1b8 100644 --- a/thirdparty/freetype/include/freetype/ftimage.h +++ b/thirdparty/freetype/include/freetype/ftimage.h @@ -5,7 +5,7 @@ * FreeType glyph image formats and default raster interface * (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftincrem.h b/thirdparty/freetype/include/freetype/ftincrem.h index a4db02b585..8c00cfe41c 100644 --- a/thirdparty/freetype/include/freetype/ftincrem.h +++ b/thirdparty/freetype/include/freetype/ftincrem.h @@ -4,7 +4,7 @@ * * FreeType incremental loading (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftlcdfil.h b/thirdparty/freetype/include/freetype/ftlcdfil.h index 3a19d043bb..c5516d0e0d 100644 --- a/thirdparty/freetype/include/freetype/ftlcdfil.h +++ b/thirdparty/freetype/include/freetype/ftlcdfil.h @@ -5,7 +5,7 @@ * FreeType API for color filtering of subpixel bitmap glyphs * (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftlist.h b/thirdparty/freetype/include/freetype/ftlist.h index 4782892d1a..3f6079f243 100644 --- a/thirdparty/freetype/include/freetype/ftlist.h +++ b/thirdparty/freetype/include/freetype/ftlist.h @@ -4,7 +4,7 @@ * * Generic list support for FreeType (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftlzw.h b/thirdparty/freetype/include/freetype/ftlzw.h index fd22968f5a..37a53c1b3e 100644 --- a/thirdparty/freetype/include/freetype/ftlzw.h +++ b/thirdparty/freetype/include/freetype/ftlzw.h @@ -4,7 +4,7 @@ * * LZW-compressed stream support. * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftmac.h b/thirdparty/freetype/include/freetype/ftmac.h index 92b9f3dc0f..c1a0aa373e 100644 --- a/thirdparty/freetype/include/freetype/ftmac.h +++ b/thirdparty/freetype/include/freetype/ftmac.h @@ -4,7 +4,7 @@ * * Additional Mac-specific API. * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftmm.h b/thirdparty/freetype/include/freetype/ftmm.h index f2e16b6408..0d839942b9 100644 --- a/thirdparty/freetype/include/freetype/ftmm.h +++ b/thirdparty/freetype/include/freetype/ftmm.h @@ -4,7 +4,7 @@ * * FreeType Multiple Master font interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftmodapi.h b/thirdparty/freetype/include/freetype/ftmodapi.h index 8d039c4f3a..01cb5fba88 100644 --- a/thirdparty/freetype/include/freetype/ftmodapi.h +++ b/thirdparty/freetype/include/freetype/ftmodapi.h @@ -4,7 +4,7 @@ * * FreeType modules public interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftmoderr.h b/thirdparty/freetype/include/freetype/ftmoderr.h index e16993572c..5e6aeeb43e 100644 --- a/thirdparty/freetype/include/freetype/ftmoderr.h +++ b/thirdparty/freetype/include/freetype/ftmoderr.h @@ -4,7 +4,7 @@ * * FreeType module error offsets (specification). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftotval.h b/thirdparty/freetype/include/freetype/ftotval.h index c034f48959..6f46c414bd 100644 --- a/thirdparty/freetype/include/freetype/ftotval.h +++ b/thirdparty/freetype/include/freetype/ftotval.h @@ -4,7 +4,7 @@ * * FreeType API for validating OpenType tables (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftoutln.h b/thirdparty/freetype/include/freetype/ftoutln.h index b72327b703..fa295b0ab6 100644 --- a/thirdparty/freetype/include/freetype/ftoutln.h +++ b/thirdparty/freetype/include/freetype/ftoutln.h @@ -5,7 +5,7 @@ * Support for the FT_Outline type used to store glyph shapes of * most scalable font formats (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftparams.h b/thirdparty/freetype/include/freetype/ftparams.h index c374ee2f2f..255c6bb160 100644 --- a/thirdparty/freetype/include/freetype/ftparams.h +++ b/thirdparty/freetype/include/freetype/ftparams.h @@ -4,7 +4,7 @@ * * FreeType API for possible FT_Parameter tags (specification only). * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftpfr.h b/thirdparty/freetype/include/freetype/ftpfr.h index b4eca76eb7..58fbbb78d3 100644 --- a/thirdparty/freetype/include/freetype/ftpfr.h +++ b/thirdparty/freetype/include/freetype/ftpfr.h @@ -4,7 +4,7 @@ * * FreeType API for accessing PFR-specific data (specification only). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftrender.h b/thirdparty/freetype/include/freetype/ftrender.h index a01c774272..6845111901 100644 --- a/thirdparty/freetype/include/freetype/ftrender.h +++ b/thirdparty/freetype/include/freetype/ftrender.h @@ -4,7 +4,7 @@ * * FreeType renderer modules public interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftsizes.h b/thirdparty/freetype/include/freetype/ftsizes.h index 6c63cef2bf..7dc9295211 100644 --- a/thirdparty/freetype/include/freetype/ftsizes.h +++ b/thirdparty/freetype/include/freetype/ftsizes.h @@ -4,7 +4,7 @@ * * FreeType size objects management (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftsnames.h b/thirdparty/freetype/include/freetype/ftsnames.h index 4d43602a42..2982760635 100644 --- a/thirdparty/freetype/include/freetype/ftsnames.h +++ b/thirdparty/freetype/include/freetype/ftsnames.h @@ -7,7 +7,7 @@ * * This is _not_ used to retrieve glyph names! * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftstroke.h b/thirdparty/freetype/include/freetype/ftstroke.h index 01a9c1811c..141af7d0ba 100644 --- a/thirdparty/freetype/include/freetype/ftstroke.h +++ b/thirdparty/freetype/include/freetype/ftstroke.h @@ -4,7 +4,7 @@ * * FreeType path stroker (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -114,22 +114,19 @@ FT_BEGIN_HEADER * FT_STROKER_LINEJOIN_MITER_FIXED :: * Used to render mitered line joins, with fixed bevels if the miter * limit is exceeded. The outer edges of the strokes for the two - * segments are extended until they meet at an angle. If the segments - * meet at too sharp an angle (such that the miter would extend from - * the intersection of the segments a distance greater than the product - * of the miter limit value and the border radius), then a bevel join - * (see above) is used instead. This prevents long spikes being - * created. `FT_STROKER_LINEJOIN_MITER_FIXED` generates a miter line - * join as used in PostScript and PDF. + * segments are extended until they meet at an angle. A bevel join + * (see above) is used if the segments meet at too sharp an angle and + * the outer edges meet beyond a distance corresponding to the meter + * limit. This prevents long spikes being created. + * `FT_STROKER_LINEJOIN_MITER_FIXED` generates a miter line join as + * used in PostScript and PDF. * * FT_STROKER_LINEJOIN_MITER_VARIABLE :: * FT_STROKER_LINEJOIN_MITER :: * Used to render mitered line joins, with variable bevels if the miter - * limit is exceeded. The intersection of the strokes is clipped at a - * line perpendicular to the bisector of the angle between the strokes, - * at the distance from the intersection of the segments equal to the - * product of the miter limit value and the border radius. This - * prevents long spikes being created. + * limit is exceeded. The intersection of the strokes is clipped + * perpendicularly to the bisector, at a distance corresponding to + * the miter limit. This prevents long spikes being created. * `FT_STROKER_LINEJOIN_MITER_VARIABLE` generates a mitered line join * as used in XPS. `FT_STROKER_LINEJOIN_MITER` is an alias for * `FT_STROKER_LINEJOIN_MITER_VARIABLE`, retained for backward @@ -296,12 +293,17 @@ FT_BEGIN_HEADER * The line join style. * * miter_limit :: - * The miter limit for the `FT_STROKER_LINEJOIN_MITER_FIXED` and - * `FT_STROKER_LINEJOIN_MITER_VARIABLE` line join styles, expressed as - * 16.16 fixed-point value. + * The maximum reciprocal sine of half-angle at the miter join, + * expressed as 16.16 fixed point value. * * @note: - * The radius is expressed in the same units as the outline coordinates. + * The `radius` is expressed in the same units as the outline + * coordinates. + * + * The `miter_limit` multiplied by the `radius` gives the maximum size + * of a miter spike, at which it is clipped for + * @FT_STROKER_LINEJOIN_MITER_VARIABLE or replaced with a bevel join for + * @FT_STROKER_LINEJOIN_MITER_FIXED. * * This function calls @FT_Stroker_Rewind automatically. */ diff --git a/thirdparty/freetype/include/freetype/ftsynth.h b/thirdparty/freetype/include/freetype/ftsynth.h index 8754f97cee..3882e69e61 100644 --- a/thirdparty/freetype/include/freetype/ftsynth.h +++ b/thirdparty/freetype/include/freetype/ftsynth.h @@ -5,7 +5,7 @@ * FreeType synthesizing code for emboldening and slanting * (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftsystem.h b/thirdparty/freetype/include/freetype/ftsystem.h index 889a6ba172..f7fecb53f3 100644 --- a/thirdparty/freetype/include/freetype/ftsystem.h +++ b/thirdparty/freetype/include/freetype/ftsystem.h @@ -4,7 +4,7 @@ * * FreeType low-level system interface definition (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/fttrigon.h b/thirdparty/freetype/include/freetype/fttrigon.h index 37e1412fdf..968df1fbfd 100644 --- a/thirdparty/freetype/include/freetype/fttrigon.h +++ b/thirdparty/freetype/include/freetype/fttrigon.h @@ -4,7 +4,7 @@ * * FreeType trigonometric functions (specification). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/fttypes.h b/thirdparty/freetype/include/freetype/fttypes.h index 10571505a5..cb785d98b2 100644 --- a/thirdparty/freetype/include/freetype/fttypes.h +++ b/thirdparty/freetype/include/freetype/fttypes.h @@ -4,7 +4,7 @@ * * FreeType simple types definitions (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ftwinfnt.h b/thirdparty/freetype/include/freetype/ftwinfnt.h index a2fba903d2..bacb8aa373 100644 --- a/thirdparty/freetype/include/freetype/ftwinfnt.h +++ b/thirdparty/freetype/include/freetype/ftwinfnt.h @@ -4,7 +4,7 @@ * * FreeType API for accessing Windows fnt-specific data. * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/autohint.h b/thirdparty/freetype/include/freetype/internal/autohint.h index f64c28bb2c..438f9c175e 100644 --- a/thirdparty/freetype/include/freetype/internal/autohint.h +++ b/thirdparty/freetype/include/freetype/internal/autohint.h @@ -4,7 +4,7 @@ * * High-level 'autohint' module-specific interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/cffotypes.h b/thirdparty/freetype/include/freetype/internal/cffotypes.h index b26893eab3..207eeda5ff 100644 --- a/thirdparty/freetype/include/freetype/internal/cffotypes.h +++ b/thirdparty/freetype/include/freetype/internal/cffotypes.h @@ -4,7 +4,7 @@ * * Basic OpenType/CFF object type definitions (specification). * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/cfftypes.h b/thirdparty/freetype/include/freetype/internal/cfftypes.h index 2fc905ec79..40b0fc73c9 100644 --- a/thirdparty/freetype/include/freetype/internal/cfftypes.h +++ b/thirdparty/freetype/include/freetype/internal/cfftypes.h @@ -5,7 +5,7 @@ * Basic OpenType/CFF type definitions and interface (specification * only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftcalc.h b/thirdparty/freetype/include/freetype/internal/ftcalc.h index 1811fcd1ea..3054a4c497 100644 --- a/thirdparty/freetype/include/freetype/internal/ftcalc.h +++ b/thirdparty/freetype/include/freetype/internal/ftcalc.h @@ -4,7 +4,7 @@ * * Arithmetic computations (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftdebug.h b/thirdparty/freetype/include/freetype/internal/ftdebug.h index 54a9673afa..00d258e642 100644 --- a/thirdparty/freetype/include/freetype/internal/ftdebug.h +++ b/thirdparty/freetype/include/freetype/internal/ftdebug.h @@ -4,7 +4,7 @@ * * Debugging and logging component (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftdrv.h b/thirdparty/freetype/include/freetype/internal/ftdrv.h index 09e846e1c7..1dd9206c87 100644 --- a/thirdparty/freetype/include/freetype/internal/ftdrv.h +++ b/thirdparty/freetype/include/freetype/internal/ftdrv.h @@ -4,7 +4,7 @@ * * FreeType internal font driver interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftgloadr.h b/thirdparty/freetype/include/freetype/internal/ftgloadr.h index 770871d81b..6f3793b1c0 100644 --- a/thirdparty/freetype/include/freetype/internal/ftgloadr.h +++ b/thirdparty/freetype/include/freetype/internal/ftgloadr.h @@ -4,7 +4,7 @@ * * The FreeType glyph loader (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftmemory.h b/thirdparty/freetype/include/freetype/internal/ftmemory.h index 78bd3bc229..e0758c127a 100644 --- a/thirdparty/freetype/include/freetype/internal/ftmemory.h +++ b/thirdparty/freetype/include/freetype/internal/ftmemory.h @@ -4,7 +4,7 @@ * * The FreeType memory management macros (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg * * This file is part of the FreeType project, and may only be used, @@ -57,6 +57,14 @@ FT_BEGIN_HEADER /*************************************************************************/ + /* The calculation `NULL + n' is undefined in C. Even if the resulting */ + /* pointer doesn't get dereferenced, this causes warnings with */ + /* sanitizers. */ + /* */ + /* We thus provide a macro that should be used if `base' can be NULL. */ +#define FT_OFFSET( base, count ) ( (base) ? (base) + (count) : NULL ) + + /* * C++ refuses to handle statements like p = (void*)anything, with `p' a * typed pointer. Since we don't have a `typeof' operator in standard C++, @@ -153,10 +161,10 @@ extern "C++" (FT_Long)(size), \ &error ) ) -#define FT_MEM_FREE( ptr ) \ - FT_BEGIN_STMNT \ - ft_mem_free( memory, (ptr) ); \ - (ptr) = NULL; \ +#define FT_MEM_FREE( ptr ) \ + FT_BEGIN_STMNT \ + FT_DEBUG_INNER( ft_mem_free( memory, (ptr) ) ); \ + (ptr) = NULL; \ FT_END_STMNT #define FT_MEM_NEW( ptr ) \ diff --git a/thirdparty/freetype/include/freetype/internal/ftobjs.h b/thirdparty/freetype/include/freetype/internal/ftobjs.h index 0c1d3e5bf2..140eebc7c6 100644 --- a/thirdparty/freetype/include/freetype/internal/ftobjs.h +++ b/thirdparty/freetype/include/freetype/internal/ftobjs.h @@ -4,7 +4,7 @@ * * The FreeType private base classes (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftpsprop.h b/thirdparty/freetype/include/freetype/internal/ftpsprop.h index 574837f6d4..72907c4c3a 100644 --- a/thirdparty/freetype/include/freetype/internal/ftpsprop.h +++ b/thirdparty/freetype/include/freetype/internal/ftpsprop.h @@ -4,7 +4,7 @@ * * Get and set properties of PostScript drivers (specification). * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftrfork.h b/thirdparty/freetype/include/freetype/internal/ftrfork.h index 75b3e531bb..9a275a5155 100644 --- a/thirdparty/freetype/include/freetype/internal/ftrfork.h +++ b/thirdparty/freetype/include/freetype/internal/ftrfork.h @@ -4,7 +4,7 @@ * * Embedded resource forks accessor (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * Masatake YAMATO and Redhat K.K. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftserv.h b/thirdparty/freetype/include/freetype/internal/ftserv.h index 8836cf3f18..bcaf4720d5 100644 --- a/thirdparty/freetype/include/freetype/internal/ftserv.h +++ b/thirdparty/freetype/include/freetype/internal/ftserv.h @@ -4,7 +4,7 @@ * * The FreeType services (specification only). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/ftstream.h b/thirdparty/freetype/include/freetype/internal/ftstream.h index a579a039b9..f3b3ef0d02 100644 --- a/thirdparty/freetype/include/freetype/internal/ftstream.h +++ b/thirdparty/freetype/include/freetype/internal/ftstream.h @@ -4,7 +4,7 @@ * * Stream handling (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/fttrace.h b/thirdparty/freetype/include/freetype/internal/fttrace.h index f5f9598046..58bd77413c 100644 --- a/thirdparty/freetype/include/freetype/internal/fttrace.h +++ b/thirdparty/freetype/include/freetype/internal/fttrace.h @@ -4,7 +4,7 @@ * * Tracing handling (specification only). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -49,6 +49,7 @@ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */ FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */ FT_TRACE_DEF( sfwoff ) /* WOFF format handler (sfwoff.c) */ +FT_TRACE_DEF( sfwoff2 ) /* WOFF2 format handler (sfwoff2.c) */ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */ diff --git a/thirdparty/freetype/include/freetype/internal/ftvalid.h b/thirdparty/freetype/include/freetype/internal/ftvalid.h index 38aa06cc4e..62aea4dc68 100644 --- a/thirdparty/freetype/include/freetype/internal/ftvalid.h +++ b/thirdparty/freetype/include/freetype/internal/ftvalid.h @@ -4,7 +4,7 @@ * * FreeType validation support (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/internal.h b/thirdparty/freetype/include/freetype/internal/internal.h index 3c8830f7e4..766bf64c23 100644 --- a/thirdparty/freetype/include/freetype/internal/internal.h +++ b/thirdparty/freetype/include/freetype/internal/internal.h @@ -4,7 +4,7 @@ * * Internal header files (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/psaux.h b/thirdparty/freetype/include/freetype/internal/psaux.h index f962a973de..8248a0ecdb 100644 --- a/thirdparty/freetype/include/freetype/internal/psaux.h +++ b/thirdparty/freetype/include/freetype/internal/psaux.h @@ -5,7 +5,7 @@ * Auxiliary functions and data structures related to PostScript fonts * (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/pshints.h b/thirdparty/freetype/include/freetype/internal/pshints.h index 699acea6f5..cf0c65298c 100644 --- a/thirdparty/freetype/include/freetype/internal/pshints.h +++ b/thirdparty/freetype/include/freetype/internal/pshints.h @@ -6,7 +6,7 @@ * recorders (specification only). These are used to support native * T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers. * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svbdf.h b/thirdparty/freetype/include/freetype/internal/services/svbdf.h index e4786ed038..0ec9c7ccb0 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svbdf.h +++ b/thirdparty/freetype/include/freetype/internal/services/svbdf.h @@ -4,7 +4,7 @@ * * The FreeType BDF services (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svcfftl.h b/thirdparty/freetype/include/freetype/internal/services/svcfftl.h index 6c621732da..c2f42c1d17 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svcfftl.h +++ b/thirdparty/freetype/include/freetype/internal/services/svcfftl.h @@ -4,7 +4,7 @@ * * The FreeType CFF tables loader service (specification). * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svcid.h b/thirdparty/freetype/include/freetype/internal/services/svcid.h index 555a5af5b9..b8efd8147b 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svcid.h +++ b/thirdparty/freetype/include/freetype/internal/services/svcid.h @@ -4,7 +4,7 @@ * * The FreeType CID font services (specification). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * Derek Clegg and Michael Toftdal. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h b/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h index 6f4285ea8c..5ec84c933c 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h +++ b/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h @@ -4,7 +4,7 @@ * * The FreeType font format service (specification only). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svgldict.h b/thirdparty/freetype/include/freetype/internal/services/svgldict.h index 0949621835..5a63883c90 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svgldict.h +++ b/thirdparty/freetype/include/freetype/internal/services/svgldict.h @@ -4,7 +4,7 @@ * * The FreeType glyph dictionary services (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svgxval.h b/thirdparty/freetype/include/freetype/internal/services/svgxval.h index 0bb76f3144..d0cb10a423 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svgxval.h +++ b/thirdparty/freetype/include/freetype/internal/services/svgxval.h @@ -4,7 +4,7 @@ * * FreeType API for validating TrueTypeGX/AAT tables (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/include/freetype/internal/services/svkern.h b/thirdparty/freetype/include/freetype/internal/services/svkern.h index f992a327c1..891c61a755 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svkern.h +++ b/thirdparty/freetype/include/freetype/internal/services/svkern.h @@ -4,7 +4,7 @@ * * The FreeType Kerning service (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svmetric.h b/thirdparty/freetype/include/freetype/internal/services/svmetric.h index d688bc7c60..06faa4b4f8 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svmetric.h +++ b/thirdparty/freetype/include/freetype/internal/services/svmetric.h @@ -4,7 +4,7 @@ * * The FreeType services for metrics variations (specification). * - * Copyright (C) 2016-2019 by + * Copyright (C) 2016-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svmm.h b/thirdparty/freetype/include/freetype/internal/services/svmm.h index 3652f2050a..fa044c92dd 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svmm.h +++ b/thirdparty/freetype/include/freetype/internal/services/svmm.h @@ -4,7 +4,7 @@ * * The FreeType Multiple Masters and GX var services (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svotval.h b/thirdparty/freetype/include/freetype/internal/services/svotval.h index cab4c6efbb..34ad7ca9f1 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svotval.h +++ b/thirdparty/freetype/include/freetype/internal/services/svotval.h @@ -4,7 +4,7 @@ * * The FreeType OpenType validation service (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svpfr.h b/thirdparty/freetype/include/freetype/internal/services/svpfr.h index fd01d614dd..2dd075c5da 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svpfr.h +++ b/thirdparty/freetype/include/freetype/internal/services/svpfr.h @@ -4,7 +4,7 @@ * * Internal PFR service functions (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svpostnm.h b/thirdparty/freetype/include/freetype/internal/services/svpostnm.h index 18e3843cbe..86ab611382 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svpostnm.h +++ b/thirdparty/freetype/include/freetype/internal/services/svpostnm.h @@ -4,7 +4,7 @@ * * The FreeType PostScript name services (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svprop.h b/thirdparty/freetype/include/freetype/internal/services/svprop.h index e48d0151ec..8f755436a1 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svprop.h +++ b/thirdparty/freetype/include/freetype/internal/services/svprop.h @@ -4,7 +4,7 @@ * * The FreeType property service (specification). * - * Copyright (C) 2012-2019 by + * Copyright (C) 2012-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svpscmap.h b/thirdparty/freetype/include/freetype/internal/services/svpscmap.h index dfac3bafa9..6c2ffe2e2a 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svpscmap.h +++ b/thirdparty/freetype/include/freetype/internal/services/svpscmap.h @@ -4,7 +4,7 @@ * * The FreeType PostScript charmap service (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h b/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h index fb4e0e3fa9..ade24dc2ba 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h +++ b/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h @@ -4,7 +4,7 @@ * * The FreeType PostScript info service (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svsfnt.h b/thirdparty/freetype/include/freetype/internal/services/svsfnt.h index 464aa209f7..f3e81ca84e 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svsfnt.h +++ b/thirdparty/freetype/include/freetype/internal/services/svsfnt.h @@ -4,7 +4,7 @@ * * The FreeType SFNT table loading service (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svttcmap.h b/thirdparty/freetype/include/freetype/internal/services/svttcmap.h index 0fcb81371d..fbb3115ed4 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svttcmap.h +++ b/thirdparty/freetype/include/freetype/internal/services/svttcmap.h @@ -4,7 +4,7 @@ * * The FreeType TrueType/sfnt cmap extra information service. * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * Masatake YAMATO, Redhat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/include/freetype/internal/services/svtteng.h b/thirdparty/freetype/include/freetype/internal/services/svtteng.h index a852f5c6fb..6218d9efe0 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svtteng.h +++ b/thirdparty/freetype/include/freetype/internal/services/svtteng.h @@ -4,7 +4,7 @@ * * The FreeType TrueType engine query service (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svttglyf.h b/thirdparty/freetype/include/freetype/internal/services/svttglyf.h index c8798771fb..d9894e362d 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svttglyf.h +++ b/thirdparty/freetype/include/freetype/internal/services/svttglyf.h @@ -4,7 +4,7 @@ * * The FreeType TrueType glyph service. * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h b/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h index 38ee020965..377f73d450 100644 --- a/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h +++ b/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h @@ -4,7 +4,7 @@ * * The FreeType Windows FNT/FONT service (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/sfnt.h b/thirdparty/freetype/include/freetype/internal/sfnt.h index b19241c306..b9c81a8f37 100644 --- a/thirdparty/freetype/include/freetype/internal/sfnt.h +++ b/thirdparty/freetype/include/freetype/internal/sfnt.h @@ -4,7 +4,7 @@ * * High-level 'sfnt' driver interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/t1types.h b/thirdparty/freetype/include/freetype/internal/t1types.h index d94c8c1284..799c2939fa 100644 --- a/thirdparty/freetype/include/freetype/internal/t1types.h +++ b/thirdparty/freetype/include/freetype/internal/t1types.h @@ -5,7 +5,7 @@ * Basic Type1/Type2 type definitions and interface (specification * only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/tttypes.h b/thirdparty/freetype/include/freetype/internal/tttypes.h index 23db240e7c..1bddf102be 100644 --- a/thirdparty/freetype/include/freetype/internal/tttypes.h +++ b/thirdparty/freetype/include/freetype/internal/tttypes.h @@ -5,7 +5,7 @@ * Basic SFNT/TrueType type definitions and interface (specification * only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/internal/wofftypes.h b/thirdparty/freetype/include/freetype/internal/wofftypes.h index ba55bf883e..26159b9d3e 100644 --- a/thirdparty/freetype/include/freetype/internal/wofftypes.h +++ b/thirdparty/freetype/include/freetype/internal/wofftypes.h @@ -5,7 +5,7 @@ * Basic WOFF/WOFF2 type definitions and interface (specification * only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -104,6 +104,207 @@ FT_BEGIN_HEADER } WOFF_TableRec, *WOFF_Table; + /************************************************************************** + * + * @struct: + * WOFF2_TtcFontRec + * + * @description: + * Metadata for a TTC font entry in WOFF2. + * + * @fields: + * flavor :: + * TTC font flavor. + * + * num_tables :: + * Number of tables in TTC, indicating number of elements in + * `table_indices`. + * + * table_indices :: + * Array of table indices for each TTC font. + */ + typedef struct WOFF2_TtcFontRec_ + { + FT_ULong flavor; + FT_UShort num_tables; + FT_UShort* table_indices; + + } WOFF2_TtcFontRec, *WOFF2_TtcFont; + + + /************************************************************************** + * + * @struct: + * WOFF2_HeaderRec + * + * @description: + * WOFF2 file format header. + * + * @fields: + * See + * + * https://www.w3.org/TR/WOFF2/#woff20Header + * + * @note: + * We don't care about the fields `reserved`, `majorVersion` and + * `minorVersion`, so they are not included. The `totalSfntSize` field + * does not necessarily represent the actual size of the uncompressed + * SFNT font stream, so that is used as a reference value instead. + */ + typedef struct WOFF2_HeaderRec_ + { + FT_ULong signature; + FT_ULong flavor; + FT_ULong length; + FT_UShort num_tables; + FT_ULong totalSfntSize; + FT_ULong totalCompressedSize; + FT_ULong metaOffset; + FT_ULong metaLength; + FT_ULong metaOrigLength; + FT_ULong privOffset; + FT_ULong privLength; + + FT_ULong uncompressed_size; /* uncompressed brotli stream size */ + FT_ULong compressed_offset; /* compressed stream offset */ + FT_ULong header_version; /* version of original TTC Header */ + FT_UShort num_fonts; /* number of fonts in TTC */ + FT_ULong actual_sfnt_size; /* actual size of sfnt stream */ + + WOFF2_TtcFont ttc_fonts; /* metadata for fonts in a TTC */ + + } WOFF2_HeaderRec, *WOFF2_Header; + + + /************************************************************************** + * + * @struct: + * WOFF2_TableRec + * + * @description: + * This structure describes a given table of a WOFF2 font. + * + * @fields: + * See + * + * https://www.w3.org/TR/WOFF2/#table_dir_format + */ + typedef struct WOFF2_TableRec_ + { + FT_Byte FlagByte; /* table type and flags */ + FT_ULong Tag; /* table file offset */ + FT_ULong dst_length; /* uncompressed table length */ + FT_ULong TransformLength; /* transformed length */ + + FT_ULong flags; /* calculated flags */ + FT_ULong src_offset; /* compressed table offset */ + FT_ULong src_length; /* compressed table length */ + FT_ULong dst_offset; /* uncompressed table offset */ + + } WOFF2_TableRec, *WOFF2_Table; + + + /************************************************************************** + * + * @struct: + * WOFF2_InfoRec + * + * @description: + * Metadata for WOFF2 font that may be required for reconstruction of + * sfnt tables. + * + * @fields: + * header_checksum :: + * Checksum of SFNT offset table. + * + * num_glyphs :: + * Number of glyphs in the font. + * + * num_hmetrics :: + * `numberOfHMetrics` field in the 'hhea' table. + * + * x_mins :: + * `xMin` values of glyph bounding box. + * + * glyf_table :: + * A pointer to the `glyf' table record. + * + * loca_table :: + * A pointer to the `loca' table record. + * + * head_table :: + * A pointer to the `head' table record. + */ + typedef struct WOFF2_InfoRec_ + { + FT_ULong header_checksum; + FT_UShort num_glyphs; + FT_UShort num_hmetrics; + FT_Short* x_mins; + + WOFF2_Table glyf_table; + WOFF2_Table loca_table; + WOFF2_Table head_table; + + } WOFF2_InfoRec, *WOFF2_Info; + + + /************************************************************************** + * + * @struct: + * WOFF2_SubstreamRec + * + * @description: + * This structure stores information about a substream in the transformed + * 'glyf' table in a WOFF2 stream. + * + * @fields: + * start :: + * Beginning of the substream relative to uncompressed table stream. + * + * offset :: + * Offset of the substream relative to uncompressed table stream. + * + * size :: + * Size of the substream. + */ + typedef struct WOFF2_SubstreamRec_ + { + FT_ULong start; + FT_ULong offset; + FT_ULong size; + + } WOFF2_SubstreamRec, *WOFF2_Substream; + + + /************************************************************************** + * + * @struct: + * WOFF2_PointRec + * + * @description: + * This structure stores information about a point in the transformed + * 'glyf' table in a WOFF2 stream. + * + * @fields: + * x :: + * x-coordinate of point. + * + * y :: + * y-coordinate of point. + * + * on_curve :: + * Set if point is on-curve. + */ + typedef struct WOFF2_PointRec_ + { + FT_Int x; + FT_Int y; + FT_Bool on_curve; + + } WOFF2_PointRec, *WOFF2_Point; + + FT_END_HEADER #endif /* WOFFTYPES_H_ */ diff --git a/thirdparty/freetype/include/freetype/t1tables.h b/thirdparty/freetype/include/freetype/t1tables.h index 645e645720..522d6ae6aa 100644 --- a/thirdparty/freetype/include/freetype/t1tables.h +++ b/thirdparty/freetype/include/freetype/t1tables.h @@ -5,7 +5,7 @@ * Basic Type 1/Type 2 tables definitions and interface (specification * only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/ttnameid.h b/thirdparty/freetype/include/freetype/ttnameid.h index cc677de75a..9a00913ee7 100644 --- a/thirdparty/freetype/include/freetype/ttnameid.h +++ b/thirdparty/freetype/include/freetype/ttnameid.h @@ -4,7 +4,7 @@ * * TrueType name ID definitions (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/tttables.h b/thirdparty/freetype/include/freetype/tttables.h index d04f810218..8108db7173 100644 --- a/thirdparty/freetype/include/freetype/tttables.h +++ b/thirdparty/freetype/include/freetype/tttables.h @@ -5,7 +5,7 @@ * Basic SFNT/TrueType tables definitions and interface * (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/include/freetype/tttags.h b/thirdparty/freetype/include/freetype/tttags.h index bd0986eff0..f2b2a45266 100644 --- a/thirdparty/freetype/include/freetype/tttags.h +++ b/thirdparty/freetype/include/freetype/tttags.h @@ -4,7 +4,7 @@ * * Tags for TrueType and OpenType tables (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -107,6 +107,7 @@ FT_BEGIN_HEADER #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) #define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' ) #define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' ) +#define TTAG_wOF2 FT_MAKE_TAG( 'w', 'O', 'F', '2' ) /* used by "Keyboard.dfont" on legacy Mac OS X */ #define TTAG_0xA5kbd FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' ) diff --git a/thirdparty/freetype/include/ft2build.h b/thirdparty/freetype/include/ft2build.h index e3f4887943..195e918335 100644 --- a/thirdparty/freetype/include/ft2build.h +++ b/thirdparty/freetype/include/ft2build.h @@ -4,7 +4,7 @@ * * FreeType 2 build and setup macros. * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afangles.c b/thirdparty/freetype/src/autofit/afangles.c index 9e1f7a21ff..a2d45eb72c 100644 --- a/thirdparty/freetype/src/autofit/afangles.c +++ b/thirdparty/freetype/src/autofit/afangles.c @@ -5,7 +5,7 @@ * Routines used to compute vector angles with limited accuracy * and very high speed. It also contains sorting routines (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afblue.c b/thirdparty/freetype/src/autofit/afblue.c index b99dbeb19c..63f9ed4589 100644 --- a/thirdparty/freetype/src/autofit/afblue.c +++ b/thirdparty/freetype/src/autofit/afblue.c @@ -7,7 +7,7 @@ * * Auto-fitter data for blue strings (body). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -340,6 +340,12 @@ '\0', '\xF0', '\x90', '\x92', '\x80', ' ', '\xF0', '\x90', '\x92', '\x82', ' ', '\xF0', '\x90', '\x92', '\x86', ' ', '\xF0', '\x90', '\x92', '\x88', ' ', '\xF0', '\x90', '\x92', '\x8A', ' ', '\xF0', '\x90', '\x92', '\x92', ' ', '\xF0', '\x90', '\x92', '\xA0', ' ', '\xF0', '\x90', '\x92', '\xA9', /* 𐒀 𐒂 𐒆 𐒈 𐒊 𐒒 𐒠 𐒩 */ '\0', + '\xF0', '\x90', '\xB4', '\x83', ' ', '\xF0', '\x90', '\xB4', '\x80', ' ', '\xF0', '\x90', '\xB4', '\x86', ' ', '\xF0', '\x90', '\xB4', '\x96', ' ', '\xF0', '\x90', '\xB4', '\x95', /* 𐴃 𐴀 𐴆 𐴖 𐴕 */ + '\0', + '\xF0', '\x90', '\xB4', '\x94', ' ', '\xF0', '\x90', '\xB4', '\x96', ' ', '\xF0', '\x90', '\xB4', '\x95', ' ', '\xF0', '\x90', '\xB4', '\x91', ' ', '\xF0', '\x90', '\xB4', '\x90', /* 𐴔 𐴖 𐴕 𐴑 𐴐 */ + '\0', + '\xD9', '\x80', /* ـ */ + '\0', '\xEA', '\xA2', '\x9C', ' ', '\xEA', '\xA2', '\x9E', ' ', '\xEA', '\xA2', '\xB3', ' ', '\xEA', '\xA2', '\x82', ' ', '\xEA', '\xA2', '\x96', ' ', '\xEA', '\xA2', '\x92', ' ', '\xEA', '\xA2', '\x9D', ' ', '\xEA', '\xA2', '\x9B', /* ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ ꢝ ꢛ */ '\0', '\xEA', '\xA2', '\x82', ' ', '\xEA', '\xA2', '\xA8', ' ', '\xEA', '\xA2', '\xBA', ' ', '\xEA', '\xA2', '\xA4', ' ', '\xEA', '\xA2', '\x8E', /* ꢂ ꢨ ꢺ ꢤ ꢎ */ @@ -687,6 +693,10 @@ { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_ROHINGYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_ROHINGYA_BOTTOM, 0 }, + { AF_BLUE_STRING_ROHINGYA_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, diff --git a/thirdparty/freetype/src/autofit/afblue.cin b/thirdparty/freetype/src/autofit/afblue.cin index 6545d1fd43..c6a697fee0 100644 --- a/thirdparty/freetype/src/autofit/afblue.cin +++ b/thirdparty/freetype/src/autofit/afblue.cin @@ -4,7 +4,7 @@ * * Auto-fitter data for blue strings (body). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afblue.dat b/thirdparty/freetype/src/autofit/afblue.dat index 46db43fe22..f8356ba3a1 100644 --- a/thirdparty/freetype/src/autofit/afblue.dat +++ b/thirdparty/freetype/src/autofit/afblue.dat @@ -2,7 +2,7 @@ // // Auto-fitter data for blue strings. // -// Copyright (C) 2013-2019 by +// Copyright (C) 2013-2020 by // David Turner, Robert Wilhelm, and Werner Lemberg. // // This file is part of the FreeType project, and may only be used, @@ -443,6 +443,13 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_OSMANYA_BOTTOM "𐒀 𐒂 𐒆 𐒈 𐒊 𐒒 𐒠 𐒩" + AF_BLUE_STRING_ROHINGYA_TOP + "𐴃 𐴀 𐴆 𐴖 𐴕" + AF_BLUE_STRING_ROHINGYA_BOTTOM + "𐴔 𐴖 𐴕 𐴑 𐴐" + AF_BLUE_STRING_ROHINGYA_JOIN + "ـ" + AF_BLUE_STRING_SAURASHTRA_TOP "ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ ꢝ ꢛ" AF_BLUE_STRING_SAURASHTRA_BOTTOM @@ -1002,6 +1009,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_ROHG + { AF_BLUE_STRING_ROHINGYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ROHINGYA_BOTTOM, 0 } + { AF_BLUE_STRING_ROHINGYA_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_SAUR { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 } diff --git a/thirdparty/freetype/src/autofit/afblue.h b/thirdparty/freetype/src/autofit/afblue.h index b69b1df521..2b6a5cdda4 100644 --- a/thirdparty/freetype/src/autofit/afblue.h +++ b/thirdparty/freetype/src/autofit/afblue.h @@ -7,7 +7,7 @@ * * Auto-fitter data for blue strings (specification). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -234,36 +234,39 @@ FT_BEGIN_HEADER AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4095, AF_BLUE_STRING_OSMANYA_TOP = 4110, AF_BLUE_STRING_OSMANYA_BOTTOM = 4150, - AF_BLUE_STRING_SAURASHTRA_TOP = 4190, - AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4222, - AF_BLUE_STRING_SHAVIAN_TOP = 4242, - AF_BLUE_STRING_SHAVIAN_BOTTOM = 4252, - AF_BLUE_STRING_SHAVIAN_DESCENDER = 4277, - AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4287, - AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4322, - AF_BLUE_STRING_SINHALA_TOP = 4337, - AF_BLUE_STRING_SINHALA_BOTTOM = 4369, - AF_BLUE_STRING_SINHALA_DESCENDER = 4401, - AF_BLUE_STRING_SUNDANESE_TOP = 4445, - AF_BLUE_STRING_SUNDANESE_BOTTOM = 4469, - AF_BLUE_STRING_SUNDANESE_DESCENDER = 4501, - AF_BLUE_STRING_TAI_VIET_TOP = 4509, - AF_BLUE_STRING_TAI_VIET_BOTTOM = 4529, - AF_BLUE_STRING_TAMIL_TOP = 4541, - AF_BLUE_STRING_TAMIL_BOTTOM = 4573, - AF_BLUE_STRING_TELUGU_TOP = 4605, - AF_BLUE_STRING_TELUGU_BOTTOM = 4633, - AF_BLUE_STRING_THAI_TOP = 4661, - AF_BLUE_STRING_THAI_BOTTOM = 4685, - AF_BLUE_STRING_THAI_ASCENDER = 4713, - AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4725, - AF_BLUE_STRING_THAI_DESCENDER = 4737, - AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4753, - AF_BLUE_STRING_THAI_DIGIT_TOP = 4761, - AF_BLUE_STRING_TIFINAGH = 4773, - AF_BLUE_STRING_VAI_TOP = 4805, - AF_BLUE_STRING_VAI_BOTTOM = 4837, - af_blue_1_1 = 4868, + AF_BLUE_STRING_ROHINGYA_TOP = 4190, + AF_BLUE_STRING_ROHINGYA_BOTTOM = 4215, + AF_BLUE_STRING_ROHINGYA_JOIN = 4240, + AF_BLUE_STRING_SAURASHTRA_TOP = 4243, + AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4275, + AF_BLUE_STRING_SHAVIAN_TOP = 4295, + AF_BLUE_STRING_SHAVIAN_BOTTOM = 4305, + AF_BLUE_STRING_SHAVIAN_DESCENDER = 4330, + AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4340, + AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4375, + AF_BLUE_STRING_SINHALA_TOP = 4390, + AF_BLUE_STRING_SINHALA_BOTTOM = 4422, + AF_BLUE_STRING_SINHALA_DESCENDER = 4454, + AF_BLUE_STRING_SUNDANESE_TOP = 4498, + AF_BLUE_STRING_SUNDANESE_BOTTOM = 4522, + AF_BLUE_STRING_SUNDANESE_DESCENDER = 4554, + AF_BLUE_STRING_TAI_VIET_TOP = 4562, + AF_BLUE_STRING_TAI_VIET_BOTTOM = 4582, + AF_BLUE_STRING_TAMIL_TOP = 4594, + AF_BLUE_STRING_TAMIL_BOTTOM = 4626, + AF_BLUE_STRING_TELUGU_TOP = 4658, + AF_BLUE_STRING_TELUGU_BOTTOM = 4686, + AF_BLUE_STRING_THAI_TOP = 4714, + AF_BLUE_STRING_THAI_BOTTOM = 4738, + AF_BLUE_STRING_THAI_ASCENDER = 4766, + AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4778, + AF_BLUE_STRING_THAI_DESCENDER = 4790, + AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4806, + AF_BLUE_STRING_THAI_DIGIT_TOP = 4814, + AF_BLUE_STRING_TIFINAGH = 4826, + AF_BLUE_STRING_VAI_TOP = 4858, + AF_BLUE_STRING_VAI_BOTTOM = 4890, + af_blue_1_1 = 4921, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, @@ -365,17 +368,18 @@ FT_BEGIN_HEADER AF_BLUE_STRINGSET_ORKH = 196, AF_BLUE_STRINGSET_OSGE = 199, AF_BLUE_STRINGSET_OSMA = 207, - AF_BLUE_STRINGSET_SAUR = 210, - AF_BLUE_STRINGSET_SHAW = 213, - AF_BLUE_STRINGSET_SINH = 219, - AF_BLUE_STRINGSET_SUND = 223, - AF_BLUE_STRINGSET_TAML = 227, - AF_BLUE_STRINGSET_TAVT = 230, - AF_BLUE_STRINGSET_TELU = 233, - AF_BLUE_STRINGSET_TFNG = 236, - AF_BLUE_STRINGSET_THAI = 239, - AF_BLUE_STRINGSET_VAII = 247, - af_blue_2_1 = 250, + AF_BLUE_STRINGSET_ROHG = 210, + AF_BLUE_STRINGSET_SAUR = 214, + AF_BLUE_STRINGSET_SHAW = 217, + AF_BLUE_STRINGSET_SINH = 223, + AF_BLUE_STRINGSET_SUND = 227, + AF_BLUE_STRINGSET_TAML = 231, + AF_BLUE_STRINGSET_TAVT = 234, + AF_BLUE_STRINGSET_TELU = 237, + AF_BLUE_STRINGSET_TFNG = 240, + AF_BLUE_STRINGSET_THAI = 243, + AF_BLUE_STRINGSET_VAII = 251, + af_blue_2_1 = 254, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, af_blue_2_1_1 = af_blue_2_1 + 2, diff --git a/thirdparty/freetype/src/autofit/afblue.hin b/thirdparty/freetype/src/autofit/afblue.hin index 30a28dafa5..3957027091 100644 --- a/thirdparty/freetype/src/autofit/afblue.hin +++ b/thirdparty/freetype/src/autofit/afblue.hin @@ -4,7 +4,7 @@ * * Auto-fitter data for blue strings (specification). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afcjk.c b/thirdparty/freetype/src/autofit/afcjk.c index a61689bee3..ca6ce0c60c 100644 --- a/thirdparty/freetype/src/autofit/afcjk.c +++ b/thirdparty/freetype/src/autofit/afcjk.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for CJK writing system (body). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -806,7 +806,7 @@ { AF_AxisHints axis = &hints->axis[dim]; AF_Segment segments = axis->segments; - AF_Segment segment_limit = segments + axis->num_segments; + AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments ); FT_Error error; AF_Segment seg; diff --git a/thirdparty/freetype/src/autofit/afcjk.h b/thirdparty/freetype/src/autofit/afcjk.h index 59acae5342..fd0f451aa8 100644 --- a/thirdparty/freetype/src/autofit/afcjk.h +++ b/thirdparty/freetype/src/autofit/afcjk.h @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for CJK writing system (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afcover.h b/thirdparty/freetype/src/autofit/afcover.h index ff207a97e0..03085ad07e 100644 --- a/thirdparty/freetype/src/autofit/afcover.h +++ b/thirdparty/freetype/src/autofit/afcover.h @@ -4,7 +4,7 @@ * * Auto-fitter coverages (specification only). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afdummy.c b/thirdparty/freetype/src/autofit/afdummy.c index 7e07a41e7d..77d31df974 100644 --- a/thirdparty/freetype/src/autofit/afdummy.c +++ b/thirdparty/freetype/src/autofit/afdummy.c @@ -5,7 +5,7 @@ * Auto-fitter dummy routines to be used if no hinting should be * performed (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afdummy.h b/thirdparty/freetype/src/autofit/afdummy.h index ab9227d35d..efd799e84b 100644 --- a/thirdparty/freetype/src/autofit/afdummy.h +++ b/thirdparty/freetype/src/autofit/afdummy.h @@ -5,7 +5,7 @@ * Auto-fitter dummy routines to be used if no hinting should be * performed (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/aferrors.h b/thirdparty/freetype/src/autofit/aferrors.h index 2ec336f72c..6c7d0e1d70 100644 --- a/thirdparty/freetype/src/autofit/aferrors.h +++ b/thirdparty/freetype/src/autofit/aferrors.h @@ -4,7 +4,7 @@ * * Autofitter error codes (specification only). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afglobal.c b/thirdparty/freetype/src/autofit/afglobal.c index 6a9a1e5aaa..5ad4ea9211 100644 --- a/thirdparty/freetype/src/autofit/afglobal.c +++ b/thirdparty/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-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afglobal.h b/thirdparty/freetype/src/autofit/afglobal.h index 52f38350db..fecf7af977 100644 --- a/thirdparty/freetype/src/autofit/afglobal.h +++ b/thirdparty/freetype/src/autofit/afglobal.h @@ -5,7 +5,7 @@ * Auto-fitter routines to compute global hinting values * (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afhints.c b/thirdparty/freetype/src/autofit/afhints.c index ed111c4117..5a123b2ba3 100644 --- a/thirdparty/freetype/src/autofit/afhints.c +++ b/thirdparty/freetype/src/autofit/afhints.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afhints.h b/thirdparty/freetype/src/autofit/afhints.h index e0cf612f0c..6397f098f0 100644 --- a/thirdparty/freetype/src/autofit/afhints.h +++ b/thirdparty/freetype/src/autofit/afhints.h @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afindic.c b/thirdparty/freetype/src/autofit/afindic.c index a17117c712..bc2837a26d 100644 --- a/thirdparty/freetype/src/autofit/afindic.c +++ b/thirdparty/freetype/src/autofit/afindic.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for Indic writing system (body). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afindic.h b/thirdparty/freetype/src/autofit/afindic.h index bc5bc59fa5..088b88b19d 100644 --- a/thirdparty/freetype/src/autofit/afindic.h +++ b/thirdparty/freetype/src/autofit/afindic.h @@ -5,7 +5,7 @@ * Auto-fitter hinting routines for Indic writing system * (specification). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/aflatin.c b/thirdparty/freetype/src/autofit/aflatin.c index 27d4024882..b453fcdf69 100644 --- a/thirdparty/freetype/src/autofit/aflatin.c +++ b/thirdparty/freetype/src/autofit/aflatin.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for latin writing system (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -1910,7 +1910,7 @@ /* sense -- this is used to better detect and ignore serifs */ { AF_Segment segments = axis->segments; - AF_Segment segments_end = segments + axis->num_segments; + AF_Segment segments_end = FT_OFFSET( segments, axis->num_segments ); for ( segment = segments; segment < segments_end; segment++ ) @@ -2314,7 +2314,7 @@ */ { AF_Edge edges = axis->edges; - AF_Edge edge_limit = edges + axis->num_edges; + AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges ); AF_Edge edge; diff --git a/thirdparty/freetype/src/autofit/aflatin.h b/thirdparty/freetype/src/autofit/aflatin.h index 40479538c2..62bc4c8d44 100644 --- a/thirdparty/freetype/src/autofit/aflatin.h +++ b/thirdparty/freetype/src/autofit/aflatin.h @@ -5,7 +5,7 @@ * Auto-fitter hinting routines for latin writing system * (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/aflatin2.c b/thirdparty/freetype/src/autofit/aflatin2.c index c601ab8d9a..7bd4156a0f 100644 --- a/thirdparty/freetype/src/autofit/aflatin2.c +++ b/thirdparty/freetype/src/autofit/aflatin2.c @@ -9,7 +9,7 @@ * * Auto-fitter hinting routines for latin writing system (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -21,6 +21,7 @@ */ +#include <ft2build.h> #include FT_ADVANCES_H diff --git a/thirdparty/freetype/src/autofit/aflatin2.h b/thirdparty/freetype/src/autofit/aflatin2.h index 507cef3df2..c2aebc49ac 100644 --- a/thirdparty/freetype/src/autofit/aflatin2.h +++ b/thirdparty/freetype/src/autofit/aflatin2.h @@ -10,7 +10,7 @@ * Auto-fitter hinting routines for latin writing system * (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afloader.c b/thirdparty/freetype/src/autofit/afloader.c index 83743b7be1..a53fbf2d21 100644 --- a/thirdparty/freetype/src/autofit/afloader.c +++ b/thirdparty/freetype/src/autofit/afloader.c @@ -4,7 +4,7 @@ * * Auto-fitter glyph loading routines (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afloader.h b/thirdparty/freetype/src/autofit/afloader.h index d1e0f3c093..97282371cd 100644 --- a/thirdparty/freetype/src/autofit/afloader.h +++ b/thirdparty/freetype/src/autofit/afloader.h @@ -4,7 +4,7 @@ * * Auto-fitter glyph loading routines (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afmodule.c b/thirdparty/freetype/src/autofit/afmodule.c index 3e46a3655a..0bcae4cc25 100644 --- a/thirdparty/freetype/src/autofit/afmodule.c +++ b/thirdparty/freetype/src/autofit/afmodule.c @@ -4,7 +4,7 @@ * * Auto-fitter module implementation (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afmodule.h b/thirdparty/freetype/src/autofit/afmodule.h index b410809aa8..efa0240b4b 100644 --- a/thirdparty/freetype/src/autofit/afmodule.h +++ b/thirdparty/freetype/src/autofit/afmodule.h @@ -4,7 +4,7 @@ * * Auto-fitter module implementation (specification). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afranges.c b/thirdparty/freetype/src/autofit/afranges.c index 45c8bbfc95..d6ecf88910 100644 --- a/thirdparty/freetype/src/autofit/afranges.c +++ b/thirdparty/freetype/src/autofit/afranges.c @@ -4,7 +4,7 @@ * * Auto-fitter Unicode script ranges (body). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -778,6 +778,18 @@ }; + const AF_Script_UniRangeRec af_rohg_uniranges[] = + { + AF_UNIRANGE_REC( 0x10D00, 0x10D3F ), /* Hanifi Rohingya */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_rohg_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_saur_uniranges[] = { AF_UNIRANGE_REC( 0xA880, 0xA8DF ), /* Saurashtra */ diff --git a/thirdparty/freetype/src/autofit/afranges.h b/thirdparty/freetype/src/autofit/afranges.h index d5917aefed..c2ffda4b0f 100644 --- a/thirdparty/freetype/src/autofit/afranges.h +++ b/thirdparty/freetype/src/autofit/afranges.h @@ -4,7 +4,7 @@ * * Auto-fitter Unicode script ranges (specification). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afscript.h b/thirdparty/freetype/src/autofit/afscript.h index 2da8c70183..36caaddc56 100644 --- a/thirdparty/freetype/src/autofit/afscript.h +++ b/thirdparty/freetype/src/autofit/afscript.h @@ -4,7 +4,7 @@ * * Auto-fitter scripts (specification only). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -291,6 +291,12 @@ HINTING_BOTTOM_TO_TOP, "\xF0\x90\x92\x86 \xF0\x90\x92\xA0" ) /* 𐒆 𐒠 */ + SCRIPT( rohg, ROHG, + "Hanifi Rohingya", + HB_SCRIPT_HANIFI_ROHINGYA, + HINTING_BOTTOM_TO_TOP, + "\xF0\x90\xB4\xB0" ) /* 𐴰 */ + SCRIPT( saur, SAUR, "Saurashtra", HB_SCRIPT_SAURASHTRA, diff --git a/thirdparty/freetype/src/autofit/afshaper.c b/thirdparty/freetype/src/autofit/afshaper.c index a5191c6915..d3902db2ed 100644 --- a/thirdparty/freetype/src/autofit/afshaper.c +++ b/thirdparty/freetype/src/autofit/afshaper.c @@ -4,7 +4,7 @@ * * HarfBuzz interface for accessing OpenType features (body). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afshaper.h b/thirdparty/freetype/src/autofit/afshaper.h index 06a1e06616..a7dbf34f1a 100644 --- a/thirdparty/freetype/src/autofit/afshaper.h +++ b/thirdparty/freetype/src/autofit/afshaper.h @@ -4,7 +4,7 @@ * * HarfBuzz interface for accessing OpenType features (specification). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afstyles.h b/thirdparty/freetype/src/autofit/afstyles.h index 8d1d70812f..8d411ab0d7 100644 --- a/thirdparty/freetype/src/autofit/afstyles.h +++ b/thirdparty/freetype/src/autofit/afstyles.h @@ -4,7 +4,7 @@ * * Auto-fitter styles (specification only). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -378,6 +378,13 @@ AF_BLUE_STRINGSET_OSMA, AF_COVERAGE_DEFAULT ) + STYLE( rohg_dflt, ROHG_DFLT, + "Hanifi Rohingya default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_ROHG, + AF_BLUE_STRINGSET_ROHG, + AF_COVERAGE_DEFAULT ) + STYLE( saur_dflt, SAUR_DFLT, "Saurashtra default style", AF_WRITING_SYSTEM_LATIN, diff --git a/thirdparty/freetype/src/autofit/aftypes.h b/thirdparty/freetype/src/autofit/aftypes.h index 579003d27d..7ca0b59e32 100644 --- a/thirdparty/freetype/src/autofit/aftypes.h +++ b/thirdparty/freetype/src/autofit/aftypes.h @@ -4,7 +4,7 @@ * * Auto-fitter types (specification only). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afwarp.c b/thirdparty/freetype/src/autofit/afwarp.c index 84e9753ad9..808280df5d 100644 --- a/thirdparty/freetype/src/autofit/afwarp.c +++ b/thirdparty/freetype/src/autofit/afwarp.c @@ -4,7 +4,7 @@ * * Auto-fitter warping algorithm (body). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afwarp.h b/thirdparty/freetype/src/autofit/afwarp.h index 9a2c9a42c1..cdea23e7de 100644 --- a/thirdparty/freetype/src/autofit/afwarp.h +++ b/thirdparty/freetype/src/autofit/afwarp.h @@ -4,7 +4,7 @@ * * Auto-fitter warping algorithm (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/afwrtsys.h b/thirdparty/freetype/src/autofit/afwrtsys.h index 5611cf441a..3990633d2d 100644 --- a/thirdparty/freetype/src/autofit/afwrtsys.h +++ b/thirdparty/freetype/src/autofit/afwrtsys.h @@ -4,7 +4,7 @@ * * Auto-fitter writing systems (specification only). * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/autofit.c b/thirdparty/freetype/src/autofit/autofit.c index facfec1744..88be8bf2bc 100644 --- a/thirdparty/freetype/src/autofit/autofit.c +++ b/thirdparty/freetype/src/autofit/autofit.c @@ -4,7 +4,7 @@ * * Auto-fitter module (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/autofit/module.mk b/thirdparty/freetype/src/autofit/module.mk index cf77b169f7..c32781f478 100644 --- a/thirdparty/freetype/src/autofit/module.mk +++ b/thirdparty/freetype/src/autofit/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2003-2019 by +# Copyright (C) 2003-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/autofit/rules.mk b/thirdparty/freetype/src/autofit/rules.mk index c59da33a55..553ddce6b7 100644 --- a/thirdparty/freetype/src/autofit/rules.mk +++ b/thirdparty/freetype/src/autofit/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2003-2019 by +# Copyright (C) 2003-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/base/ftadvanc.c b/thirdparty/freetype/src/base/ftadvanc.c index 0dfba57036..310bbba41e 100644 --- a/thirdparty/freetype/src/base/ftadvanc.c +++ b/thirdparty/freetype/src/base/ftadvanc.c @@ -4,7 +4,7 @@ * * Quick computation of advance widths (body). * - * Copyright (C) 2008-2019 by + * Copyright (C) 2008-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftbase.c b/thirdparty/freetype/src/base/ftbase.c index fb8cbfcc27..b8242bb960 100644 --- a/thirdparty/freetype/src/base/ftbase.c +++ b/thirdparty/freetype/src/base/ftbase.c @@ -4,7 +4,7 @@ * * Single object library component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftbase.h b/thirdparty/freetype/src/base/ftbase.h index 35b1c47fd9..472713addf 100644 --- a/thirdparty/freetype/src/base/ftbase.h +++ b/thirdparty/freetype/src/base/ftbase.h @@ -4,7 +4,7 @@ * * Private functions used in the `base' module (specification). * - * Copyright (C) 2008-2019 by + * Copyright (C) 2008-2020 by * David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftbbox.c b/thirdparty/freetype/src/base/ftbbox.c index a0b2c46f7b..9d9f9c4015 100644 --- a/thirdparty/freetype/src/base/ftbbox.c +++ b/thirdparty/freetype/src/base/ftbbox.c @@ -4,7 +4,7 @@ * * FreeType bbox computation (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used @@ -294,10 +294,10 @@ if ( shift > 2 ) shift = 2; - q1 <<= shift; - q2 <<= shift; - q3 <<= shift; - q4 <<= shift; + q1 *= 1 << shift; + q2 *= 1 << shift; + q3 *= 1 << shift; + q4 *= 1 << shift; } else { diff --git a/thirdparty/freetype/src/base/ftbdf.c b/thirdparty/freetype/src/base/ftbdf.c index c0fccd7b7c..a239e5f873 100644 --- a/thirdparty/freetype/src/base/ftbdf.c +++ b/thirdparty/freetype/src/base/ftbdf.c @@ -4,7 +4,7 @@ * * FreeType API for accessing BDF-specific strings (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftbitmap.c b/thirdparty/freetype/src/base/ftbitmap.c index 0e0a76fe40..18ac4c5f34 100644 --- a/thirdparty/freetype/src/base/ftbitmap.c +++ b/thirdparty/freetype/src/base/ftbitmap.c @@ -4,7 +4,7 @@ * * FreeType utility functions for bitmaps (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftcalc.c b/thirdparty/freetype/src/base/ftcalc.c index 315dc44185..53550057b1 100644 --- a/thirdparty/freetype/src/base/ftcalc.c +++ b/thirdparty/freetype/src/base/ftcalc.c @@ -4,7 +4,7 @@ * * Arithmetic computations (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftcid.c b/thirdparty/freetype/src/base/ftcid.c index 190b23f357..17c25730e7 100644 --- a/thirdparty/freetype/src/base/ftcid.c +++ b/thirdparty/freetype/src/base/ftcid.c @@ -4,7 +4,7 @@ * * FreeType API for accessing CID font information. * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * Derek Clegg and Michael Toftdal. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftcolor.c b/thirdparty/freetype/src/base/ftcolor.c index 8cb057a365..986e9924a6 100644 --- a/thirdparty/freetype/src/base/ftcolor.c +++ b/thirdparty/freetype/src/base/ftcolor.c @@ -4,7 +4,7 @@ * * FreeType's glyph color management (body). * - * Copyright (C) 2018-2019 by + * Copyright (C) 2018-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftdbgmem.c b/thirdparty/freetype/src/base/ftdbgmem.c index 55cd269e1f..7f06c86006 100644 --- a/thirdparty/freetype/src/base/ftdbgmem.c +++ b/thirdparty/freetype/src/base/ftdbgmem.c @@ -4,7 +4,7 @@ * * Memory debugger (body). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -621,8 +621,10 @@ if ( node->size < 0 ) ft_mem_debug_panic( - "freeing memory block at %p more than once at (%s:%ld)\n" - "block allocated at (%s:%ld) and released at (%s:%ld)", + "freeing memory block at %p more than once\n" + " at (%s:%ld)!\n" + " Block was allocated at (%s:%ld)\n" + " and released at (%s:%ld).", address, FT_FILENAME( _ft_debug_file ), _ft_debug_lineno, FT_FILENAME( node->source->file_name ), node->source->line_no, diff --git a/thirdparty/freetype/src/base/ftdebug.c b/thirdparty/freetype/src/base/ftdebug.c index ec72337873..da1c1265e3 100644 --- a/thirdparty/freetype/src/base/ftdebug.c +++ b/thirdparty/freetype/src/base/ftdebug.c @@ -4,7 +4,7 @@ * * Debugging and logging component (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/fterrors.c b/thirdparty/freetype/src/base/fterrors.c index 84fe590289..8aa688fbe2 100644 --- a/thirdparty/freetype/src/base/fterrors.c +++ b/thirdparty/freetype/src/base/fterrors.c @@ -4,7 +4,7 @@ * * FreeType API for error code handling. * - * Copyright (C) 2018-2019 by + * Copyright (C) 2018-2020 by * Armin Hasitzka, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftfntfmt.c b/thirdparty/freetype/src/base/ftfntfmt.c index 54ba537416..95e9b6e4c1 100644 --- a/thirdparty/freetype/src/base/ftfntfmt.c +++ b/thirdparty/freetype/src/base/ftfntfmt.c @@ -4,7 +4,7 @@ * * FreeType utility file for font formats (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftfstype.c b/thirdparty/freetype/src/base/ftfstype.c index 45e2d8089b..461d857077 100644 --- a/thirdparty/freetype/src/base/ftfstype.c +++ b/thirdparty/freetype/src/base/ftfstype.c @@ -4,7 +4,7 @@ * * FreeType utility file to access FSType data (body). * - * Copyright (C) 2008-2019 by + * Copyright (C) 2008-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftgasp.c b/thirdparty/freetype/src/base/ftgasp.c index 720fb113ca..0fd80b9cd6 100644 --- a/thirdparty/freetype/src/base/ftgasp.c +++ b/thirdparty/freetype/src/base/ftgasp.c @@ -4,7 +4,7 @@ * * Access of TrueType's `gasp' table (body). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftgloadr.c b/thirdparty/freetype/src/base/ftgloadr.c index bfeed461a8..6032885c6b 100644 --- a/thirdparty/freetype/src/base/ftgloadr.c +++ b/thirdparty/freetype/src/base/ftgloadr.c @@ -4,7 +4,7 @@ * * The FreeType glyph loader (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg * * This file is part of the FreeType project, and may only be used, @@ -146,9 +146,9 @@ FT_Outline* current = &loader->current.outline; - current->points = base->points + base->n_points; - current->tags = base->tags + base->n_points; - current->contours = base->contours + base->n_contours; + current->points = FT_OFFSET( base->points, base->n_points ); + current->tags = FT_OFFSET( base->tags, base->n_points ); + current->contours = FT_OFFSET( base->contours, base->n_contours ); /* handle extra points table - if any */ if ( loader->use_extra ) @@ -169,6 +169,10 @@ FT_Memory memory = loader->memory; + if ( loader->max_points == 0 || + loader->base.extra_points != NULL ) + return FT_Err_Ok; + if ( !FT_NEW_ARRAY( loader->base.extra_points, 2 * loader->max_points ) ) { loader->use_extra = 1; @@ -189,7 +193,7 @@ FT_GlyphLoad current = &loader->current; - current->subglyphs = base->subglyphs + base->num_subglyphs; + current->subglyphs = FT_OFFSET( base->subglyphs, base->num_subglyphs ); } @@ -211,6 +215,10 @@ FT_UInt new_max, old_max; + error = FT_GlyphLoader_CreateExtra( loader ); + if ( error ) + return error; + /* check points & tags */ new_max = (FT_UInt)base->n_points + (FT_UInt)current->n_points + n_points; @@ -244,6 +252,10 @@ loader->max_points = new_max; } + error = FT_GlyphLoader_CreateExtra( loader ); + if ( error ) + return error; + /* check contours */ old_max = loader->max_contours; new_max = (FT_UInt)base->n_contours + (FT_UInt)current->n_contours + diff --git a/thirdparty/freetype/src/base/ftglyph.c b/thirdparty/freetype/src/base/ftglyph.c index e6b1327901..44654be780 100644 --- a/thirdparty/freetype/src/base/ftglyph.c +++ b/thirdparty/freetype/src/base/ftglyph.c @@ -4,7 +4,7 @@ * * FreeType convenience functions to handle glyphs (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftgxval.c b/thirdparty/freetype/src/base/ftgxval.c index 0677d26faa..fa32c5f6ca 100644 --- a/thirdparty/freetype/src/base/ftgxval.c +++ b/thirdparty/freetype/src/base/ftgxval.c @@ -4,7 +4,7 @@ * * FreeType API for validating TrueTypeGX/AAT tables (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * Masatake YAMATO, Redhat K.K, * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/base/ftinit.c b/thirdparty/freetype/src/base/ftinit.c index c73cd78b83..1aab09a771 100644 --- a/thirdparty/freetype/src/base/ftinit.c +++ b/thirdparty/freetype/src/base/ftinit.c @@ -4,7 +4,7 @@ * * FreeType initialization layer (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftlcdfil.c b/thirdparty/freetype/src/base/ftlcdfil.c index d9f4af4293..d4ef93a518 100644 --- a/thirdparty/freetype/src/base/ftlcdfil.c +++ b/thirdparty/freetype/src/base/ftlcdfil.c @@ -4,7 +4,7 @@ * * FreeType API for color filtering of subpixel bitmap glyphs (body). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftmac.c b/thirdparty/freetype/src/base/ftmac.c index 5f23ceea9f..2de43a0146 100644 --- a/thirdparty/freetype/src/base/ftmac.c +++ b/thirdparty/freetype/src/base/ftmac.c @@ -8,7 +8,7 @@ * This file is for Mac OS X only; see builds/mac/ftoldmac.c for * classic platforms built by MPW. * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftmm.c b/thirdparty/freetype/src/base/ftmm.c index ba9e67f008..ef2e3d9588 100644 --- a/thirdparty/freetype/src/base/ftmm.c +++ b/thirdparty/freetype/src/base/ftmm.c @@ -4,7 +4,7 @@ * * Multiple Master font support (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftobjs.c b/thirdparty/freetype/src/base/ftobjs.c index e301f8f11a..1b042614d2 100644 --- a/thirdparty/freetype/src/base/ftobjs.c +++ b/thirdparty/freetype/src/base/ftobjs.c @@ -4,7 +4,7 @@ * * The FreeType private base classes (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftotval.c b/thirdparty/freetype/src/base/ftotval.c index 007576ce6e..9f69e0c1fd 100644 --- a/thirdparty/freetype/src/base/ftotval.c +++ b/thirdparty/freetype/src/base/ftotval.c @@ -4,7 +4,7 @@ * * FreeType API for validating OpenType tables (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftoutln.c b/thirdparty/freetype/src/base/ftoutln.c index 0e2ba3475d..faaae83294 100644 --- a/thirdparty/freetype/src/base/ftoutln.c +++ b/thirdparty/freetype/src/base/ftoutln.c @@ -4,7 +4,7 @@ * * FreeType outline management (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -711,7 +711,7 @@ FT_Vector* limit; - if ( !outline || !matrix ) + if ( !outline || !matrix || !outline->points ) return; vec = outline->points; diff --git a/thirdparty/freetype/src/base/ftpatent.c b/thirdparty/freetype/src/base/ftpatent.c index 020f4646eb..077a9b03fa 100644 --- a/thirdparty/freetype/src/base/ftpatent.c +++ b/thirdparty/freetype/src/base/ftpatent.c @@ -5,7 +5,7 @@ * FreeType API for checking patented TrueType bytecode instructions * (body). Obsolete, retained for backward compatibility. * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftpfr.c b/thirdparty/freetype/src/base/ftpfr.c index aeff1db8bd..57e65665ff 100644 --- a/thirdparty/freetype/src/base/ftpfr.c +++ b/thirdparty/freetype/src/base/ftpfr.c @@ -4,7 +4,7 @@ * * FreeType API for accessing PFR-specific data (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftpsprop.c b/thirdparty/freetype/src/base/ftpsprop.c index 52b9d453ad..c63f864c1a 100644 --- a/thirdparty/freetype/src/base/ftpsprop.c +++ b/thirdparty/freetype/src/base/ftpsprop.c @@ -5,7 +5,7 @@ * Get and set properties of PostScript drivers (body). * See `ftdriver.h' for available properties. * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -165,9 +165,9 @@ driver->hinting_engine = *hinting_engine; else error = FT_ERR( Unimplemented_Feature ); - - return error; } + + return error; } else if ( !ft_strcmp( property_name, "no-stem-darkening" ) ) diff --git a/thirdparty/freetype/src/base/ftrfork.c b/thirdparty/freetype/src/base/ftrfork.c index 73b7eb0ded..1bf7800f17 100644 --- a/thirdparty/freetype/src/base/ftrfork.c +++ b/thirdparty/freetype/src/base/ftrfork.c @@ -4,7 +4,7 @@ * * Embedded resource forks accessor (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * Masatake YAMATO and Redhat K.K. * * FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are diff --git a/thirdparty/freetype/src/base/ftsnames.c b/thirdparty/freetype/src/base/ftsnames.c index 7ab3fe3cfa..25f5d45be5 100644 --- a/thirdparty/freetype/src/base/ftsnames.c +++ b/thirdparty/freetype/src/base/ftsnames.c @@ -7,7 +7,7 @@ * * This is _not_ used to retrieve glyph names! * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftstream.c b/thirdparty/freetype/src/base/ftstream.c index 4b0890d7fd..7dbf9b55fc 100644 --- a/thirdparty/freetype/src/base/ftstream.c +++ b/thirdparty/freetype/src/base/ftstream.c @@ -4,7 +4,7 @@ * * I/O stream support (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -286,7 +286,7 @@ } stream->cursor = stream->base; - stream->limit = stream->cursor + count; + stream->limit = FT_OFFSET( stream->cursor, count ); stream->pos += read_bytes; } else diff --git a/thirdparty/freetype/src/base/ftstroke.c b/thirdparty/freetype/src/base/ftstroke.c index 1b2c0f657c..3369dc24b1 100644 --- a/thirdparty/freetype/src/base/ftstroke.c +++ b/thirdparty/freetype/src/base/ftstroke.c @@ -4,7 +4,7 @@ * * FreeType path stroker (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -540,63 +540,52 @@ FT_Angle angle_start, FT_Angle angle_diff ) { - FT_Angle total, angle, step, rotate, next, theta; - FT_Vector a, b, a2, b2; - FT_Fixed length; + FT_Fixed coef; + FT_Vector a0, a1, a2, a3; + FT_Int i, arcs = 1; FT_Error error = FT_Err_Ok; - /* compute start point */ - FT_Vector_From_Polar( &a, radius, angle_start ); - a.x += center->x; - a.y += center->y; + /* number of cubic arcs to draw */ + while ( angle_diff > FT_ARC_CUBIC_ANGLE * arcs || + -angle_diff > FT_ARC_CUBIC_ANGLE * arcs ) + arcs++; - total = angle_diff; - angle = angle_start; - rotate = ( angle_diff >= 0 ) ? FT_ANGLE_PI2 : -FT_ANGLE_PI2; + /* control tangents */ + coef = FT_Tan( angle_diff / ( 4 * arcs ) ); + coef += coef / 3; - while ( total != 0 ) - { - step = total; - if ( step > FT_ARC_CUBIC_ANGLE ) - step = FT_ARC_CUBIC_ANGLE; - - else if ( step < -FT_ARC_CUBIC_ANGLE ) - step = -FT_ARC_CUBIC_ANGLE; - - next = angle + step; - theta = step; - if ( theta < 0 ) - theta = -theta; + /* compute start and first control point */ + FT_Vector_From_Polar( &a0, radius, angle_start ); + a1.x = FT_MulFix( -a0.y, coef ); + a1.y = FT_MulFix( a0.x, coef ); - theta >>= 1; + a0.x += center->x; + a0.y += center->y; + a1.x += a0.x; + a1.y += a0.y; - /* compute end point */ - FT_Vector_From_Polar( &b, radius, next ); - b.x += center->x; - b.y += center->y; - - /* compute first and second control points */ - length = FT_MulDiv( radius, FT_Sin( theta ) * 4, - ( 0x10000L + FT_Cos( theta ) ) * 3 ); - - FT_Vector_From_Polar( &a2, length, angle + rotate ); - a2.x += a.x; - a2.y += a.y; + for ( i = 1; i <= arcs; i++ ) + { + /* compute end and second control point */ + FT_Vector_From_Polar( &a3, radius, + angle_start + i * angle_diff / arcs ); + a2.x = FT_MulFix( a3.y, coef ); + a2.y = FT_MulFix( -a3.x, coef ); - FT_Vector_From_Polar( &b2, length, next - rotate ); - b2.x += b.x; - b2.y += b.y; + a3.x += center->x; + a3.y += center->y; + a2.x += a3.x; + a2.y += a3.y; /* add cubic arc */ - error = ft_stroke_border_cubicto( border, &a2, &b2, &b ); + error = ft_stroke_border_cubicto( border, &a1, &a2, &a3 ); if ( error ) break; - /* process the rest of the arc ?? */ - a = b; - total -= step; - angle = next; + /* a0 = a3; */ + a1.x = a3.x - a2.x + a3.x; + a1.y = a3.y - a2.y + a3.y; } return error; @@ -934,55 +923,40 @@ error = ft_stroker_arcto( stroker, side ); } - else if ( stroker->line_cap == FT_STROKER_LINECAP_SQUARE ) + else { - /* add a square cap */ - FT_Vector delta, delta2; - FT_Angle rotate = FT_SIDE_TO_ROTATE( side ); + /* add a square or butt cap */ + FT_Vector middle, delta; FT_Fixed radius = stroker->radius; FT_StrokeBorder border = stroker->borders + side; - FT_Vector_From_Polar( &delta2, radius, angle + rotate ); - FT_Vector_From_Polar( &delta, radius, angle ); - - delta.x += stroker->center.x + delta2.x; - delta.y += stroker->center.y + delta2.y; - - error = ft_stroke_border_lineto( border, &delta, FALSE ); - if ( error ) - goto Exit; - - FT_Vector_From_Polar( &delta2, radius, angle - rotate ); - FT_Vector_From_Polar( &delta, radius, angle ); - - delta.x += delta2.x + stroker->center.x; - delta.y += delta2.y + stroker->center.y; + /* compute middle point and first angle point */ + FT_Vector_From_Polar( &middle, radius, angle ); + delta.x = side ? middle.y : -middle.y; + delta.y = side ? -middle.x : middle.x; - error = ft_stroke_border_lineto( border, &delta, FALSE ); - } - else if ( stroker->line_cap == FT_STROKER_LINECAP_BUTT ) - { - /* add a butt ending */ - FT_Vector delta; - FT_Angle rotate = FT_SIDE_TO_ROTATE( side ); - FT_Fixed radius = stroker->radius; - FT_StrokeBorder border = stroker->borders + side; - - - FT_Vector_From_Polar( &delta, radius, angle + rotate ); + if ( stroker->line_cap == FT_STROKER_LINECAP_SQUARE ) + { + middle.x += stroker->center.x; + middle.y += stroker->center.y; + } + else /* FT_STROKER_LINECAP_BUTT */ + { + middle.x = stroker->center.x; + middle.y = stroker->center.y; + } - delta.x += stroker->center.x; - delta.y += stroker->center.y; + delta.x += middle.x; + delta.y += middle.y; error = ft_stroke_border_lineto( border, &delta, FALSE ); if ( error ) goto Exit; - FT_Vector_From_Polar( &delta, radius, angle - rotate ); - - delta.x += stroker->center.x; - delta.y += stroker->center.y; + /* compute second angle point */ + delta.x = middle.x - delta.x + middle.x; + delta.y = middle.y - delta.y + middle.y; error = ft_stroke_border_lineto( border, &delta, FALSE ); } @@ -1000,8 +974,8 @@ { FT_StrokeBorder border = stroker->borders + side; FT_Angle phi, theta, rotate; - FT_Fixed length, thcos; - FT_Vector delta; + FT_Fixed length; + FT_Vector sigma, delta; FT_Error error = FT_Err_Ok; FT_Bool intersect; /* use intersection of lines? */ @@ -1019,10 +993,13 @@ else { /* compute minimum required length of lines */ - FT_Fixed min_length = ft_pos_abs( FT_MulFix( stroker->radius, - FT_Tan( theta ) ) ); + FT_Fixed min_length; + FT_Vector_Unit( &sigma, theta ); + min_length = + ft_pos_abs( FT_MulDiv( stroker->radius, sigma.y, sigma.x ) ); + intersect = FT_BOOL( min_length && stroker->line_length >= min_length && line_length >= min_length ); @@ -1040,13 +1017,11 @@ else { /* compute median angle */ - phi = stroker->angle_in + theta; - - thcos = FT_Cos( theta ); + phi = stroker->angle_in + theta + rotate; - length = FT_DivFix( stroker->radius, thcos ); + length = FT_DivFix( stroker->radius, sigma.x ); - FT_Vector_From_Polar( &delta, length, phi + rotate ); + FT_Vector_From_Polar( &delta, length, phi ); delta.x += stroker->center.x; delta.y += stroker->center.y; } @@ -1073,10 +1048,10 @@ else { /* this is a mitered (pointed) or beveled (truncated) corner */ - FT_Fixed sigma = 0, radius = stroker->radius; - FT_Angle theta = 0, phi = 0; - FT_Fixed thcos = 0; - FT_Bool bevel, fixed_bevel; + FT_Fixed radius = stroker->radius; + FT_Vector sigma; + FT_Angle theta = 0, phi = 0; + FT_Bool bevel, fixed_bevel; rotate = FT_SIDE_TO_ROTATE( side ); @@ -1087,26 +1062,20 @@ fixed_bevel = FT_BOOL( stroker->line_join != FT_STROKER_LINEJOIN_MITER_VARIABLE ); + /* check miter limit first */ if ( !bevel ) { - theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ); + theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ) / 2; - if ( theta == FT_ANGLE_PI ) - { - theta = rotate; - phi = stroker->angle_in; - } - else - { - theta /= 2; - phi = stroker->angle_in + theta + rotate; - } + if ( theta == FT_ANGLE_PI2 ) + theta = -rotate; - thcos = FT_Cos( theta ); - sigma = FT_MulFix( stroker->miter_limit, thcos ); + phi = stroker->angle_in + theta + rotate; + + FT_Vector_From_Polar( &sigma, stroker->miter_limit, theta ); /* is miter limit exceeded? */ - if ( sigma < 0x10000L ) + if ( sigma.x < 0x10000L ) { /* don't create variable bevels for very small deviations; */ /* FT_Sin(x) = 0 for x <= 57 */ @@ -1133,36 +1102,34 @@ border->movable = FALSE; error = ft_stroke_border_lineto( border, &delta, FALSE ); } - else /* variable bevel */ + else /* variable bevel or clipped miter */ { /* the miter is truncated */ FT_Vector middle, delta; - FT_Fixed length; + FT_Fixed coef; - /* compute middle point */ + /* compute middle point and first angle point */ FT_Vector_From_Polar( &middle, FT_MulFix( radius, stroker->miter_limit ), phi ); - middle.x += stroker->center.x; - middle.y += stroker->center.y; - /* compute first angle point */ - length = FT_MulDiv( radius, 0x10000L - sigma, - ft_pos_abs( FT_Sin( theta ) ) ); + coef = FT_DivFix( 0x10000L - sigma.x, sigma.y ); + delta.x = FT_MulFix( middle.y, coef ); + delta.y = FT_MulFix( -middle.x, coef ); - FT_Vector_From_Polar( &delta, length, phi + rotate ); - delta.x += middle.x; - delta.y += middle.y; + middle.x += stroker->center.x; + middle.y += stroker->center.y; + delta.x += middle.x; + delta.y += middle.y; error = ft_stroke_border_lineto( border, &delta, FALSE ); if ( error ) goto Exit; /* compute second angle point */ - FT_Vector_From_Polar( &delta, length, phi - rotate ); - delta.x += middle.x; - delta.y += middle.y; + delta.x = middle.x - delta.x + middle.x; + delta.y = middle.y - delta.y + middle.y; error = ft_stroke_border_lineto( border, &delta, FALSE ); if ( error ) @@ -1189,7 +1156,7 @@ FT_Vector delta; - length = FT_DivFix( stroker->radius, thcos ); + length = FT_MulDiv( stroker->radius, stroker->miter_limit, sigma.x ); FT_Vector_From_Polar( &delta, length, phi ); delta.x += stroker->center.x; diff --git a/thirdparty/freetype/src/base/ftsynth.c b/thirdparty/freetype/src/base/ftsynth.c index f87ed65e75..eee6b952b4 100644 --- a/thirdparty/freetype/src/base/ftsynth.c +++ b/thirdparty/freetype/src/base/ftsynth.c @@ -4,7 +4,7 @@ * * FreeType synthesizing code for emboldening and slanting (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftsystem.c b/thirdparty/freetype/src/base/ftsystem.c index f92b3a03d5..290100613f 100644 --- a/thirdparty/freetype/src/base/ftsystem.c +++ b/thirdparty/freetype/src/base/ftsystem.c @@ -4,7 +4,7 @@ * * ANSI-specific FreeType low-level system interface (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/fttrigon.c b/thirdparty/freetype/src/base/fttrigon.c index 38721977c7..dbe11107bd 100644 --- a/thirdparty/freetype/src/base/fttrigon.c +++ b/thirdparty/freetype/src/base/fttrigon.c @@ -4,7 +4,7 @@ * * FreeType trigonometric functions (body). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/fttype1.c b/thirdparty/freetype/src/base/fttype1.c index 26d4f1c3a8..61778faa70 100644 --- a/thirdparty/freetype/src/base/fttype1.c +++ b/thirdparty/freetype/src/base/fttype1.c @@ -4,7 +4,7 @@ * * FreeType utility file for PS names support (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftutil.c b/thirdparty/freetype/src/base/ftutil.c index 92bd857e92..629af174b1 100644 --- a/thirdparty/freetype/src/base/ftutil.c +++ b/thirdparty/freetype/src/base/ftutil.c @@ -4,7 +4,7 @@ * * FreeType utility file for memory and list management (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/ftver.rc b/thirdparty/freetype/src/base/ftver.rc index 1354497423..fcbd9eff5f 100644 --- a/thirdparty/freetype/src/base/ftver.rc +++ b/thirdparty/freetype/src/base/ftver.rc @@ -4,7 +4,7 @@ /* */ /* FreeType VERSIONINFO resource for Windows DLLs. */ /* */ -/* Copyright (C) 2018-2019 by */ +/* Copyright (C) 2018-2020 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -18,8 +18,8 @@ #include<windows.h> -#define FT_VERSION 2,10,1,0 -#define FT_VERSION_STR "2.10.1" +#define FT_VERSION 2,10,2,0 +#define FT_VERSION_STR "2.10.2" VS_VERSION_INFO VERSIONINFO FILEVERSION FT_VERSION @@ -45,7 +45,7 @@ BEGIN VALUE "FileVersion", FT_VERSION_STR VALUE "ProductName", "FreeType" VALUE "ProductVersion", FT_VERSION_STR - VALUE "LegalCopyright", "\251 2018-2019 The FreeType Project www.freetype.org. All rights reserved." + VALUE "LegalCopyright", "\251 2000-2020 The FreeType Project www.freetype.org. All rights reserved." VALUE "InternalName", "freetype" VALUE "OriginalFilename", FT_FILENAME END diff --git a/thirdparty/freetype/src/base/ftwinfnt.c b/thirdparty/freetype/src/base/ftwinfnt.c index 59daa77031..77527277c2 100644 --- a/thirdparty/freetype/src/base/ftwinfnt.c +++ b/thirdparty/freetype/src/base/ftwinfnt.c @@ -4,7 +4,7 @@ * * FreeType API for accessing Windows FNT specific info (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/base/rules.mk b/thirdparty/freetype/src/base/rules.mk index 4b24c6dce7..411c4c821f 100644 --- a/thirdparty/freetype/src/base/rules.mk +++ b/thirdparty/freetype/src/base/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/bzip2/ftbzip2.c b/thirdparty/freetype/src/bzip2/ftbzip2.c index 1fda59b60c..e4d7a4901a 100644 --- a/thirdparty/freetype/src/bzip2/ftbzip2.c +++ b/thirdparty/freetype/src/bzip2/ftbzip2.c @@ -8,7 +8,7 @@ * parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2010-2019 by + * Copyright (C) 2010-2020 by * Joel Klinghed. * * based on `src/gzip/ftgzip.c' diff --git a/thirdparty/freetype/src/bzip2/rules.mk b/thirdparty/freetype/src/bzip2/rules.mk index f365c1f76d..eed0f4baa4 100644 --- a/thirdparty/freetype/src/bzip2/rules.mk +++ b/thirdparty/freetype/src/bzip2/rules.mk @@ -2,7 +2,7 @@ # FreeType 2 BZIP2 support configuration rules # -# Copyright (C) 2010-2019 by +# Copyright (C) 2010-2020 by # Joel Klinghed. # # based on `src/lzw/rules.mk' diff --git a/thirdparty/freetype/src/cache/ftcache.c b/thirdparty/freetype/src/cache/ftcache.c index a6a3e63ef0..4137f68690 100644 --- a/thirdparty/freetype/src/cache/ftcache.c +++ b/thirdparty/freetype/src/cache/ftcache.c @@ -4,7 +4,7 @@ * * The FreeType Caching sub-system (body only). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcbasic.c b/thirdparty/freetype/src/cache/ftcbasic.c index a473585ebc..a65a90e867 100644 --- a/thirdparty/freetype/src/cache/ftcbasic.c +++ b/thirdparty/freetype/src/cache/ftcbasic.c @@ -4,7 +4,7 @@ * * The FreeType basic cache interface (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftccache.c b/thirdparty/freetype/src/cache/ftccache.c index f38ca44ddd..1d406c4200 100644 --- a/thirdparty/freetype/src/cache/ftccache.c +++ b/thirdparty/freetype/src/cache/ftccache.c @@ -4,7 +4,7 @@ * * The FreeType internal cache interface (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftccache.h b/thirdparty/freetype/src/cache/ftccache.h index 140ceadb11..2996ee8080 100644 --- a/thirdparty/freetype/src/cache/ftccache.h +++ b/thirdparty/freetype/src/cache/ftccache.h @@ -4,7 +4,7 @@ * * FreeType internal cache interface (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftccback.h b/thirdparty/freetype/src/cache/ftccback.h index 9321bc3d4e..252be7c2b5 100644 --- a/thirdparty/freetype/src/cache/ftccback.h +++ b/thirdparty/freetype/src/cache/ftccback.h @@ -4,7 +4,7 @@ * * Callback functions of the caching sub-system (specification only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftccmap.c b/thirdparty/freetype/src/cache/ftccmap.c index 76ba10e3e9..a5da694d56 100644 --- a/thirdparty/freetype/src/cache/ftccmap.c +++ b/thirdparty/freetype/src/cache/ftccmap.c @@ -4,7 +4,7 @@ * * FreeType CharMap cache (body) * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcerror.h b/thirdparty/freetype/src/cache/ftcerror.h index e2d6417180..15e416ed21 100644 --- a/thirdparty/freetype/src/cache/ftcerror.h +++ b/thirdparty/freetype/src/cache/ftcerror.h @@ -4,7 +4,7 @@ * * Caching sub-system error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcglyph.c b/thirdparty/freetype/src/cache/ftcglyph.c index 2a0e97d4af..559a2fb4c8 100644 --- a/thirdparty/freetype/src/cache/ftcglyph.c +++ b/thirdparty/freetype/src/cache/ftcglyph.c @@ -4,7 +4,7 @@ * * FreeType Glyph Image (FT_Glyph) cache (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcglyph.h b/thirdparty/freetype/src/cache/ftcglyph.h index 5a1f0e2a74..ef689f9947 100644 --- a/thirdparty/freetype/src/cache/ftcglyph.h +++ b/thirdparty/freetype/src/cache/ftcglyph.h @@ -4,7 +4,7 @@ * * FreeType abstract glyph cache (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcimage.c b/thirdparty/freetype/src/cache/ftcimage.c index 9e64d51a22..7696b2e52d 100644 --- a/thirdparty/freetype/src/cache/ftcimage.c +++ b/thirdparty/freetype/src/cache/ftcimage.c @@ -4,7 +4,7 @@ * * FreeType Image cache (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcimage.h b/thirdparty/freetype/src/cache/ftcimage.h index dcb101fabc..f99c5074cf 100644 --- a/thirdparty/freetype/src/cache/ftcimage.h +++ b/thirdparty/freetype/src/cache/ftcimage.h @@ -4,7 +4,7 @@ * * FreeType Generic Image cache (specification) * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcmanag.c b/thirdparty/freetype/src/cache/ftcmanag.c index bd585968e3..a6f1733f64 100644 --- a/thirdparty/freetype/src/cache/ftcmanag.c +++ b/thirdparty/freetype/src/cache/ftcmanag.c @@ -4,7 +4,7 @@ * * FreeType Cache Manager (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcmanag.h b/thirdparty/freetype/src/cache/ftcmanag.h index 60c66c8fc8..17ade7175f 100644 --- a/thirdparty/freetype/src/cache/ftcmanag.h +++ b/thirdparty/freetype/src/cache/ftcmanag.h @@ -4,7 +4,7 @@ * * FreeType Cache Manager (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcmru.c b/thirdparty/freetype/src/cache/ftcmru.c index 18a7b80054..370ae3be04 100644 --- a/thirdparty/freetype/src/cache/ftcmru.c +++ b/thirdparty/freetype/src/cache/ftcmru.c @@ -4,7 +4,7 @@ * * FreeType MRU support (body). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcmru.h b/thirdparty/freetype/src/cache/ftcmru.h index 58721ed340..1591c20807 100644 --- a/thirdparty/freetype/src/cache/ftcmru.h +++ b/thirdparty/freetype/src/cache/ftcmru.h @@ -4,7 +4,7 @@ * * Simple MRU list-cache (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcsbits.c b/thirdparty/freetype/src/cache/ftcsbits.c index 06b46c896e..24e4aa1316 100644 --- a/thirdparty/freetype/src/cache/ftcsbits.c +++ b/thirdparty/freetype/src/cache/ftcsbits.c @@ -4,7 +4,7 @@ * * FreeType sbits manager (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/ftcsbits.h b/thirdparty/freetype/src/cache/ftcsbits.h index f1b71c2835..2517d15552 100644 --- a/thirdparty/freetype/src/cache/ftcsbits.h +++ b/thirdparty/freetype/src/cache/ftcsbits.h @@ -4,7 +4,7 @@ * * A small-bitmap cache (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cache/rules.mk b/thirdparty/freetype/src/cache/rules.mk index 1618d98303..4738b5153a 100644 --- a/thirdparty/freetype/src/cache/rules.mk +++ b/thirdparty/freetype/src/cache/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2000-2019 by +# Copyright (C) 2000-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/cff/cff.c b/thirdparty/freetype/src/cff/cff.c index a34ba9b710..755228bb6c 100644 --- a/thirdparty/freetype/src/cff/cff.c +++ b/thirdparty/freetype/src/cff/cff.c @@ -4,7 +4,7 @@ * * FreeType OpenType driver component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffcmap.c b/thirdparty/freetype/src/cff/cffcmap.c index 15cc94cafb..1a045765de 100644 --- a/thirdparty/freetype/src/cff/cffcmap.c +++ b/thirdparty/freetype/src/cff/cffcmap.c @@ -4,7 +4,7 @@ * * CFF character mapping table (cmap) support (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffcmap.h b/thirdparty/freetype/src/cff/cffcmap.h index 07366bc748..319be88241 100644 --- a/thirdparty/freetype/src/cff/cffcmap.h +++ b/thirdparty/freetype/src/cff/cffcmap.h @@ -4,7 +4,7 @@ * * CFF character mapping table (cmap) support (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffdrivr.c b/thirdparty/freetype/src/cff/cffdrivr.c index 2324989811..6d0dcd09d2 100644 --- a/thirdparty/freetype/src/cff/cffdrivr.c +++ b/thirdparty/freetype/src/cff/cffdrivr.c @@ -4,7 +4,7 @@ * * OpenType font driver implementation (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffdrivr.h b/thirdparty/freetype/src/cff/cffdrivr.h index f2bbcfe4f1..25471d511b 100644 --- a/thirdparty/freetype/src/cff/cffdrivr.h +++ b/thirdparty/freetype/src/cff/cffdrivr.h @@ -4,7 +4,7 @@ * * High-level OpenType driver interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cfferrs.h b/thirdparty/freetype/src/cff/cfferrs.h index 78d47a156d..32be8a7637 100644 --- a/thirdparty/freetype/src/cff/cfferrs.h +++ b/thirdparty/freetype/src/cff/cfferrs.h @@ -4,7 +4,7 @@ * * CFF error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffgload.c b/thirdparty/freetype/src/cff/cffgload.c index 36aa7d1b9c..1c4e1979c4 100644 --- a/thirdparty/freetype/src/cff/cffgload.c +++ b/thirdparty/freetype/src/cff/cffgload.c @@ -4,7 +4,7 @@ * * OpenType Glyph Loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffgload.h b/thirdparty/freetype/src/cff/cffgload.h index 754c55acf9..b4ad61a564 100644 --- a/thirdparty/freetype/src/cff/cffgload.h +++ b/thirdparty/freetype/src/cff/cffgload.h @@ -4,7 +4,7 @@ * * OpenType Glyph Loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffload.c b/thirdparty/freetype/src/cff/cffload.c index 12efd18dc4..9f1d0e2e64 100644 --- a/thirdparty/freetype/src/cff/cffload.c +++ b/thirdparty/freetype/src/cff/cffload.c @@ -4,7 +4,7 @@ * * OpenType and CFF data/program tables loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -2057,7 +2057,7 @@ if ( !error ) { FT_TRACE4(( " top dictionary:\n" )); - error = cff_parser_run( &parser, dict, dict + dict_len ); + error = cff_parser_run( &parser, dict, FT_OFFSET( dict, dict_len ) ); } /* clean up regardless of error */ diff --git a/thirdparty/freetype/src/cff/cffload.h b/thirdparty/freetype/src/cff/cffload.h index 42d2696f33..1b7971293b 100644 --- a/thirdparty/freetype/src/cff/cffload.h +++ b/thirdparty/freetype/src/cff/cffload.h @@ -4,7 +4,7 @@ * * OpenType & CFF data/program tables loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffobjs.c b/thirdparty/freetype/src/cff/cffobjs.c index f76245f30b..78c3cb3c2d 100644 --- a/thirdparty/freetype/src/cff/cffobjs.c +++ b/thirdparty/freetype/src/cff/cffobjs.c @@ -4,7 +4,7 @@ * * OpenType objects manager (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -1018,9 +1018,9 @@ } #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES - /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */ - /* has unset this flag because of the 3.0 `post' table. */ - if ( dict->cid_registry == 0xFFFFU ) + /* CID-keyed CFF or CFF2 fonts don't have glyph names -- the SFNT */ + /* loader has unset this flag because of the 3.0 `post' table. */ + if ( dict->cid_registry == 0xFFFFU && !cff2 ) cffface->face_flags |= FT_FACE_FLAG_GLYPH_NAMES; #endif diff --git a/thirdparty/freetype/src/cff/cffobjs.h b/thirdparty/freetype/src/cff/cffobjs.h index 03bc78a67f..6f12b95db6 100644 --- a/thirdparty/freetype/src/cff/cffobjs.h +++ b/thirdparty/freetype/src/cff/cffobjs.h @@ -4,7 +4,7 @@ * * OpenType objects manager (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffparse.c b/thirdparty/freetype/src/cff/cffparse.c index 008752c3ae..0d3bf34592 100644 --- a/thirdparty/freetype/src/cff/cffparse.c +++ b/thirdparty/freetype/src/cff/cffparse.c @@ -4,7 +4,7 @@ * * CFF token stream parser (body) * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cffparse.h b/thirdparty/freetype/src/cff/cffparse.h index 4e74709a2d..887110a748 100644 --- a/thirdparty/freetype/src/cff/cffparse.h +++ b/thirdparty/freetype/src/cff/cffparse.h @@ -4,7 +4,7 @@ * * CFF token stream parser (specification) * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/cfftoken.h b/thirdparty/freetype/src/cff/cfftoken.h index 063a7b3be0..4c6a53eec1 100644 --- a/thirdparty/freetype/src/cff/cfftoken.h +++ b/thirdparty/freetype/src/cff/cfftoken.h @@ -4,7 +4,7 @@ * * CFF token definitions (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cff/module.mk b/thirdparty/freetype/src/cff/module.mk index 8c610959d3..bd728c6a34 100644 --- a/thirdparty/freetype/src/cff/module.mk +++ b/thirdparty/freetype/src/cff/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/cff/rules.mk b/thirdparty/freetype/src/cff/rules.mk index 6e2dc476ef..70bb92d506 100644 --- a/thirdparty/freetype/src/cff/rules.mk +++ b/thirdparty/freetype/src/cff/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/cid/ciderrs.h b/thirdparty/freetype/src/cid/ciderrs.h index be80bed3be..52ab55d684 100644 --- a/thirdparty/freetype/src/cid/ciderrs.h +++ b/thirdparty/freetype/src/cid/ciderrs.h @@ -4,7 +4,7 @@ * * CID error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidgload.c b/thirdparty/freetype/src/cid/cidgload.c index f59f2880f0..daa0bddc2a 100644 --- a/thirdparty/freetype/src/cid/cidgload.c +++ b/thirdparty/freetype/src/cid/cidgload.c @@ -4,7 +4,7 @@ * * CID-keyed Type1 Glyph Loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidgload.h b/thirdparty/freetype/src/cid/cidgload.h index 37eba7ca7b..251c93c9f2 100644 --- a/thirdparty/freetype/src/cid/cidgload.h +++ b/thirdparty/freetype/src/cid/cidgload.h @@ -4,7 +4,7 @@ * * OpenType Glyph Loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidload.c b/thirdparty/freetype/src/cid/cidload.c index fce3e37da7..4723966024 100644 --- a/thirdparty/freetype/src/cid/cidload.c +++ b/thirdparty/freetype/src/cid/cidload.c @@ -4,7 +4,7 @@ * * CID-keyed Type1 font loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -715,7 +715,7 @@ if ( ft_isdigit( *p ) ) val = (FT_Byte)( *p - '0' ); else if ( *p >= 'a' && *p <= 'f' ) - val = (FT_Byte)( *p - 'a' ); + val = (FT_Byte)( *p - 'a' + 10 ); else if ( *p >= 'A' && *p <= 'F' ) val = (FT_Byte)( *p - 'A' + 10 ); else if ( *p == ' ' || diff --git a/thirdparty/freetype/src/cid/cidload.h b/thirdparty/freetype/src/cid/cidload.h index fb9d46216d..e639f6ffef 100644 --- a/thirdparty/freetype/src/cid/cidload.h +++ b/thirdparty/freetype/src/cid/cidload.h @@ -4,7 +4,7 @@ * * CID-keyed Type1 font loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidobjs.c b/thirdparty/freetype/src/cid/cidobjs.c index 4e9728719b..34f72b588d 100644 --- a/thirdparty/freetype/src/cid/cidobjs.c +++ b/thirdparty/freetype/src/cid/cidobjs.c @@ -4,7 +4,7 @@ * * CID objects manager (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidobjs.h b/thirdparty/freetype/src/cid/cidobjs.h index 89c9aa74ab..efe812fd11 100644 --- a/thirdparty/freetype/src/cid/cidobjs.h +++ b/thirdparty/freetype/src/cid/cidobjs.h @@ -4,7 +4,7 @@ * * CID objects manager (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidparse.c b/thirdparty/freetype/src/cid/cidparse.c index 1be46ec328..94a36e22f5 100644 --- a/thirdparty/freetype/src/cid/cidparse.c +++ b/thirdparty/freetype/src/cid/cidparse.c @@ -4,7 +4,7 @@ * * CID-keyed Type1 parser (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidparse.h b/thirdparty/freetype/src/cid/cidparse.h index ec1f6a346d..6b2944ff57 100644 --- a/thirdparty/freetype/src/cid/cidparse.h +++ b/thirdparty/freetype/src/cid/cidparse.h @@ -4,7 +4,7 @@ * * CID-keyed Type1 parser (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidriver.c b/thirdparty/freetype/src/cid/cidriver.c index 4d91e87529..ad2f7b5cf5 100644 --- a/thirdparty/freetype/src/cid/cidriver.c +++ b/thirdparty/freetype/src/cid/cidriver.c @@ -4,7 +4,7 @@ * * CID driver interface (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidriver.h b/thirdparty/freetype/src/cid/cidriver.h index 3402fd7e99..400c2ae295 100644 --- a/thirdparty/freetype/src/cid/cidriver.h +++ b/thirdparty/freetype/src/cid/cidriver.h @@ -4,7 +4,7 @@ * * High-level CID driver interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/cidtoken.h b/thirdparty/freetype/src/cid/cidtoken.h index f505c9e166..e9f068bb50 100644 --- a/thirdparty/freetype/src/cid/cidtoken.h +++ b/thirdparty/freetype/src/cid/cidtoken.h @@ -4,7 +4,7 @@ * * CID token definitions (specification only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/cid/module.mk b/thirdparty/freetype/src/cid/module.mk index 875c683c72..9fb02235e6 100644 --- a/thirdparty/freetype/src/cid/module.mk +++ b/thirdparty/freetype/src/cid/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/cid/rules.mk b/thirdparty/freetype/src/cid/rules.mk index 2b68dd48a0..94f663c80e 100644 --- a/thirdparty/freetype/src/cid/rules.mk +++ b/thirdparty/freetype/src/cid/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/cid/type1cid.c b/thirdparty/freetype/src/cid/type1cid.c index d21801cec1..ba9141075f 100644 --- a/thirdparty/freetype/src/cid/type1cid.c +++ b/thirdparty/freetype/src/cid/type1cid.c @@ -4,7 +4,7 @@ * * FreeType OpenType driver component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/gxvalid/README b/thirdparty/freetype/src/gxvalid/README index d493587842..2a32bab204 100644 --- a/thirdparty/freetype/src/gxvalid/README +++ b/thirdparty/freetype/src/gxvalid/README @@ -518,7 +518,7 @@ gxvalid: TrueType GX validator ------------------------------------------------------------------------ -Copyright (C) 2004-2019 by +Copyright (C) 2004-2020 by suzuki toshiya, Masatake YAMATO, Red hat K.K., David Turner, Robert Wilhelm, and Werner Lemberg. diff --git a/thirdparty/freetype/src/gxvalid/gxvalid.c b/thirdparty/freetype/src/gxvalid/gxvalid.c index 462e461bf2..cb655aeb9d 100644 --- a/thirdparty/freetype/src/gxvalid/gxvalid.c +++ b/thirdparty/freetype/src/gxvalid/gxvalid.c @@ -4,7 +4,7 @@ * * FreeType validator for TrueTypeGX/AAT tables (body only). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvalid.h b/thirdparty/freetype/src/gxvalid/gxvalid.h index 969cd0927a..cdf1986324 100644 --- a/thirdparty/freetype/src/gxvalid/gxvalid.h +++ b/thirdparty/freetype/src/gxvalid/gxvalid.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT table validation (specification only). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvbsln.c b/thirdparty/freetype/src/gxvalid/gxvbsln.c index f22f2545fa..ac58d4615c 100644 --- a/thirdparty/freetype/src/gxvalid/gxvbsln.c +++ b/thirdparty/freetype/src/gxvalid/gxvbsln.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT bsln table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvcommn.c b/thirdparty/freetype/src/gxvalid/gxvcommn.c index c5cb8ebe8b..ead0f24cd3 100644 --- a/thirdparty/freetype/src/gxvalid/gxvcommn.c +++ b/thirdparty/freetype/src/gxvalid/gxvcommn.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common tables validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvcommn.h b/thirdparty/freetype/src/gxvalid/gxvcommn.h index 334dc9dfb3..2372fc86fa 100644 --- a/thirdparty/freetype/src/gxvalid/gxvcommn.h +++ b/thirdparty/freetype/src/gxvalid/gxvcommn.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common tables validation (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxverror.h b/thirdparty/freetype/src/gxvalid/gxverror.h index da0edb35f9..475b9f7778 100644 --- a/thirdparty/freetype/src/gxvalid/gxverror.h +++ b/thirdparty/freetype/src/gxvalid/gxverror.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT validation module error codes (specification only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvfeat.c b/thirdparty/freetype/src/gxvalid/gxvfeat.c index e1a12a18ed..400ec8a3fb 100644 --- a/thirdparty/freetype/src/gxvalid/gxvfeat.c +++ b/thirdparty/freetype/src/gxvalid/gxvfeat.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT feat table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvfeat.h b/thirdparty/freetype/src/gxvalid/gxvfeat.h index 6c9892910c..435dcefb09 100644 --- a/thirdparty/freetype/src/gxvalid/gxvfeat.h +++ b/thirdparty/freetype/src/gxvalid/gxvfeat.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT feat table validation (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvfgen.c b/thirdparty/freetype/src/gxvalid/gxvfgen.c index 5ecb9443c3..fe05a6f3a1 100644 --- a/thirdparty/freetype/src/gxvalid/gxvfgen.c +++ b/thirdparty/freetype/src/gxvalid/gxvfgen.c @@ -5,7 +5,7 @@ * Generate feature registry data for gxv `feat' validator. * This program is derived from gxfeatreg.c in gxlayout. * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * Masatake YAMATO and Redhat K.K. * * This file may only be used, diff --git a/thirdparty/freetype/src/gxvalid/gxvjust.c b/thirdparty/freetype/src/gxvalid/gxvjust.c index a582377859..d8875b4111 100644 --- a/thirdparty/freetype/src/gxvalid/gxvjust.c +++ b/thirdparty/freetype/src/gxvalid/gxvjust.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT just table validation (body). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvkern.c b/thirdparty/freetype/src/gxvalid/gxvkern.c index a7532335a5..ab5643eb83 100644 --- a/thirdparty/freetype/src/gxvalid/gxvkern.c +++ b/thirdparty/freetype/src/gxvalid/gxvkern.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT kern table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvlcar.c b/thirdparty/freetype/src/gxvalid/gxvlcar.c index 13b3de3eaa..82ac1907ab 100644 --- a/thirdparty/freetype/src/gxvalid/gxvlcar.c +++ b/thirdparty/freetype/src/gxvalid/gxvlcar.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT lcar table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmod.c b/thirdparty/freetype/src/gxvalid/gxvmod.c index eeadeb3e1d..2b8f45d1c2 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmod.c +++ b/thirdparty/freetype/src/gxvalid/gxvmod.c @@ -4,7 +4,7 @@ * * FreeType's TrueTypeGX/AAT validation module implementation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmod.h b/thirdparty/freetype/src/gxvalid/gxvmod.h index 6ecd7312c9..bdf465f4f0 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmod.h +++ b/thirdparty/freetype/src/gxvalid/gxvmod.h @@ -5,7 +5,7 @@ * FreeType's TrueTypeGX/AAT validation module implementation * (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmort.c b/thirdparty/freetype/src/gxvalid/gxvmort.c index 288ef6988b..aae7f01a89 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmort.c +++ b/thirdparty/freetype/src/gxvalid/gxvmort.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT mort table validation (body). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmort.h b/thirdparty/freetype/src/gxvalid/gxvmort.h index 0619e24fb9..35a18e76a6 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmort.h +++ b/thirdparty/freetype/src/gxvalid/gxvmort.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common definition for mort table (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmort0.c b/thirdparty/freetype/src/gxvalid/gxvmort0.c index 2c01bf95ec..d452c1ccaa 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmort0.c +++ b/thirdparty/freetype/src/gxvalid/gxvmort0.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type0 (Indic Script Rearrangement) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmort1.c b/thirdparty/freetype/src/gxvalid/gxvmort1.c index c71ba13351..d743f89f6e 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmort1.c +++ b/thirdparty/freetype/src/gxvalid/gxvmort1.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type1 (Contextual Substitution) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmort2.c b/thirdparty/freetype/src/gxvalid/gxvmort2.c index 889d3bd582..9e69e1269d 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmort2.c +++ b/thirdparty/freetype/src/gxvalid/gxvmort2.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type2 (Ligature Substitution) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmort4.c b/thirdparty/freetype/src/gxvalid/gxvmort4.c index f8ce6cf789..4584d204cf 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmort4.c +++ b/thirdparty/freetype/src/gxvalid/gxvmort4.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type4 (Non-Contextual Glyph Substitution) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmort5.c b/thirdparty/freetype/src/gxvalid/gxvmort5.c index 1ba1e5ded0..a15a24fe65 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmort5.c +++ b/thirdparty/freetype/src/gxvalid/gxvmort5.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type5 (Contextual Glyph Insertion) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx.c b/thirdparty/freetype/src/gxvalid/gxvmorx.c index 8bd45c27e6..754d9f8bf1 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmorx.c +++ b/thirdparty/freetype/src/gxvalid/gxvmorx.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT morx table validation (body). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx.h b/thirdparty/freetype/src/gxvalid/gxvmorx.h index e257270342..99be181067 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmorx.h +++ b/thirdparty/freetype/src/gxvalid/gxvmorx.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common definition for morx table (specification). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx0.c b/thirdparty/freetype/src/gxvalid/gxvmorx0.c index d7764a0ae8..5a42e552e2 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmorx0.c +++ b/thirdparty/freetype/src/gxvalid/gxvmorx0.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type0 (Indic Script Rearrangement) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx1.c b/thirdparty/freetype/src/gxvalid/gxvmorx1.c index 5b41b3605f..9f8b69067e 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmorx1.c +++ b/thirdparty/freetype/src/gxvalid/gxvmorx1.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type1 (Contextual Substitution) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx2.c b/thirdparty/freetype/src/gxvalid/gxvmorx2.c index ec4c81299d..98b5c49c26 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmorx2.c +++ b/thirdparty/freetype/src/gxvalid/gxvmorx2.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type2 (Ligature Substitution) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx4.c b/thirdparty/freetype/src/gxvalid/gxvmorx4.c index 7b041534c0..857e4d4eb8 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmorx4.c +++ b/thirdparty/freetype/src/gxvalid/gxvmorx4.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx5.c b/thirdparty/freetype/src/gxvalid/gxvmorx5.c index 70a4623656..7ceba077af 100644 --- a/thirdparty/freetype/src/gxvalid/gxvmorx5.c +++ b/thirdparty/freetype/src/gxvalid/gxvmorx5.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type5 (Contextual Glyph Insertion) subtable. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvopbd.c b/thirdparty/freetype/src/gxvalid/gxvopbd.c index f055a22054..a398fe0977 100644 --- a/thirdparty/freetype/src/gxvalid/gxvopbd.c +++ b/thirdparty/freetype/src/gxvalid/gxvopbd.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT opbd table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvprop.c b/thirdparty/freetype/src/gxvalid/gxvprop.c index e1911edd48..bee8bab97b 100644 --- a/thirdparty/freetype/src/gxvalid/gxvprop.c +++ b/thirdparty/freetype/src/gxvalid/gxvprop.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT prop table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/gxvtrak.c b/thirdparty/freetype/src/gxvalid/gxvtrak.c index b7794b7af4..58a631c9e5 100644 --- a/thirdparty/freetype/src/gxvalid/gxvtrak.c +++ b/thirdparty/freetype/src/gxvalid/gxvtrak.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT trak table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/thirdparty/freetype/src/gxvalid/module.mk b/thirdparty/freetype/src/gxvalid/module.mk index 04067ce617..e7d408df9d 100644 --- a/thirdparty/freetype/src/gxvalid/module.mk +++ b/thirdparty/freetype/src/gxvalid/module.mk @@ -2,7 +2,7 @@ # FreeType 2 gxvalid module definition # -# Copyright (C) 2004-2019 by +# Copyright (C) 2004-2020 by # suzuki toshiya, Masatake YAMATO, Red Hat K.K., # David Turner, Robert Wilhelm, and Werner Lemberg. # diff --git a/thirdparty/freetype/src/gxvalid/rules.mk b/thirdparty/freetype/src/gxvalid/rules.mk index 4ef463bc21..d55a4935e2 100644 --- a/thirdparty/freetype/src/gxvalid/rules.mk +++ b/thirdparty/freetype/src/gxvalid/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2004-2019 by +# Copyright (C) 2004-2020 by # suzuki toshiya, Masatake YAMATO, Red Hat K.K., # David Turner, Robert Wilhelm, and Werner Lemberg. # diff --git a/thirdparty/freetype/src/gzip/ftgzip.c b/thirdparty/freetype/src/gzip/ftgzip.c index 5e78bc6f8d..6b1df3a4a7 100644 --- a/thirdparty/freetype/src/gzip/ftgzip.c +++ b/thirdparty/freetype/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ * parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -746,7 +746,17 @@ stream.zfree = (free_func) ft_gzip_free; stream.opaque = memory; + /* This is a temporary fix and will be removed once the internal + * copy of zlib is updated to the newest version. The `|32' flag + * is only supported in the new versions of zlib to enable gzip + * encoded header. + */ +#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB err = inflateInit2( &stream, MAX_WBITS|32 ); +#else + err = inflateInit2( &stream, MAX_WBITS ); +#endif + if ( err != Z_OK ) return FT_THROW( Invalid_Argument ); diff --git a/thirdparty/freetype/src/gzip/infutil.h b/thirdparty/freetype/src/gzip/infutil.h index 7174b6dd0f..cdf18b4f90 100644 --- a/thirdparty/freetype/src/gzip/infutil.h +++ b/thirdparty/freetype/src/gzip/infutil.h @@ -86,7 +86,7 @@ struct inflate_blocks_state { /* masks for lower bits (size given to avoid silly warnings with Visual C++) */ #ifndef NO_INFLATE_MASK -local uInt inflate_mask[17]; +local const uInt inflate_mask[17]; #endif /* copy as much as possible from the sliding window to the output area */ diff --git a/thirdparty/freetype/src/gzip/rules.mk b/thirdparty/freetype/src/gzip/rules.mk index 44206a1dae..4ea823f8d3 100644 --- a/thirdparty/freetype/src/gzip/rules.mk +++ b/thirdparty/freetype/src/gzip/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2002-2019 by +# Copyright (C) 2002-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/lzw/ftlzw.c b/thirdparty/freetype/src/lzw/ftlzw.c index 9805a1e3bd..7d3f3e3f55 100644 --- a/thirdparty/freetype/src/lzw/ftlzw.c +++ b/thirdparty/freetype/src/lzw/ftlzw.c @@ -8,7 +8,7 @@ * be used to parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * Albert Chin-A-Young. * * based on code in `src/gzip/ftgzip.c' diff --git a/thirdparty/freetype/src/lzw/ftzopen.c b/thirdparty/freetype/src/lzw/ftzopen.c index 67e6760f95..cdc7f4e683 100644 --- a/thirdparty/freetype/src/lzw/ftzopen.c +++ b/thirdparty/freetype/src/lzw/ftzopen.c @@ -8,7 +8,7 @@ * be used to parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/lzw/ftzopen.h b/thirdparty/freetype/src/lzw/ftzopen.h index 44fe36d6c5..2866529bd4 100644 --- a/thirdparty/freetype/src/lzw/ftzopen.h +++ b/thirdparty/freetype/src/lzw/ftzopen.h @@ -8,7 +8,7 @@ * be used to parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/lzw/rules.mk b/thirdparty/freetype/src/lzw/rules.mk index 930b32e6b1..3468ee024d 100644 --- a/thirdparty/freetype/src/lzw/rules.mk +++ b/thirdparty/freetype/src/lzw/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2004-2019 by +# Copyright (C) 2004-2020 by # Albert Chin-A-Young. # # based on `src/lzw/rules.mk' diff --git a/thirdparty/freetype/src/otvalid/module.mk b/thirdparty/freetype/src/otvalid/module.mk index 5ea5b7b57b..67b9820d84 100644 --- a/thirdparty/freetype/src/otvalid/module.mk +++ b/thirdparty/freetype/src/otvalid/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2004-2019 by +# Copyright (C) 2004-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/otvalid/otvalid.c b/thirdparty/freetype/src/otvalid/otvalid.c index e3964b99ae..487d336a3b 100644 --- a/thirdparty/freetype/src/otvalid/otvalid.c +++ b/thirdparty/freetype/src/otvalid/otvalid.c @@ -4,7 +4,7 @@ * * FreeType validator for OpenType tables (body only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvalid.h b/thirdparty/freetype/src/otvalid/otvalid.h index 5ca819f261..3c70268964 100644 --- a/thirdparty/freetype/src/otvalid/otvalid.h +++ b/thirdparty/freetype/src/otvalid/otvalid.h @@ -4,7 +4,7 @@ * * OpenType table validation (specification only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvbase.c b/thirdparty/freetype/src/otvalid/otvbase.c index be69d7ca31..250ae98ab5 100644 --- a/thirdparty/freetype/src/otvalid/otvbase.c +++ b/thirdparty/freetype/src/otvalid/otvbase.c @@ -4,7 +4,7 @@ * * OpenType BASE table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvcommn.c b/thirdparty/freetype/src/otvalid/otvcommn.c index 5ed1723506..faaa846871 100644 --- a/thirdparty/freetype/src/otvalid/otvcommn.c +++ b/thirdparty/freetype/src/otvalid/otvcommn.c @@ -4,7 +4,7 @@ * * OpenType common tables validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -151,6 +151,9 @@ FT_UInt result = 0; + if ( !count ) + return result; + switch ( CoverageFormat ) { case 1: diff --git a/thirdparty/freetype/src/otvalid/otvcommn.h b/thirdparty/freetype/src/otvalid/otvcommn.h index bfcc5b974a..1daf7dca79 100644 --- a/thirdparty/freetype/src/otvalid/otvcommn.h +++ b/thirdparty/freetype/src/otvalid/otvcommn.h @@ -4,7 +4,7 @@ * * OpenType common tables validation (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otverror.h b/thirdparty/freetype/src/otvalid/otverror.h index a7d35acf1a..49c34d6cd8 100644 --- a/thirdparty/freetype/src/otvalid/otverror.h +++ b/thirdparty/freetype/src/otvalid/otverror.h @@ -4,7 +4,7 @@ * * OpenType validation module error codes (specification only). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvgdef.c b/thirdparty/freetype/src/otvalid/otvgdef.c index 2529b544d2..88874b8474 100644 --- a/thirdparty/freetype/src/otvalid/otvgdef.c +++ b/thirdparty/freetype/src/otvalid/otvgdef.c @@ -4,7 +4,7 @@ * * OpenType GDEF table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvgpos.c b/thirdparty/freetype/src/otvalid/otvgpos.c index f3bddeac6c..29d56f91e8 100644 --- a/thirdparty/freetype/src/otvalid/otvgpos.c +++ b/thirdparty/freetype/src/otvalid/otvgpos.c @@ -4,7 +4,7 @@ * * OpenType GPOS table validation (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvgpos.h b/thirdparty/freetype/src/otvalid/otvgpos.h index b3154312eb..06a03a0e6c 100644 --- a/thirdparty/freetype/src/otvalid/otvgpos.h +++ b/thirdparty/freetype/src/otvalid/otvgpos.h @@ -4,7 +4,7 @@ * * OpenType GPOS table validator (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvgsub.c b/thirdparty/freetype/src/otvalid/otvgsub.c index 97da997d3d..f0d563ba92 100644 --- a/thirdparty/freetype/src/otvalid/otvgsub.c +++ b/thirdparty/freetype/src/otvalid/otvgsub.c @@ -4,7 +4,7 @@ * * OpenType GSUB table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvjstf.c b/thirdparty/freetype/src/otvalid/otvjstf.c index d4e6d87178..79de7b809d 100644 --- a/thirdparty/freetype/src/otvalid/otvjstf.c +++ b/thirdparty/freetype/src/otvalid/otvjstf.c @@ -4,7 +4,7 @@ * * OpenType JSTF table validation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvmath.c b/thirdparty/freetype/src/otvalid/otvmath.c index 3aaf0ec0ec..dfdeaaba7e 100644 --- a/thirdparty/freetype/src/otvalid/otvmath.c +++ b/thirdparty/freetype/src/otvalid/otvmath.c @@ -4,7 +4,7 @@ * * OpenType MATH table validation (body). * - * Copyright (C) 2007-2019 by + * Copyright (C) 2007-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by George Williams. diff --git a/thirdparty/freetype/src/otvalid/otvmod.c b/thirdparty/freetype/src/otvalid/otvmod.c index f417bd220f..5f3e7e8d49 100644 --- a/thirdparty/freetype/src/otvalid/otvmod.c +++ b/thirdparty/freetype/src/otvalid/otvmod.c @@ -4,7 +4,7 @@ * * FreeType's OpenType validation module implementation (body). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/otvmod.h b/thirdparty/freetype/src/otvalid/otvmod.h index 5539de7ec6..f172c2c8fa 100644 --- a/thirdparty/freetype/src/otvalid/otvmod.h +++ b/thirdparty/freetype/src/otvalid/otvmod.h @@ -5,7 +5,7 @@ * FreeType's OpenType validation module implementation * (specification). * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/otvalid/rules.mk b/thirdparty/freetype/src/otvalid/rules.mk index 3c6ece1c19..7f0169fd89 100644 --- a/thirdparty/freetype/src/otvalid/rules.mk +++ b/thirdparty/freetype/src/otvalid/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2004-2019 by +# Copyright (C) 2004-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/pfr/module.mk b/thirdparty/freetype/src/pfr/module.mk index 30d876d4c8..762353dda2 100644 --- a/thirdparty/freetype/src/pfr/module.mk +++ b/thirdparty/freetype/src/pfr/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2002-2019 by +# Copyright (C) 2002-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/pfr/pfr.c b/thirdparty/freetype/src/pfr/pfr.c index 6d885ea47f..5dea6fa34a 100644 --- a/thirdparty/freetype/src/pfr/pfr.c +++ b/thirdparty/freetype/src/pfr/pfr.c @@ -4,7 +4,7 @@ * * FreeType PFR driver component. * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrcmap.c b/thirdparty/freetype/src/pfr/pfrcmap.c index bfa1b9ea05..3f64ba8b04 100644 --- a/thirdparty/freetype/src/pfr/pfrcmap.c +++ b/thirdparty/freetype/src/pfr/pfrcmap.c @@ -4,7 +4,7 @@ * * FreeType PFR cmap handling (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrcmap.h b/thirdparty/freetype/src/pfr/pfrcmap.h index 1e203a0514..b90e8a101f 100644 --- a/thirdparty/freetype/src/pfr/pfrcmap.h +++ b/thirdparty/freetype/src/pfr/pfrcmap.h @@ -4,7 +4,7 @@ * * FreeType PFR cmap handling (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrdrivr.c b/thirdparty/freetype/src/pfr/pfrdrivr.c index f67eebf118..2028c8e11b 100644 --- a/thirdparty/freetype/src/pfr/pfrdrivr.c +++ b/thirdparty/freetype/src/pfr/pfrdrivr.c @@ -4,7 +4,7 @@ * * FreeType PFR driver interface (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrdrivr.h b/thirdparty/freetype/src/pfr/pfrdrivr.h index 33b7b9413f..865ec8188a 100644 --- a/thirdparty/freetype/src/pfr/pfrdrivr.h +++ b/thirdparty/freetype/src/pfr/pfrdrivr.h @@ -4,7 +4,7 @@ * * High-level Type PFR driver interface (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrerror.h b/thirdparty/freetype/src/pfr/pfrerror.h index 4829cfc000..2dbeedfe15 100644 --- a/thirdparty/freetype/src/pfr/pfrerror.h +++ b/thirdparty/freetype/src/pfr/pfrerror.h @@ -4,7 +4,7 @@ * * PFR error codes (specification only). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrgload.c b/thirdparty/freetype/src/pfr/pfrgload.c index 6ef5856a8d..7d57ae1530 100644 --- a/thirdparty/freetype/src/pfr/pfrgload.c +++ b/thirdparty/freetype/src/pfr/pfrgload.c @@ -4,7 +4,7 @@ * * FreeType PFR glyph loader (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrgload.h b/thirdparty/freetype/src/pfr/pfrgload.h index d0e1420b67..f356b4c75b 100644 --- a/thirdparty/freetype/src/pfr/pfrgload.h +++ b/thirdparty/freetype/src/pfr/pfrgload.h @@ -4,7 +4,7 @@ * * FreeType PFR glyph loader (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrload.c b/thirdparty/freetype/src/pfr/pfrload.c index ccf0b7e1f8..6eeed28245 100644 --- a/thirdparty/freetype/src/pfr/pfrload.c +++ b/thirdparty/freetype/src/pfr/pfrload.c @@ -4,7 +4,7 @@ * * FreeType PFR loader (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrload.h b/thirdparty/freetype/src/pfr/pfrload.h index 2e7ffd0127..7d113df270 100644 --- a/thirdparty/freetype/src/pfr/pfrload.h +++ b/thirdparty/freetype/src/pfr/pfrload.h @@ -4,7 +4,7 @@ * * FreeType PFR loader (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrobjs.c b/thirdparty/freetype/src/pfr/pfrobjs.c index 9765f95c2f..9bc90a4b68 100644 --- a/thirdparty/freetype/src/pfr/pfrobjs.c +++ b/thirdparty/freetype/src/pfr/pfrobjs.c @@ -4,7 +4,7 @@ * * FreeType PFR object methods (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrobjs.h b/thirdparty/freetype/src/pfr/pfrobjs.h index 39cffd07c5..808822f1c4 100644 --- a/thirdparty/freetype/src/pfr/pfrobjs.h +++ b/thirdparty/freetype/src/pfr/pfrobjs.h @@ -4,7 +4,7 @@ * * FreeType PFR object methods (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrsbit.c b/thirdparty/freetype/src/pfr/pfrsbit.c index 00a9616455..00669e13ff 100644 --- a/thirdparty/freetype/src/pfr/pfrsbit.c +++ b/thirdparty/freetype/src/pfr/pfrsbit.c @@ -4,7 +4,7 @@ * * FreeType PFR bitmap loader (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrsbit.h b/thirdparty/freetype/src/pfr/pfrsbit.h index 6568b90943..8cb0de0d25 100644 --- a/thirdparty/freetype/src/pfr/pfrsbit.h +++ b/thirdparty/freetype/src/pfr/pfrsbit.h @@ -4,7 +4,7 @@ * * FreeType PFR bitmap loader (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/pfrtypes.h b/thirdparty/freetype/src/pfr/pfrtypes.h index 6a5f9d571b..dfc47beff3 100644 --- a/thirdparty/freetype/src/pfr/pfrtypes.h +++ b/thirdparty/freetype/src/pfr/pfrtypes.h @@ -4,7 +4,7 @@ * * FreeType PFR data structures (specification only). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pfr/rules.mk b/thirdparty/freetype/src/pfr/rules.mk index f14ca699e2..a1fe82baff 100644 --- a/thirdparty/freetype/src/pfr/rules.mk +++ b/thirdparty/freetype/src/pfr/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2002-2019 by +# Copyright (C) 2002-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/psaux/afmparse.c b/thirdparty/freetype/src/psaux/afmparse.c index f78adbba3d..b957158aec 100644 --- a/thirdparty/freetype/src/psaux/afmparse.c +++ b/thirdparty/freetype/src/psaux/afmparse.c @@ -4,7 +4,7 @@ * * AFM parser (body). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/afmparse.h b/thirdparty/freetype/src/psaux/afmparse.h index 2ceb77553b..50f4834b3f 100644 --- a/thirdparty/freetype/src/psaux/afmparse.h +++ b/thirdparty/freetype/src/psaux/afmparse.h @@ -4,7 +4,7 @@ * * AFM parser (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/cffdecode.c b/thirdparty/freetype/src/psaux/cffdecode.c index 17cccf818b..172e3b23a3 100644 --- a/thirdparty/freetype/src/psaux/cffdecode.c +++ b/thirdparty/freetype/src/psaux/cffdecode.c @@ -4,7 +4,7 @@ * * PostScript CFF (Type 2) decoding routines (body). * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -330,7 +330,7 @@ builder->left_bearing.x = 0; builder->left_bearing.y = 0; - builder->pos_x = adx - asb; + builder->pos_x = SUB_LONG( adx, asb ); builder->pos_y = ady; /* Now load `achar' on top of the base outline. */ @@ -530,6 +530,9 @@ builder->path_begun = 0; + if ( !charstring_base ) + return FT_Err_Ok; + zone->base = charstring_base; limit = zone->limit = charstring_base + charstring_len; ip = zone->cursor = zone->base; diff --git a/thirdparty/freetype/src/psaux/cffdecode.h b/thirdparty/freetype/src/psaux/cffdecode.h index a6691979f0..5dc968b255 100644 --- a/thirdparty/freetype/src/psaux/cffdecode.h +++ b/thirdparty/freetype/src/psaux/cffdecode.h @@ -4,7 +4,7 @@ * * PostScript CFF (Type 2) decoding routines (specification). * - * Copyright (C) 2017-2019 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/module.mk b/thirdparty/freetype/src/psaux/module.mk index bb0886abdf..651db01426 100644 --- a/thirdparty/freetype/src/psaux/module.mk +++ b/thirdparty/freetype/src/psaux/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/psaux/psaux.c b/thirdparty/freetype/src/psaux/psaux.c index 1db0462551..96d2484e9d 100644 --- a/thirdparty/freetype/src/psaux/psaux.c +++ b/thirdparty/freetype/src/psaux/psaux.c @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript driver component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/psauxerr.h b/thirdparty/freetype/src/psaux/psauxerr.h index 523e1886c2..df8b09ff78 100644 --- a/thirdparty/freetype/src/psaux/psauxerr.h +++ b/thirdparty/freetype/src/psaux/psauxerr.h @@ -4,7 +4,7 @@ * * PS auxiliary module error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/psauxmod.c b/thirdparty/freetype/src/psaux/psauxmod.c index 5df8e69056..bb520792e0 100644 --- a/thirdparty/freetype/src/psaux/psauxmod.c +++ b/thirdparty/freetype/src/psaux/psauxmod.c @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript module implementation (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/psauxmod.h b/thirdparty/freetype/src/psaux/psauxmod.h index a0eda0bfc0..6e2eb67042 100644 --- a/thirdparty/freetype/src/psaux/psauxmod.h +++ b/thirdparty/freetype/src/psaux/psauxmod.h @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript module implementation (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/psconv.c b/thirdparty/freetype/src/psaux/psconv.c index c88761681c..c813a0596c 100644 --- a/thirdparty/freetype/src/psaux/psconv.c +++ b/thirdparty/freetype/src/psaux/psconv.c @@ -4,7 +4,7 @@ * * Some convenience conversions (body). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/psconv.h b/thirdparty/freetype/src/psaux/psconv.h index 6b24bf6fc9..2cd5c60e4b 100644 --- a/thirdparty/freetype/src/psaux/psconv.h +++ b/thirdparty/freetype/src/psaux/psconv.h @@ -4,7 +4,7 @@ * * Some convenience conversions (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/psft.c b/thirdparty/freetype/src/psaux/psft.c index 54be468343..50b40bf8fe 100644 --- a/thirdparty/freetype/src/psaux/psft.c +++ b/thirdparty/freetype/src/psaux/psft.c @@ -313,7 +313,7 @@ FT_Error error = FT_Err_Ok; CF2_Font font; - FT_Bool is_t1 = decoder->builder.is_t1; + FT_Bool is_t1 = decoder->builder.is_t1; FT_ASSERT( decoder && @@ -385,7 +385,7 @@ FT_ZERO( &buf ); buf.start = buf.ptr = charstring_base; - buf.end = charstring_base + charstring_len; + buf.end = FT_OFFSET( charstring_base, charstring_len ); FT_ZERO( &transform ); @@ -697,7 +697,7 @@ FT_ASSERT( charstring + len >= charstring ); buf->start = charstring; - buf->end = charstring + len; + buf->end = FT_OFFSET( charstring, len ); buf->ptr = buf->start; return FT_Err_Ok; @@ -820,7 +820,7 @@ /* The CID driver stores subroutines with seed bytes. This */ /* case is taken care of when decoder->subrs_len == 0. */ if ( decoder->locals_len ) - buf->end = buf->start + decoder->locals_len[idx]; + buf->end = FT_OFFSET( buf->start, decoder->locals_len[idx] ); else { /* We are using subroutines from a CID font. We must adjust */ diff --git a/thirdparty/freetype/src/psaux/psintrp.c b/thirdparty/freetype/src/psaux/psintrp.c index e2f3accdd5..0a84145535 100644 --- a/thirdparty/freetype/src/psaux/psintrp.c +++ b/thirdparty/freetype/src/psaux/psintrp.c @@ -1433,6 +1433,13 @@ lastError = error2; /* pass FreeType error through */ goto exit; } + + /* save the left bearing and width of the SEAC */ + /* glyph as they will be erased by the next load */ + + left_bearing = *decoder->builder.left_bearing; + advance = *decoder->builder.advance; + cf2_interpT2CharString( font, &component, callbacks, @@ -1443,11 +1450,14 @@ &dummyWidth ); cf2_freeT1SeacComponent( decoder, &component ); - /* save the left bearing and width of the base */ - /* character as they will be erased by the next load */ + /* If the SEAC glyph doesn't have a (H)SBW of its */ + /* own use the values from the base glyph. */ - left_bearing = *decoder->builder.left_bearing; - advance = *decoder->builder.advance; + if ( !haveWidth ) + { + left_bearing = *decoder->builder.left_bearing; + advance = *decoder->builder.advance; + } decoder->builder.left_bearing->x = 0; decoder->builder.left_bearing->y = 0; @@ -1473,8 +1483,8 @@ &dummyWidth ); cf2_freeT1SeacComponent( decoder, &component ); - /* restore the left side bearing and */ - /* advance width of the base character */ + /* restore the left side bearing and advance width */ + /* of the SEAC glyph or base character (saved above) */ *decoder->builder.left_bearing = left_bearing; *decoder->builder.advance = advance; diff --git a/thirdparty/freetype/src/psaux/psobjs.c b/thirdparty/freetype/src/psaux/psobjs.c index 8bfdb92332..b37a78832c 100644 --- a/thirdparty/freetype/src/psaux/psobjs.c +++ b/thirdparty/freetype/src/psaux/psobjs.c @@ -4,7 +4,7 @@ * * Auxiliary functions for PostScript fonts (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -214,7 +214,7 @@ } /* add the object to the base block and adjust offset */ - table->elements[idx] = table->block + table->cursor; + table->elements[idx] = FT_OFFSET( table->block, table->cursor ); table->lengths [idx] = length; FT_MEM_COPY( table->block + table->cursor, object, length ); @@ -2577,7 +2577,7 @@ FT_UShort seed ) { PS_Conv_EexecDecode( &buffer, - buffer + length, + FT_OFFSET( buffer, length ), buffer, length, &seed ); diff --git a/thirdparty/freetype/src/psaux/psobjs.h b/thirdparty/freetype/src/psaux/psobjs.h index c44dc450ec..d37638d0ca 100644 --- a/thirdparty/freetype/src/psaux/psobjs.h +++ b/thirdparty/freetype/src/psaux/psobjs.h @@ -4,7 +4,7 @@ * * Auxiliary functions for PostScript fonts (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/rules.mk b/thirdparty/freetype/src/psaux/rules.mk index 2de734d547..f49aecbc79 100644 --- a/thirdparty/freetype/src/psaux/rules.mk +++ b/thirdparty/freetype/src/psaux/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/psaux/t1cmap.c b/thirdparty/freetype/src/psaux/t1cmap.c index d62d2d5c81..451b276537 100644 --- a/thirdparty/freetype/src/psaux/t1cmap.c +++ b/thirdparty/freetype/src/psaux/t1cmap.c @@ -4,7 +4,7 @@ * * Type 1 character map support (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/t1cmap.h b/thirdparty/freetype/src/psaux/t1cmap.h index d325e7b5a6..5411913831 100644 --- a/thirdparty/freetype/src/psaux/t1cmap.h +++ b/thirdparty/freetype/src/psaux/t1cmap.h @@ -4,7 +4,7 @@ * * Type 1 character map support (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psaux/t1decode.c b/thirdparty/freetype/src/psaux/t1decode.c index c2b3729b53..fa1745d9e0 100644 --- a/thirdparty/freetype/src/psaux/t1decode.c +++ b/thirdparty/freetype/src/psaux/t1decode.c @@ -4,7 +4,7 @@ * * PostScript Type 1 decoding routines (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -367,6 +367,12 @@ FT_GlyphLoader_Prepare( decoder->builder.loader ); /* prepare loader */ + /* save the left bearing and width of the SEAC */ + /* glyph as they will be erased by the next load */ + + left_bearing = decoder->builder.left_bearing; + advance = decoder->builder.advance; + /* the seac operator must not be nested */ decoder->seac = TRUE; error = t1_decoder_parse_glyph( decoder, (FT_UInt)bchar_index ); @@ -374,11 +380,14 @@ if ( error ) goto Exit; - /* save the left bearing and width of the base character */ - /* as they will be erased by the next load. */ + /* If the SEAC glyph doesn't have a (H)SBW of its */ + /* own use the values from the base glyph. */ - left_bearing = decoder->builder.left_bearing; - advance = decoder->builder.advance; + if ( decoder->builder.parse_state != T1_Parse_Have_Width ) + { + left_bearing = decoder->builder.left_bearing; + advance = decoder->builder.advance; + } decoder->builder.left_bearing.x = 0; decoder->builder.left_bearing.y = 0; @@ -396,8 +405,8 @@ if ( error ) goto Exit; - /* restore the left side bearing and */ - /* advance width of the base character */ + /* restore the left side bearing and advance width */ + /* of the SEAC glyph or base character (saved above) */ decoder->builder.left_bearing = left_bearing; decoder->builder.advance = advance; @@ -650,10 +659,8 @@ if ( value > 32000 || value < -32000 ) { if ( large_int ) - { FT_ERROR(( "t1_decoder_parse_charstrings:" " no `div' after large integer\n" )); - } else large_int = TRUE; } @@ -1690,6 +1697,7 @@ FT_Byte* ip; FT_Byte* limit; T1_Builder builder = &decoder->builder; + FT_Bool large_int; #ifdef FT_DEBUG_LEVEL_TRACE FT_Bool bol = TRUE; @@ -1707,6 +1715,8 @@ limit = zone->limit = charstring_base + charstring_len; ip = zone->cursor = zone->base; + large_int = FALSE; + /* now, execute loop */ while ( ip < limit ) { @@ -1767,6 +1777,9 @@ case 7: op = op_sbw; break; + case 12: + op = op_div; + break; default: goto No_Width; @@ -1796,13 +1809,19 @@ /* anyway. */ if ( value > 32000 || value < -32000 ) { - FT_ERROR(( "t1_decoder_parse_metrics:" - " large integer found for width\n" )); - goto Syntax_Error; + if ( large_int ) + { + FT_ERROR(( "t1_decoder_parse_metrics:" + " no `div' after large integer\n" )); + goto Syntax_Error; + } + else + large_int = TRUE; } else { - value = (FT_Int32)( (FT_UInt32)value << 16 ); + if ( !large_int ) + value = (FT_Int32)( (FT_UInt32)value << 16 ); } break; @@ -1827,7 +1846,8 @@ value = -( ( ( ip[-2] - 251 ) * 256 ) + ip[-1] + 108 ); } - value = (FT_Int32)( (FT_UInt32)value << 16 ); + if ( !large_int ) + value = (FT_Int32)( (FT_UInt32)value << 16 ); } else { @@ -1837,6 +1857,13 @@ } } + if ( large_int && !( op == op_none || op == op_div ) ) + { + FT_ERROR(( "t1_decoder_parse_metrics:" + " no `div' after large integer\n" )); + goto Syntax_Error; + } + /********************************************************************** * * Push value on stack, or process operator @@ -1851,6 +1878,9 @@ } #ifdef FT_DEBUG_LEVEL_TRACE + if ( large_int ) + FT_TRACE4(( " %d", value )); + else FT_TRACE4(( " %d", value / 65536 )); #endif @@ -1869,11 +1899,14 @@ #ifdef FT_DEBUG_LEVEL_TRACE - if ( top - decoder->stack != num_args ) - FT_TRACE0(( "t1_decoder_parse_metrics:" - " too much operands on the stack" - " (seen %d, expected %d)\n", - top - decoder->stack, num_args )); + if ( op != op_div ) + { + if ( top - decoder->stack != num_args ) + FT_TRACE0(( "t1_decoder_parse_metrics:" + " too much operands on the stack" + " (seen %d, expected %d)\n", + top - decoder->stack, num_args )); + } #endif /* FT_DEBUG_LEVEL_TRACE */ @@ -1917,12 +1950,26 @@ FT_TRACE4(( "\n" )); return FT_Err_Ok; + case op_div: + FT_TRACE4(( " div" )); + + /* if `large_int' is set, we divide unscaled numbers; */ + /* otherwise, we divide numbers in 16.16 format -- */ + /* in both cases, it is the same operation */ + *top = FT_DivFix( top[0], top[1] ); + top++; + + large_int = FALSE; + break; + default: FT_ERROR(( "t1_decoder_parse_metrics:" " unhandled opcode %d\n", op )); goto Syntax_Error; } + decoder->top = top; + } /* general operator processing */ } /* while ip < limit */ diff --git a/thirdparty/freetype/src/psaux/t1decode.h b/thirdparty/freetype/src/psaux/t1decode.h index 1b5d6263d3..231947e852 100644 --- a/thirdparty/freetype/src/psaux/t1decode.h +++ b/thirdparty/freetype/src/psaux/t1decode.h @@ -4,7 +4,7 @@ * * PostScript Type 1 decoding routines (specification). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/module.mk b/thirdparty/freetype/src/pshinter/module.mk index 0a12a260e1..b440d2e76a 100644 --- a/thirdparty/freetype/src/pshinter/module.mk +++ b/thirdparty/freetype/src/pshinter/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/pshinter/pshalgo.c b/thirdparty/freetype/src/pshinter/pshalgo.c index 0c5ae62699..57dfa3da96 100644 --- a/thirdparty/freetype/src/pshinter/pshalgo.c +++ b/thirdparty/freetype/src/pshinter/pshalgo.c @@ -4,7 +4,7 @@ * * PostScript hinting algorithm (body). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used diff --git a/thirdparty/freetype/src/pshinter/pshalgo.h b/thirdparty/freetype/src/pshinter/pshalgo.h index 6859e95cd2..5367a5d164 100644 --- a/thirdparty/freetype/src/pshinter/pshalgo.h +++ b/thirdparty/freetype/src/pshinter/pshalgo.h @@ -4,7 +4,7 @@ * * PostScript hinting algorithm (specification). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/pshglob.c b/thirdparty/freetype/src/pshinter/pshglob.c index b021e6e42a..d9f835f99e 100644 --- a/thirdparty/freetype/src/pshinter/pshglob.c +++ b/thirdparty/freetype/src/pshinter/pshglob.c @@ -5,7 +5,7 @@ * PostScript hinter global hinting management (body). * Inspired by the new auto-hinter module. * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used diff --git a/thirdparty/freetype/src/pshinter/pshglob.h b/thirdparty/freetype/src/pshinter/pshglob.h index 0049d4c0bc..cd2f3122f7 100644 --- a/thirdparty/freetype/src/pshinter/pshglob.h +++ b/thirdparty/freetype/src/pshinter/pshglob.h @@ -4,7 +4,7 @@ * * PostScript hinter global hinting management. * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/pshinter.c b/thirdparty/freetype/src/pshinter/pshinter.c index 16c3a0a117..6009db5187 100644 --- a/thirdparty/freetype/src/pshinter/pshinter.c +++ b/thirdparty/freetype/src/pshinter/pshinter.c @@ -4,7 +4,7 @@ * * FreeType PostScript Hinting module * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/pshmod.c b/thirdparty/freetype/src/pshinter/pshmod.c index 2d36ea2a6a..686859b3ed 100644 --- a/thirdparty/freetype/src/pshinter/pshmod.c +++ b/thirdparty/freetype/src/pshinter/pshmod.c @@ -4,7 +4,7 @@ * * FreeType PostScript hinter module implementation (body). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/pshmod.h b/thirdparty/freetype/src/pshinter/pshmod.h index ea8771308a..c44112e9d4 100644 --- a/thirdparty/freetype/src/pshinter/pshmod.h +++ b/thirdparty/freetype/src/pshinter/pshmod.h @@ -4,7 +4,7 @@ * * PostScript hinter module interface (specification). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/pshnterr.h b/thirdparty/freetype/src/pshinter/pshnterr.h index fb9dbca2b1..c4e9f42d2c 100644 --- a/thirdparty/freetype/src/pshinter/pshnterr.h +++ b/thirdparty/freetype/src/pshinter/pshnterr.h @@ -4,7 +4,7 @@ * * PS Hinter error codes (specification only). * - * Copyright (C) 2003-2019 by + * Copyright (C) 2003-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/pshrec.c b/thirdparty/freetype/src/pshinter/pshrec.c index 9dd09efe4c..a81c6f7123 100644 --- a/thirdparty/freetype/src/pshinter/pshrec.c +++ b/thirdparty/freetype/src/pshinter/pshrec.c @@ -4,7 +4,7 @@ * * FreeType PostScript hints recorder (body). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/pshrec.h b/thirdparty/freetype/src/pshinter/pshrec.h index 02cc2102ec..a8bc5aeecb 100644 --- a/thirdparty/freetype/src/pshinter/pshrec.h +++ b/thirdparty/freetype/src/pshinter/pshrec.h @@ -4,7 +4,7 @@ * * Postscript (Type1/Type2) hints recorder (specification). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/pshinter/rules.mk b/thirdparty/freetype/src/pshinter/rules.mk index 58227d10f2..c845c255cd 100644 --- a/thirdparty/freetype/src/pshinter/rules.mk +++ b/thirdparty/freetype/src/pshinter/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2001-2019 by +# Copyright (C) 2001-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/psnames/module.mk b/thirdparty/freetype/src/psnames/module.mk index 0806a318a7..675bb37131 100644 --- a/thirdparty/freetype/src/psnames/module.mk +++ b/thirdparty/freetype/src/psnames/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/psnames/psmodule.c b/thirdparty/freetype/src/psnames/psmodule.c index 0ec440e67b..bb3ff07022 100644 --- a/thirdparty/freetype/src/psnames/psmodule.c +++ b/thirdparty/freetype/src/psnames/psmodule.c @@ -4,7 +4,7 @@ * * psnames module implementation (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psnames/psmodule.h b/thirdparty/freetype/src/psnames/psmodule.h index 0df9a7d889..955f699f3a 100644 --- a/thirdparty/freetype/src/psnames/psmodule.h +++ b/thirdparty/freetype/src/psnames/psmodule.h @@ -4,7 +4,7 @@ * * High-level psnames module interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psnames/psnamerr.h b/thirdparty/freetype/src/psnames/psnamerr.h index 67ab1765d3..fb9058e61a 100644 --- a/thirdparty/freetype/src/psnames/psnamerr.h +++ b/thirdparty/freetype/src/psnames/psnamerr.h @@ -4,7 +4,7 @@ * * PS names module error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psnames/psnames.c b/thirdparty/freetype/src/psnames/psnames.c index 4722f98831..5ac3897d25 100644 --- a/thirdparty/freetype/src/psnames/psnames.c +++ b/thirdparty/freetype/src/psnames/psnames.c @@ -4,7 +4,7 @@ * * FreeType psnames module component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psnames/pstables.h b/thirdparty/freetype/src/psnames/pstables.h index c0139bbc60..c215f16ffc 100644 --- a/thirdparty/freetype/src/psnames/pstables.h +++ b/thirdparty/freetype/src/psnames/pstables.h @@ -4,7 +4,7 @@ * * PostScript glyph names. * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/psnames/rules.mk b/thirdparty/freetype/src/psnames/rules.mk index dcc203e391..14cdda3ad1 100644 --- a/thirdparty/freetype/src/psnames/rules.mk +++ b/thirdparty/freetype/src/psnames/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/raster/ftmisc.h b/thirdparty/freetype/src/raster/ftmisc.h index a246569e3b..6efe4a9a5a 100644 --- a/thirdparty/freetype/src/raster/ftmisc.h +++ b/thirdparty/freetype/src/raster/ftmisc.h @@ -5,7 +5,7 @@ * Miscellaneous macros for stand-alone rasterizer (specification * only). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used diff --git a/thirdparty/freetype/src/raster/ftraster.c b/thirdparty/freetype/src/raster/ftraster.c index 023b6c1eff..35655a6346 100644 --- a/thirdparty/freetype/src/raster/ftraster.c +++ b/thirdparty/freetype/src/raster/ftraster.c @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/raster/ftraster.h b/thirdparty/freetype/src/raster/ftraster.h index 50d34201a1..833d30f234 100644 --- a/thirdparty/freetype/src/raster/ftraster.h +++ b/thirdparty/freetype/src/raster/ftraster.h @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used diff --git a/thirdparty/freetype/src/raster/ftrend1.c b/thirdparty/freetype/src/raster/ftrend1.c index 62c727182a..944279a8d1 100644 --- a/thirdparty/freetype/src/raster/ftrend1.c +++ b/thirdparty/freetype/src/raster/ftrend1.c @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer interface (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/raster/ftrend1.h b/thirdparty/freetype/src/raster/ftrend1.h index 82ecac686c..dc972b1bc2 100644 --- a/thirdparty/freetype/src/raster/ftrend1.h +++ b/thirdparty/freetype/src/raster/ftrend1.h @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/raster/module.mk b/thirdparty/freetype/src/raster/module.mk index 0a6d4b09d9..3600732b16 100644 --- a/thirdparty/freetype/src/raster/module.mk +++ b/thirdparty/freetype/src/raster/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/raster/raster.c b/thirdparty/freetype/src/raster/raster.c index e3ac9e566a..08431c8509 100644 --- a/thirdparty/freetype/src/raster/raster.c +++ b/thirdparty/freetype/src/raster/raster.c @@ -4,7 +4,7 @@ * * FreeType monochrome rasterer module component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/raster/rasterrs.h b/thirdparty/freetype/src/raster/rasterrs.h index 7266407365..379e1d3e89 100644 --- a/thirdparty/freetype/src/raster/rasterrs.h +++ b/thirdparty/freetype/src/raster/rasterrs.h @@ -4,7 +4,7 @@ * * monochrome renderer error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/raster/rules.mk b/thirdparty/freetype/src/raster/rules.mk index 7664671e80..3e949d7741 100644 --- a/thirdparty/freetype/src/raster/rules.mk +++ b/thirdparty/freetype/src/raster/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/sfnt/module.mk b/thirdparty/freetype/src/sfnt/module.mk index 8c3b44fec7..0f459d8421 100644 --- a/thirdparty/freetype/src/sfnt/module.mk +++ b/thirdparty/freetype/src/sfnt/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/sfnt/pngshim.c b/thirdparty/freetype/src/sfnt/pngshim.c index ca85d9751f..523b30a745 100644 --- a/thirdparty/freetype/src/sfnt/pngshim.c +++ b/thirdparty/freetype/src/sfnt/pngshim.c @@ -4,7 +4,7 @@ * * PNG Bitmap glyph support. * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * Google, Inc. * Written by Stuart Gill and Behdad Esfahbod. * @@ -68,6 +68,7 @@ ( ( __clang_major__ >= 4 ) || \ ( ( __clang_major__ == 3 ) && ( __clang_minor__ >= 2 ) ) ) ) ) && \ defined( __OPTIMIZE__ ) && \ + defined( __SSE__ ) && \ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #ifdef __clang__ diff --git a/thirdparty/freetype/src/sfnt/pngshim.h b/thirdparty/freetype/src/sfnt/pngshim.h index 06c6f6b20e..d2c9e2b9b5 100644 --- a/thirdparty/freetype/src/sfnt/pngshim.h +++ b/thirdparty/freetype/src/sfnt/pngshim.h @@ -4,7 +4,7 @@ * * PNG Bitmap glyph support. * - * Copyright (C) 2013-2019 by + * Copyright (C) 2013-2020 by * Google, Inc. * Written by Stuart Gill and Behdad Esfahbod. * diff --git a/thirdparty/freetype/src/sfnt/rules.mk b/thirdparty/freetype/src/sfnt/rules.mk index ee3314eac3..f56ef060ed 100644 --- a/thirdparty/freetype/src/sfnt/rules.mk +++ b/thirdparty/freetype/src/sfnt/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -28,19 +28,21 @@ SFNT_COMPILE := $(CC) $(ANSIFLAGS) \ # SFNT driver sources (i.e., C files) # -SFNT_DRV_SRC := $(SFNT_DIR)/pngshim.c \ - $(SFNT_DIR)/sfdriver.c \ - $(SFNT_DIR)/sfobjs.c \ - $(SFNT_DIR)/sfwoff.c \ - $(SFNT_DIR)/ttbdf.c \ - $(SFNT_DIR)/ttcmap.c \ - $(SFNT_DIR)/ttcolr.c \ - $(SFNT_DIR)/ttcpal.c \ - $(SFNT_DIR)/ttkern.c \ - $(SFNT_DIR)/ttload.c \ - $(SFNT_DIR)/ttmtx.c \ - $(SFNT_DIR)/ttpost.c \ - $(SFNT_DIR)/ttsbit.c +SFNT_DRV_SRC := $(SFNT_DIR)/pngshim.c \ + $(SFNT_DIR)/sfdriver.c \ + $(SFNT_DIR)/sfobjs.c \ + $(SFNT_DIR)/sfwoff.c \ + $(SFNT_DIR)/sfwoff2.c \ + $(SFNT_DIR)/ttbdf.c \ + $(SFNT_DIR)/ttcmap.c \ + $(SFNT_DIR)/ttcolr.c \ + $(SFNT_DIR)/ttcpal.c \ + $(SFNT_DIR)/ttkern.c \ + $(SFNT_DIR)/ttload.c \ + $(SFNT_DIR)/ttmtx.c \ + $(SFNT_DIR)/ttpost.c \ + $(SFNT_DIR)/ttsbit.c \ + $(SFNT_DIR)/woff2tags.c # SFNT driver headers # diff --git a/thirdparty/freetype/src/sfnt/sfdriver.c b/thirdparty/freetype/src/sfnt/sfdriver.c index 2611685284..6ca4f3c268 100644 --- a/thirdparty/freetype/src/sfnt/sfdriver.c +++ b/thirdparty/freetype/src/sfnt/sfdriver.c @@ -4,7 +4,7 @@ * * High-level SFNT driver interface (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/sfdriver.h b/thirdparty/freetype/src/sfnt/sfdriver.h index 8c174634b3..d108ee2000 100644 --- a/thirdparty/freetype/src/sfnt/sfdriver.h +++ b/thirdparty/freetype/src/sfnt/sfdriver.h @@ -4,7 +4,7 @@ * * High-level SFNT driver interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/sferrors.h b/thirdparty/freetype/src/sfnt/sferrors.h index 43e148d295..fbfca0e525 100644 --- a/thirdparty/freetype/src/sfnt/sferrors.h +++ b/thirdparty/freetype/src/sfnt/sferrors.h @@ -4,7 +4,7 @@ * * SFNT error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/sfnt.c b/thirdparty/freetype/src/sfnt/sfnt.c index b4faf34a3a..9db7935ae4 100644 --- a/thirdparty/freetype/src/sfnt/sfnt.c +++ b/thirdparty/freetype/src/sfnt/sfnt.c @@ -4,7 +4,7 @@ * * Single object library component. * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -23,6 +23,7 @@ #include "sfdriver.c" #include "sfobjs.c" #include "sfwoff.c" +#include "sfwoff2.c" #include "ttbdf.c" #include "ttcmap.c" #include "ttcolr.c" @@ -33,6 +34,7 @@ #include "ttmtx.c" #include "ttpost.c" #include "ttsbit.c" +#include "woff2tags.c" /* END */ diff --git a/thirdparty/freetype/src/sfnt/sfobjs.c b/thirdparty/freetype/src/sfnt/sfobjs.c index 6edf3ae1de..2c66a9b648 100644 --- a/thirdparty/freetype/src/sfnt/sfobjs.c +++ b/thirdparty/freetype/src/sfnt/sfobjs.c @@ -4,7 +4,7 @@ * * SFNT object management (base). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -22,6 +22,7 @@ #include "ttcmap.h" #include "ttkern.h" #include "sfwoff.h" +#include "sfwoff2.h" #include FT_INTERNAL_SFNT_H #include FT_INTERNAL_DEBUG_H #include FT_TRUETYPE_IDS_H @@ -341,7 +342,9 @@ /* synthesized into a TTC with one offset table. */ static FT_Error sfnt_open_font( FT_Stream stream, - TT_Face face ) + TT_Face face, + FT_Int* face_instance_index, + FT_Long* woff2_num_faces ) { FT_Memory memory = stream->memory; FT_Error error; @@ -385,6 +388,25 @@ goto retry; } + if ( tag == TTAG_wOF2 ) + { + FT_TRACE2(( "sfnt_open_font: file is a WOFF2; synthesizing SFNT\n" )); + + if ( FT_STREAM_SEEK( offset ) ) + return error; + + error = woff2_open_font( stream, + face, + face_instance_index, + woff2_num_faces ); + if ( error ) + return error; + + /* Swap out stream and retry! */ + stream = face->root.stream; + goto retry; + } + if ( tag != 0x00010000UL && tag != TTAG_ttcf && tag != TTAG_OTTO && @@ -461,9 +483,10 @@ FT_Parameter* params ) { FT_Error error; - FT_Library library = face->root.driver->root.library; + FT_Library library = face->root.driver->root.library; SFNT_Service sfnt; FT_Int face_index; + FT_Long woff2_num_faces = 0; /* for now, parameters are unused */ @@ -514,7 +537,10 @@ FT_TRACE2(( "SFNT driver\n" )); - error = sfnt_open_font( stream, face ); + error = sfnt_open_font( stream, + face, + &face_instance_index, + &woff2_num_faces ); if ( error ) return error; @@ -689,6 +715,10 @@ face->root.num_faces = face->ttc_header.count; face->root.face_index = face_instance_index; + /* `num_faces' for a WOFF2 needs to be handled separately. */ + if ( woff2_num_faces ) + face->root.num_faces = woff2_num_faces; + return error; } diff --git a/thirdparty/freetype/src/sfnt/sfobjs.h b/thirdparty/freetype/src/sfnt/sfobjs.h index 3fbf2dd6bd..d8438a4834 100644 --- a/thirdparty/freetype/src/sfnt/sfobjs.h +++ b/thirdparty/freetype/src/sfnt/sfobjs.h @@ -4,7 +4,7 @@ * * SFNT object management (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/sfwoff.c b/thirdparty/freetype/src/sfnt/sfwoff.c index ca4821a20a..d1e330f675 100644 --- a/thirdparty/freetype/src/sfnt/sfwoff.c +++ b/thirdparty/freetype/src/sfnt/sfwoff.c @@ -4,7 +4,7 @@ * * WOFF format management (base). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -371,18 +371,18 @@ sfnt + table->OrigOffset, &output_len, stream->cursor, table->CompLength ); if ( error ) - goto Exit; + goto Exit1; if ( output_len != table->OrigLength ) { FT_ERROR(( "woff_font_open: compressed table length mismatch\n" )); error = FT_THROW( Invalid_Table ); - goto Exit; + goto Exit1; } #else /* !FT_CONFIG_OPTION_USE_ZLIB */ error = FT_THROW( Unimplemented_Feature ); - goto Exit; + goto Exit1; #endif /* !FT_CONFIG_OPTION_USE_ZLIB */ } @@ -424,6 +424,10 @@ } return error; + + Exit1: + FT_FRAME_EXIT(); + goto Exit; } diff --git a/thirdparty/freetype/src/sfnt/sfwoff.h b/thirdparty/freetype/src/sfnt/sfwoff.h index 15495c32a2..c1789d33d5 100644 --- a/thirdparty/freetype/src/sfnt/sfwoff.h +++ b/thirdparty/freetype/src/sfnt/sfwoff.h @@ -4,7 +4,7 @@ * * WOFFF format management (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/sfwoff2.c b/thirdparty/freetype/src/sfnt/sfwoff2.c new file mode 100644 index 0000000000..1b99e7d28c --- /dev/null +++ b/thirdparty/freetype/src/sfnt/sfwoff2.c @@ -0,0 +1,2328 @@ +/**************************************************************************** + * + * sfwoff2.c + * + * WOFF2 format management (base). + * + * Copyright (C) 2019-2020 by + * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + +#include <ft2build.h> +#include "sfwoff2.h" +#include "woff2tags.h" +#include FT_TRUETYPE_TAGS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H + + +#ifdef FT_CONFIG_OPTION_USE_BROTLI + +#include <brotli/decode.h> + +#endif + + + /************************************************************************** + * + * The macro FT_COMPONENT is used in trace mode. It is an implicit + * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log + * messages during execution. + */ +#undef FT_COMPONENT +#define FT_COMPONENT sfwoff2 + + +#define READ_255USHORT( var ) FT_SET_ERROR( Read255UShort( stream, &var ) ) + +#define READ_BASE128( var ) FT_SET_ERROR( ReadBase128( stream, &var ) ) + +#define ROUND4( var ) ( ( var + 3 ) & ~3 ) + +#define WRITE_USHORT( p, v ) \ + do \ + { \ + *(p)++ = (FT_Byte)( (v) >> 8 ); \ + *(p)++ = (FT_Byte)( (v) >> 0 ); \ + \ + } while ( 0 ) + +#define WRITE_ULONG( p, v ) \ + do \ + { \ + *(p)++ = (FT_Byte)( (v) >> 24 ); \ + *(p)++ = (FT_Byte)( (v) >> 16 ); \ + *(p)++ = (FT_Byte)( (v) >> 8 ); \ + *(p)++ = (FT_Byte)( (v) >> 0 ); \ + \ + } while ( 0 ) + +#define WRITE_SHORT( p, v ) \ + do \ + { \ + *(p)++ = ( (v) >> 8 ); \ + *(p)++ = ( (v) >> 0 ); \ + \ + } while ( 0 ) + +#define WRITE_SFNT_BUF( buf, s ) \ + write_buf( &sfnt, sfnt_size, &dest_offset, buf, s, memory ) + +#define WRITE_SFNT_BUF_AT( offset, buf, s ) \ + write_buf( &sfnt, sfnt_size, &offset, buf, s, memory ) + +#define N_CONTOUR_STREAM 0 +#define N_POINTS_STREAM 1 +#define FLAG_STREAM 2 +#define GLYPH_STREAM 3 +#define COMPOSITE_STREAM 4 +#define BBOX_STREAM 5 +#define INSTRUCTION_STREAM 6 + + + static void + stream_close( FT_Stream stream ) + { + FT_Memory memory = stream->memory; + + + FT_FREE( stream->base ); + + stream->size = 0; + stream->base = NULL; + stream->close = NULL; + } + + + FT_CALLBACK_DEF( int ) + compare_tags( const void* a, + const void* b ) + { + WOFF2_Table table1 = *(WOFF2_Table*)a; + WOFF2_Table table2 = *(WOFF2_Table*)b; + + FT_ULong tag1 = table1->Tag; + FT_ULong tag2 = table2->Tag; + + + if ( tag1 > tag2 ) + return 1; + else if ( tag1 < tag2 ) + return -1; + else + return 0; + } + + + static FT_Error + Read255UShort( FT_Stream stream, + FT_UShort* value ) + { + static const FT_Int oneMoreByteCode1 = 255; + static const FT_Int oneMoreByteCode2 = 254; + static const FT_Int wordCode = 253; + static const FT_Int lowestUCode = 253; + + FT_Error error = FT_Err_Ok; + FT_Byte code; + FT_Byte result_byte = 0; + FT_UShort result_short = 0; + + + if ( FT_READ_BYTE( code ) ) + return error; + if ( code == wordCode ) + { + /* Read next two bytes and store `FT_UShort' value. */ + if ( FT_READ_USHORT( result_short ) ) + return error; + *value = result_short; + return FT_Err_Ok; + } + else if ( code == oneMoreByteCode1 ) + { + if ( FT_READ_BYTE( result_byte ) ) + return error; + *value = result_byte + lowestUCode; + return FT_Err_Ok; + } + else if ( code == oneMoreByteCode2 ) + { + if ( FT_READ_BYTE( result_byte ) ) + return error; + *value = result_byte + lowestUCode * 2; + return FT_Err_Ok; + } + else + { + *value = code; + return FT_Err_Ok; + } + } + + + static FT_Error + ReadBase128( FT_Stream stream, + FT_ULong* value ) + { + FT_ULong result = 0; + FT_Int i; + FT_Byte code; + FT_Error error = FT_Err_Ok; + + + for ( i = 0; i < 5; ++i ) + { + code = 0; + if ( FT_READ_BYTE( code ) ) + return error; + + /* Leading zeros are invalid. */ + if ( i == 0 && code == 0x80 ) + return FT_THROW( Invalid_Table ); + + /* If any of top seven bits are set then we're about to overflow. */ + if ( result & 0xfe000000 ) + return FT_THROW( Invalid_Table ); + + result = ( result << 7 ) | ( code & 0x7f ); + + /* Spin until most significant bit of data byte is false. */ + if ( ( code & 0x80 ) == 0 ) + { + *value = result; + return FT_Err_Ok; + } + } + + /* Make sure not to exceed the size bound. */ + return FT_THROW( Invalid_Table ); + } + + + /* Extend memory of `dst_bytes' buffer and copy data from `src'. */ + static FT_Error + write_buf( FT_Byte** dst_bytes, + FT_ULong* dst_size, + FT_ULong* offset, + FT_Byte* src, + FT_ULong size, + FT_Memory memory ) + { + FT_Error error = FT_Err_Ok; + /* We are reallocating memory for `dst', so its pointer may change. */ + FT_Byte* dst = *dst_bytes; + + + /* Check whether we are within limits. */ + if ( ( *offset + size ) > WOFF2_DEFAULT_MAX_SIZE ) + return FT_THROW( Array_Too_Large ); + + /* Reallocate `dst'. */ + if ( ( *offset + size ) > *dst_size ) + { + FT_TRACE6(( "Reallocating %lu to %lu.\n", + *dst_size, (*offset + size) )); + if ( FT_REALLOC( dst, + (FT_ULong)( *dst_size ), + (FT_ULong)( *offset + size ) ) ) + goto Exit; + + *dst_size = *offset + size; + } + + /* Copy data. */ + ft_memcpy( dst + *offset, src, size ); + + *offset += size; + /* Set pointer of `dst' to its correct value. */ + *dst_bytes = dst; + + Exit: + return error; + } + + + /* Pad buffer to closest multiple of 4. */ + static FT_Error + pad4( FT_Byte** sfnt_bytes, + FT_ULong* sfnt_size, + FT_ULong* out_offset, + FT_Memory memory ) + { + FT_Byte* sfnt = *sfnt_bytes; + FT_ULong dest_offset = *out_offset; + + FT_Byte zeroes[] = { 0, 0, 0 }; + FT_ULong pad_bytes; + + + if ( dest_offset + 3 < dest_offset ) + return FT_THROW( Invalid_Table ); + + pad_bytes = ROUND4( dest_offset ) - dest_offset; + if ( pad_bytes > 0 ) + { + if ( WRITE_SFNT_BUF( &zeroes[0], pad_bytes ) ) + return FT_THROW( Invalid_Table ); + } + + *sfnt_bytes = sfnt; + *out_offset = dest_offset; + return FT_Err_Ok; + } + + + /* Calculate table checksum of `buf'. */ + static FT_Long + compute_ULong_sum( FT_Byte* buf, + FT_ULong size ) + { + FT_ULong checksum = 0; + FT_ULong aligned_size = size & ~3; + FT_ULong i; + FT_ULong v; + + + for ( i = 0; i < aligned_size; i += 4 ) + checksum += ( (FT_ULong)buf[i ] << 24 ) | + ( (FT_ULong)buf[i + 1] << 16 ) | + ( (FT_ULong)buf[i + 2] << 8 ) | + ( (FT_ULong)buf[i + 3] << 0 ); + + /* If size is not aligned to 4, treat as if it is padded with 0s. */ + if ( size != aligned_size ) + { + v = 0; + for ( i = aligned_size ; i < size; ++i ) + v |= (FT_ULong)buf[i] << ( 24 - 8 * ( i & 3 ) ); + checksum += v; + } + + return checksum; + } + + + static FT_Error + woff2_decompress( FT_Byte* dst, + FT_ULong dst_size, + const FT_Byte* src, + FT_ULong src_size ) + { +#ifdef FT_CONFIG_OPTION_USE_BROTLI + + FT_ULong uncompressed_size = dst_size; + BrotliDecoderResult result; + + + result = BrotliDecoderDecompress( src_size, + src, + &uncompressed_size, + dst ); + + if ( result != BROTLI_DECODER_RESULT_SUCCESS || + uncompressed_size != dst_size ) + { + FT_ERROR(( "woff2_decompress: Stream length mismatch.\n" )); + return FT_THROW( Invalid_Table ); + } + + FT_TRACE2(( "woff2_decompress: Brotli stream decompressed.\n" )); + return FT_Err_Ok; + +#else /* !FT_CONFIG_OPTION_USE_BROTLI */ + + FT_ERROR(( "woff2_decompress: Brotli support not available.\n" )); + return FT_THROW( Unimplemented_Feature ); + +#endif /* !FT_CONFIG_OPTION_USE_BROTLI */ + } + + + static WOFF2_Table + find_table( WOFF2_Table* tables, + FT_UShort num_tables, + FT_ULong tag ) + { + FT_Int i; + + + for ( i = 0; i < num_tables; i++ ) + { + if ( tables[i]->Tag == tag ) + return tables[i]; + } + return NULL; + } + + + /* Read `numberOfHMetrics' field from `hhea' table. */ + static FT_Error + read_num_hmetrics( FT_Stream stream, + FT_UShort* num_hmetrics ) + { + FT_Error error = FT_Err_Ok; + FT_UShort num_metrics; + + + if ( FT_STREAM_SKIP( 34 ) ) + return FT_THROW( Invalid_Table ); + + if ( FT_READ_USHORT( num_metrics ) ) + return FT_THROW( Invalid_Table ); + + *num_hmetrics = num_metrics; + + return error; + } + + + /* An auxiliary function for overflow-safe addition. */ + static FT_Int + with_sign( FT_Byte flag, + FT_Int base_val ) + { + /* Precondition: 0 <= base_val < 65536 (to avoid overflow). */ + return ( flag & 1 ) ? base_val : -base_val; + } + + + /* An auxiliary function for overflow-safe addition. */ + static FT_Int + safe_int_addition( FT_Int a, + FT_Int b, + FT_Int* result ) + { + if ( ( ( a > 0 ) && ( b > FT_INT_MAX - a ) ) || + ( ( a < 0 ) && ( b < FT_INT_MIN - a ) ) ) + return FT_THROW( Invalid_Table ); + + *result = a + b; + return FT_Err_Ok; + } + + + /* + * Decode variable-length (flag, xCoordinate, yCoordinate) triplet for a + * simple glyph. See + * + * https://www.w3.org/TR/WOFF2/#triplet_decoding + */ + static FT_Error + triplet_decode( const FT_Byte* flags_in, + const FT_Byte* in, + FT_ULong in_size, + FT_ULong n_points, + WOFF2_Point result, + FT_ULong* in_bytes_used ) + { + FT_Int x = 0; + FT_Int y = 0; + FT_Int dx; + FT_Int dy; + FT_Int b0, b1, b2; + + FT_ULong triplet_index = 0; + FT_ULong data_bytes; + + FT_UInt i; + + + if ( n_points > in_size ) + return FT_THROW( Invalid_Table ); + + for ( i = 0; i < n_points; ++i ) + { + FT_Byte flag = flags_in[i]; + FT_Bool on_curve = !( flag >> 7 ); + + + flag &= 0x7f; + if ( flag < 84 ) + data_bytes = 1; + else if ( flag < 120 ) + data_bytes = 2; + else if ( flag < 124 ) + data_bytes = 3; + else + data_bytes = 4; + + /* Overflow checks */ + if ( triplet_index + data_bytes > in_size || + triplet_index + data_bytes < triplet_index ) + return FT_THROW( Invalid_Table ); + + if ( flag < 10 ) + { + dx = 0; + dy = with_sign( flag, + ( ( flag & 14 ) << 7 ) + in[triplet_index] ); + } + else if ( flag < 20 ) + { + dx = with_sign( flag, + ( ( ( flag - 10 ) & 14 ) << 7 ) + + in[triplet_index] ); + dy = 0; + } + else if ( flag < 84 ) + { + b0 = flag - 20; + b1 = in[triplet_index]; + dx = with_sign( flag, + 1 + ( b0 & 0x30 ) + ( b1 >> 4 ) ); + dy = with_sign( flag >> 1, + 1 + ( ( b0 & 0x0c ) << 2 ) + ( b1 & 0x0f ) ); + } + else if ( flag < 120 ) + { + b0 = flag - 84; + dx = with_sign( flag, + 1 + ( ( b0 / 12 ) << 8 ) + in[triplet_index] ); + dy = with_sign( flag >> 1, + 1 + ( ( ( b0 % 12 ) >> 2 ) << 8 ) + + in[triplet_index + 1] ); + } + else if ( flag < 124 ) + { + b2 = in[triplet_index + 1]; + dx = with_sign( flag, + ( in[triplet_index] << 4 ) + ( b2 >> 4 ) ); + dy = with_sign( flag >> 1, + ( ( b2 & 0x0f ) << 8 ) + in[triplet_index + 2] ); + } + else + { + dx = with_sign( flag, + ( in[triplet_index] << 8 ) + + in[triplet_index + 1] ); + dy = with_sign( flag >> 1, + ( in[triplet_index + 2] << 8 ) + + in[triplet_index + 3] ); + } + + triplet_index += data_bytes; + + if ( safe_int_addition( x, dx, &x ) ) + return FT_THROW( Invalid_Table ); + + if ( safe_int_addition( y, dy, &y ) ) + return FT_THROW( Invalid_Table ); + + result[i].x = x; + result[i].y = y; + result[i].on_curve = on_curve; + } + + *in_bytes_used = triplet_index; + return FT_Err_Ok; + } + + + /* Store decoded points in glyph buffer. */ + static FT_Error + store_points( FT_ULong n_points, + const WOFF2_Point points, + FT_UShort n_contours, + FT_UShort instruction_len, + FT_Byte* dst, + FT_ULong dst_size, + FT_ULong* glyph_size ) + { + FT_UInt flag_offset = 10 + ( 2 * n_contours ) + 2 + instruction_len; + FT_Int last_flag = -1; + FT_Int repeat_count = 0; + FT_Int last_x = 0; + FT_Int last_y = 0; + FT_UInt x_bytes = 0; + FT_UInt y_bytes = 0; + FT_UInt xy_bytes; + FT_UInt i; + FT_UInt x_offset; + FT_UInt y_offset; + FT_Byte* pointer; + + + for ( i = 0; i < n_points; ++i ) + { + const WOFF2_PointRec point = points[i]; + + FT_Int flag = point.on_curve ? GLYF_ON_CURVE : 0; + FT_Int dx = point.x - last_x; + FT_Int dy = point.y - last_y; + + + if ( dx == 0 ) + flag |= GLYF_THIS_X_IS_SAME; + else if ( dx > -256 && dx < 256 ) + { + flag |= GLYF_X_SHORT | ( dx > 0 ? GLYF_THIS_X_IS_SAME : 0 ); + x_bytes += 1; + } + else + x_bytes += 2; + + if ( dy == 0 ) + flag |= GLYF_THIS_Y_IS_SAME; + else if ( dy > -256 && dy < 256 ) + { + flag |= GLYF_Y_SHORT | ( dy > 0 ? GLYF_THIS_Y_IS_SAME : 0 ); + y_bytes += 1; + } + else + y_bytes += 2; + + if ( flag == last_flag && repeat_count != 255 ) + { + dst[flag_offset - 1] |= GLYF_REPEAT; + repeat_count++; + } + else + { + if ( repeat_count != 0 ) + { + if ( flag_offset >= dst_size ) + return FT_THROW( Invalid_Table ); + + dst[flag_offset++] = repeat_count; + } + if ( flag_offset >= dst_size ) + return FT_THROW( Invalid_Table ); + + dst[flag_offset++] = flag; + repeat_count = 0; + } + + last_x = point.x; + last_y = point.y; + last_flag = flag; + } + + if ( repeat_count != 0 ) + { + if ( flag_offset >= dst_size ) + return FT_THROW( Invalid_Table ); + + dst[flag_offset++] = repeat_count; + } + + xy_bytes = x_bytes + y_bytes; + if ( xy_bytes < x_bytes || + flag_offset + xy_bytes < flag_offset || + flag_offset + xy_bytes > dst_size ) + return FT_THROW( Invalid_Table ); + + x_offset = flag_offset; + y_offset = flag_offset + x_bytes; + last_x = 0; + last_y = 0; + + for ( i = 0; i < n_points; ++i ) + { + FT_Int dx = points[i].x - last_x; + FT_Int dy = points[i].y - last_y; + + + if ( dx == 0 ) + ; + else if ( dx > -256 && dx < 256 ) + dst[x_offset++] = FT_ABS( dx ); + else + { + pointer = dst + x_offset; + WRITE_SHORT( pointer, dx ); + x_offset += 2; + } + + last_x += dx; + + if ( dy == 0 ) + ; + else if ( dy > -256 && dy < 256 ) + dst[y_offset++] = FT_ABS( dy ); + else + { + pointer = dst + y_offset; + WRITE_SHORT( pointer, dy ); + y_offset += 2; + } + + last_y += dy; + } + + *glyph_size = y_offset; + return FT_Err_Ok; + } + + + static void + compute_bbox( FT_ULong n_points, + const WOFF2_Point points, + FT_Byte* dst, + FT_UShort* src_x_min ) + { + FT_Int x_min = 0; + FT_Int y_min = 0; + FT_Int x_max = 0; + FT_Int y_max = 0; + + FT_UInt i; + + FT_ULong offset; + FT_Byte* pointer; + + + if ( n_points > 0 ) + { + x_min = points[0].x; + y_min = points[0].y; + x_max = points[0].x; + y_max = points[0].y; + } + + for ( i = 1; i < n_points; ++i ) + { + FT_Int x = points[i].x; + FT_Int y = points[i].y; + + + x_min = FT_MIN( x, x_min ); + y_min = FT_MIN( y, y_min ); + x_max = FT_MAX( x, x_max ); + y_max = FT_MAX( y, y_max ); + } + + /* Write values to `glyf' record. */ + offset = 2; + pointer = dst + offset; + + WRITE_SHORT( pointer, x_min ); + WRITE_SHORT( pointer, y_min ); + WRITE_SHORT( pointer, x_max ); + WRITE_SHORT( pointer, y_max ); + + *src_x_min = (FT_UShort)x_min; + } + + + static FT_Error + compositeGlyph_size( FT_Stream stream, + FT_ULong offset, + FT_ULong* size, + FT_Bool* have_instructions ) + { + FT_Error error = FT_Err_Ok; + FT_ULong start_offset = offset; + FT_Bool we_have_inst = FALSE; + FT_UShort flags = FLAG_MORE_COMPONENTS; + + + if ( FT_STREAM_SEEK( start_offset ) ) + goto Exit; + while ( flags & FLAG_MORE_COMPONENTS ) + { + FT_ULong arg_size; + + + if ( FT_READ_USHORT( flags ) ) + goto Exit; + we_have_inst |= ( flags & FLAG_WE_HAVE_INSTRUCTIONS ) != 0; + /* glyph index */ + arg_size = 2; + if ( flags & FLAG_ARG_1_AND_2_ARE_WORDS ) + arg_size += 4; + else + arg_size += 2; + + if ( flags & FLAG_WE_HAVE_A_SCALE ) + arg_size += 2; + else if ( flags & FLAG_WE_HAVE_AN_X_AND_Y_SCALE ) + arg_size += 4; + else if ( flags & FLAG_WE_HAVE_A_TWO_BY_TWO ) + arg_size += 8; + + if ( FT_STREAM_SKIP( arg_size ) ) + goto Exit; + } + + *size = FT_STREAM_POS() - start_offset; + *have_instructions = we_have_inst; + + Exit: + return error; + } + + + /* Store loca values (provided by `reconstruct_glyf') to output stream. */ + static FT_Error + store_loca( FT_ULong* loca_values, + FT_ULong loca_values_size, + FT_UShort index_format, + FT_ULong* checksum, + FT_Byte** sfnt_bytes, + FT_ULong* sfnt_size, + FT_ULong* out_offset, + FT_Memory memory ) + { + FT_Error error = FT_Err_Ok; + FT_Byte* sfnt = *sfnt_bytes; + FT_ULong dest_offset = *out_offset; + + FT_Byte* loca_buf = NULL; + FT_Byte* dst = NULL; + + FT_UInt i = 0; + FT_ULong loca_buf_size; + + const FT_ULong offset_size = index_format ? 4 : 2; + + + if ( ( loca_values_size << 2 ) >> 2 != loca_values_size ) + goto Fail; + + loca_buf_size = loca_values_size * offset_size; + if ( FT_NEW_ARRAY( loca_buf, loca_buf_size ) ) + goto Fail; + + dst = loca_buf; + for ( i = 0; i < loca_values_size; i++ ) + { + FT_ULong value = loca_values[i]; + + + if ( index_format ) + WRITE_ULONG( dst, value ); + else + WRITE_USHORT( dst, ( value >> 1 ) ); + } + + *checksum = compute_ULong_sum( loca_buf, loca_buf_size ); + /* Write `loca' table to sfnt buffer. */ + if ( WRITE_SFNT_BUF( loca_buf, loca_buf_size ) ) + goto Fail; + + /* Set pointer `sfnt_bytes' to its correct value. */ + *sfnt_bytes = sfnt; + *out_offset = dest_offset; + + FT_FREE( loca_buf ); + return error; + + Fail: + if ( !error ) + error = FT_THROW( Invalid_Table ); + + FT_FREE( loca_buf ); + + return error; + } + + + static FT_Error + reconstruct_glyf( FT_Stream stream, + FT_ULong* glyf_checksum, + FT_ULong* loca_checksum, + FT_Byte** sfnt_bytes, + FT_ULong* sfnt_size, + FT_ULong* out_offset, + WOFF2_Info info, + FT_Memory memory ) + { + FT_Error error = FT_Err_Ok; + FT_Byte* sfnt = *sfnt_bytes; + + /* current position in stream */ + const FT_ULong pos = FT_STREAM_POS(); + + FT_UInt num_substreams = 7; + + FT_UShort num_glyphs; + FT_UShort index_format; + FT_ULong expected_loca_length; + FT_UInt offset; + FT_UInt i; + FT_ULong points_size; + FT_ULong bitmap_length; + FT_ULong glyph_buf_size; + FT_ULong bbox_bitmap_offset; + + const FT_ULong glyf_start = *out_offset; + FT_ULong dest_offset = *out_offset; + + WOFF2_Substream substreams = NULL; + + FT_ULong* loca_values = NULL; + FT_UShort* n_points_arr = NULL; + FT_Byte* glyph_buf = NULL; + WOFF2_Point points = NULL; + + + if ( FT_NEW_ARRAY( substreams, num_substreams ) ) + goto Fail; + + if ( FT_STREAM_SKIP( 4 ) ) + goto Fail; + if ( FT_READ_USHORT( num_glyphs ) ) + goto Fail; + if ( FT_READ_USHORT( index_format ) ) + goto Fail; + + FT_TRACE4(( "num_glyphs = %u; index_format = %u\n", + num_glyphs, index_format )); + + info->num_glyphs = num_glyphs; + + /* Calculate expected length of loca and compare. */ + /* See https://www.w3.org/TR/WOFF2/#conform-mustRejectLoca */ + /* index_format = 0 => Short version `loca'. */ + /* index_format = 1 => Long version `loca'. */ + expected_loca_length = ( index_format ? 4 : 2 ) * + ( (FT_ULong)num_glyphs + 1 ); + if ( info->loca_table->dst_length != expected_loca_length ) + goto Fail; + + offset = ( 2 + num_substreams ) * 4; + if ( offset > info->glyf_table->TransformLength ) + goto Fail; + + for ( i = 0; i < num_substreams; ++i ) + { + FT_ULong substream_size; + + + if ( FT_READ_ULONG( substream_size ) ) + goto Fail; + if ( substream_size > info->glyf_table->TransformLength - offset ) + goto Fail; + + substreams[i].start = pos + offset; + substreams[i].offset = pos + offset; + substreams[i].size = substream_size; + + FT_TRACE5(( " Substream %d: offset = %lu; size = %lu;\n", + i, substreams[i].offset, substreams[i].size )); + offset += substream_size; + } + + if ( FT_NEW_ARRAY( loca_values, num_glyphs + 1 ) ) + goto Fail; + + points_size = 0; + bbox_bitmap_offset = substreams[BBOX_STREAM].offset; + + /* Size of bboxBitmap = 4 * floor((numGlyphs + 31) / 32) */ + bitmap_length = ( ( num_glyphs + 31 ) >> 5 ) << 2; + substreams[BBOX_STREAM].offset += bitmap_length; + + glyph_buf_size = WOFF2_DEFAULT_GLYPH_BUF; + if ( FT_NEW_ARRAY( glyph_buf, glyph_buf_size ) ) + goto Fail; + + if ( FT_NEW_ARRAY( info->x_mins, num_glyphs ) ) + goto Fail; + + for ( i = 0; i < num_glyphs; ++i ) + { + FT_ULong glyph_size = 0; + FT_UShort n_contours = 0; + FT_Bool have_bbox = FALSE; + FT_Byte bbox_bitmap; + FT_ULong bbox_offset; + FT_UShort x_min = 0; + + + /* Set `have_bbox'. */ + bbox_offset = bbox_bitmap_offset + ( i >> 3 ); + if ( FT_STREAM_SEEK( bbox_offset ) || + FT_READ_BYTE( bbox_bitmap ) ) + goto Fail; + if ( bbox_bitmap & ( 0x80 >> ( i & 7 ) ) ) + have_bbox = TRUE; + + /* Read value from `nContourStream'. */ + if ( FT_STREAM_SEEK( substreams[N_CONTOUR_STREAM].offset ) || + FT_READ_USHORT( n_contours ) ) + goto Fail; + substreams[N_CONTOUR_STREAM].offset += 2; + + if ( n_contours == 0xffff ) + { + /* composite glyph */ + FT_Bool have_instructions = FALSE; + FT_UShort instruction_size = 0; + FT_ULong composite_size; + FT_ULong size_needed; + FT_Byte* pointer = NULL; + + + /* Composite glyphs must have explicit bbox. */ + if ( !have_bbox ) + goto Fail; + + if ( compositeGlyph_size( stream, + substreams[COMPOSITE_STREAM].offset, + &composite_size, + &have_instructions) ) + goto Fail; + + if ( have_instructions ) + { + if ( FT_STREAM_SEEK( substreams[GLYPH_STREAM].offset ) || + READ_255USHORT( instruction_size ) ) + goto Fail; + substreams[GLYPH_STREAM].offset = FT_STREAM_POS(); + } + + size_needed = 12 + composite_size + instruction_size; + if ( glyph_buf_size < size_needed ) + { + if ( FT_RENEW_ARRAY( glyph_buf, glyph_buf_size, size_needed ) ) + goto Fail; + glyph_buf_size = size_needed; + } + + pointer = glyph_buf + glyph_size; + WRITE_USHORT( pointer, n_contours ); + glyph_size += 2; + + /* Read x_min for current glyph. */ + if ( FT_STREAM_SEEK( substreams[BBOX_STREAM].offset ) || + FT_READ_USHORT( x_min ) ) + goto Fail; + /* No increment here because we read again. */ + + if ( FT_STREAM_SEEK( substreams[BBOX_STREAM].offset ) || + FT_STREAM_READ( glyph_buf + glyph_size, 8 ) ) + goto Fail; + + substreams[BBOX_STREAM].offset += 8; + glyph_size += 8; + + if ( FT_STREAM_SEEK( substreams[COMPOSITE_STREAM].offset ) || + FT_STREAM_READ( glyph_buf + glyph_size, composite_size ) ) + goto Fail; + + substreams[COMPOSITE_STREAM].offset += composite_size; + glyph_size += composite_size; + + if ( have_instructions ) + { + pointer = glyph_buf + glyph_size; + WRITE_USHORT( pointer, instruction_size ); + glyph_size += 2; + + if ( FT_STREAM_SEEK( substreams[INSTRUCTION_STREAM].offset ) || + FT_STREAM_READ( glyph_buf + glyph_size, instruction_size ) ) + goto Fail; + + substreams[INSTRUCTION_STREAM].offset += instruction_size; + glyph_size += instruction_size; + } + } + else if ( n_contours > 0 ) + { + /* simple glyph */ + FT_ULong total_n_points = 0; + FT_UShort n_points_contour; + FT_UInt j; + FT_ULong flag_size; + FT_ULong triplet_size; + FT_ULong triplet_bytes_used; + FT_Byte* flags_buf = NULL; + FT_Byte* triplet_buf = NULL; + FT_UShort instruction_size; + FT_ULong size_needed; + FT_Int end_point; + FT_UInt contour_ix; + + FT_Byte* pointer = NULL; + + + if ( FT_NEW_ARRAY( n_points_arr, n_contours ) ) + goto Fail; + + if ( FT_STREAM_SEEK( substreams[N_POINTS_STREAM].offset ) ) + goto Fail; + + for ( j = 0; j < n_contours; ++j ) + { + if ( READ_255USHORT( n_points_contour ) ) + goto Fail; + n_points_arr[j] = n_points_contour; + /* Prevent negative/overflow. */ + if ( total_n_points + n_points_contour < total_n_points ) + goto Fail; + total_n_points += n_points_contour; + } + substreams[N_POINTS_STREAM].offset = FT_STREAM_POS(); + + flag_size = total_n_points; + if ( flag_size > substreams[FLAG_STREAM].size ) + goto Fail; + + flags_buf = stream->base + substreams[FLAG_STREAM].offset; + triplet_buf = stream->base + substreams[GLYPH_STREAM].offset; + + if ( substreams[GLYPH_STREAM].size < + ( substreams[GLYPH_STREAM].offset - + substreams[GLYPH_STREAM].start ) ) + goto Fail; + + triplet_size = substreams[GLYPH_STREAM].size - + ( substreams[GLYPH_STREAM].offset - + substreams[GLYPH_STREAM].start ); + triplet_bytes_used = 0; + + /* Create array to store point information. */ + points_size = total_n_points; + if ( FT_NEW_ARRAY( points, points_size ) ) + goto Fail; + + if ( triplet_decode( flags_buf, + triplet_buf, + triplet_size, + total_n_points, + points, + &triplet_bytes_used ) ) + goto Fail; + + substreams[FLAG_STREAM].offset += flag_size; + substreams[GLYPH_STREAM].offset += triplet_bytes_used; + + if ( FT_STREAM_SEEK( substreams[GLYPH_STREAM].offset ) || + READ_255USHORT( instruction_size ) ) + goto Fail; + + substreams[GLYPH_STREAM].offset = FT_STREAM_POS(); + + if ( total_n_points >= ( 1 << 27 ) ) + goto Fail; + + size_needed = 12 + + ( 2 * n_contours ) + + ( 5 * total_n_points ) + + instruction_size; + if ( glyph_buf_size < size_needed ) + { + if ( FT_RENEW_ARRAY( glyph_buf, glyph_buf_size, size_needed ) ) + goto Fail; + glyph_buf_size = size_needed; + } + + pointer = glyph_buf + glyph_size; + WRITE_USHORT( pointer, n_contours ); + glyph_size += 2; + + if ( have_bbox ) + { + /* Read x_min for current glyph. */ + if ( FT_STREAM_SEEK( substreams[BBOX_STREAM].offset ) || + FT_READ_USHORT( x_min ) ) + goto Fail; + /* No increment here because we read again. */ + + if ( FT_STREAM_SEEK( substreams[BBOX_STREAM].offset ) || + FT_STREAM_READ( glyph_buf + glyph_size, 8 ) ) + goto Fail; + substreams[BBOX_STREAM].offset += 8; + } + else + compute_bbox( total_n_points, points, glyph_buf, &x_min ); + + glyph_size = CONTOUR_OFFSET_END_POINT; + + pointer = glyph_buf + glyph_size; + end_point = -1; + + for ( contour_ix = 0; contour_ix < n_contours; ++contour_ix ) + { + end_point += n_points_arr[contour_ix]; + if ( end_point >= 65536 ) + goto Fail; + + WRITE_SHORT( pointer, end_point ); + glyph_size += 2; + } + + WRITE_USHORT( pointer, instruction_size ); + glyph_size += 2; + + if ( FT_STREAM_SEEK( substreams[INSTRUCTION_STREAM].offset ) || + FT_STREAM_READ( glyph_buf + glyph_size, instruction_size ) ) + goto Fail; + + substreams[INSTRUCTION_STREAM].offset += instruction_size; + glyph_size += instruction_size; + + if ( store_points( total_n_points, + points, + n_contours, + instruction_size, + glyph_buf, + glyph_buf_size, + &glyph_size ) ) + goto Fail; + + FT_FREE( points ); + FT_FREE( n_points_arr ); + } + else + { + /* Empty glyph. */ + /* Must not have a bbox. */ + if ( have_bbox ) + { + FT_ERROR(( "Empty glyph has a bbox.\n" )); + goto Fail; + } + } + + loca_values[i] = dest_offset - glyf_start; + + if ( WRITE_SFNT_BUF( glyph_buf, glyph_size ) ) + goto Fail; + + if ( pad4( &sfnt, sfnt_size, &dest_offset, memory ) ) + goto Fail; + + *glyf_checksum += compute_ULong_sum( glyph_buf, glyph_size ); + + /* Store x_mins, may be required to reconstruct `hmtx'. */ + if ( n_contours > 0 ) + info->x_mins[i] = x_min; + } + + info->glyf_table->dst_length = dest_offset - info->glyf_table->dst_offset; + info->loca_table->dst_offset = dest_offset; + + /* `loca[n]' will be equal to the length of the `glyf' table. */ + loca_values[num_glyphs] = info->glyf_table->dst_length; + + if ( store_loca( loca_values, + num_glyphs + 1, + index_format, + loca_checksum, + &sfnt, + sfnt_size, + &dest_offset, + memory ) ) + goto Fail; + + info->loca_table->dst_length = dest_offset - info->loca_table->dst_offset; + + FT_TRACE4(( " loca table info:\n" )); + FT_TRACE4(( " dst_offset = %lu\n", info->loca_table->dst_offset )); + FT_TRACE4(( " dst_length = %lu\n", info->loca_table->dst_length )); + FT_TRACE4(( " checksum = %09x\n", *loca_checksum )); + + /* Set pointer `sfnt_bytes' to its correct value. */ + *sfnt_bytes = sfnt; + *out_offset = dest_offset; + + FT_FREE( substreams ); + FT_FREE( loca_values ); + FT_FREE( n_points_arr ); + FT_FREE( glyph_buf ); + FT_FREE( points ); + + return error; + + Fail: + if ( !error ) + error = FT_THROW( Invalid_Table ); + + /* Set pointer `sfnt_bytes' to its correct value. */ + *sfnt_bytes = sfnt; + + FT_FREE( substreams ); + FT_FREE( loca_values ); + FT_FREE( n_points_arr ); + FT_FREE( glyph_buf ); + FT_FREE( points ); + + return error; + } + + + /* Get `x_mins' for untransformed `glyf' table. */ + static FT_Error + get_x_mins( FT_Stream stream, + WOFF2_Table* tables, + FT_UShort num_tables, + WOFF2_Info info, + FT_Memory memory ) + { + FT_UShort num_glyphs; + FT_UShort index_format; + FT_ULong glyf_offset; + FT_UShort glyf_offset_short; + FT_ULong loca_offset; + FT_Int i; + FT_Error error = FT_Err_Ok; + FT_ULong offset_size; + + /* At this point of time those tables might not have been read yet. */ + const WOFF2_Table maxp_table = find_table( tables, num_tables, + TTAG_maxp ); + const WOFF2_Table head_table = find_table( tables, num_tables, + TTAG_head ); + + + if ( !maxp_table ) + { + FT_ERROR(( "`maxp' table is missing.\n" )); + return FT_THROW( Invalid_Table ); + } + + if ( !head_table ) + { + FT_ERROR(( "`head' table is missing.\n" )); + return FT_THROW( Invalid_Table ); + } + + /* Read `numGlyphs' field from `maxp' table. */ + if ( FT_STREAM_SEEK( maxp_table->src_offset ) || FT_STREAM_SKIP( 8 ) ) + return error; + + if ( FT_READ_USHORT( num_glyphs ) ) + return error; + + info->num_glyphs = num_glyphs; + + /* Read `indexToLocFormat' field from `head' table. */ + if ( FT_STREAM_SEEK( head_table->src_offset ) || + FT_STREAM_SKIP( 50 ) ) + return error; + + if ( FT_READ_USHORT( index_format ) ) + return error; + + offset_size = index_format ? 4 : 2; + + /* Create `x_mins' array. */ + if ( FT_NEW_ARRAY( info->x_mins, num_glyphs ) ) + return error; + + loca_offset = info->loca_table->src_offset; + + for ( i = 0; i < num_glyphs; ++i ) + { + if ( FT_STREAM_SEEK( loca_offset ) ) + return error; + + loca_offset += offset_size; + + if ( index_format ) + { + if ( FT_READ_ULONG( glyf_offset ) ) + return error; + } + else + { + if ( FT_READ_USHORT( glyf_offset_short ) ) + return error; + + glyf_offset = (FT_ULong)( glyf_offset_short ); + glyf_offset = glyf_offset << 1; + } + + glyf_offset += info->glyf_table->src_offset; + + if ( FT_STREAM_SEEK( glyf_offset ) || FT_STREAM_SKIP( 2 ) ) + return error; + + if ( FT_READ_USHORT( info->x_mins[i] ) ) + return error; + } + + return error; + } + + + static FT_Error + reconstruct_hmtx( FT_Stream stream, + FT_UShort num_glyphs, + FT_UShort num_hmetrics, + FT_Short* x_mins, + FT_ULong* checksum, + FT_Byte** sfnt_bytes, + FT_ULong* sfnt_size, + FT_ULong* out_offset, + FT_Memory memory ) + { + FT_Error error = FT_Err_Ok; + FT_Byte* sfnt = *sfnt_bytes; + FT_ULong dest_offset = *out_offset; + + FT_Byte hmtx_flags; + FT_Bool has_proportional_lsbs, has_monospace_lsbs; + FT_ULong hmtx_table_size; + FT_Int i; + + FT_UShort* advance_widths = NULL; + FT_Short* lsbs = NULL; + FT_Byte* hmtx_table = NULL; + FT_Byte* dst = NULL; + + + if ( FT_READ_BYTE( hmtx_flags ) ) + goto Fail; + + has_proportional_lsbs = ( hmtx_flags & 1 ) == 0; + has_monospace_lsbs = ( hmtx_flags & 2 ) == 0; + + /* Bits 2-7 are reserved and MUST be zero. */ + if ( ( hmtx_flags & 0xFC ) != 0 ) + goto Fail; + + /* Are you REALLY transformed? */ + if ( has_proportional_lsbs && has_monospace_lsbs ) + goto Fail; + + /* Cannot have a transformed `hmtx' without `glyf'. */ + if ( ( num_hmetrics > num_glyphs ) || + ( num_hmetrics < 1 ) ) + goto Fail; + + /* Must have at least one entry. */ + if ( num_hmetrics < 1 ) + goto Fail; + + if ( FT_NEW_ARRAY( advance_widths, num_hmetrics ) || + FT_NEW_ARRAY( lsbs, num_glyphs ) ) + goto Fail; + + /* Read `advanceWidth' stream. Always present. */ + for ( i = 0; i < num_hmetrics; i++ ) + { + FT_UShort advance_width; + + + if ( FT_READ_USHORT( advance_width ) ) + goto Fail; + + advance_widths[i] = advance_width; + } + + /* lsb values for proportional glyphs. */ + for ( i = 0; i < num_hmetrics; i++ ) + { + FT_Short lsb; + + + if ( has_proportional_lsbs ) + { + if ( FT_READ_SHORT( lsb ) ) + goto Fail; + } + else + lsb = x_mins[i]; + + lsbs[i] = lsb; + } + + /* lsb values for monospaced glyphs. */ + for ( i = num_hmetrics; i < num_glyphs; i++ ) + { + FT_Short lsb; + + + if ( has_monospace_lsbs ) + { + if ( FT_READ_SHORT( lsb ) ) + goto Fail; + } + else + lsb = x_mins[i]; + + lsbs[i] = lsb; + } + + /* Build the hmtx table. */ + hmtx_table_size = 2 * num_hmetrics + 2 * num_glyphs; + if ( FT_NEW_ARRAY( hmtx_table, hmtx_table_size ) ) + goto Fail; + + dst = hmtx_table; + FT_TRACE6(( "hmtx values: \n" )); + for ( i = 0; i < num_glyphs; i++ ) + { + if ( i < num_hmetrics ) + { + WRITE_SHORT( dst, advance_widths[i] ); + FT_TRACE6(( "%d ", advance_widths[i] )); + } + + WRITE_SHORT( dst, lsbs[i] ); + FT_TRACE6(( "%d ", lsbs[i] )); + } + FT_TRACE6(( "\n" )); + + *checksum = compute_ULong_sum( hmtx_table, hmtx_table_size ); + /* Write `hmtx' table to sfnt buffer. */ + if ( WRITE_SFNT_BUF( hmtx_table, hmtx_table_size ) ) + goto Fail; + + /* Set pointer `sfnt_bytes' to its correct value. */ + *sfnt_bytes = sfnt; + *out_offset = dest_offset; + + FT_FREE( advance_widths ); + FT_FREE( lsbs ); + FT_FREE( hmtx_table ); + + return error; + + Fail: + FT_FREE( advance_widths ); + FT_FREE( lsbs ); + FT_FREE( hmtx_table ); + + if ( !error ) + error = FT_THROW( Invalid_Table ); + + return error; + } + + + static FT_Error + reconstruct_font( FT_Byte* transformed_buf, + FT_ULong transformed_buf_size, + WOFF2_Table* indices, + WOFF2_Header woff2, + WOFF2_Info info, + FT_Byte** sfnt_bytes, + FT_ULong* sfnt_size, + FT_Memory memory ) + { + /* Memory management of `transformed_buf' is handled by the caller. */ + + FT_Error error = FT_Err_Ok; + FT_Stream stream = NULL; + FT_Byte* buf_cursor = NULL; + FT_Byte* table_entry = NULL; + + /* We are reallocating memory for `sfnt', so its pointer may change. */ + FT_Byte* sfnt = *sfnt_bytes; + + FT_UShort num_tables = woff2->num_tables; + FT_ULong dest_offset = 12 + num_tables * 16UL; + + FT_ULong checksum = 0; + FT_ULong loca_checksum = 0; + FT_Int nn = 0; + FT_UShort num_hmetrics = 0; + FT_ULong font_checksum = info->header_checksum; + FT_Bool is_glyf_xform = FALSE; + + FT_ULong table_entry_offset = 12; + + + /* A few table checks before reconstruction. */ + /* `glyf' must be present with `loca'. */ + info->glyf_table = find_table( indices, num_tables, TTAG_glyf ); + info->loca_table = find_table( indices, num_tables, TTAG_loca ); + + if ( ( info->glyf_table == NULL ) ^ ( info->loca_table == NULL ) ) + { + FT_ERROR(( "One of `glyf'/`loca' tables missing.\n" )); + return FT_THROW( Invalid_Table ); + } + + /* Both `glyf' and `loca' must have same transformation. */ + if ( info->glyf_table != NULL ) + { + if ( ( info->glyf_table->flags & WOFF2_FLAGS_TRANSFORM ) != + ( info->loca_table->flags & WOFF2_FLAGS_TRANSFORM ) ) + { + FT_ERROR(( "Transformation mismatch" + " between `glyf' and `loca' table." )); + return FT_THROW( Invalid_Table ); + } + } + + /* Create buffer for table entries. */ + if ( FT_NEW_ARRAY( table_entry, 16 ) ) + goto Fail; + + /* Create a stream for the uncompressed buffer. */ + if ( FT_NEW( stream ) ) + goto Fail; + FT_Stream_OpenMemory( stream, transformed_buf, transformed_buf_size ); + + FT_ASSERT( FT_STREAM_POS() == 0 ); + + /* Reconstruct/copy tables to output stream. */ + for ( nn = 0; nn < num_tables; nn++ ) + { + WOFF2_TableRec table = *( indices[nn] ); + + + FT_TRACE3(( "Seeking to %d with table size %d.\n", + table.src_offset, table.src_length )); + FT_TRACE3(( "Table tag: %c%c%c%c.\n", + (FT_Char)( table.Tag >> 24 ), + (FT_Char)( table.Tag >> 16 ), + (FT_Char)( table.Tag >> 8 ), + (FT_Char)( table.Tag ) )); + + if ( FT_STREAM_SEEK( table.src_offset ) ) + goto Fail; + + if ( table.src_offset + table.src_length > transformed_buf_size ) + goto Fail; + + /* Get stream size for fields of `hmtx' table. */ + if ( table.Tag == TTAG_hhea ) + { + if ( read_num_hmetrics( stream, &num_hmetrics ) ) + goto Fail; + } + + info->num_hmetrics = num_hmetrics; + + checksum = 0; + if ( ( table.flags & WOFF2_FLAGS_TRANSFORM ) != WOFF2_FLAGS_TRANSFORM ) + { + /* Check whether `head' is at least 12 bytes. */ + if ( table.Tag == TTAG_head ) + { + if ( table.src_length < 12 ) + goto Fail; + + buf_cursor = transformed_buf + table.src_offset + 8; + /* Set checkSumAdjustment = 0 */ + WRITE_ULONG( buf_cursor, 0 ); + } + + table.dst_offset = dest_offset; + + checksum = compute_ULong_sum( transformed_buf + table.src_offset, + table.src_length ); + FT_TRACE4(( "Checksum = %09x.\n", checksum )); + + if ( WRITE_SFNT_BUF( transformed_buf + table.src_offset, + table.src_length ) ) + goto Fail; + } + else + { + FT_TRACE3(( "This table is transformed.\n" )); + + if ( table.Tag == TTAG_glyf ) + { + is_glyf_xform = TRUE; + table.dst_offset = dest_offset; + + if ( reconstruct_glyf( stream, + &checksum, + &loca_checksum, + &sfnt, + sfnt_size, + &dest_offset, + info, + memory ) ) + goto Fail; + + FT_TRACE4(( "Checksum = %09x.\n", checksum )); + } + + else if ( table.Tag == TTAG_loca ) + checksum = loca_checksum; + + else if ( table.Tag == TTAG_hmtx ) + { + /* If glyf is not transformed and hmtx is, handle separately. */ + if ( !is_glyf_xform ) + { + if ( get_x_mins( stream, indices, num_tables, info, memory ) ) + goto Fail; + } + + table.dst_offset = dest_offset; + + if ( reconstruct_hmtx( stream, + info->num_glyphs, + info->num_hmetrics, + info->x_mins, + &checksum, + &sfnt, + sfnt_size, + &dest_offset, + memory ) ) + goto Fail; + } + else + { + /* Unknown transform. */ + FT_ERROR(( "Unknown table transform.\n" )); + goto Fail; + } + } + + font_checksum += checksum; + + buf_cursor = &table_entry[0]; + WRITE_ULONG( buf_cursor, table.Tag ); + WRITE_ULONG( buf_cursor, checksum ); + WRITE_ULONG( buf_cursor, table.dst_offset ); + WRITE_ULONG( buf_cursor, table.dst_length ); + + WRITE_SFNT_BUF_AT( table_entry_offset, table_entry, 16 ); + + /* Update checksum. */ + font_checksum += compute_ULong_sum( table_entry, 16 ); + + if ( pad4( &sfnt, sfnt_size, &dest_offset, memory ) ) + goto Fail; + + /* Sanity check. */ + if ( (FT_ULong)( table.dst_offset + table.dst_length ) > dest_offset ) + { + FT_ERROR(( "Table was partially written.\n" )); + goto Fail; + } + } + + /* Update `head' checkSumAdjustment. */ + info->head_table = find_table( indices, num_tables, TTAG_head ); + if ( !info->head_table ) + { + FT_ERROR(( "`head' table is missing.\n" )); + goto Fail; + } + + if ( info->head_table->dst_length < 12 ) + goto Fail; + + buf_cursor = sfnt + info->head_table->dst_offset + 8; + font_checksum = 0xB1B0AFBA - font_checksum; + + WRITE_ULONG( buf_cursor, font_checksum ); + + FT_TRACE2(( "Final checksum = %09x.\n", font_checksum )); + + woff2->actual_sfnt_size = dest_offset; + + /* Set pointer of sfnt stream to its correct value. */ + *sfnt_bytes = sfnt; + + FT_FREE( table_entry ); + FT_Stream_Close( stream ); + FT_FREE( stream ); + + return error; + + Fail: + if ( !error ) + error = FT_THROW( Invalid_Table ); + + /* Set pointer of sfnt stream to its correct value. */ + *sfnt_bytes = sfnt; + + FT_FREE( table_entry ); + FT_Stream_Close( stream ); + FT_FREE( stream ); + + return error; + } + + + /* Replace `face->root.stream' with a stream containing the extracted */ + /* SFNT of a WOFF2 font. */ + + FT_LOCAL_DEF( FT_Error ) + woff2_open_font( FT_Stream stream, + TT_Face face, + FT_Int* face_instance_index, + FT_Long* num_faces ) + { + FT_Memory memory = stream->memory; + FT_Error error = FT_Err_Ok; + FT_Int face_index; + + WOFF2_HeaderRec woff2; + WOFF2_InfoRec info = { 0, 0, 0, NULL, NULL, NULL, NULL }; + WOFF2_Table tables = NULL; + WOFF2_Table* indices = NULL; + WOFF2_Table* temp_indices = NULL; + WOFF2_Table last_table; + + FT_Int nn; + FT_ULong j; + FT_ULong flags; + FT_UShort xform_version; + FT_ULong src_offset = 0; + + FT_UInt glyf_index; + FT_UInt loca_index; + FT_UInt32 file_offset; + + FT_Byte* sfnt = NULL; + FT_Stream sfnt_stream = NULL; + FT_Byte* sfnt_header; + FT_ULong sfnt_size; + + FT_Byte* uncompressed_buf = NULL; + + static const FT_Frame_Field woff2_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WOFF2_HeaderRec + + FT_FRAME_START( 48 ), + FT_FRAME_ULONG ( signature ), + FT_FRAME_ULONG ( flavor ), + FT_FRAME_ULONG ( length ), + FT_FRAME_USHORT ( num_tables ), + FT_FRAME_SKIP_BYTES( 2 ), + FT_FRAME_ULONG ( totalSfntSize ), + FT_FRAME_ULONG ( totalCompressedSize ), + FT_FRAME_SKIP_BYTES( 2 * 2 ), + FT_FRAME_ULONG ( metaOffset ), + FT_FRAME_ULONG ( metaLength ), + FT_FRAME_ULONG ( metaOrigLength ), + FT_FRAME_ULONG ( privOffset ), + FT_FRAME_ULONG ( privLength ), + FT_FRAME_END + }; + + + FT_ASSERT( stream == face->root.stream ); + FT_ASSERT( FT_STREAM_POS() == 0 ); + + face_index = FT_ABS( *face_instance_index ) & 0xFFFF; + + /* Read WOFF2 Header. */ + if ( FT_STREAM_READ_FIELDS( woff2_header_fields, &woff2 ) ) + return error; + + FT_TRACE4(( "signature -> 0x%X\n", woff2.signature )); + FT_TRACE2(( "flavor -> 0x%08lx\n", woff2.flavor )); + FT_TRACE4(( "length -> %lu\n", woff2.length )); + FT_TRACE2(( "num_tables -> %hu\n", woff2.num_tables )); + FT_TRACE4(( "totalSfntSize -> %lu\n", woff2.totalSfntSize )); + FT_TRACE4(( "metaOffset -> %hu\n", woff2.metaOffset )); + FT_TRACE4(( "metaLength -> %hu\n", woff2.metaLength )); + FT_TRACE4(( "privOffset -> %hu\n", woff2.privOffset )); + FT_TRACE4(( "privLength -> %hu\n", woff2.privLength )); + + /* Make sure we don't recurse back here. */ + if ( woff2.flavor == TTAG_wOF2 ) + return FT_THROW( Invalid_Table ); + + /* Miscellaneous checks. */ + if ( woff2.length != stream->size || + woff2.num_tables == 0 || + 48 + woff2.num_tables * 20UL >= woff2.length || + ( woff2.metaOffset == 0 && ( woff2.metaLength != 0 || + woff2.metaOrigLength != 0 ) ) || + ( woff2.metaLength != 0 && woff2.metaOrigLength == 0 ) || + ( woff2.metaOffset >= woff2.length ) || + ( woff2.length - woff2.metaOffset < woff2.metaLength ) || + ( woff2.privOffset == 0 && woff2.privLength != 0 ) || + ( woff2.privOffset >= woff2.length ) || + ( woff2.length - woff2.privOffset < woff2.privLength ) ) + { + FT_ERROR(( "woff2_open_font: invalid WOFF2 header\n" )); + return FT_THROW( Invalid_Table ); + } + + FT_TRACE2(( "woff2_open_font: WOFF2 Header is valid.\n" )); + + woff2.ttc_fonts = NULL; + + /* Read table directory. */ + if ( FT_NEW_ARRAY( tables, woff2.num_tables ) || + FT_NEW_ARRAY( indices, woff2.num_tables ) ) + goto Exit; + + FT_TRACE2(( "\n" + " tag flags transform origLen transformLen\n" + " --------------------------------------------------\n" )); + + for ( nn = 0; nn < woff2.num_tables; nn++ ) + { + WOFF2_Table table = tables + nn; + + + if ( FT_READ_BYTE( table->FlagByte ) ) + goto Exit; + + if ( ( table->FlagByte & 0x3f ) == 0x3f ) + { + if ( FT_READ_ULONG( table->Tag ) ) + goto Exit; + } + else + { + table->Tag = woff2_known_tags( table->FlagByte & 0x3f ); + if ( !table->Tag ) + { + FT_ERROR(( "woff2_open_font: Unknown table tag." )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + } + + flags = 0; + xform_version = ( table->FlagByte >> 6 ) & 0x03; + + /* 0 means xform for glyph/loca, non-0 for others. */ + if ( table->Tag == TTAG_glyf || table->Tag == TTAG_loca ) + { + if ( xform_version == 0 ) + flags |= WOFF2_FLAGS_TRANSFORM; + } + else if ( xform_version != 0 ) + flags |= WOFF2_FLAGS_TRANSFORM; + + flags |= xform_version; + + if ( READ_BASE128( table->dst_length ) ) + goto Exit; + + table->TransformLength = table->dst_length; + + if ( ( flags & WOFF2_FLAGS_TRANSFORM ) != 0 ) + { + if ( READ_BASE128( table->TransformLength ) ) + goto Exit; + + if ( table->Tag == TTAG_loca && table->TransformLength ) + { + FT_ERROR(( "woff2_open_font: Invalid loca `transformLength'.\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + } + + if ( src_offset + table->TransformLength < src_offset ) + { + FT_ERROR(( "woff2_open_font: invalid WOFF2 table directory.\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + table->src_offset = src_offset; + table->src_length = table->TransformLength; + src_offset += table->TransformLength; + table->flags = flags; + + FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld\n", + (FT_Char)( table->Tag >> 24 ), + (FT_Char)( table->Tag >> 16 ), + (FT_Char)( table->Tag >> 8 ), + (FT_Char)( table->Tag ), + table->FlagByte & 0x3f, + ( table->FlagByte >> 6 ) & 0x03, + table->dst_length, + table->TransformLength, + table->src_length, + table->src_offset )); + + indices[nn] = table; + } + + /* End of last table is uncompressed size. */ + last_table = indices[woff2.num_tables - 1]; + + woff2.uncompressed_size = last_table->src_offset + + last_table->src_length; + if ( woff2.uncompressed_size < last_table->src_offset ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + FT_TRACE2(( "Table directory parsed.\n" )); + + /* Check for and read collection directory. */ + woff2.num_fonts = 1; + woff2.header_version = 0; + + if ( woff2.flavor == TTAG_ttcf ) + { + FT_TRACE2(( "Font is a TTC, reading collection directory.\n" )); + + if ( FT_READ_ULONG( woff2.header_version ) ) + goto Exit; + + if ( woff2.header_version != 0x00010000 && + woff2.header_version != 0x00020000 ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + if ( READ_255USHORT( woff2.num_fonts ) ) + goto Exit; + + if ( !woff2.num_fonts ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + FT_TRACE4(( "Number of fonts in TTC: %ld\n", woff2.num_fonts )); + + if ( FT_NEW_ARRAY( woff2.ttc_fonts, woff2.num_fonts ) ) + goto Exit; + + for ( nn = 0; nn < woff2.num_fonts; nn++ ) + { + WOFF2_TtcFont ttc_font = woff2.ttc_fonts + nn; + + + if ( READ_255USHORT( ttc_font->num_tables ) ) + goto Exit; + if ( FT_READ_ULONG( ttc_font->flavor ) ) + goto Exit; + + if ( FT_NEW_ARRAY( ttc_font->table_indices, ttc_font->num_tables ) ) + goto Exit; + + FT_TRACE5(( "Number of tables in font %d: %ld\n", + nn, ttc_font->num_tables )); + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( ttc_font->num_tables ) + FT_TRACE6(( " Indices: " )); +#endif + + glyf_index = 0; + loca_index = 0; + + for ( j = 0; j < ttc_font->num_tables; j++ ) + { + FT_UShort table_index; + WOFF2_Table table; + + + if ( READ_255USHORT( table_index ) ) + goto Exit; + + FT_TRACE6(( "%hu ", table_index )); + if ( table_index >= woff2.num_tables ) + { + FT_ERROR(( "woff2_open_font: invalid table index\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + ttc_font->table_indices[j] = table_index; + + table = indices[table_index]; + if ( table->Tag == TTAG_loca ) + loca_index = table_index; + if ( table->Tag == TTAG_glyf ) + glyf_index = table_index; + } + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( ttc_font->num_tables ) + FT_TRACE6(( "\n" )); +#endif + + /* glyf and loca must be consecutive */ + if ( glyf_index > 0 || loca_index > 0 ) + { + if ( glyf_index > loca_index || + loca_index - glyf_index != 1 ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + } + } + + /* Collection directory reading complete. */ + FT_TRACE2(( "WOFF2 collection directory is valid.\n" )); + } + else + woff2.ttc_fonts = NULL; + + woff2.compressed_offset = FT_STREAM_POS(); + file_offset = ROUND4( woff2.compressed_offset + + woff2.totalCompressedSize ); + + /* Some more checks before we start reading the tables. */ + if ( file_offset > woff2.length ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + if ( woff2.metaOffset ) + { + if ( file_offset != woff2.metaOffset ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + file_offset = ROUND4(woff2.metaOffset + woff2.metaLength); + } + + if ( woff2.privOffset ) + { + if ( file_offset != woff2.privOffset ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + file_offset = ROUND4(woff2.privOffset + woff2.privLength); + } + + if ( file_offset != ( ROUND4( woff2.length ) ) ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* Validate requested face index. */ + *num_faces = woff2.num_fonts; + /* value -(N+1) requests information on index N */ + if ( *face_instance_index < 0 ) + face_index--; + + if ( face_index >= woff2.num_fonts ) + { + if ( *face_instance_index >= 0 ) + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } + else + face_index = 0; + } + + /* Only retain tables of the requested face in a TTC. */ + if ( woff2.header_version ) + { + WOFF2_TtcFont ttc_font = woff2.ttc_fonts + face_index; + + + /* Create a temporary array. */ + if ( FT_NEW_ARRAY( temp_indices, + ttc_font->num_tables ) ) + goto Exit; + + FT_TRACE4(( "Storing tables for TTC face index %d.\n", face_index )); + for ( nn = 0; nn < ttc_font->num_tables; nn++ ) + temp_indices[nn] = indices[ttc_font->table_indices[nn]]; + + /* Resize array to required size. */ + if ( FT_RENEW_ARRAY( indices, + woff2.num_tables, + ttc_font->num_tables ) ) + goto Exit; + + for ( nn = 0; nn < ttc_font->num_tables; nn++ ) + indices[nn] = temp_indices[nn]; + + FT_FREE( temp_indices ); + + /* Change header values. */ + woff2.flavor = ttc_font->flavor; + woff2.num_tables = ttc_font->num_tables; + } + + /* We need to allocate this much at the minimum. */ + sfnt_size = 12 + woff2.num_tables * 16UL; + /* This is what we normally expect. */ + /* Initially trust `totalSfntSize' and change later as required. */ + if ( woff2.totalSfntSize > sfnt_size ) + { + /* However, adjust the value to something reasonable. */ + + /* Factor 64 is heuristic. */ + if ( ( woff2.totalSfntSize >> 6 ) > woff2.length ) + sfnt_size = woff2.length << 6; + else + sfnt_size = woff2.totalSfntSize; + + /* Value 1<<26 = 67108864 is heuristic. */ + if (sfnt_size >= (1 << 26)) + sfnt_size = 1 << 26; + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( sfnt_size != woff2.totalSfntSize ) + FT_TRACE4(( "adjusting estimate of uncompressed font size" + " to %lu bytes\n", + sfnt_size )); +#endif + } + + /* Write sfnt header. */ + if ( FT_ALLOC( sfnt, sfnt_size ) || + FT_NEW( sfnt_stream ) ) + goto Exit; + + sfnt_header = sfnt; + + WRITE_ULONG( sfnt_header, woff2.flavor ); + + if ( woff2.num_tables ) + { + FT_UInt searchRange, entrySelector, rangeShift, x; + + + x = woff2.num_tables; + entrySelector = 0; + while ( x ) + { + x >>= 1; + entrySelector += 1; + } + entrySelector--; + + searchRange = ( 1 << entrySelector ) * 16; + rangeShift = ( woff2.num_tables * 16 ) - searchRange; + + WRITE_USHORT( sfnt_header, woff2.num_tables ); + WRITE_USHORT( sfnt_header, searchRange ); + WRITE_USHORT( sfnt_header, entrySelector ); + WRITE_USHORT( sfnt_header, rangeShift ); + } + + info.header_checksum = compute_ULong_sum( sfnt, 12 ); + + /* Sort tables by tag. */ + ft_qsort( indices, + woff2.num_tables, + sizeof ( WOFF2_Table ), + compare_tags ); + + if ( woff2.uncompressed_size < 1 ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + if ( woff2.uncompressed_size > sfnt_size ) + { + FT_ERROR(( "woff2_open_font: SFNT table lengths are too large.\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* Allocate memory for uncompressed table data. */ + if ( FT_ALLOC( uncompressed_buf, woff2.uncompressed_size ) || + FT_FRAME_ENTER( woff2.totalCompressedSize ) ) + goto Exit; + + /* Uncompress the stream. */ + error = woff2_decompress( uncompressed_buf, + woff2.uncompressed_size, + stream->cursor, + woff2.totalCompressedSize ); + + FT_FRAME_EXIT(); + + if ( error ) + goto Exit; + + error = reconstruct_font( uncompressed_buf, + woff2.uncompressed_size, + indices, + &woff2, + &info, + &sfnt, + &sfnt_size, + memory ); + + if ( error ) + goto Exit; + + /* Resize `sfnt' to actual size of sfnt stream. */ + if ( woff2.actual_sfnt_size < sfnt_size ) + { + FT_TRACE5(( "Trimming sfnt stream from %lu to %lu.\n", + sfnt_size, woff2.actual_sfnt_size )); + if ( FT_REALLOC( sfnt, + (FT_ULong)( sfnt_size ), + (FT_ULong)( woff2.actual_sfnt_size ) ) ) + goto Exit; + } + + /* `reconstruct_font' has done all the work. */ + /* Swap out stream and return. */ + FT_Stream_OpenMemory( sfnt_stream, sfnt, woff2.actual_sfnt_size ); + sfnt_stream->memory = stream->memory; + sfnt_stream->close = stream_close; + + FT_Stream_Free( + face->root.stream, + ( face->root.face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 ); + + face->root.stream = sfnt_stream; + face->root.face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM; + + /* Set face_index to 0 or -1. */ + if ( *face_instance_index >= 0 ) + *face_instance_index = 0; + else + *face_instance_index = -1; + + FT_TRACE2(( "woff2_open_font: SFNT synthesized.\n" )); + + Exit: + FT_FREE( tables ); + FT_FREE( indices ); + FT_FREE( uncompressed_buf ); + FT_FREE( info.x_mins ); + + if ( woff2.ttc_fonts ) + { + WOFF2_TtcFont ttc_font = woff2.ttc_fonts; + + + for ( nn = 0; nn < woff2.num_fonts; nn++ ) + { + FT_FREE( ttc_font->table_indices ); + ttc_font++; + } + + FT_FREE( woff2.ttc_fonts ); + } + + if ( error ) + { + FT_FREE( sfnt ); + if ( sfnt_stream ) + { + FT_Stream_Close( sfnt_stream ); + FT_FREE( sfnt_stream ); + } + } + + return error; + } + + +#undef READ_255USHORT +#undef READ_BASE128 +#undef ROUND4 +#undef WRITE_USHORT +#undef WRITE_ULONG +#undef WRITE_SHORT +#undef WRITE_SFNT_BUF +#undef WRITE_SFNT_BUF_AT + +#undef N_CONTOUR_STREAM +#undef N_POINTS_STREAM +#undef FLAG_STREAM +#undef GLYPH_STREAM +#undef COMPOSITE_STREAM +#undef BBOX_STREAM +#undef INSTRUCTION_STREAM + + +/* END */ diff --git a/thirdparty/freetype/src/sfnt/sfwoff2.h b/thirdparty/freetype/src/sfnt/sfwoff2.h new file mode 100644 index 0000000000..7ae6e2c06d --- /dev/null +++ b/thirdparty/freetype/src/sfnt/sfwoff2.h @@ -0,0 +1,76 @@ +/**************************************************************************** + * + * sfwoff2.h + * + * WOFFF2 format management (specification). + * + * Copyright (C) 2019-2020 by + * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#ifndef SFWOFF2_H_ +#define SFWOFF2_H_ + + +#include <ft2build.h> +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_OBJECTS_H + + +FT_BEGIN_HEADER + + + /* Leave the first byte open to store `flag_byte'. */ +#define WOFF2_FLAGS_TRANSFORM 1 << 8 + +#define WOFF2_SFNT_HEADER_SIZE 12 +#define WOFF2_SFNT_ENTRY_SIZE 16 + + /* Suggested maximum size for output. */ +#define WOFF2_DEFAULT_MAX_SIZE 30 * 1024 * 1024 + + /* 98% of Google Fonts have no glyph above 5k bytes. */ +#define WOFF2_DEFAULT_GLYPH_BUF 5120 + + /* Composite glyph flags. */ + /* See `CompositeGlyph.java' in `sfntly' for full definitions. */ +#define FLAG_ARG_1_AND_2_ARE_WORDS 1 << 0 +#define FLAG_WE_HAVE_A_SCALE 1 << 3 +#define FLAG_MORE_COMPONENTS 1 << 5 +#define FLAG_WE_HAVE_AN_X_AND_Y_SCALE 1 << 6 +#define FLAG_WE_HAVE_A_TWO_BY_TWO 1 << 7 +#define FLAG_WE_HAVE_INSTRUCTIONS 1 << 8 + + /* Simple glyph flags */ +#define GLYF_ON_CURVE 1 << 0 +#define GLYF_X_SHORT 1 << 1 +#define GLYF_Y_SHORT 1 << 2 +#define GLYF_REPEAT 1 << 3 +#define GLYF_THIS_X_IS_SAME 1 << 4 +#define GLYF_THIS_Y_IS_SAME 1 << 5 + + /* Other constants */ +#define CONTOUR_OFFSET_END_POINT 10 + + + FT_LOCAL( FT_Error ) + woff2_open_font( FT_Stream stream, + TT_Face face, + FT_Int* face_index, + FT_Long* num_faces ); + + +FT_END_HEADER + +#endif /* SFWOFF2_H_ */ + + +/* END */ diff --git a/thirdparty/freetype/src/sfnt/ttbdf.c b/thirdparty/freetype/src/sfnt/ttbdf.c index 853599fc43..bc35284cc8 100644 --- a/thirdparty/freetype/src/sfnt/ttbdf.c +++ b/thirdparty/freetype/src/sfnt/ttbdf.c @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded BDF properties (body). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttbdf.h b/thirdparty/freetype/src/sfnt/ttbdf.h index e4164e61fc..c340f6631d 100644 --- a/thirdparty/freetype/src/sfnt/ttbdf.h +++ b/thirdparty/freetype/src/sfnt/ttbdf.h @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded BDF properties (specification). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttcmap.c b/thirdparty/freetype/src/sfnt/ttcmap.c index 683f3b1818..2c34efb5ce 100644 --- a/thirdparty/freetype/src/sfnt/ttcmap.c +++ b/thirdparty/freetype/src/sfnt/ttcmap.c @@ -4,7 +4,7 @@ * * TrueType character mapping table (cmap) support (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -3764,28 +3764,31 @@ FT_LOCAL_DEF( FT_Error ) tt_face_build_cmaps( TT_Face face ) { - FT_Byte* table = face->cmap_table; - FT_Byte* limit = table + face->cmap_size; + FT_Byte* const table = face->cmap_table; + FT_Byte* limit; FT_UInt volatile num_cmaps; - FT_Byte* volatile p = table; + FT_Byte* volatile p = table; FT_Library library = FT_FACE_LIBRARY( face ); FT_UNUSED( library ); - if ( !p || p + 4 > limit ) + if ( !p || face->cmap_size < 4 ) return FT_THROW( Invalid_Table ); - /* only recognize format 0 */ - if ( TT_NEXT_USHORT( p ) != 0 ) - { - FT_ERROR(( "tt_face_build_cmaps:" - " unsupported `cmap' table format = %d\n", - TT_PEEK_USHORT( p - 2 ) )); - return FT_THROW( Invalid_Table ); - } + /* Version 1.8.3 of the OpenType specification contains the following */ + /* (https://docs.microsoft.com/en-us/typography/opentype/spec/cmap): */ + /* */ + /* The 'cmap' table version number remains at 0x0000 for fonts that */ + /* make use of the newer subtable formats. */ + /* */ + /* This essentially means that a version format test is useless. */ + + /* ignore format */ + p += 2; num_cmaps = TT_NEXT_USHORT( p ); + limit = table + face->cmap_size; for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) { diff --git a/thirdparty/freetype/src/sfnt/ttcmap.h b/thirdparty/freetype/src/sfnt/ttcmap.h index 36801c939e..4bf49e2d49 100644 --- a/thirdparty/freetype/src/sfnt/ttcmap.h +++ b/thirdparty/freetype/src/sfnt/ttcmap.h @@ -4,7 +4,7 @@ * * TrueType character mapping table (cmap) support (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttcmapc.h b/thirdparty/freetype/src/sfnt/ttcmapc.h index ace9e69ca8..2e4ce5075b 100644 --- a/thirdparty/freetype/src/sfnt/ttcmapc.h +++ b/thirdparty/freetype/src/sfnt/ttcmapc.h @@ -4,7 +4,7 @@ * * TT CMAP classes definitions (specification only). * - * Copyright (C) 2009-2019 by + * Copyright (C) 2009-2020 by * Oran Agra and Mickey Gabel. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttcolr.c b/thirdparty/freetype/src/sfnt/ttcolr.c index 6b537d95b8..b37fa7b09a 100644 --- a/thirdparty/freetype/src/sfnt/ttcolr.c +++ b/thirdparty/freetype/src/sfnt/ttcolr.c @@ -4,7 +4,7 @@ * * TrueType and OpenType colored glyph layer support (body). * - * Copyright (C) 2018-2019 by + * Copyright (C) 2018-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang <shaozhang@fb.com>. diff --git a/thirdparty/freetype/src/sfnt/ttcolr.h b/thirdparty/freetype/src/sfnt/ttcolr.h index 817489a855..8da6b3aa14 100644 --- a/thirdparty/freetype/src/sfnt/ttcolr.h +++ b/thirdparty/freetype/src/sfnt/ttcolr.h @@ -4,7 +4,7 @@ * * TrueType and OpenType colored glyph layer support (specification). * - * Copyright (C) 2018-2019 by + * Copyright (C) 2018-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang <shaozhang@fb.com>. diff --git a/thirdparty/freetype/src/sfnt/ttcpal.c b/thirdparty/freetype/src/sfnt/ttcpal.c index 3482169a89..165423e305 100644 --- a/thirdparty/freetype/src/sfnt/ttcpal.c +++ b/thirdparty/freetype/src/sfnt/ttcpal.c @@ -4,7 +4,7 @@ * * TrueType and OpenType color palette support (body). * - * Copyright (C) 2018-2019 by + * Copyright (C) 2018-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang <shaozhang@fb.com>. diff --git a/thirdparty/freetype/src/sfnt/ttcpal.h b/thirdparty/freetype/src/sfnt/ttcpal.h index d1b244f3e3..f2e116ba2c 100644 --- a/thirdparty/freetype/src/sfnt/ttcpal.h +++ b/thirdparty/freetype/src/sfnt/ttcpal.h @@ -4,7 +4,7 @@ * * TrueType and OpenType color palette support (specification). * - * Copyright (C) 2018-2019 by + * Copyright (C) 2018-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang <shaozhang@fb.com>. diff --git a/thirdparty/freetype/src/sfnt/ttkern.c b/thirdparty/freetype/src/sfnt/ttkern.c index 8d1b781090..1d34acbd13 100644 --- a/thirdparty/freetype/src/sfnt/ttkern.c +++ b/thirdparty/freetype/src/sfnt/ttkern.c @@ -5,7 +5,7 @@ * Load the basic TrueType kerning table. This doesn't handle * kerning data within the GPOS table at the moment. * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttkern.h b/thirdparty/freetype/src/sfnt/ttkern.h index 5f283e5e62..6560a283a6 100644 --- a/thirdparty/freetype/src/sfnt/ttkern.h +++ b/thirdparty/freetype/src/sfnt/ttkern.h @@ -5,7 +5,7 @@ * Load the basic TrueType kerning table. This doesn't handle * kerning data within the GPOS table at the moment. * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttload.c b/thirdparty/freetype/src/sfnt/ttload.c index 5443bf4b69..d4e4ee4f10 100644 --- a/thirdparty/freetype/src/sfnt/ttload.c +++ b/thirdparty/freetype/src/sfnt/ttload.c @@ -5,7 +5,7 @@ * Load the basic TrueType tables, i.e., tables that can be either in * TTF or OTF fonts (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -397,7 +397,15 @@ } } else + { valid_entries = sfnt.num_tables; + if ( !valid_entries ) + { + FT_TRACE2(( "tt_face_load_font_dir: no valid tables found\n" )); + error = FT_THROW( Unknown_File_Format ); + goto Exit; + } + } face->num_tables = valid_entries; face->format_tag = sfnt.format_tag; @@ -916,7 +924,7 @@ /* load language tags */ { TT_LangTag entry = table->langTags; - TT_LangTag limit = entry + table->numLangTagRecords; + TT_LangTag limit = FT_OFFSET( entry, table->numLangTagRecords ); for ( ; entry < limit; entry++ ) diff --git a/thirdparty/freetype/src/sfnt/ttload.h b/thirdparty/freetype/src/sfnt/ttload.h index cc18c18694..49d40655f8 100644 --- a/thirdparty/freetype/src/sfnt/ttload.h +++ b/thirdparty/freetype/src/sfnt/ttload.h @@ -5,7 +5,7 @@ * Load the basic TrueType tables, i.e., tables that can be either in * TTF or OTF fonts (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttmtx.c b/thirdparty/freetype/src/sfnt/ttmtx.c index b6725c962f..e18ff877ef 100644 --- a/thirdparty/freetype/src/sfnt/ttmtx.c +++ b/thirdparty/freetype/src/sfnt/ttmtx.c @@ -4,7 +4,7 @@ * * Load the metrics tables common to TTF and OTF fonts (body). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttmtx.h b/thirdparty/freetype/src/sfnt/ttmtx.h index 5b0b60b641..c98c79ec51 100644 --- a/thirdparty/freetype/src/sfnt/ttmtx.h +++ b/thirdparty/freetype/src/sfnt/ttmtx.h @@ -4,7 +4,7 @@ * * Load the metrics tables common to TTF and OTF fonts (specification). * - * Copyright (C) 2006-2019 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttpost.c b/thirdparty/freetype/src/sfnt/ttpost.c index 636a0a004a..f7be716219 100644 --- a/thirdparty/freetype/src/sfnt/ttpost.c +++ b/thirdparty/freetype/src/sfnt/ttpost.c @@ -5,7 +5,7 @@ * PostScript name table processing for TrueType and OpenType fonts * (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttpost.h b/thirdparty/freetype/src/sfnt/ttpost.h index 812a0fc92d..547f2ff843 100644 --- a/thirdparty/freetype/src/sfnt/ttpost.h +++ b/thirdparty/freetype/src/sfnt/ttpost.h @@ -5,7 +5,7 @@ * PostScript name table processing for TrueType and OpenType fonts * (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/ttsbit.c b/thirdparty/freetype/src/sfnt/ttsbit.c index 23bd9d7eb0..3f8730f7fb 100644 --- a/thirdparty/freetype/src/sfnt/ttsbit.c +++ b/thirdparty/freetype/src/sfnt/ttsbit.c @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded bitmap support (body). * - * Copyright (C) 2005-2019 by + * Copyright (C) 2005-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Copyright 2013 by Google, Inc. diff --git a/thirdparty/freetype/src/sfnt/ttsbit.h b/thirdparty/freetype/src/sfnt/ttsbit.h index 5ab8ff5568..dfeb886838 100644 --- a/thirdparty/freetype/src/sfnt/ttsbit.h +++ b/thirdparty/freetype/src/sfnt/ttsbit.h @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded bitmap support (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/sfnt/woff2tags.c b/thirdparty/freetype/src/sfnt/woff2tags.c new file mode 100644 index 0000000000..246f7fa062 --- /dev/null +++ b/thirdparty/freetype/src/sfnt/woff2tags.c @@ -0,0 +1,110 @@ +/**************************************************************************** + * + * woff2tags.c + * + * WOFF2 Font table tags (base). + * + * Copyright (C) 2019-2020 by + * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#include <ft2build.h> +#include FT_TRUETYPE_TAGS_H + + + /* + * Return tag from index in the order given in WOFF2 specification. + * + * See + * + * https://www.w3.org/TR/WOFF2/#table_dir_format + * + * for details. + */ + FT_LOCAL_DEF( FT_ULong ) + woff2_known_tags( FT_Byte index ) + { + const FT_ULong known_tags[63] = + { + FT_MAKE_TAG('c', 'm', 'a', 'p'), /* 0 */ + FT_MAKE_TAG('h', 'e', 'a', 'd'), /* 1 */ + FT_MAKE_TAG('h', 'h', 'e', 'a'), /* 2 */ + FT_MAKE_TAG('h', 'm', 't', 'x'), /* 3 */ + FT_MAKE_TAG('m', 'a', 'x', 'p'), /* 4 */ + FT_MAKE_TAG('n', 'a', 'm', 'e'), /* 5 */ + FT_MAKE_TAG('O', 'S', '/', '2'), /* 6 */ + FT_MAKE_TAG('p', 'o', 's', 't'), /* 7 */ + FT_MAKE_TAG('c', 'v', 't', ' '), /* 8 */ + FT_MAKE_TAG('f', 'p', 'g', 'm'), /* 9 */ + FT_MAKE_TAG('g', 'l', 'y', 'f'), /* 10 */ + FT_MAKE_TAG('l', 'o', 'c', 'a'), /* 11 */ + FT_MAKE_TAG('p', 'r', 'e', 'p'), /* 12 */ + FT_MAKE_TAG('C', 'F', 'F', ' '), /* 13 */ + FT_MAKE_TAG('V', 'O', 'R', 'G'), /* 14 */ + FT_MAKE_TAG('E', 'B', 'D', 'T'), /* 15 */ + FT_MAKE_TAG('E', 'B', 'L', 'C'), /* 16 */ + FT_MAKE_TAG('g', 'a', 's', 'p'), /* 17 */ + FT_MAKE_TAG('h', 'd', 'm', 'x'), /* 18 */ + FT_MAKE_TAG('k', 'e', 'r', 'n'), /* 19 */ + FT_MAKE_TAG('L', 'T', 'S', 'H'), /* 20 */ + FT_MAKE_TAG('P', 'C', 'L', 'T'), /* 21 */ + FT_MAKE_TAG('V', 'D', 'M', 'X'), /* 22 */ + FT_MAKE_TAG('v', 'h', 'e', 'a'), /* 23 */ + FT_MAKE_TAG('v', 'm', 't', 'x'), /* 24 */ + FT_MAKE_TAG('B', 'A', 'S', 'E'), /* 25 */ + FT_MAKE_TAG('G', 'D', 'E', 'F'), /* 26 */ + FT_MAKE_TAG('G', 'P', 'O', 'S'), /* 27 */ + FT_MAKE_TAG('G', 'S', 'U', 'B'), /* 28 */ + FT_MAKE_TAG('E', 'B', 'S', 'C'), /* 29 */ + FT_MAKE_TAG('J', 'S', 'T', 'F'), /* 30 */ + FT_MAKE_TAG('M', 'A', 'T', 'H'), /* 31 */ + FT_MAKE_TAG('C', 'B', 'D', 'T'), /* 32 */ + FT_MAKE_TAG('C', 'B', 'L', 'C'), /* 33 */ + FT_MAKE_TAG('C', 'O', 'L', 'R'), /* 34 */ + FT_MAKE_TAG('C', 'P', 'A', 'L'), /* 35 */ + FT_MAKE_TAG('S', 'V', 'G', ' '), /* 36 */ + FT_MAKE_TAG('s', 'b', 'i', 'x'), /* 37 */ + FT_MAKE_TAG('a', 'c', 'n', 't'), /* 38 */ + FT_MAKE_TAG('a', 'v', 'a', 'r'), /* 39 */ + FT_MAKE_TAG('b', 'd', 'a', 't'), /* 40 */ + FT_MAKE_TAG('b', 'l', 'o', 'c'), /* 41 */ + FT_MAKE_TAG('b', 's', 'l', 'n'), /* 42 */ + FT_MAKE_TAG('c', 'v', 'a', 'r'), /* 43 */ + FT_MAKE_TAG('f', 'd', 's', 'c'), /* 44 */ + FT_MAKE_TAG('f', 'e', 'a', 't'), /* 45 */ + FT_MAKE_TAG('f', 'm', 't', 'x'), /* 46 */ + FT_MAKE_TAG('f', 'v', 'a', 'r'), /* 47 */ + FT_MAKE_TAG('g', 'v', 'a', 'r'), /* 48 */ + FT_MAKE_TAG('h', 's', 't', 'y'), /* 49 */ + FT_MAKE_TAG('j', 'u', 's', 't'), /* 50 */ + FT_MAKE_TAG('l', 'c', 'a', 'r'), /* 51 */ + FT_MAKE_TAG('m', 'o', 'r', 't'), /* 52 */ + FT_MAKE_TAG('m', 'o', 'r', 'x'), /* 53 */ + FT_MAKE_TAG('o', 'p', 'b', 'd'), /* 54 */ + FT_MAKE_TAG('p', 'r', 'o', 'p'), /* 55 */ + FT_MAKE_TAG('t', 'r', 'a', 'k'), /* 56 */ + FT_MAKE_TAG('Z', 'a', 'p', 'f'), /* 57 */ + FT_MAKE_TAG('S', 'i', 'l', 'f'), /* 58 */ + FT_MAKE_TAG('G', 'l', 'a', 't'), /* 59 */ + FT_MAKE_TAG('G', 'l', 'o', 'c'), /* 60 */ + FT_MAKE_TAG('F', 'e', 'a', 't'), /* 61 */ + FT_MAKE_TAG('S', 'i', 'l', 'l'), /* 62 */ + }; + + + if ( index > 62 ) + return 0; + + return known_tags[index]; + } + + +/* END */ diff --git a/thirdparty/freetype/src/sfnt/woff2tags.h b/thirdparty/freetype/src/sfnt/woff2tags.h new file mode 100644 index 0000000000..13d242e11d --- /dev/null +++ b/thirdparty/freetype/src/sfnt/woff2tags.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * + * woff2tags.h + * + * WOFFF2 Font table tags (specification). + * + * Copyright (C) 1996-2020 by + * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#ifndef WOFF2TAGS_H +#define WOFF2TAGS_H + + +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_ULong ) + woff2_known_tags( FT_Byte index ); + + +FT_END_HEADER + +#endif /* WOFF2TAGS_H */ + + +/* END */ diff --git a/thirdparty/freetype/src/smooth/ftgrays.c b/thirdparty/freetype/src/smooth/ftgrays.c index fd357a50fc..93538331af 100644 --- a/thirdparty/freetype/src/smooth/ftgrays.c +++ b/thirdparty/freetype/src/smooth/ftgrays.c @@ -4,7 +4,7 @@ * * A new `perfect' anti-aliasing renderer (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/smooth/ftgrays.h b/thirdparty/freetype/src/smooth/ftgrays.h index e9f9c7a4ad..e10fd039ac 100644 --- a/thirdparty/freetype/src/smooth/ftgrays.h +++ b/thirdparty/freetype/src/smooth/ftgrays.h @@ -4,7 +4,7 @@ * * FreeType smooth renderer declaration * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/smooth/ftsmerrs.h b/thirdparty/freetype/src/smooth/ftsmerrs.h index d52c0dd9e2..3f8567b0fa 100644 --- a/thirdparty/freetype/src/smooth/ftsmerrs.h +++ b/thirdparty/freetype/src/smooth/ftsmerrs.h @@ -4,7 +4,7 @@ * * smooth renderer error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/smooth/ftsmooth.c b/thirdparty/freetype/src/smooth/ftsmooth.c index cd034d2b40..072045cbc2 100644 --- a/thirdparty/freetype/src/smooth/ftsmooth.c +++ b/thirdparty/freetype/src/smooth/ftsmooth.c @@ -4,7 +4,7 @@ * * Anti-aliasing renderer interface (body). * - * Copyright (C) 2000-2019 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -155,6 +155,9 @@ goto Exit; } + if ( !bitmap->rows || !bitmap->pitch ) + goto Exit; + /* allocate new one */ if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) ) goto Exit; @@ -188,7 +191,7 @@ /* implode outline if needed */ { FT_Vector* points = outline->points; - FT_Vector* points_end = points + outline->n_points; + FT_Vector* points_end = FT_OFFSET( points, outline->n_points ); FT_Vector* vec; @@ -207,7 +210,7 @@ /* deflate outline if needed */ { FT_Vector* points = outline->points; - FT_Vector* points_end = points + outline->n_points; + FT_Vector* points_end = FT_OFFSET( points, outline->n_points ); FT_Vector* vec; diff --git a/thirdparty/freetype/src/smooth/ftsmooth.h b/thirdparty/freetype/src/smooth/ftsmooth.h index fbb21a31d0..ee5d2ff61d 100644 --- a/thirdparty/freetype/src/smooth/ftsmooth.h +++ b/thirdparty/freetype/src/smooth/ftsmooth.h @@ -4,7 +4,7 @@ * * Anti-aliasing renderer interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/smooth/module.mk b/thirdparty/freetype/src/smooth/module.mk index 44b76dfec6..ad8b47dab6 100644 --- a/thirdparty/freetype/src/smooth/module.mk +++ b/thirdparty/freetype/src/smooth/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/smooth/rules.mk b/thirdparty/freetype/src/smooth/rules.mk index 0153ac24a4..b08056fac5 100644 --- a/thirdparty/freetype/src/smooth/rules.mk +++ b/thirdparty/freetype/src/smooth/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/smooth/smooth.c b/thirdparty/freetype/src/smooth/smooth.c index 9c543d3360..6ad9424f01 100644 --- a/thirdparty/freetype/src/smooth/smooth.c +++ b/thirdparty/freetype/src/smooth/smooth.c @@ -4,7 +4,7 @@ * * FreeType anti-aliasing rasterer module component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/module.mk b/thirdparty/freetype/src/truetype/module.mk index 8a841cc956..2d8d39d1f7 100644 --- a/thirdparty/freetype/src/truetype/module.mk +++ b/thirdparty/freetype/src/truetype/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/truetype/rules.mk b/thirdparty/freetype/src/truetype/rules.mk index df8dcd4a4e..2f6fecfc44 100644 --- a/thirdparty/freetype/src/truetype/rules.mk +++ b/thirdparty/freetype/src/truetype/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/truetype/truetype.c b/thirdparty/freetype/src/truetype/truetype.c index 84928e7321..1f15b29bb2 100644 --- a/thirdparty/freetype/src/truetype/truetype.c +++ b/thirdparty/freetype/src/truetype/truetype.c @@ -4,7 +4,7 @@ * * FreeType TrueType driver component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttdriver.c b/thirdparty/freetype/src/truetype/ttdriver.c index ff626d53ab..90fab46e28 100644 --- a/thirdparty/freetype/src/truetype/ttdriver.c +++ b/thirdparty/freetype/src/truetype/ttdriver.c @@ -4,7 +4,7 @@ * * TrueType font driver implementation (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttdriver.h b/thirdparty/freetype/src/truetype/ttdriver.h index 3936c6a4de..d1cfa47c8b 100644 --- a/thirdparty/freetype/src/truetype/ttdriver.h +++ b/thirdparty/freetype/src/truetype/ttdriver.h @@ -4,7 +4,7 @@ * * High-level TrueType driver interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/tterrors.h b/thirdparty/freetype/src/truetype/tterrors.h index 5609d28d68..71d66023cd 100644 --- a/thirdparty/freetype/src/truetype/tterrors.h +++ b/thirdparty/freetype/src/truetype/tterrors.h @@ -4,7 +4,7 @@ * * TrueType error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttgload.c b/thirdparty/freetype/src/truetype/ttgload.c index a04684086b..2a1742839a 100644 --- a/thirdparty/freetype/src/truetype/ttgload.c +++ b/thirdparty/freetype/src/truetype/ttgload.c @@ -4,7 +4,7 @@ * * TrueType Glyph Loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -1102,9 +1102,16 @@ } #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - /* if we have a HVAR table, `pp1' and/or `pp2' are already adjusted */ - if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) || - !IS_HINTED( loader->load_flags ) ) + /* if we have a HVAR table, `pp1' and/or `pp2' */ + /* are already adjusted but unscaled */ + if ( ( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) && + IS_HINTED( loader->load_flags ) ) + { + loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale ); + loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale ); + /* pp1.y and pp2.y are always zero */ + } + else #endif { loader->pp1 = outline->points[n_points - 4]; @@ -1112,9 +1119,17 @@ } #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - /* if we have a VVAR table, `pp3' and/or `pp4' are already adjusted */ - if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) || - !IS_HINTED( loader->load_flags ) ) + /* if we have a VVAR table, `pp3' and/or `pp4' */ + /* are already adjusted but unscaled */ + if ( ( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) && + IS_HINTED( loader->load_flags ) ) + { + loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale ); + loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale ); + loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale ); + loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale ); + } + else #endif { loader->pp3 = outline->points[n_points - 2]; @@ -2287,13 +2302,14 @@ if ( face->vertical_info && face->vertical.number_Of_VMetrics > 0 ) { - top = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax, + top = (FT_Short)FT_DivFix( SUB_LONG( loader->pp3.y, bbox.yMax ), y_scale ); if ( loader->pp3.y <= loader->pp4.y ) advance = 0; else - advance = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y, + advance = (FT_UShort)FT_DivFix( SUB_LONG( loader->pp3.y, + loader->pp4.y ), y_scale ); } else diff --git a/thirdparty/freetype/src/truetype/ttgload.h b/thirdparty/freetype/src/truetype/ttgload.h index f1324bc862..9a8c3e71dd 100644 --- a/thirdparty/freetype/src/truetype/ttgload.h +++ b/thirdparty/freetype/src/truetype/ttgload.h @@ -4,7 +4,7 @@ * * TrueType Glyph Loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttgxvar.c b/thirdparty/freetype/src/truetype/ttgxvar.c index 78d87dc097..110f24a116 100644 --- a/thirdparty/freetype/src/truetype/ttgxvar.c +++ b/thirdparty/freetype/src/truetype/ttgxvar.c @@ -4,7 +4,7 @@ * * TrueType GX Font Variation loader * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. * * This file is part of the FreeType project, and may only be used, @@ -1470,6 +1470,7 @@ FT_ULong table_len; FT_ULong gvar_start; FT_ULong offsetToData; + FT_ULong offsets_len; GX_GVar_Head gvar_head; static const FT_Frame_Field gvar_fields[] = @@ -1530,9 +1531,13 @@ goto Exit; } - /* rough sanity check: offsets can be either 2 or 4 bytes */ - if ( (FT_ULong)gvar_head.glyphCount * - ( ( gvar_head.flags & 1 ) ? 4 : 2 ) > table_len ) + /* offsets can be either 2 or 4 bytes */ + /* (one more offset than glyphs, to mark size of last) */ + offsets_len = ( gvar_head.glyphCount + 1 ) * + ( ( gvar_head.flags & 1 ) ? 4L : 2L ); + + /* rough sanity check */ + if (offsets_len > table_len ) { FT_TRACE1(( "ft_var_load_gvar: invalid number of glyphs\n" )); error = FT_THROW( Invalid_Table ); @@ -1541,81 +1546,102 @@ FT_TRACE2(( "loaded\n" )); - blend->gvar_size = table_len; - blend->tuplecount = gvar_head.globalCoordCount; - blend->gv_glyphcnt = gvar_head.glyphCount; - offsetToData = gvar_start + gvar_head.offsetToData; + blend->gvar_size = table_len; + offsetToData = gvar_start + gvar_head.offsetToData; FT_TRACE5(( "gvar: there %s %d shared coordinate%s:\n", - blend->tuplecount == 1 ? "is" : "are", - blend->tuplecount, - blend->tuplecount == 1 ? "" : "s" )); + gvar_head.globalCoordCount == 1 ? "is" : "are", + gvar_head.globalCoordCount, + gvar_head.globalCoordCount == 1 ? "" : "s" )); - if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) ) + if ( FT_FRAME_ENTER( offsets_len ) ) goto Exit; + /* offsets (one more offset than glyphs, to mark size of last) */ + if ( FT_NEW_ARRAY( blend->glyphoffsets, gvar_head.glyphCount + 1 ) ) + goto Fail2; + if ( gvar_head.flags & 1 ) { - FT_ULong limit = gvar_start + table_len; - + FT_ULong limit = gvar_start + table_len; + FT_ULong max_offset = 0; - /* long offsets (one more offset than glyphs, to mark size of last) */ - if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 4L ) ) - goto Exit; - for ( i = 0; i <= blend->gv_glyphcnt; i++ ) + for ( i = 0; i <= gvar_head.glyphCount; i++ ) { blend->glyphoffsets[i] = offsetToData + FT_GET_ULONG(); - /* use `>', not `>=' */ - if ( blend->glyphoffsets[i] > limit ) + + if ( max_offset <= blend->glyphoffsets[i] ) + max_offset = blend->glyphoffsets[i]; + else { FT_TRACE2(( "ft_var_load_gvar:" - " invalid glyph variation data offset for index %d\n", + " glyph variation data offset %d not monotonic\n", i )); - error = FT_THROW( Invalid_Table ); - break; + blend->glyphoffsets[i] = max_offset; + } + + /* use `<', not `<=' */ + if ( limit < blend->glyphoffsets[i] ) + { + FT_TRACE2(( "ft_var_load_gvar:" + " glyph variation data offset %d out of range\n", + i )); + blend->glyphoffsets[i] = limit; } } } else { - FT_ULong limit = gvar_start + table_len; - + FT_ULong limit = gvar_start + table_len; + FT_ULong max_offset = 0; - /* short offsets (one more offset than glyphs, to mark size of last) */ - if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 2L ) ) - goto Exit; - for ( i = 0; i <= blend->gv_glyphcnt; i++ ) + for ( i = 0; i <= gvar_head.glyphCount; i++ ) { blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2; - /* use `>', not `>=' */ - if ( blend->glyphoffsets[i] > limit ) + + if ( max_offset <= blend->glyphoffsets[i] ) + max_offset = blend->glyphoffsets[i]; + else { FT_TRACE2(( "ft_var_load_gvar:" - " invalid glyph variation data offset for index %d\n", + " glyph variation data offset %d not monotonic\n", i )); - error = FT_THROW( Invalid_Table ); - break; + blend->glyphoffsets[i] = max_offset; + } + + /* use `<', not `<=' */ + if ( limit < blend->glyphoffsets[i] ) + { + FT_TRACE2(( "ft_var_load_gvar:" + " glyph variation data offset %d out of range\n", + i )); + blend->glyphoffsets[i] = limit; } } } + blend->gv_glyphcnt = gvar_head.glyphCount; + FT_FRAME_EXIT(); - if ( error ) - goto Exit; - if ( blend->tuplecount != 0 ) + if ( gvar_head.globalCoordCount != 0 ) { - if ( FT_NEW_ARRAY( blend->tuplecoords, - gvar_head.axisCount * blend->tuplecount ) ) - goto Exit; + if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord ) || + FT_FRAME_ENTER( gvar_head.globalCoordCount * + gvar_head.axisCount * 2L ) ) + { + FT_TRACE2(( "ft_var_load_gvar:" + " glyph variation shared tuples missing\n" )); + goto Fail; + } - if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord ) || - FT_FRAME_ENTER( blend->tuplecount * gvar_head.axisCount * 2L ) ) - goto Exit; + if ( FT_NEW_ARRAY( blend->tuplecoords, + gvar_head.axisCount * gvar_head.globalCoordCount ) ) + goto Fail2; - for ( i = 0; i < blend->tuplecount; i++ ) + for ( i = 0; i < gvar_head.globalCoordCount; i++ ) { FT_TRACE5(( " [ " )); for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ ) @@ -1628,6 +1654,8 @@ FT_TRACE5(( "]\n" )); } + blend->tuplecount = gvar_head.globalCoordCount; + FT_TRACE5(( "\n" )); FT_FRAME_EXIT(); @@ -1635,6 +1663,14 @@ Exit: return error; + + Fail2: + FT_FRAME_EXIT(); + + Fail: + FT_FREE( blend->glyphoffsets ); + blend->gv_glyphcnt = 0; + goto Exit; } @@ -2127,7 +2163,7 @@ /* `fvar' table validity check in `sfnt_init_face' */ /* the various `*_size' variables, which we also use as */ - /* offsets into the `mmlen' array, must be multiples of the */ + /* offsets into the `mmvar' array, must be multiples of the */ /* pointer size (except the last one); without such an */ /* alignment there might be runtime errors due to */ /* misaligned addresses */ @@ -3037,7 +3073,7 @@ TT_Set_Named_Instance( TT_Face face, FT_UInt instance_index ) { - FT_Error error = FT_ERR( Invalid_Argument ); + FT_Error error; GX_Blend blend; FT_MM_Var* mmvar; @@ -3057,7 +3093,10 @@ /* `instance_index' starts with value 1, thus `>' */ if ( instance_index > num_instances ) + { + error = FT_ERR( Invalid_Argument ); goto Exit; + } if ( instance_index > 0 ) { @@ -3766,7 +3805,7 @@ blend->glyphoffsets[glyph_index + 1] ) { FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" - " no variation data for this glyph\n" )); + " no variation data for glyph %d\n", glyph_index )); return FT_Err_Ok; } diff --git a/thirdparty/freetype/src/truetype/ttgxvar.h b/thirdparty/freetype/src/truetype/ttgxvar.h index 07c99b6403..11664e997a 100644 --- a/thirdparty/freetype/src/truetype/ttgxvar.h +++ b/thirdparty/freetype/src/truetype/ttgxvar.h @@ -4,7 +4,7 @@ * * TrueType GX Font Variation loader (specification) * - * Copyright (C) 2004-2019 by + * Copyright (C) 2004-2020 by * David Turner, Robert Wilhelm, Werner Lemberg and George Williams. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttinterp.c b/thirdparty/freetype/src/truetype/ttinterp.c index 70434e1729..3215040970 100644 --- a/thirdparty/freetype/src/truetype/ttinterp.c +++ b/thirdparty/freetype/src/truetype/ttinterp.c @@ -4,7 +4,7 @@ * * TrueType bytecode interpreter (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -3718,7 +3718,7 @@ /* We will then parse the current table. */ rec = exc->FDefs; - limit = rec + exc->numFDefs; + limit = FT_OFFSET( rec, exc->numFDefs ); n = (FT_ULong)args[0]; for ( ; rec < limit; rec++ ) @@ -3965,6 +3965,9 @@ if ( BOUNDSL( F, exc->maxFunc + 1 ) ) goto Fail; + if ( !exc->FDefs ) + goto Fail; + /* Except for some old Apple fonts, all functions in a TrueType */ /* font are defined in increasing order, starting from 0. This */ /* means that we normally have */ @@ -4062,7 +4065,7 @@ /* */ /* If this isn't true, we need to look up the function table. */ - def = exc->FDefs + F; + def = FT_OFFSET( exc->FDefs, F ); if ( exc->maxFunc + 1 != exc->numFDefs || def->opc != F ) { /* look up the FDefs table */ @@ -4070,7 +4073,7 @@ def = exc->FDefs; - limit = def + exc->numFDefs; + limit = FT_OFFSET( def, exc->numFDefs ); while ( def < limit && def->opc != F ) def++; @@ -4150,7 +4153,7 @@ /* First of all, look for the same function in our table */ def = exc->IDefs; - limit = def + exc->numIDefs; + limit = FT_OFFSET( def, exc->numIDefs ); for ( ; def < limit; def++ ) if ( def->opc == (FT_ULong)args[0] ) @@ -6346,12 +6349,14 @@ /* twilight points (confirmed by Greg Hitchcock) */ if ( exc->GS.gep1 == 0 ) { - exc->zp1.org[point].x = exc->zp0.org[exc->GS.rp0].x + - TT_MulFix14( cvt_dist, - exc->GS.freeVector.x ); - exc->zp1.org[point].y = exc->zp0.org[exc->GS.rp0].y + - TT_MulFix14( cvt_dist, - exc->GS.freeVector.y ); + exc->zp1.org[point].x = ADD_LONG( + exc->zp0.org[exc->GS.rp0].x, + TT_MulFix14( cvt_dist, + exc->GS.freeVector.x ) ); + exc->zp1.org[point].y = ADD_LONG( + exc->zp0.org[exc->GS.rp0].y, + TT_MulFix14( cvt_dist, + exc->GS.freeVector.y ) ); exc->zp1.cur[point] = exc->zp1.org[point]; } @@ -7715,7 +7720,7 @@ Ins_UNKNOWN( TT_ExecContext exc ) { TT_DefRecord* def = exc->IDefs; - TT_DefRecord* limit = def + exc->numIDefs; + TT_DefRecord* limit = FT_OFFSET( def, exc->numIDefs ); for ( ; def < limit; def++ ) @@ -7867,7 +7872,7 @@ FT_MAX( 50, exc->cvtSize / 10 ); else - exc->loopcall_counter_max = 300 + 8 * exc->cvtSize; + exc->loopcall_counter_max = 300 + 22 * exc->cvtSize; /* as a protection against an unreasonable number of CVT entries */ /* we assume at most 100 control values per glyph for the counter */ @@ -8567,7 +8572,7 @@ case FT_ERR( Invalid_Opcode ): { TT_DefRecord* def = exc->IDefs; - TT_DefRecord* limit = def + exc->numIDefs; + TT_DefRecord* limit = FT_OFFSET( def, exc->numIDefs ); for ( ; def < limit; def++ ) diff --git a/thirdparty/freetype/src/truetype/ttinterp.h b/thirdparty/freetype/src/truetype/ttinterp.h index 0cb1e892fb..07e4ad6891 100644 --- a/thirdparty/freetype/src/truetype/ttinterp.h +++ b/thirdparty/freetype/src/truetype/ttinterp.h @@ -4,7 +4,7 @@ * * TrueType bytecode interpreter (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttobjs.c b/thirdparty/freetype/src/truetype/ttobjs.c index e4775a51ed..730a5b8cdf 100644 --- a/thirdparty/freetype/src/truetype/ttobjs.c +++ b/thirdparty/freetype/src/truetype/ttobjs.c @@ -4,7 +4,7 @@ * * Objects manager (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttobjs.h b/thirdparty/freetype/src/truetype/ttobjs.h index 9fc654d5d1..7c3fc7ef8a 100644 --- a/thirdparty/freetype/src/truetype/ttobjs.h +++ b/thirdparty/freetype/src/truetype/ttobjs.h @@ -4,7 +4,7 @@ * * Objects manager (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttpload.c b/thirdparty/freetype/src/truetype/ttpload.c index bc954c2dba..d35393a8b0 100644 --- a/thirdparty/freetype/src/truetype/ttpload.c +++ b/thirdparty/freetype/src/truetype/ttpload.c @@ -4,7 +4,7 @@ * * TrueType-specific tables loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -633,7 +633,7 @@ FT_UInt nn; FT_Byte* result = NULL; FT_ULong record_size = face->hdmx_record_size; - FT_Byte* record = face->hdmx_table + 8; + FT_Byte* record = FT_OFFSET( face->hdmx_table, 8 ); for ( nn = 0; nn < face->hdmx_record_count; nn++ ) diff --git a/thirdparty/freetype/src/truetype/ttpload.h b/thirdparty/freetype/src/truetype/ttpload.h index 022750e324..3bbd4add19 100644 --- a/thirdparty/freetype/src/truetype/ttpload.h +++ b/thirdparty/freetype/src/truetype/ttpload.h @@ -4,7 +4,7 @@ * * TrueType-specific tables loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttsubpix.c b/thirdparty/freetype/src/truetype/ttsubpix.c index 23a2e5b440..8289818863 100644 --- a/thirdparty/freetype/src/truetype/ttsubpix.c +++ b/thirdparty/freetype/src/truetype/ttsubpix.c @@ -4,7 +4,7 @@ * * TrueType Subpixel Hinting. * - * Copyright (C) 2010-2019 by + * Copyright (C) 2010-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/truetype/ttsubpix.h b/thirdparty/freetype/src/truetype/ttsubpix.h index 4966800c2d..23adf7e8d8 100644 --- a/thirdparty/freetype/src/truetype/ttsubpix.h +++ b/thirdparty/freetype/src/truetype/ttsubpix.h @@ -4,7 +4,7 @@ * * TrueType Subpixel Hinting. * - * Copyright (C) 2010-2019 by + * Copyright (C) 2010-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/module.mk b/thirdparty/freetype/src/type1/module.mk index 2f48c65821..cffb774b45 100644 --- a/thirdparty/freetype/src/type1/module.mk +++ b/thirdparty/freetype/src/type1/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/type1/rules.mk b/thirdparty/freetype/src/type1/rules.mk index 901169c7a5..213e619247 100644 --- a/thirdparty/freetype/src/type1/rules.mk +++ b/thirdparty/freetype/src/type1/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/type1/t1afm.c b/thirdparty/freetype/src/type1/t1afm.c index 6841184539..0866e7bf97 100644 --- a/thirdparty/freetype/src/type1/t1afm.c +++ b/thirdparty/freetype/src/type1/t1afm.c @@ -4,7 +4,7 @@ * * AFM support for Type 1 fonts (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1afm.h b/thirdparty/freetype/src/type1/t1afm.h index a8e6a5495a..40ce8f9754 100644 --- a/thirdparty/freetype/src/type1/t1afm.h +++ b/thirdparty/freetype/src/type1/t1afm.h @@ -4,7 +4,7 @@ * * AFM support for Type 1 fonts (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1driver.c b/thirdparty/freetype/src/type1/t1driver.c index 557733da3b..75a5698e8d 100644 --- a/thirdparty/freetype/src/type1/t1driver.c +++ b/thirdparty/freetype/src/type1/t1driver.c @@ -4,7 +4,7 @@ * * Type 1 driver interface (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1driver.h b/thirdparty/freetype/src/type1/t1driver.h index 206f64a0bc..84b3e041c4 100644 --- a/thirdparty/freetype/src/type1/t1driver.h +++ b/thirdparty/freetype/src/type1/t1driver.h @@ -4,7 +4,7 @@ * * High-level Type 1 driver interface (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1errors.h b/thirdparty/freetype/src/type1/t1errors.h index b35f67a24c..1b119b843a 100644 --- a/thirdparty/freetype/src/type1/t1errors.h +++ b/thirdparty/freetype/src/type1/t1errors.h @@ -4,7 +4,7 @@ * * Type 1 error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1gload.c b/thirdparty/freetype/src/type1/t1gload.c index f9b115b186..fcaf66c401 100644 --- a/thirdparty/freetype/src/type1/t1gload.c +++ b/thirdparty/freetype/src/type1/t1gload.c @@ -4,7 +4,7 @@ * * Type 1 Glyph Loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1gload.h b/thirdparty/freetype/src/type1/t1gload.h index 80440369dc..59fae82b6d 100644 --- a/thirdparty/freetype/src/type1/t1gload.h +++ b/thirdparty/freetype/src/type1/t1gload.h @@ -4,7 +4,7 @@ * * Type 1 Glyph Loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1load.c b/thirdparty/freetype/src/type1/t1load.c index 5cffdfaac4..d0ea36badb 100644 --- a/thirdparty/freetype/src/type1/t1load.c +++ b/thirdparty/freetype/src/type1/t1load.c @@ -4,7 +4,7 @@ * * Type 1 font loader (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -309,31 +309,55 @@ FT_UInt i; FT_Fixed axiscoords[T1_MAX_MM_AXIS]; PS_Blend blend = face->blend; + FT_UShort* axis_flags; + + FT_Offset mmvar_size; + FT_Offset axis_flags_size; + FT_Offset axis_size; error = T1_Get_Multi_Master( face, &mmaster ); if ( error ) goto Exit; - if ( FT_ALLOC( mmvar, - sizeof ( FT_MM_Var ) + - mmaster.num_axis * sizeof ( FT_Var_Axis ) ) ) + + /* the various `*_size' variables, which we also use as */ + /* offsets into the `mmvar' array, must be multiples of the */ + /* pointer size (except the last one); without such an */ + /* alignment there might be runtime errors due to */ + /* misaligned addresses */ +#undef ALIGN_SIZE +#define ALIGN_SIZE( n ) \ + ( ( (n) + sizeof (void*) - 1 ) & ~( sizeof (void*) - 1 ) ) + + mmvar_size = ALIGN_SIZE( sizeof ( FT_MM_Var ) ); + axis_flags_size = ALIGN_SIZE( mmaster.num_axis * + sizeof ( FT_UShort ) ); + axis_size = mmaster.num_axis * sizeof ( FT_Var_Axis ); + + if ( FT_ALLOC( mmvar, mmvar_size + + axis_flags_size + + axis_size ) ) goto Exit; mmvar->num_axis = mmaster.num_axis; mmvar->num_designs = mmaster.num_designs; mmvar->num_namedstyles = 0; /* Not supported */ - mmvar->axis = (FT_Var_Axis*)&mmvar[1]; - /* Point to axes after MM_Var struct */ - mmvar->namedstyle = NULL; + + /* while axis flags are meaningless here, we have to provide the array */ + /* to make `FT_Get_Var_Axis_Flags' work: the function expects that the */ + /* values directly follow the data of `FT_MM_Var' */ + axis_flags = (FT_UShort*)( (char*)mmvar + mmvar_size ); + for ( i = 0; i < mmaster.num_axis; i++ ) + axis_flags[i] = 0; + + mmvar->axis = (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size ); + mmvar->namedstyle = NULL; for ( i = 0; i < mmaster.num_axis; i++ ) { mmvar->axis[i].name = mmaster.axis[i].name; mmvar->axis[i].minimum = INT_TO_FIXED( mmaster.axis[i].minimum ); mmvar->axis[i].maximum = INT_TO_FIXED( mmaster.axis[i].maximum ); - mmvar->axis[i].def = ( mmvar->axis[i].minimum + - mmvar->axis[i].maximum ) / 2; - /* Does not apply. But this value is in range */ mmvar->axis[i].strid = ~0U; /* Does not apply */ mmvar->axis[i].tag = ~0U; /* Does not apply */ diff --git a/thirdparty/freetype/src/type1/t1load.h b/thirdparty/freetype/src/type1/t1load.h index 44f835bde2..9cac0f6fb6 100644 --- a/thirdparty/freetype/src/type1/t1load.h +++ b/thirdparty/freetype/src/type1/t1load.h @@ -4,7 +4,7 @@ * * Type 1 font loader (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1objs.c b/thirdparty/freetype/src/type1/t1objs.c index 741388a645..80ee0e265e 100644 --- a/thirdparty/freetype/src/type1/t1objs.c +++ b/thirdparty/freetype/src/type1/t1objs.c @@ -4,7 +4,7 @@ * * Type 1 objects manager (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1objs.h b/thirdparty/freetype/src/type1/t1objs.h index 2161091f77..6bc902cc89 100644 --- a/thirdparty/freetype/src/type1/t1objs.h +++ b/thirdparty/freetype/src/type1/t1objs.h @@ -4,7 +4,7 @@ * * Type 1 objects manager (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1parse.c b/thirdparty/freetype/src/type1/t1parse.c index 56caeb9e40..ec30355bf8 100644 --- a/thirdparty/freetype/src/type1/t1parse.c +++ b/thirdparty/freetype/src/type1/t1parse.c @@ -4,7 +4,7 @@ * * Type 1 parser (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1parse.h b/thirdparty/freetype/src/type1/t1parse.h index dab8fddc8b..edf79b0a8b 100644 --- a/thirdparty/freetype/src/type1/t1parse.h +++ b/thirdparty/freetype/src/type1/t1parse.h @@ -4,7 +4,7 @@ * * Type 1 parser (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/t1tokens.h b/thirdparty/freetype/src/type1/t1tokens.h index 97f2dbe0cf..c09420355d 100644 --- a/thirdparty/freetype/src/type1/t1tokens.h +++ b/thirdparty/freetype/src/type1/t1tokens.h @@ -4,7 +4,7 @@ * * Type 1 tokenizer (specification). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type1/type1.c b/thirdparty/freetype/src/type1/type1.c index ce8557a5fb..95dbaeb501 100644 --- a/thirdparty/freetype/src/type1/type1.c +++ b/thirdparty/freetype/src/type1/type1.c @@ -4,7 +4,7 @@ * * FreeType Type 1 driver component (body only). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/module.mk b/thirdparty/freetype/src/type42/module.mk index 9e9d15455b..6ef3a95ead 100644 --- a/thirdparty/freetype/src/type42/module.mk +++ b/thirdparty/freetype/src/type42/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2002-2019 by +# Copyright (C) 2002-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/type42/rules.mk b/thirdparty/freetype/src/type42/rules.mk index 9d71f5300e..f4ce91a3b7 100644 --- a/thirdparty/freetype/src/type42/rules.mk +++ b/thirdparty/freetype/src/type42/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 2002-2019 by +# Copyright (C) 2002-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/type42/t42drivr.c b/thirdparty/freetype/src/type42/t42drivr.c index 09ad632e97..4b2cab3474 100644 --- a/thirdparty/freetype/src/type42/t42drivr.c +++ b/thirdparty/freetype/src/type42/t42drivr.c @@ -4,7 +4,7 @@ * * High-level Type 42 driver interface (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/t42drivr.h b/thirdparty/freetype/src/type42/t42drivr.h index a35ca28f84..7e7ec70f9d 100644 --- a/thirdparty/freetype/src/type42/t42drivr.h +++ b/thirdparty/freetype/src/type42/t42drivr.h @@ -4,7 +4,7 @@ * * High-level Type 42 driver interface (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/t42error.h b/thirdparty/freetype/src/type42/t42error.h index 5fb2143949..6d3617e927 100644 --- a/thirdparty/freetype/src/type42/t42error.h +++ b/thirdparty/freetype/src/type42/t42error.h @@ -4,7 +4,7 @@ * * Type 42 error codes (specification only). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/t42objs.c b/thirdparty/freetype/src/type42/t42objs.c index d31bace451..8d1e63ffc7 100644 --- a/thirdparty/freetype/src/type42/t42objs.c +++ b/thirdparty/freetype/src/type42/t42objs.c @@ -4,7 +4,7 @@ * * Type 42 objects manager (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/t42objs.h b/thirdparty/freetype/src/type42/t42objs.h index 98300cf348..ecb495e8f0 100644 --- a/thirdparty/freetype/src/type42/t42objs.h +++ b/thirdparty/freetype/src/type42/t42objs.h @@ -4,7 +4,7 @@ * * Type 42 objects manager (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/t42parse.c b/thirdparty/freetype/src/type42/t42parse.c index c47a77786d..7f26d04170 100644 --- a/thirdparty/freetype/src/type42/t42parse.c +++ b/thirdparty/freetype/src/type42/t42parse.c @@ -4,7 +4,7 @@ * * Type 42 font parser (body). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/t42parse.h b/thirdparty/freetype/src/type42/t42parse.h index 0c7bb48496..de54a46cf1 100644 --- a/thirdparty/freetype/src/type42/t42parse.h +++ b/thirdparty/freetype/src/type42/t42parse.h @@ -4,7 +4,7 @@ * * Type 42 font parser (specification). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/t42types.h b/thirdparty/freetype/src/type42/t42types.h index a258144ec3..f66f09db87 100644 --- a/thirdparty/freetype/src/type42/t42types.h +++ b/thirdparty/freetype/src/type42/t42types.h @@ -4,7 +4,7 @@ * * Type 42 font data types (specification only). * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/type42/type42.c b/thirdparty/freetype/src/type42/type42.c index 0cb7b77eec..4739b3c333 100644 --- a/thirdparty/freetype/src/type42/type42.c +++ b/thirdparty/freetype/src/type42/type42.c @@ -4,7 +4,7 @@ * * FreeType Type 42 driver component. * - * Copyright (C) 2002-2019 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/winfonts/fnterrs.h b/thirdparty/freetype/src/winfonts/fnterrs.h index af29307c75..f98e68435b 100644 --- a/thirdparty/freetype/src/winfonts/fnterrs.h +++ b/thirdparty/freetype/src/winfonts/fnterrs.h @@ -4,7 +4,7 @@ * * Win FNT/FON error codes (specification only). * - * Copyright (C) 2001-2019 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/thirdparty/freetype/src/winfonts/module.mk b/thirdparty/freetype/src/winfonts/module.mk index 82fb0151f8..4614c55fd0 100644 --- a/thirdparty/freetype/src/winfonts/module.mk +++ b/thirdparty/freetype/src/winfonts/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/winfonts/rules.mk b/thirdparty/freetype/src/winfonts/rules.mk index 998d49bc9f..e73ef5ea99 100644 --- a/thirdparty/freetype/src/winfonts/rules.mk +++ b/thirdparty/freetype/src/winfonts/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2019 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/thirdparty/freetype/src/winfonts/winfnt.c b/thirdparty/freetype/src/winfonts/winfnt.c index 2d771be2cc..9b466e8f28 100644 --- a/thirdparty/freetype/src/winfonts/winfnt.c +++ b/thirdparty/freetype/src/winfonts/winfnt.c @@ -4,7 +4,7 @@ * * FreeType font driver for Windows FNT/FON files * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * Copyright 2003 Huw D M Davies for Codeweavers * Copyright 2007 Dmitry Timoshkov for Codeweavers @@ -331,7 +331,7 @@ { FT_TRACE2(( "invalid alignment shift count for resource data\n" )); error = FT_THROW( Invalid_File_Format ); - goto Exit; + goto Exit1; } @@ -597,6 +597,10 @@ Exit: return error; + + Exit1: + FT_FRAME_EXIT(); + goto Exit; } diff --git a/thirdparty/freetype/src/winfonts/winfnt.h b/thirdparty/freetype/src/winfonts/winfnt.h index b628ad4c42..391f4448a7 100644 --- a/thirdparty/freetype/src/winfonts/winfnt.h +++ b/thirdparty/freetype/src/winfonts/winfnt.h @@ -4,7 +4,7 @@ * * FreeType font driver for Windows FNT/FON files * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * Copyright 2007 Dmitry Timoshkov for Codeweavers * |