Skip to content

Commit fc81c86

Browse files
committed
8285686: Update FreeType to 2.12.0
Backport-of: 67dd8a8d6a3f069f11d8e1492a775892f1f49829
1 parent 2680e83 commit fc81c86

File tree

293 files changed

+8787
-4126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+8787
-4126
lines changed

src/java.desktop/share/legal/freetype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## The FreeType Project: Freetype v2.10.4
1+
## The FreeType Project: Freetype v2.12.0
22

33

44
### FreeType Notice

src/java.desktop/share/native/libfreetype/UPDATING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ src/java.desktop/share/legal/freetype.md
3030

3131
When updating specify --with-freetype=bundled to test builds to
3232
expose build issues.
33-
This is important because presently on Linux and Solaris the build
33+
This is important because presently on Linux the build
3434
defaults to linking against the system library and does not attempt
3535
to compile the sources.

src/java.desktop/share/native/libfreetype/include/freetype/config/ftconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* ANSI-specific configuration file (specification only).
66
*
7-
* Copyright (C) 1996-2020 by
7+
* Copyright (C) 1996-2022 by
88
* David Turner, Robert Wilhelm, and Werner Lemberg.
99
*
1010
* This file is part of the FreeType project, and may only be used,

src/java.desktop/share/native/libfreetype/include/freetype/config/ftheader.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Build macros of the FreeType 2 library.
66
*
7-
* Copyright (C) 1996-2020 by
7+
* Copyright (C) 1996-2022 by
88
* David Turner, Robert Wilhelm, and Werner Lemberg.
99
*
1010
* This file is part of the FreeType project, and may only be used,
@@ -777,6 +777,18 @@
777777
#define FT_COLOR_H <freetype/ftcolor.h>
778778

779779

780+
/**************************************************************************
781+
*
782+
* @macro:
783+
* FT_OTSVG_H
784+
*
785+
* @description:
786+
* A macro used in `#include` statements to name the file containing the
787+
* FreeType~2 API which handles the OpenType 'SVG~' glyphs.
788+
*/
789+
#define FT_OTSVG_H <freetype/otsvg.h>
790+
791+
780792
/* */
781793

782794
/* These header files don't need to be included by the user. */

src/java.desktop/share/native/libfreetype/include/freetype/config/ftmodule.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
1919
// FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
2020
// FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
2121
// FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
22+
// FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
2223
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
2324
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
2425
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
25-
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
2626
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
2727
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
28-
// FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
28+
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
29+
// FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
30+
// FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
31+
// FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class )
2932

3033
/* EOF */

src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* User-selectable configuration macros (specification only).
66
*
7-
* Copyright (C) 1996-2020 by
7+
* Copyright (C) 1996-2022 by
88
* David Turner, Robert Wilhelm, and Werner Lemberg.
99
*
1010
* This file is part of the FreeType project, and may only be used,
@@ -105,8 +105,7 @@ FT_BEGIN_HEADER
105105
*
106106
* ```
107107
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
108-
* cff:no-stem-darkening=1 \
109-
* autofitter:warping=1
108+
* cff:no-stem-darkening=1
110109
* ```
111110
*
112111
*/
@@ -220,6 +219,10 @@ FT_BEGIN_HEADER
220219
* If you use a build system like cmake or the `configure` script,
221220
* options set by those programs have precedence, overwriting the value
222221
* here with the configured one.
222+
*
223+
* If you use the GNU make build system directly (that is, without the
224+
* `configure` script) and you define this macro, you also have to pass
225+
* `SYSTEM_ZLIB=yes` as an argument to make.
223226
*/
224227
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
225228

@@ -431,6 +434,23 @@ FT_BEGIN_HEADER
431434
/* #define FT_DEBUG_LEVEL_TRACE */
432435

433436

437+
/**************************************************************************
438+
*
439+
* Logging
440+
*
441+
* Compiling FreeType in debug or trace mode makes FreeType write error
442+
* and trace log messages to `stderr`. Enabling this macro
443+
* automatically forces the `FT_DEBUG_LEVEL_ERROR` and
444+
* `FT_DEBUG_LEVEL_TRACE` macros and allows FreeType to write error and
445+
* trace log messages to a file instead of `stderr`. For writing logs
446+
* to a file, FreeType uses an the external `dlg` library (the source
447+
* code is in `src/dlg`).
448+
*
449+
* This option needs a C99 compiler.
450+
*/
451+
/* #define FT_DEBUG_LOGGING */
452+
453+
434454
/**************************************************************************
435455
*
436456
* Autofitter debugging
@@ -507,6 +527,20 @@ FT_BEGIN_HEADER
507527
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
508528

509529

530+
/**************************************************************************
531+
*
532+
* OpenType SVG Glyph Support
533+
*
534+
* Setting this macro enables support for OpenType SVG glyphs. By
535+
* default, FreeType can only fetch SVG documents. However, it can also
536+
* render them if external rendering hook functions are plugged in at
537+
* runtime.
538+
*
539+
* More details on the hooks can be found in file `otsvg.h`.
540+
*/
541+
/* #define FT_CONFIG_OPTION_SVG */
542+
543+
510544
/**************************************************************************
511545
*
512546
* Error Strings
@@ -892,24 +926,6 @@ FT_BEGIN_HEADER
892926
#endif
893927

894928

895-
/**************************************************************************
896-
*
897-
* Compile 'autofit' module with warp hinting. The idea of the warping
898-
* code is to slightly scale and shift a glyph within a single dimension so
899-
* that as much of its segments are aligned (more or less) on the grid. To
900-
* find out the optimal scaling and shifting value, various parameter
901-
* combinations are tried and scored.
902-
*
903-
* You can switch warping on and off with the `warping` property of the
904-
* auto-hinter (see file `ftdriver.h` for more information; by default it
905-
* is switched off).
906-
*
907-
* This experimental option is not active if the rendering mode is
908-
* `FT_RENDER_MODE_LIGHT`.
909-
*/
910-
#define AF_CONFIG_OPTION_USE_WARPER
911-
912-
913929
/**************************************************************************
914930
*
915931
* Use TrueType-like size metrics for 'light' auto-hinting.
@@ -961,6 +977,21 @@ FT_BEGIN_HEADER
961977
#endif
962978

963979

980+
/*
981+
* The TT_SUPPORT_COLRV1 macro is defined to indicate to clients that this
982+
* version of FreeType has support for 'COLR' v1 API. This definition is
983+
* useful to FreeType clients that want to build in support for 'COLR' v1
984+
* depending on a tip-of-tree checkout before it is officially released in
985+
* FreeType, and while the feature cannot yet be tested against using
986+
* version macros. Don't change this macro. This may be removed once the
987+
* feature is in a FreeType release version and version macros can be used
988+
* to test for availability.
989+
*/
990+
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
991+
#define TT_SUPPORT_COLRV1
992+
#endif
993+
994+
964995
/*
965996
* Check CFF darkening parameters. The checks are the same as in function
966997
* `cff_property_set` in file `cffdrivr.c`.
@@ -989,8 +1020,8 @@ FT_BEGIN_HEADER
9891020
#error "Invalid CFF darkening parameters!"
9901021
#endif
9911022

992-
FT_END_HEADER
9931023

1024+
FT_END_HEADER
9941025

9951026
#endif /* FTOPTION_H_ */
9961027

src/java.desktop/share/native/libfreetype/include/freetype/config/ftstdlib.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* ANSI-specific library and header configuration file (specification
66
* only).
77
*
8-
* Copyright (C) 2002-2020 by
8+
* Copyright (C) 2002-2022 by
99
* David Turner, Robert Wilhelm, and Werner Lemberg.
1010
*
1111
* This file is part of the FreeType project, and may only be used,
@@ -43,7 +43,8 @@
4343
*
4444
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
4545
* `int` and `long` in bytes at compile-time. So far, this works for all
46-
* platforms the library has been tested on.
46+
* platforms the library has been tested on. We also check `ULLONG_MAX`
47+
* to see whether we can use 64-bit `long long` later on.
4748
*
4849
* Note that on the extremely rare platforms that do not provide integer
4950
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
@@ -66,6 +67,15 @@
6667
#define FT_LONG_MIN LONG_MIN
6768
#define FT_LONG_MAX LONG_MAX
6869
#define FT_ULONG_MAX ULONG_MAX
70+
#ifdef LLONG_MAX
71+
#define FT_LLONG_MAX LLONG_MAX
72+
#endif
73+
#ifdef LLONG_MIN
74+
#define FT_LLONG_MIN LLONG_MIN
75+
#endif
76+
#ifdef ULLONG_MAX
77+
#define FT_ULLONG_MAX ULLONG_MAX
78+
#endif
6979

7080

7181
/**************************************************************************

src/java.desktop/share/native/libfreetype/include/freetype/config/integer-types.h

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* FreeType integer types definitions.
66
*
7-
* Copyright (C) 1996-2020 by
7+
* Copyright (C) 1996-2022 by
88
* David Turner, Robert Wilhelm, and Werner Lemberg.
99
*
1010
* This file is part of the FreeType project, and may only be used,
@@ -60,6 +60,18 @@
6060

6161
#endif /* !defined(FT_SIZEOF_LONG) */
6262

63+
#ifndef FT_SIZEOF_LONG_LONG
64+
65+
/* The size of a `long long` type if available */
66+
#if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL
67+
#define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT )
68+
#else
69+
#define FT_SIZEOF_LONG_LONG 0
70+
#endif
71+
72+
#endif /* !defined(FT_SIZEOF_LONG_LONG) */
73+
74+
6375
/**************************************************************************
6476
*
6577
* @section:
@@ -174,15 +186,17 @@
174186
#endif
175187

176188

177-
/* determine whether we have a 64-bit `int` type for platforms without */
178-
/* Autoconf */
189+
/* determine whether we have a 64-bit integer type */
179190
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
180191

181-
/* `FT_LONG64` must be defined if a 64-bit type is available */
182-
#define FT_LONG64
183192
#define FT_INT64 long
184193
#define FT_UINT64 unsigned long
185194

195+
#elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT )
196+
197+
#define FT_INT64 long long int
198+
#define FT_UINT64 unsigned long long int
199+
186200
/**************************************************************************
187201
*
188202
* A 64-bit data type may create compilation problems if you compile in
@@ -192,16 +206,9 @@
192206
*/
193207
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
194208

195-
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
196-
197-
#define FT_LONG64
198-
#define FT_INT64 long long int
199-
#define FT_UINT64 unsigned long long int
200-
201-
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
209+
#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
202210

203211
/* this compiler provides the `__int64` type */
204-
#define FT_LONG64
205212
#define FT_INT64 __int64
206213
#define FT_UINT64 unsigned __int64
207214

@@ -211,32 +218,30 @@
211218
/* to test the compiler version. */
212219

213220
/* this compiler provides the `__int64` type */
214-
#define FT_LONG64
215221
#define FT_INT64 __int64
216222
#define FT_UINT64 unsigned __int64
217223

218-
#elif defined( __WATCOMC__ ) /* Watcom C++ */
224+
#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */
219225

220-
/* Watcom doesn't provide 64-bit data types */
226+
#define FT_INT64 long long int
227+
#define FT_UINT64 unsigned long long int
221228

222229
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
223230

224-
#define FT_LONG64
225231
#define FT_INT64 long long int
226232
#define FT_UINT64 unsigned long long int
227233

228234
#elif defined( __GNUC__ )
229235

230236
/* GCC provides the `long long` type */
231-
#define FT_LONG64
232237
#define FT_INT64 long long int
233238
#define FT_UINT64 unsigned long long int
234239

235-
#endif /* __STDC_VERSION__ >= 199901L */
240+
#endif /* !__STDC__ */
236241

237242
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
238243

239-
#ifdef FT_LONG64
244+
#ifdef FT_INT64
240245
typedef FT_INT64 FT_Int64;
241246
typedef FT_UINT64 FT_UInt64;
242247
#endif

src/java.desktop/share/native/libfreetype/include/freetype/config/mac-support.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Mac/OS X support configuration header.
66
*
7-
* Copyright (C) 1996-2020 by
7+
* Copyright (C) 1996-2022 by
88
* David Turner, Robert Wilhelm, and Werner Lemberg.
99
*
1010
* This file is part of the FreeType project, and may only be used,

src/java.desktop/share/native/libfreetype/include/freetype/config/public-macros.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Define a set of compiler macros used in public FreeType headers.
66
*
7-
* Copyright (C) 2020 by
7+
* Copyright (C) 2020-2022 by
88
* David Turner, Robert Wilhelm, and Werner Lemberg.
99
*
1010
* This file is part of the FreeType project, and may only be used,
@@ -103,6 +103,7 @@ FT_BEGIN_HEADER
103103
*/
104104
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
105105

106+
106107
/*
107108
* `FT_UNUSED` indicates that a given parameter is not used -- this is
108109
* only used to get rid of unpleasant compiler warnings.
@@ -115,6 +116,23 @@ FT_BEGIN_HEADER
115116
#endif
116117

117118

119+
/*
120+
* Support for casts in both C and C++.
121+
*/
122+
#ifdef __cplusplus
123+
#define FT_STATIC_CAST( type, var ) static_cast<type>(var)
124+
#define FT_REINTERPRET_CAST( type, var ) reinterpret_cast<type>(var)
125+
126+
#define FT_STATIC_BYTE_CAST( type, var ) \
127+
static_cast<type>( static_cast<unsigned char>( var ) )
128+
#else
129+
#define FT_STATIC_CAST( type, var ) (type)(var)
130+
#define FT_REINTERPRET_CAST( type, var ) (type)(var)
131+
132+
#define FT_STATIC_BYTE_CAST( type, var ) (type)(unsigned char)(var)
133+
#endif
134+
135+
118136
FT_END_HEADER
119137

120138
#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */

0 commit comments

Comments
 (0)