Update FreeType to 2.14.1

This commit is contained in:
Pāvels Nadtočajevs
2025-11-05 09:27:23 +02:00
parent 019889d1da
commit b54d575636
434 changed files with 10416 additions and 5579 deletions
+1 -1
View File
@@ -341,7 +341,7 @@ for UI.
## freetype
- Upstream: https://www.freetype.org
- Version: 2.13.3 (42608f77f20749dd6ddc9e0536788eaad70ea4b5, 2024)
- Version: 2.14.1 (526ec5c47b9ebccc4754c85ac0c0cdf7c85a5e9b, 2025)
- License: FreeType License (BSD-like)
Files extracted from upstream source:
+2 -2
View File
@@ -49,7 +49,7 @@ Introduction
"""
Portions of this software are copyright © <year> The FreeType
Project (www.freetype.org). All rights reserved.
Project (https://freetype.org). All rights reserved.
"""
Please replace <year> with the value from the FreeType version you
@@ -163,7 +163,7 @@ Legal Terms
Our home page can be found at
https://www.freetype.org
https://freetype.org
--- end of FTL.TXT ---
+4 -3
View File
@@ -35,9 +35,10 @@ in earlier FreeType versions.
The gzip module uses the zlib license (see `src/gzip/zlib.h`) which
too is compatible to the above two licenses.
The files `src/autofit/ft-hb.c` and `src/autofit/ft-hb.h` contain code
taken almost verbatim from the HarfBuzz file `hb-ft.cc`, which uses
the 'Old MIT' license, compatible to the above two licenses.
The files `src/autofit/ft-hb-ft.c`, `src/autofit/ft-hb-decls.h`,
`src/autofit/ft-hb-types.h`, and `src/autofit/hb-script-list.h`
contain code taken (almost) verbatim from the HarfBuzz library, which
uses the 'Old MIT' license compatible to the above two licenses.
The MD5 checksum support (only used for debugging in development
builds) is in the public domain.
+1 -1
View File
@@ -4,7 +4,7 @@
*
* ANSI-specific configuration file (specification only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Build macros of the FreeType 2 library.
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+37 -12
View File
@@ -4,7 +4,7 @@
*
* User-selectable configuration macros (specification only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -158,12 +158,12 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* If this macro is defined, try to use an inlined assembler version of the
* @FT_MulFix function, which is a 'hotspot' when loading and hinting
* glyphs, and which should be executed as fast as possible.
* If this macro is defined, try to use an inlined 64-bit or assembler
* version of the @FT_MulFix function, which is a 'hotspot' when loading
* and hinting glyphs, and which should be executed as fast as possible.
*
* Note that if your compiler or CPU is not supported, this will default to
* the standard and portable implementation found in `ftcalc.c`.
* If your compiler is not C99-compliant or CPU assembly is not supported,
* you can disable this option.
*/
#define FT_CONFIG_OPTION_INLINE_MULFIX
@@ -293,6 +293,31 @@ FT_BEGIN_HEADER
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
/**************************************************************************
*
* HarfBuzz dynamic support.
*
* Define this macro if you want the HarfBuzz library to be loaded at
* runtime instead of being linked to FreeType.
*
* This option has no effect if `FT_CONFIG_OPTION_USE_HARFBUZZ` is not
* defined.
*
* When this option is enabled, FreeType will try to load the HarfBuzz
* library at runtime, using `dlopen` or `LoadLibrary`, depending on the
* platform. On Microsoft platforms, the library name looked up is
* `libharfbuzz-0.dll`. On Apple platforms, the library name looked up
* is `libharfbuzz.0.dylib`. On all other platforms, the library name
* looked up is `libharfbuzz.so.0`. This name can be overridden by
* defining the macro `FT_LIBHARFBUZZ` at FreeType compilation time.
*
* 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_HARFBUZZ_DYNAMIC */
/**************************************************************************
*
* Brotli support.
@@ -679,7 +704,7 @@ FT_BEGIN_HEADER
* defined.
*
* [1]
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
* https://learn.microsoft.com/typography/cleartype/truetypecleartype
*/
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
@@ -697,7 +722,7 @@ FT_BEGIN_HEADER
* flags array which can be used to disambiguate, but old fonts will not
* have them.
*
* https://www.microsoft.com/typography/otspec/glyf.htm
* https://learn.microsoft.com/typography/opentype/spec/glyf
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html
*/
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@@ -760,10 +785,10 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* Option `TT_CONFIG_OPTION_GPOS_KERNING` enables a basic GPOS kerning
* implementation (for TrueType fonts only). With this defined, FreeType
* is able to get kerning pair data from the GPOS 'kern' feature as well as
* legacy 'kern' tables; without this defined, FreeType will only be able
* to use legacy 'kern' tables.
* implementation (for TrueType and OpenType fonts only). With this
* defined, FreeType is able to get kerning pair data from the GPOS 'kern'
* feature as well as legacy 'kern' tables; without this defined, FreeType
* will only be able to use legacy 'kern' tables.
*
* Note that FreeType does not support more advanced GPOS layout features;
* even the 'kern' feature implemented here doesn't handle more
+1 -1
View File
@@ -5,7 +5,7 @@
* ANSI-specific library and header configuration file (specification
* only).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+29 -2
View File
@@ -4,7 +4,7 @@
*
* FreeType integer types definitions.
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -17,6 +17,8 @@
#ifndef FREETYPE_CONFIG_INTEGER_TYPES_H_
#define FREETYPE_CONFIG_INTEGER_TYPES_H_
FT_BEGIN_HEADER
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
@@ -242,9 +244,34 @@
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
#ifdef FT_INT64
typedef FT_INT64 FT_Int64;
typedef FT_UINT64 FT_UInt64;
#endif
# define FT_INT64_ZERO 0
#else /* !FT_INT64 */
/* we need to emulate 64-bit data types if none are available */
typedef struct FT_Int64_
{
FT_UInt32 lo;
FT_UInt32 hi;
} FT_Int64;
typedef struct FT_UInt64_
{
FT_UInt32 lo;
FT_UInt32 hi;
} FT_UInt64;
# define FT_INT64_ZERO { 0, 0 }
#endif /* !FT_INT64 */
FT_END_HEADER
#endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Mac/OS X support configuration header.
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* Define a set of compiler macros used in public FreeType headers.
*
* Copyright (C) 2020-2024 by
* Copyright (C) 2020-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -62,8 +62,8 @@ FT_BEGIN_HEADER
* because it is needed by `FT_EXPORT`.
*/
/* Visual C, mingw */
#if defined( _WIN32 )
/* Visual C, MinGW, Cygwin */
#if defined( _WIN32 ) || defined( __CYGWIN__ )
#if defined( FT2_BUILD_LIBRARY ) && defined( DLL_EXPORT )
#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport )
+51 -47
View File
@@ -4,7 +4,7 @@
*
* FreeType high-level API and common types (specification only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -811,7 +811,7 @@ FT_BEGIN_HEADER
* FT_ENCODING_MS_SYMBOL ::
* Microsoft Symbol encoding, used to encode mathematical symbols and
* wingdings. For more information, see
* 'https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts',
* 'https://learn.microsoft.com/typography/opentype/spec/recom#non-standard-symbol-fonts',
* 'http://www.kostis.net/charsets/symbol.htm', and
* 'http://www.kostis.net/charsets/wingding.htm'.
*
@@ -1068,12 +1068,12 @@ FT_BEGIN_HEADER
* the face in the font file (starting with value~0). They are set
* to~0 if there is only one face in the font file.
*
* [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation
* fonts only, holding the named instance index for the current face
* index (starting with value~1; value~0 indicates font access without
* a named instance). For non-variation fonts, bits 16-30 are ignored.
* If we have the third named instance of face~4, say, `face_index` is
* set to 0x00030004.
* [Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType
* Font Variations only, holding the named instance index for the
* current face index (starting with value~1; value~0 indicates font
* access without a named instance). For non-variation fonts, bits
* 16-30 are ignored. If we have the third named instance of face~4,
* say, `face_index` is set to 0x00030004.
*
* Bit 31 is always zero (that is, `face_index` is always a positive
* value).
@@ -1092,10 +1092,10 @@ FT_BEGIN_HEADER
* the face; see @FT_STYLE_FLAG_XXX for the details.
*
* [Since 2.6.1] Bits 16-30 hold the number of named instances
* available for the current face if we have a GX or OpenType variation
* (sub)font. Bit 31 is always zero (that is, `style_flags` is always
* a positive value). Note that a variation font has always at least
* one named instance, namely the default instance.
* available for the current face if we have a TrueType GX or OpenType
* Font Variation. Bit 31 is always zero (that is, `style_flags` is
* always a positive value). Note that a variation font has always at
* least one named instance, namely the default instance.
*
* num_glyphs ::
* The number of glyphs in the face. If the face is scalable and has
@@ -1159,7 +1159,7 @@ FT_BEGIN_HEADER
* Note that the bounding box might be off by (at least) one pixel for
* hinted fonts. See @FT_Size_Metrics for further discussion.
*
* Note that the bounding box does not vary in OpenType variation fonts
* Note that the bounding box does not vary in OpenType Font Variations
* and should only be used in relation to the default instance.
*
* units_per_EM ::
@@ -1218,7 +1218,7 @@ FT_BEGIN_HEADER
* Fields may be changed after a call to @FT_Attach_File or
* @FT_Attach_Stream.
*
* For an OpenType variation font, the values of the following fields can
* For OpenType Font Variations, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `ascender`, `descender`, `height`,
* `underline_position`, and `underline_thickness`.
@@ -1336,7 +1336,7 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_MULTIPLE_MASTERS ::
* The face contains multiple masters and is capable of interpolating
* between them. Supported formats are Adobe MM, TrueType GX, and
* OpenType variation fonts.
* OpenType Font Variations.
*
* See section @multiple_masters for API details.
*
@@ -1609,7 +1609,7 @@ FT_BEGIN_HEADER
*
* @description:
* A macro that returns true whenever a face object is a named instance
* of a GX or OpenType variation font.
* of a TrueType GX or OpenType Font Variations.
*
* [Since 2.9] Changing the design coordinates with
* @FT_Set_Var_Design_Coordinates or @FT_Set_Var_Blend_Coordinates does
@@ -2147,7 +2147,7 @@ FT_BEGIN_HEADER
* freed.
*
* [Since 2.10.1] If @FT_LOAD_NO_SCALE is set, outline coordinates of
* OpenType variation fonts for a selected instance are internally
* OpenType Font Variations for a selected instance are internally
* handled as 26.6 fractional font units but returned as (rounded)
* integers, as expected. To get unrounded font units, don't use
* @FT_LOAD_NO_SCALE but load the glyph with @FT_LOAD_NO_HINTING and
@@ -2640,14 +2640,14 @@ FT_BEGIN_HEADER
* the face in the font file (starting with value~0). Set it to~0 if
* there is only one face in the font file.
*
* [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation
* fonts only, specifying the named instance index for the current face
* index (starting with value~1; value~0 makes FreeType ignore named
* instances). For non-variation fonts, bits 16-30 are ignored.
* Assuming that you want to access the third named instance in face~4,
* `face_index` should be set to 0x00030004. If you want to access
* face~4 without variation handling, simply set `face_index` to
* value~4.
* [Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType
* Font Variations only, specifying the named instance index for the
* current face index (starting with value~1; value~0 makes FreeType
* ignore named instances). For non-variation fonts, bits 16-30 are
* ignored. Assuming that you want to access the third named instance
* in face~4, `face_index` should be set to 0x00030004. If you want
* to access face~4 without variation handling, simply set
* `face_index` to value~4.
*
* `FT_Open_Face` and its siblings can be used to quickly check whether
* the font format of a given font resource is supported by FreeType.
@@ -2914,11 +2914,11 @@ FT_BEGIN_HEADER
* of the available glyphs at a given ppem value is available. FreeType
* silently uses outlines if there is no bitmap for a given glyph index.
*
* For GX and OpenType variation fonts, a bitmap strike makes sense only
* if the default instance is active (that is, no glyph variation takes
* place); otherwise, FreeType simply ignores bitmap strikes. The same
* is true for all named instances that are different from the default
* instance.
* For TrueType GX and OpenType Font Variations, a bitmap strike makes
* sense only if the default instance is active (that is, no glyph
* variation takes place); otherwise, FreeType simply ignores bitmap
* strikes. The same is true for all named instances that are different
* from the default instance.
*
* Don't use this function if you are using the FreeType cache API.
*/
@@ -3078,7 +3078,7 @@ FT_BEGIN_HEADER
* is dependent entirely on how the size is defined in the source face.
* The font designer chooses the final size of each glyph relative to
* this size. For more information refer to
* 'https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'.
* 'https://freetype.org/freetype2/docs/glyphs/glyphs-2.html'.
*
* Contrary to @FT_Set_Char_Size, this function doesn't have special code
* to normalize zero-valued widths, heights, or resolutions, which are
@@ -3441,8 +3441,10 @@ FT_BEGIN_HEADER
* blending of the color glyph layers associated with the glyph index,
* using the same bitmap format as embedded color bitmap images. This
* is mainly for convenience and works only for glyphs in 'COLR' v0
* tables (or glyphs in 'COLR' v1 tables that exclusively use v0
* features). For full control of color layers use
* tables. **There is no rendering support for 'COLR' v1** (with the
* exception of v1 tables that exclusively use v0 features)! You need
* a graphics library like Skia or Cairo to interpret the graphics
* commands stored in v1 tables. For full control of color layers use
* @FT_Get_Color_Glyph_Layer and FreeType's color functions like
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
* so that the client application can handle blending by itself.
@@ -3895,8 +3897,10 @@ FT_BEGIN_HEADER
*
* This process can cost performance. There is an approximation that
* does not need to know about the background color; see
* https://bel.fi/alankila/lcd/ and
* https://bel.fi/alankila/lcd/alpcor.html for details.
* https://web.archive.org/web/20211019204945/https://bel.fi/alankila/lcd/
* and
* https://web.archive.org/web/20210211002939/https://bel.fi/alankila/lcd/alpcor.html
* for details.
*
* **ATTENTION**: Linear blending is even more important when dealing
* with subpixel-rendered glyphs to prevent color-fringing! A
@@ -3993,13 +3997,13 @@ FT_BEGIN_HEADER
* out of the scope of this API function -- they can be implemented
* through format-specific interfaces.
*
* Note that, for TrueType fonts only, this can extract data from both
* the 'kern' table and the basic, pair-wise kerning feature from the
* GPOS table (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled), though
* FreeType does not support the more advanced GPOS layout features; use
* a library like HarfBuzz for those instead. If a font has both a
* 'kern' table and kern features of a GPOS table, the 'kern' table will
* be used.
* Note that, for TrueType and OpenType fonts only, this can extract data
* from both the 'kern' table and the basic, pair-wise kerning feature
* from the GPOS table (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled),
* though FreeType does not support the more advanced GPOS layout
* features; use a library like HarfBuzz for those instead. If a font
* has both a 'kern' table and kern features of a GPOS table, the 'kern'
* table will be used.
*
* Also note for right-to-left scripts, the functionality may differ for
* fonts with GPOS tables vs. 'kern' tables. For GPOS, right-to-left
@@ -4530,7 +4534,7 @@ FT_BEGIN_HEADER
* table description in the OpenType specification for the meaning of the
* various flags (which get synthesized for non-OpenType subglyphs).
*
* https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description
* https://learn.microsoft.com/typography/opentype/spec/glyf#composite-glyph-description
*
* @values:
* FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
@@ -4593,7 +4597,7 @@ FT_BEGIN_HEADER
* interpreted depending on the flags returned in `*p_flags`. See the
* OpenType specification for details.
*
* https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description
* https://learn.microsoft.com/typography/opentype/spec/glyf#composite-glyph-description
*
*/
FT_EXPORT( FT_Error )
@@ -4619,7 +4623,7 @@ FT_BEGIN_HEADER
* associated with a font.
*
* See
* https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf
* https://adobe-type-tools.github.io/font-tech-notes/pdfs/AcrobatDC_FontPolicies.pdf
* for more details.
*
* @values:
@@ -5173,8 +5177,8 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 13
#define FREETYPE_PATCH 3
#define FREETYPE_MINOR 14
#define FREETYPE_PATCH 1
/**************************************************************************
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Quick computation of advance widths (specification only).
*
* Copyright (C) 2008-2024 by
* Copyright (C) 2008-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType exact bbox computation (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType API for accessing BDF-specific strings (specification).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType utility functions for bitmaps (specification).
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Bzip2-compressed stream support.
*
* Copyright (C) 2010-2024 by
* Copyright (C) 2010-2025 by
* Joel Klinghed.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType Cache subsystem (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType API for accessing CID font information (specification).
*
* Copyright (C) 2007-2024 by
* Copyright (C) 2007-2025 by
* Dereg Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
+13 -4
View File
@@ -4,7 +4,7 @@
*
* FreeType's glyph color management (specification).
*
* Copyright (C) 2018-2024 by
* Copyright (C) 2018-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -317,6 +317,15 @@ FT_BEGIN_HEADER
* @description:
* The functions described here allow access of colored glyph layer data
* in OpenType's 'COLR' tables.
*
* Note that FreeType does *not* provide rendering in general of glyphs
* that use a 'COLR' table! While FreeType has very limited rendering
* support for 'COLR' v0 tables (without a possibility to change the
* color palette) via @FT_Render_Glyph, there is no such convenience
* code for 'COLR' v1 tables -- while it appears that v1 is simply an
* 'improved' version of v0, this is not the case: it is a completely
* different color font format, and you need a dedicated graphics
* library like Skia or Cairo to handle a v1 table's drawing commands.
*/
@@ -359,7 +368,7 @@ FT_BEGIN_HEADER
* iteratively retrieve the colored glyph layers associated with the
* current glyph slot.
*
* https://docs.microsoft.com/en-us/typography/opentype/spec/colr
* https://learn.microsoft.com/typography/opentype/spec/colr
*
* The glyph layer data for a given glyph index, if present, provides an
* alternative, multi-color glyph representation: Instead of rendering
@@ -1518,7 +1527,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if a clip box is found. If no clip box is found or an error
* occured, value~0 is returned.
* occurred, value~0 is returned.
*
* @note:
* To retrieve the clip box in font units, reset scale to units-per-em
@@ -1646,7 +1655,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if everything is OK. Value~0 if no details can be found for
* this paint or any other error occured.
* this paint or any other error occurred.
*
* @since:
* 2.13
+3 -3
View File
@@ -4,7 +4,7 @@
*
* FreeType API for controlling driver modules (specification only).
*
* Copyright (C) 2017-2024 by
* Copyright (C) 2017-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -282,7 +282,7 @@ FT_BEGIN_HEADER
* minimize hinting techniques that were problematic with the extra
* resolution of ClearType; see
* http://rastertragedy.com/RTRCh4.htm#Sec1 and
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
* https://learn.microsoft.com/typography/cleartype/truetypecleartype.
* This technique is not to be confused with ClearType compatible widths.
* ClearType backward compatibility has no direct impact on changing
* advance widths, but there might be an indirect impact on disabling
@@ -784,7 +784,7 @@ FT_BEGIN_HEADER
*
* Details on subpixel hinting and some of the necessary tweaks can be
* found in Greg Hitchcock's whitepaper at
* 'https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
* 'https://learn.microsoft.com/typography/cleartype/truetypecleartype'.
* Note that FreeType currently doesn't really 'subpixel hint' (6x1, 6x2,
* or 6x5 supersampling) like discussed in the paper. Depending on the
* chosen interpreter, it simply ignores instructions on vertical stems
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType error codes (specification).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType error code handling (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Support functions for font formats.
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Access of TrueType's 'gasp' table (specification).
*
* Copyright (C) 2007-2024 by
* Copyright (C) 2007-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType convenience functions to handle glyphs (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* Masatake YAMATO, Redhat K.K,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Gzip-compressed stream support.
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+6 -2
View File
@@ -5,7 +5,7 @@
* FreeType glyph image formats and default raster interface
* (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -267,6 +267,10 @@ FT_BEGIN_HEADER
* *logical* one. For example, if @FT_Pixel_Mode is set to
* `FT_PIXEL_MODE_LCD`, the logical width is a just a third of the
* physical one.
*
* An empty bitmap with a NULL `buffer` is valid, with `rows` and/or
* `pitch` also set to 0. Such bitmaps might be produced while rendering
* empty or degenerate outlines.
*/
typedef struct FT_Bitmap_
{
@@ -439,7 +443,7 @@ FT_BEGIN_HEADER
* rasterizer; see the `tags` field in @FT_Outline.
*
* Please refer to the description of the 'SCANTYPE' instruction in the
* [OpenType specification](https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#scantype)
* [OpenType specification](https://learn.microsoft.com/typography/opentype/spec/tt_instructions#scantype)
* how simple drop-outs, smart drop-outs, and stubs are defined.
*/
#define FT_OUTLINE_NONE 0x0
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType incremental loading (specification).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* FreeType API for color filtering of subpixel bitmap glyphs
* (specification).
*
* Copyright (C) 2006-2024 by
* Copyright (C) 2006-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Generic list support for FreeType (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Additional debugging APIs.
*
* Copyright (C) 2020-2024 by
* Copyright (C) 2020-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* LZW-compressed stream support.
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Additional Mac-specific API.
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType modules public interface (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType module error offsets (specification).
*
* Copyright (C) 2001-2024 by
* Copyright (C) 2001-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType API for validating OpenType tables (specification).
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* Support for the FT_Outline type used to store glyph shapes of
* most scalable font formats (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType API for possible FT_Parameter tags (specification only).
*
* Copyright (C) 2017-2024 by
* Copyright (C) 2017-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType API for accessing PFR-specific data (specification only).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType renderer modules public interface (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType size objects management (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -7,7 +7,7 @@
*
* This is _not_ used to retrieve glyph names!
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType path stroker (specification).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* FreeType synthesizing code for emboldening and slanting
* (specification).
*
* Copyright (C) 2000-2024 by
* Copyright (C) 2000-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType low-level system interface definition (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType trigonometric functions (specification).
*
* Copyright (C) 2001-2024 by
* Copyright (C) 2001-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType simple types definitions (specification only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+2 -3
View File
@@ -4,7 +4,7 @@
*
* FreeType API for accessing Windows fnt-specific data.
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -93,8 +93,7 @@ FT_BEGIN_HEADER
* second default codepage that most international versions of Windows
* have. It is one of the OEM codepages from
*
* https://docs.microsoft.com/en-us/windows/desktop/intl/code-page-identifiers
* ,
* https://learn.microsoft.com/windows/win32/intl/code-page-identifiers ,
*
* and is used for the 'DOS boxes', to support legacy applications. A
* German Windows version for example usually uses ANSI codepage 1252
+1 -1
View File
@@ -4,7 +4,7 @@
*
* High-level 'autohint' module-specific interface (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Basic OpenType/CFF object type definitions (specification).
*
* Copyright (C) 2017-2024 by
* Copyright (C) 2017-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* Basic OpenType/CFF type definitions and interface (specification
* only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* Compiler-specific macro definitions used internally by FreeType.
*
* Copyright (C) 2020-2024 by
* Copyright (C) 2020-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -128,8 +128,8 @@ FT_BEGIN_HEADER
* before a function declaration.
*/
/* Visual C, mingw */
#if defined( _WIN32 )
/* Visual C, MinGW, Cygwin */
#if defined( _WIN32 ) || defined( __CYGWIN__ )
#define FT_INTERNAL_FUNCTION_ATTRIBUTE /* empty */
/* gcc, clang */
+96 -204
View File
@@ -4,7 +4,7 @@
*
* Arithmetic computations (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -27,17 +27,87 @@
FT_BEGIN_HEADER
/*
* The following macros have two purposes.
*
* - Tag places where overflow is expected and harmless.
*
* - Avoid run-time undefined behavior sanitizer errors.
*
* Use with care!
*/
#define ADD_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
#define SUB_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
#define MUL_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
#define NEG_INT( a ) \
(FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
#define ADD_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
#define SUB_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
#define MUL_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
#define NEG_LONG( a ) \
(FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
#define ADD_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
#define SUB_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
#define MUL_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
#define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
#ifdef FT_INT64
#define ADD_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
#define SUB_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) )
#define MUL_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) )
#define NEG_INT64( a ) \
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
#endif /* FT_INT64 */
/**************************************************************************
*
* FT_MulDiv() and FT_MulFix() are declared in freetype.h.
*
*/
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
/* Provide assembler fragments for performance-critical functions. */
/* These must be defined `static __inline__' with GCC. */
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
#ifdef FT_INT64
static inline FT_Long
FT_MulFix_64( FT_Long a,
FT_Long b )
{
FT_Int64 ab = MUL_INT64( a, b );
ab = ADD_INT64( ab, 0x8000 + ( ab >> 63 ) ); /* rounding phase */
return (FT_Long)( ab >> 16 );
}
#define FT_MulFix( a, b ) FT_MulFix_64( a, b )
#elif !defined( FT_CONFIG_OPTION_NO_ASSEMBLER )
/* Provide 32-bit assembler fragments for optimized FT_MulFix. */
/* These must be defined `static __inline__' or similar. */
#if defined( __arm__ ) && \
( defined( __thumb2__ ) || !defined( __thumb__ ) )
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
@@ -49,6 +119,7 @@ FT_BEGIN_HEADER
{
FT_Int32 t, t2;
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
__asm
{
@@ -60,28 +131,8 @@ FT_BEGIN_HEADER
mov a, t2, lsr #16 /* a = t2 >> 16 */
orr a, a, t, lsl #16 /* a |= t << 16 */
}
return a;
}
#endif /* __CC_ARM || __ARMCC__ */
#ifdef __GNUC__
#if defined( __arm__ ) && \
( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
/* documentation is in freetype.h */
static __inline__ FT_Int32
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
FT_Int32 t, t2;
#elif defined( __GNUC__ )
__asm__ __volatile__ (
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
@@ -98,26 +149,25 @@ FT_BEGIN_HEADER
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b)
: "cc" );
#endif
return a;
}
#endif /* __arm__ && */
/* ( __thumb2__ || !__thumb__ ) && */
/* !( __CC_ARM || __ARMCC__ ) */
#if defined( __i386__ )
#elif defined( __i386__ ) || defined( _M_IX86 )
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
/* documentation is in freetype.h */
static __inline__ FT_Int32
static __inline FT_Int32
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
FT_Int32 result;
#if defined( __GNUC__ )
__asm__ __volatile__ (
"imul %%edx\n"
@@ -132,27 +182,8 @@ FT_BEGIN_HEADER
: "=a"(result), "=d"(b)
: "a"(a), "d"(b)
: "%ecx", "cc" );
return result;
}
#endif /* i386 */
#endif /* __GNUC__ */
#ifdef _MSC_VER /* Visual C++ */
#ifdef _M_IX86
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
/* documentation is in freetype.h */
static __inline FT_Int32
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
FT_Int32 result;
#elif defined( _MSC_VER )
__asm
{
@@ -169,81 +200,21 @@ FT_BEGIN_HEADER
add eax, edx
mov result, eax
}
#endif
return result;
}
#endif /* _M_IX86 */
#endif /* __i386__ || _M_IX86 */
#endif /* _MSC_VER */
#if defined( __GNUC__ ) && defined( __x86_64__ )
#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64
static __inline__ FT_Int32
FT_MulFix_x86_64( FT_Int32 a,
FT_Int32 b )
{
/* Temporarily disable the warning that C90 doesn't support */
/* `long long'. */
#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wlong-long"
#endif
#if 1
/* Technically not an assembly fragment, but GCC does a really good */
/* job at inlining it and generating good machine code for it. */
long long ret, tmp;
ret = (long long)a * b;
tmp = ret >> 63;
ret += 0x8000 + tmp;
return (FT_Int32)( ret >> 16 );
#else
/* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */
/* code from the lines below. The main issue is that `wide_a' is not */
/* properly initialized by sign-extending `a'. Instead, the generated */
/* machine code assumes that the register that contains `a' on input */
/* can be used directly as a 64-bit value, which is wrong most of the */
/* time. */
long long wide_a = (long long)a;
long long wide_b = (long long)b;
long long result;
__asm__ __volatile__ (
"imul %2, %1\n"
"mov %1, %0\n"
"sar $63, %0\n"
"lea 0x8000(%1, %0), %0\n"
"sar $16, %0\n"
: "=&r"(result), "=&r"(wide_a)
: "r"(wide_b)
: "cc" );
return (FT_Int32)result;
#endif
#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
#pragma GCC diagnostic pop
#endif
}
#endif /* __GNUC__ && __x86_64__ */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
#ifdef FT_MULFIX_ASSEMBLER
#define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
#endif
#endif
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
#endif /* FT_CONFIG_OPTION_INLINE_MULFIX */
/**************************************************************************
@@ -278,40 +249,6 @@ FT_BEGIN_HEADER
FT_Long c );
/**************************************************************************
*
* @function:
* FT_MulAddFix
*
* @description:
* Compute `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`, where `s[n]` is
* usually a 16.16 scalar.
*
* @input:
* s ::
* The array of scalars.
* f ::
* The array of factors.
* count ::
* The number of entries in the array.
*
* @return:
* The result of `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`.
*
* @note:
* This function is currently used for the scaled delta computation of
* variation stores. It internally uses 64-bit data types when
* available, otherwise it emulates 64-bit math by using 32-bit
* operations, which produce a correct result but most likely at a slower
* performance in comparison to the implementation base on `int64_t`.
*
*/
FT_BASE( FT_Int32 )
FT_MulAddFix( FT_Fixed* s,
FT_Int32* f,
FT_UInt count );
/*
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
* idea is that both `a' and `b' are scaled by factors of 10 so that the
@@ -455,6 +392,10 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) FT_MSB_i386( x )
#elif defined( __CC_ARM )
#define FT_MSB( x ) ( 31 - __clz( x ) )
#elif defined( __SunOS_5_11 )
#include <string.h>
@@ -526,55 +467,6 @@ FT_BEGIN_HEADER
#define ROUND_F26DOT6( x ) ( ( (x) + 32 - ( x < 0 ) ) & -64 )
/*
* The following macros have two purposes.
*
* - Tag places where overflow is expected and harmless.
*
* - Avoid run-time sanitizer errors.
*
* Use with care!
*/
#define ADD_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
#define SUB_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
#define MUL_INT( a, b ) \
(FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
#define NEG_INT( a ) \
(FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
#define ADD_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
#define SUB_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
#define MUL_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
#define NEG_LONG( a ) \
(FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
#define ADD_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
#define SUB_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
#define MUL_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
#define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
#ifdef FT_INT64
#define ADD_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
#define SUB_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) )
#define MUL_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) )
#define NEG_INT64( a ) \
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
#endif /* FT_INT64 */
FT_END_HEADER
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Debugging and logging component (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType internal font driver interface (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* The FreeType glyph loader (specification).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
+23
View File
@@ -117,6 +117,18 @@ FT_BEGIN_HEADER
FT_Hash hash,
FT_Memory memory );
FT_Error
ft_hash_str_insert_no_overwrite( const char* key,
size_t data,
FT_Hash hash,
FT_Memory memory );
FT_Error
ft_hash_num_insert_no_overwrite( FT_Int num,
size_t data,
FT_Hash hash,
FT_Memory memory );
size_t*
ft_hash_str_lookup( const char* key,
FT_Hash hash );
@@ -125,6 +137,17 @@ FT_BEGIN_HEADER
ft_hash_num_lookup( FT_Int num,
FT_Hash hash );
FT_Bool
ft_hash_num_iterator( FT_UInt *idx,
FT_Int *key,
size_t *value,
FT_Hash hash );
FT_Bool
ft_hash_str_iterator( FT_UInt *idx,
const char* *key,
size_t *value,
FT_Hash hash );
FT_END_HEADER
+1 -1
View File
@@ -4,7 +4,7 @@
*
* The FreeType memory management macros (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* OpenType Variations type definitions for internal use
* with the multi-masters service (specification).
*
* Copyright (C) 2022-2024 by
* Copyright (C) 2022-2025 by
* David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
* Dominik Röttsches.
*
+26 -4
View File
@@ -4,7 +4,7 @@
*
* The FreeType private base classes (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -275,6 +275,28 @@ FT_BEGIN_HEADER
FT_GlyphSlot slot,
FT_Render_Mode mode );
/**************************************************************************
*
* @Function:
* find_unicode_charmap
*
* @Description:
* This function finds a Unicode charmap, if there is one. And if there
* is more than one, it tries to favour the more extensive one, i.e., one
* that supports UCS-4 against those which are limited to the BMP (UCS-2
* encoding.)
*
* If a unicode charmap is found, `face->charmap` is set to it.
*
* This function is called from `open_face`, from `FT_Select_Charmap(...,
* FT_ENCODING_UNICODE)`, and also from `afadjust.c` in the 'autofit'
* module.
*/
FT_BASE( FT_Error )
find_unicode_charmap( FT_Face face );
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
@@ -498,9 +520,9 @@ FT_BEGIN_HEADER
*/
typedef struct FT_ModuleRec_
{
FT_Module_Class* clazz;
FT_Library library;
FT_Memory memory;
const FT_Module_Class* clazz;
FT_Library library;
FT_Memory memory;
} FT_ModuleRec;
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Get and set properties of PostScript drivers (specification).
*
* Copyright (C) 2017-2024 by
* Copyright (C) 2017-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Embedded resource forks accessor (specification).
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* Masatake YAMATO and Redhat K.K.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* The FreeType services (specification only).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Stream handling (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+3 -2
View File
@@ -4,7 +4,7 @@
*
* Tracing handling (specification only).
*
* Copyright (C) 2002-2024 by
* Copyright (C) 2002-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -19,7 +19,7 @@
/* definitions of trace levels for FreeType 2 */
/* the maximum string length (if the argument to `FT_TRACE_DEF` */
/* gets used as a string) plus one charachter for ':' plus */
/* gets used as a string) plus one character for ':' plus */
/* another one for the trace level */
#define FT_MAX_TRACE_LEVEL_LENGTH (9 + 1 + 1)
@@ -159,6 +159,7 @@ FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvtrak )
/* autofit components */
FT_TRACE_DEF( afadjust )
FT_TRACE_DEF( afcjk )
FT_TRACE_DEF( afglobal )
FT_TRACE_DEF( afhints )
+1 -1
View File
@@ -4,7 +4,7 @@
*
* FreeType validation support (specification).
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* Auxiliary functions and data structures related to PostScript fonts
* (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -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-2024 by
* Copyright (C) 2001-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType BDF services (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType CFF tables loader service (specification).
*
* Copyright (C) 2017-2024 by
* Copyright (C) 2017-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType CID font services (specification).
*
* Copyright (C) 2007-2024 by
* Copyright (C) 2007-2025 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType font format service (specification only).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType glyph dictionary services (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
@@ -4,7 +4,7 @@
*
* The FreeType Kerning service (specification).
*
* Copyright (C) 2006-2024 by
* Copyright (C) 2006-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType services for metrics variations (specification).
*
* Copyright (C) 2016-2024 by
* Copyright (C) 2016-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -77,7 +77,7 @@ FT_BEGIN_HEADER
typedef void
(*FT_Metrics_Adjust_Func)( FT_Face face );
typedef FT_Error
typedef void
(*FT_Size_Reset_Func)( FT_Size size );
@@ -4,7 +4,7 @@
*
* The FreeType Multiple Masters and GX var services (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType OpenType validation service (specification).
*
* Copyright (C) 2004-2024 by
* Copyright (C) 2004-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* Internal PFR service functions (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType PostScript name services (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType property service (specification).
*
* Copyright (C) 2012-2024 by
* Copyright (C) 2012-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType PostScript charmap service (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType PostScript info service (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType SFNT table loading service (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType TrueType/sfnt cmap extra information service.
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* Masatake YAMATO, Redhat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
@@ -4,7 +4,7 @@
*
* The FreeType TrueType engine query service (specification).
*
* Copyright (C) 2006-2024 by
* Copyright (C) 2006-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType TrueType glyph service.
*
* Copyright (C) 2007-2024 by
* Copyright (C) 2007-2025 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
@@ -4,7 +4,7 @@
*
* The FreeType Windows FNT/FONT service (specification).
*
* Copyright (C) 2003-2024 by
* Copyright (C) 2003-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+4 -4
View File
@@ -4,7 +4,7 @@
*
* High-level 'sfnt' driver interface (specification).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -612,7 +612,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if a ClipBox is found. If no clip box is found or an
* error occured, value~0 is returned.
* error occurred, value~0 is returned.
*/
typedef FT_Bool
( *TT_Get_Color_Glyph_ClipBox_Func )( TT_Face face,
@@ -707,7 +707,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if everything is OK. Value~0 if no details can be found for
* this paint or any other error occured.
* this paint or any other error occurred.
*/
typedef FT_Bool
( *TT_Get_Paint_Func )( TT_Face face,
@@ -808,7 +808,7 @@ FT_BEGIN_HEADER
* corresponding (1,0) Apple entry.
*
* @return:
* 1 if there is either a win or apple entry (or both), 0 otheriwse.
* 1 if there is either a win or apple entry (or both), 0 otherwise.
*/
typedef FT_Bool
(*TT_Get_Name_ID_Func)( TT_Face face,
@@ -4,7 +4,7 @@
*
* Interface of ot-svg module (specification only).
*
* Copyright (C) 2022-2024 by
* Copyright (C) 2022-2025 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* Basic Type1/Type2 type definitions and interface (specification
* only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+12 -29
View File
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType type definitions and interface (specification
* only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -930,8 +930,8 @@ FT_BEGIN_HEADER
* resolution and scaling independent parts of a TrueType font resource.
*
* @note:
* The TT_Face structure is also used as a 'parent class' for the
* OpenType-CFF class (T2_Face).
* The TT_Face structure is also used for CFF support; see file
* `cffotypes.h`.
*/
typedef struct TT_FaceRec_* TT_Face;
@@ -1276,10 +1276,6 @@ FT_BEGIN_HEADER
*
* If varied by the `CVAR' table, non-integer values are possible.
*
* interpreter ::
* A pointer to the TrueType bytecode interpreters field is also used
* to hook the debugger in 'ttdebug'.
*
* extra ::
* Reserved for third-party font drivers.
*
@@ -1521,10 +1517,6 @@ FT_BEGIN_HEADER
FT_ULong cvt_size;
FT_Int32* cvt;
/* A pointer to the bytecode interpreter to use. This is also */
/* used to hook the debugger for the `ttdebug' utility. */
TT_Interpreter interpreter;
/************************************************************************
*
@@ -1582,11 +1574,6 @@ FT_BEGIN_HEADER
FT_UInt32 kern_avail_bits;
FT_UInt32 kern_order_bits;
#ifdef TT_CONFIG_OPTION_GPOS_KERNING
FT_Byte* gpos_table;
FT_Bool gpos_kerning_available;
#endif
#ifdef TT_CONFIG_OPTION_BDF
TT_BDFRec bdf;
#endif /* TT_CONFIG_OPTION_BDF */
@@ -1608,6 +1595,15 @@ FT_BEGIN_HEADER
/* since 2.12 */
void* svg;
#ifdef TT_CONFIG_OPTION_GPOS_KERNING
/* since 2.13.3 */
FT_Byte* gpos_table;
/* since 2.14 */
/* This is actually an array of GPOS lookup subtables. */
FT_UInt32* gpos_lookups_kerning;
FT_UInt num_gpos_lookups_kerning;
#endif
} TT_FaceRec;
@@ -1621,15 +1617,6 @@ FT_BEGIN_HEADER
* coordinates.
*
* @fields:
* memory ::
* A handle to the memory manager.
*
* max_points ::
* The maximum size in points of the zone.
*
* max_contours ::
* Max size in links contours of the zone.
*
* n_points ::
* The current number of points in the zone.
*
@@ -1653,9 +1640,6 @@ FT_BEGIN_HEADER
*/
typedef struct TT_GlyphZoneRec_
{
FT_Memory memory;
FT_UShort max_points;
FT_UShort max_contours;
FT_UShort n_points; /* number of points in zone */
FT_UShort n_contours; /* number of contours */
@@ -1714,7 +1698,6 @@ FT_BEGIN_HEADER
TT_GlyphZoneRec zone;
TT_ExecContext exec;
FT_Byte* instructions;
FT_ULong ins_pos;
/* for possible extensibility in other formats */
+1 -1
View File
@@ -5,7 +5,7 @@
* Basic WOFF/WOFF2 type definitions and interface (specification
* only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Interface for OT-SVG support related things (specification).
*
* Copyright (C) 2022-2024 by
* Copyright (C) 2022-2025 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
*
* This file is part of the FreeType project, and may only be used,
+1 -1
View File
@@ -5,7 +5,7 @@
* Basic Type 1/Type 2 tables definitions and interface (specification
* only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
File diff suppressed because it is too large Load Diff
+8 -5
View File
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType tables definitions and interface
* (specification only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -192,7 +192,7 @@ FT_BEGIN_HEADER
* A pointer into the 'hmtx' table.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* For OpenType Font Variations, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `caret_Slope_Rise`,
* `caret_Slope_Run`, and `caret_Offset`.
@@ -310,7 +310,7 @@ FT_BEGIN_HEADER
* A pointer into the 'vmtx' table.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* For OpenType Font Variations, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `Ascender`, `Descender`,
* `Line_Gap`, `caret_Slope_Rise`, `caret_Slope_Run`, and `caret_Offset`.
@@ -359,7 +359,7 @@ FT_BEGIN_HEADER
* table. In this case, the `version` field is always set to 0xFFFF.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* For OpenType Font Variations, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `sCapHeight`, `sTypoAscender`,
* `sTypoDescender`, `sTypoLineGap`, `sxHeight`, `usWinAscent`,
@@ -442,7 +442,7 @@ FT_BEGIN_HEADER
* them.
*
* @note:
* For an OpenType variation font, the values of the following fields can
* For OpenType Font Variations, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `underlinePosition` and
* `underlineThickness`.
@@ -705,6 +705,9 @@ FT_BEGIN_HEADER
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
* one with @FT_MAKE_TAG.
*
* [Since 2.14] Use value~1 if you want to access the table directory
* of the (currently selected) font.
*
* offset ::
* The starting offset in the table (or file if tag~==~0).
*
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Tags for TrueType and OpenType tables (specification only).
*
* Copyright (C) 1996-2024 by
* Copyright (C) 1996-2025 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

Some files were not shown because too many files have changed in this diff Show More