@@ -3,10 +3,12 @@ Strict
Module Pub.FreeType
-ModuleInfo "Version: 1.12"
+ModuleInfo "Version: 1.13"
ModuleInfo "License: FreeType License"
ModuleInfo "Modserver: BRL"
+ModuleInfo "History: 1.13"
+ModuleInfo "History: Updated to FreeType 2.9.1.f686ad"
ModuleInfo "History: 1.12"
ModuleInfo "History: Updated to FreeType 2.9.0"
ModuleInfo "History: 1.11"
@@ -1,39 +1,38 @@
-/***************************************************************************/
-/* */
-/* ftconfig.h */
-/* ANSI-specific configuration file (specification only). */
-/* Copyright 1996-2018 by */
-/* 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. */
-
- /*************************************************************************/
- /* */
- /* This header file contains a number of macro definitions that are used */
- /* by the rest of the engine. Most of the macros here are automatically */
- /* determined at compile time, and you should not need to change it to */
- /* port FreeType, except to compile the library with a non-ANSI */
- /* compiler. */
- /* Note however that if some specific modifications are needed, we */
- /* advise you to place a modified copy in your build directory. */
- /* The build directory is usually `builds/<system>', and contains */
- /* system-specific files that are always included first when building */
- /* the library. */
- /* This ANSI version should stay in `include/config/'. */
+/****************************************************************************
+ *
+ * ftconfig.h
+ * ANSI-specific configuration file (specification only).
+ * Copyright 1996-2019 by
+ * 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.
+ */
+
+ /**************************************************************************
+ * This header file contains a number of macro definitions that are used by
+ * the rest of the engine. Most of the macros here are automatically
+ * determined at compile time, and you should not need to change it to port
+ * FreeType, except to compile the library with a non-ANSI compiler.
+ * Note however that if some specific modifications are needed, we advise
+ * you to place a modified copy in your build directory.
+ * The build directory is usually `builds/<system>`, and contains
+ * system-specific files that are always included first when building the
+ * library.
+ * This ANSI version should stay in `include/config/`.
#ifndef FTCONFIG_H_
#define FTCONFIG_H_
@@ -46,32 +45,32 @@
FT_BEGIN_HEADER
- /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
- /* These macros can be toggled to suit a specific system. The current */
- /* ones are defaults used to compile FreeType in an ANSI C environment */
- /* (16bit compilers are also supported). Copy this file to your own */
- /* `builds/<system>' directory, and edit it to port the engine. */
+ * PLATFORM-SPECIFIC CONFIGURATION MACROS
+ * These macros can be toggled to suit a specific system. The current ones
+ * are defaults used to compile FreeType in an ANSI C environment (16bit
+ * compilers are also supported). Copy this file to your own
+ * `builds/<system>` directory, and edit it to port the engine.
- /* 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 */
- /* is probably unexpected. */
- /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
- /* `char' type. */
+ /* 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 */
+ /* is probably unexpected. */
+ /* */
+ /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
+ /* `char` type. */
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
#endif
- /* The size of an `int' type. */
+ /* The size of an `int` type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
#elif FT_UINT_MAX == 0xFFFFFFFFUL
@@ -82,7 +81,7 @@ FT_BEGIN_HEADER
#error "Unsupported size of `int' type!"
- /* The size of a `long' type. A five-byte `long' (as used e.g. on the */
+ /* The size of a `long` type. A five-byte `long` (as used e.g. on the */
/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
@@ -95,35 +94,35 @@ FT_BEGIN_HEADER
- /* FT_UNUSED is a macro used to indicate that a given parameter is not */
- /* used -- this is only used to get rid of unpleasant compiler warnings */
+ /* `FT_UNUSED` indicates that a given parameter is not used -- */
+ /* this is only used to get rid of unpleasant compiler warnings. */
#ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) )
- /* AUTOMATIC CONFIGURATION MACROS */
- /* These macros are computed from the ones defined above. Don't touch */
- /* their definition, unless you know precisely what you are doing. No */
- /* porter should need to mess with them. */
- /* Mac support */
- /* This is the only necessary change, so it is defined here instead */
- /* providing a new configuration file. */
+ * AUTOMATIC CONFIGURATION MACROS
+ * These macros are computed from the ones defined above. Don't touch
+ * their definition, unless you know precisely what you are doing. No
+ * porter should need to mess with them.
+ * Mac support
+ * This is the only necessary change, so it is defined here instead
+ * providing a new configuration file.
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
- /* no Carbon frameworks for 64bit 10.4.x */
- /* AvailabilityMacros.h is available since Mac OS X 10.2, */
- /* so guess the system version by maximum errno before inclusion */
+ /* No Carbon frameworks for 64bit 10.4.x. */
+ /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion. */
#include <errno.h>
#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
@@ -143,7 +142,7 @@ FT_BEGIN_HEADER
- /* Fix compiler warning with sgi compiler */
+ /* Fix compiler warning with sgi compiler. */
#if defined( __sgi ) && !defined( __GNUC__ )
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
#pragma set woff 3505
@@ -151,33 +150,33 @@ FT_BEGIN_HEADER
- /* <Section> */
- /* basic_types */
+ * @section:
+ * basic_types
- /* <Type> */
- /* FT_Int16 */
- /* <Description> */
- /* A typedef for a 16bit signed integer type. */
+ * @type:
+ * FT_Int16
+ * @description:
+ * A typedef for a 16bit signed integer type.
typedef signed short FT_Int16;
- /* FT_UInt16 */
- /* A typedef for a 16bit unsigned integer type. */
+ * FT_UInt16
+ * A typedef for a 16bit unsigned integer type.
typedef unsigned short FT_UInt16;
/* */
@@ -186,50 +185,50 @@ FT_BEGIN_HEADER
/* this #if 0 ... #endif clause is for documentation purposes */
#if 0
- /* FT_Int32 */
- /* A typedef for a 32bit signed integer type. The size depends on */
- /* the configuration. */
+ * FT_Int32
+ * A typedef for a 32bit signed integer type. The size depends on the
+ * configuration.
typedef signed XXX FT_Int32;
- /* FT_UInt32 */
- /* A typedef for a 32bit unsigned integer type. The size depends on */
+ * FT_UInt32
+ * A typedef for a 32bit unsigned integer type. The size depends on the
typedef unsigned XXX FT_UInt32;
- /* FT_Int64 */
- /* A typedef for a 64bit signed integer type. The size depends on */
- /* the configuration. Only defined if there is real 64bit support; */
- /* otherwise, it gets emulated with a structure (if necessary). */
+ * FT_Int64
+ * A typedef for a 64bit signed integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
typedef signed XXX FT_Int64;
- /* FT_UInt64 */
- /* A typedef for a 64bit unsigned integer type. The size depends on */
+ * FT_UInt64
+ * A typedef for a 64bit unsigned integer type. The size depends on the
typedef unsigned XXX FT_UInt64;
@@ -251,7 +250,7 @@ FT_BEGIN_HEADER
- /* look up an integer type that is at least 32 bits */
+ /* look up an integer type that is at least 32~bits */
#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
typedef int FT_Fast;
@@ -265,22 +264,22 @@ FT_BEGIN_HEADER
- /* determine whether we have a 64-bit int type for platforms without */
- /* Autoconf */
+ /* determine whether we have a 64-bit `int` type for platforms without */
+ /* Autoconf */
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
- /* FT_LONG64 must be defined if a 64-bit type is available */
+ /* `FT_LONG64` must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#define FT_UINT64 unsigned long
- /* A 64-bit data type may create compilation problems if you compile */
- /* in strict ANSI mode. To avoid them, we disable other 64-bit data */
- /* types if __STDC__ is defined. You can however ignore this rule */
- /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
+ * A 64-bit data type may create compilation problems if you compile in
+ * strict ANSI mode. To avoid them, we disable other 64-bit data types if
+ * `__STDC__` is defined. You can however ignore this rule by defining the
+ * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
@@ -289,19 +288,19 @@ FT_BEGIN_HEADER
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
-#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
+#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
- /* this compiler provides the __int64 type */
+ /* this compiler provides the `__int64` type */
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */
- /* XXXX: We should probably check the value of __BORLANDC__ in order */
- /* to test the compiler version. */
+ /* XXXX: We should probably check the value of `__BORLANDC__` in order */
+ /* to test the compiler version. */
@@ -318,7 +317,7 @@ FT_BEGIN_HEADER
#elif defined( __GNUC__ )
- /* GCC provides the `long long' type */
+ /* GCC provides the `long long` type */
@@ -342,11 +341,11 @@ FT_BEGIN_HEADER
- /* miscellaneous */
+ * miscellaneous
#define FT_BEGIN_STMNT do {
@@ -354,7 +353,7 @@ FT_BEGIN_HEADER
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
- /* typeof condition taken from gnulib's `intprops.h' header file */
+ /* `typeof` condition taken from gnulib's `intprops.h` header file */
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \
@@ -365,14 +364,14 @@ FT_BEGIN_HEADER
- /* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */
- /* a function that gets used only within the scope of a module. */
- /* Normally, both the header and source code files for such a */
- /* function are within a single module directory. */
- /* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */
- /* FT_LOCAL_ARRAY_DEF. */
+ /* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
+ /* respectively, a function that gets used only within the scope of a */
+ /* module. Normally, both the header and source code files for such a */
+ /* function are within a single module directory. */
+ /* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
+ /* `FT_LOCAL_ARRAY_DEF`. */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
@@ -394,12 +393,12 @@ FT_BEGIN_HEADER
#define FT_LOCAL_ARRAY_DEF( x ) const x
- /* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */
- /* functions that are used in more than a single module. In the */
- /* current setup this implies that the declaration is in a header */
- /* file in the `include/freetype/internal' directory, and the */
- /* function body is in a file in `src/base'. */
+ /* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
+ /* functions that are used in more than a single module. In the */
+ /* current setup this implies that the declaration is in a header file */
+ /* in the `include/freetype/internal` directory, and the function body */
+ /* is in a file in `src/base`. */
#ifndef FT_BASE
#ifdef __cplusplus
@@ -422,52 +421,66 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */
- /* When compiling FreeType as a DLL, some systems/compilers need a */
- /* special attribute in front OR after the return type of function */
- /* declarations. */
- /* Two macros are used within the FreeType source code to define */
- /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
- /* FT_EXPORT( return_type ) */
- /* is used in a function declaration, as in */
- /* FT_EXPORT( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ); */
- /* FT_EXPORT_DEF( return_type ) */
- /* is used in a function definition, as in */
- /* FT_EXPORT_DEF( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ) */
- /* { */
- /* ... some code ... */
- /* return FT_Err_Ok; */
- /* } */
- /* You can provide your own implementation of FT_EXPORT and */
- /* FT_EXPORT_DEF here if you want. */
- /* To export a variable, use FT_EXPORT_VAR. */
+ /* When compiling FreeType as a DLL or DSO with hidden visibility */
+ /* some systems/compilers need a special attribute in front OR after */
+ /* the return type of function declarations. */
+ /* Two macros are used within the FreeType source code to define */
+ /* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
+ /* - `FT_EXPORT( return_type )` */
+ /* is used in a function declaration, as in */
+ /* ``` */
+ /* FT_EXPORT( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ); */
+ /* - `FT_EXPORT_DEF( return_type )` */
+ /* is used in a function definition, as in */
+ /* FT_EXPORT_DEF( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ) */
+ /* { */
+ /* ... some code ... */
+ /* return FT_Err_Ok; */
+ /* } */
+ /* You can provide your own implementation of `FT_EXPORT` and */
+ /* `FT_EXPORT_DEF` here if you want. */
+ /* To export a variable, use `FT_EXPORT_VAR`. */
#ifndef FT_EXPORT
-#ifdef __cplusplus
+#ifdef FT2_BUILD_LIBRARY
+#if defined( _WIN32 ) && defined( DLL_EXPORT )
+#define FT_EXPORT( x ) __declspec( dllexport ) x
+#elif defined( __GNUC__ ) && __GNUC__ >= 4
+#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
+#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
+#define FT_EXPORT( x ) __global x
+#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
-#ifdef _MSC_VER
-#undef FT_EXPORT
-#ifdef _DLL
-#define FT_EXPORT( x ) __declspec( dllexport ) x
+#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
#endif /* !FT_EXPORT */
@@ -499,7 +512,7 @@ FT_BEGIN_HEADER
/* C++ compiler and with 16bit compilers. */
- /* This is special. Within C++, you must specify `extern "C"' for */
+ /* This is special. Within C++, you must specify `extern "C"` for */
/* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */
@@ -522,7 +535,7 @@ FT_BEGIN_HEADER
/* Some 16bit compilers have to redefine these macros to insert */
- /* the infamous `_cdecl' or `__fastcall' declarations. */
+ /* the infamous `_cdecl` or `__fastcall` declarations. */
#ifndef FT_CALLBACK_DEF
@@ -1,19 +1,19 @@
-/* ftheader.h */
-/* Build macros of the FreeType 2 library. */
+ * ftheader.h
+ * Build macros of the FreeType 2 library.
#ifndef FTHEADER_H_
#define FTHEADER_H_
@@ -27,7 +27,7 @@
/* <Description> */
/* This macro is used in association with @FT_END_HEADER in header */
/* files to ensure that the declarations within are properly */
- /* encapsulated in an `extern "C" { .. }' block when included from a */
+ /* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
@@ -45,7 +45,7 @@
/* This macro is used in association with @FT_BEGIN_HEADER in header */
@@ -55,54 +55,54 @@
- /* Aliases for the FreeType 2 public and configuration files. */
+ * Aliases for the FreeType 2 public and configuration files.
- /* header_file_macros */
- /* <Title> */
- /* Header File Macros */
- /* <Abstract> */
- /* Macro definitions used to #include specific header files. */
- /* The following macros are defined to the name of specific */
- /* FreeType~2 header files. They can be used directly in #include */
- /* statements as in: */
- /* #include FT_FREETYPE_H */
- /* #include FT_MULTIPLE_MASTERS_H */
- /* #include FT_GLYPH_H */
- /* There are several reasons why we are now using macros to name */
- /* public header files. The first one is that such macros are not */
- /* limited to the infamous 8.3~naming rule required by DOS (and */
- /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
- /* The second reason is that it allows for more flexibility in the */
- /* way FreeType~2 is installed on a given system. */
+ * header_file_macros
+ * @title:
+ * Header File Macros
+ * @abstract:
+ * Macro definitions used to `#include` specific header files.
+ * The following macros are defined to the name of specific FreeType~2
+ * header files. They can be used directly in `#include` statements as
+ * in:
+ * ```
+ * #include FT_FREETYPE_H
+ * #include FT_MULTIPLE_MASTERS_H
+ * #include FT_GLYPH_H
+ * There are several reasons why we are now using macros to name public
+ * header files. The first one is that such macros are not limited to
+ * the infamous 8.3~naming rule required by DOS (and
+ * `FT_MULTIPLE_MASTERS_H` is a lot more meaningful than `ftmm.h`).
+ * The second reason is that it allows for more flexibility in the way
+ * FreeType~2 is installed on a given system.
/* configuration files */
- /*************************************************************************
*
* @macro:
* FT_CONFIG_CONFIG_H
* @description:
- * A macro used in #include statements to name the file containing
+ * A macro used in `#include` statements to name the file containing
* FreeType~2 configuration data.
*/
@@ -111,13 +111,13 @@
* FT_CONFIG_STANDARD_LIBRARY_H
* FreeType~2 interface to the standard C library functions.
@@ -126,13 +126,13 @@
* FT_CONFIG_OPTIONS_H
* FreeType~2 project-specific configuration options.
@@ -141,13 +141,13 @@
* FT_CONFIG_MODULES_H
- * A macro used in #include statements to name the file containing the
+ * A macro used in `#include` statements to name the file containing the
* list of FreeType~2 modules that are statically linked to new library
* instances in @FT_Init_FreeType.
@@ -160,26 +160,26 @@
/* public headers */
* FT_FREETYPE_H
* base FreeType~2 API.
#define FT_FREETYPE_H <freetype/freetype.h>
* FT_ERRORS_H
* list of FreeType~2 error codes (and messages).
* It is included by @FT_FREETYPE_H.
@@ -188,26 +188,26 @@
#define FT_ERRORS_H <freetype/fterrors.h>
* FT_MODULE_ERRORS_H
* list of FreeType~2 module error offsets (and messages).
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
* FT_SYSTEM_H
* FreeType~2 interface to low-level operations (i.e., memory management
* and stream i/o).
@@ -217,13 +217,13 @@
#define FT_SYSTEM_H <freetype/ftsystem.h>
* FT_IMAGE_H
- * A macro used in #include statements to name the file containing type
+ * A macro used in `#include` statements to name the file containing type
* definitions related to glyph images (i.e., bitmaps, outlines,
* scan-converter parameters).
@@ -233,13 +233,13 @@
#define FT_IMAGE_H <freetype/ftimage.h>
* FT_TYPES_H
* basic data types defined by FreeType~2.
@@ -248,13 +248,13 @@
#define FT_TYPES_H <freetype/fttypes.h>
* FT_LIST_H
* list management API of FreeType~2.
* (Most applications will never need to include this file.)
@@ -263,151 +263,151 @@
#define FT_LIST_H <freetype/ftlist.h>
* FT_OUTLINE_H
* scalable outline management API of FreeType~2.
#define FT_OUTLINE_H <freetype/ftoutln.h>
* FT_SIZES_H
* API which manages multiple @FT_Size objects per face.
#define FT_SIZES_H <freetype/ftsizes.h>
* FT_MODULE_H
* module management API of FreeType~2.
#define FT_MODULE_H <freetype/ftmodapi.h>
* FT_RENDER_H
* renderer module management API of FreeType~2.
#define FT_RENDER_H <freetype/ftrender.h>
* FT_DRIVER_H
* structures and macros related to the driver modules.
#define FT_DRIVER_H <freetype/ftdriver.h>
* FT_AUTOHINTER_H
* structures and macros related to the auto-hinting module.
- * Deprecated since version 2.9; use @FT_DRIVER_H instead.
+ * Deprecated since version~2.9; use @FT_DRIVER_H instead.
#define FT_AUTOHINTER_H FT_DRIVER_H
* FT_CFF_DRIVER_H
* structures and macros related to the CFF driver module.
#define FT_CFF_DRIVER_H FT_DRIVER_H
* FT_TRUETYPE_DRIVER_H
* structures and macros related to the TrueType driver module.
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
* FT_PCF_DRIVER_H
* structures and macros related to the PCF driver module.
#define FT_PCF_DRIVER_H FT_DRIVER_H
* FT_TYPE1_TABLES_H
* types and API specific to the Type~1 format.
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
* FT_TRUETYPE_IDS_H
* enumeration values which identify name strings, languages, encodings,
* etc. This file really contains a _large_ set of constant macro
* definitions, taken from the TrueType and OpenType specifications.
@@ -416,174 +416,172 @@
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
* FT_TRUETYPE_TABLES_H
* types and API specific to the TrueType (as well as OpenType) format.
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
* FT_TRUETYPE_TAGS_H
- * definitions of TrueType four-byte `tags' which identify blocks in
+ * definitions of TrueType four-byte 'tags' which identify blocks in
* SFNT-based font formats (i.e., TrueType and OpenType).
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
* FT_BDF_H
- * definitions of an API which accesses BDF-specific strings from a
- * face.
+ * definitions of an API which accesses BDF-specific strings from a face.
#define FT_BDF_H <freetype/ftbdf.h>
* FT_CID_H
- * definitions of an API which access CID font information from a
+ * definitions of an API which access CID font information from a face.
#define FT_CID_H <freetype/ftcid.h>
* FT_GZIP_H
* definitions of an API which supports gzip-compressed files.
#define FT_GZIP_H <freetype/ftgzip.h>
* FT_LZW_H
* definitions of an API which supports LZW-compressed files.
#define FT_LZW_H <freetype/ftlzw.h>
* FT_BZIP2_H
* definitions of an API which supports bzip2-compressed files.
#define FT_BZIP2_H <freetype/ftbzip2.h>
* FT_WINFONTS_H
* definitions of an API which supports Windows FNT files.
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
* FT_GLYPH_H
* API of the optional glyph management component.
#define FT_GLYPH_H <freetype/ftglyph.h>
* FT_BITMAP_H
* API of the optional bitmap conversion component.
#define FT_BITMAP_H <freetype/ftbitmap.h>
* FT_BBOX_H
* API of the optional exact bounding box computation routines.
#define FT_BBOX_H <freetype/ftbbox.h>
* FT_CACHE_H
* API of the optional FreeType~2 cache sub-system.
#define FT_CACHE_H <freetype/ftcache.h>
* FT_MAC_H
- * Macintosh-specific FreeType~2 API. The latter is used to access
- * fonts embedded in resource forks.
+ * Macintosh-specific FreeType~2 API. The latter is used to access fonts
+ * embedded in resource forks.
* This header file must be explicitly included by client applications
* compiled on the Mac (note that the base API still works though).
@@ -592,105 +590,105 @@
#define FT_MAC_H <freetype/ftmac.h>
* FT_MULTIPLE_MASTERS_H
* optional multiple-masters management API of FreeType~2.
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
* FT_SFNT_NAMES_H
- * optional FreeType~2 API which accesses embedded `name' strings in
+ * optional FreeType~2 API which accesses embedded 'name' strings in
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
* FT_OPENTYPE_VALIDATE_H
- * optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
- * GPOS, GSUB, JSTF).
+ * optional FreeType~2 API which validates OpenType tables (`BASE`,
+ * `GDEF`, `GPOS`, `GSUB`, `JSTF`).
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
* FT_GX_VALIDATE_H
- * optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
- * mort, morx, bsln, just, kern, opbd, trak, prop).
+ * optional FreeType~2 API which validates TrueTypeGX/AAT tables (`feat`,
+ * `mort`, `morx`, `bsln`, `just`, `kern`, `opbd`, `trak`, `prop`).
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
* FT_PFR_H
* FreeType~2 API which accesses PFR-specific data.
#define FT_PFR_H <freetype/ftpfr.h>
* FT_STROKER_H
* FreeType~2 API which provides functions to stroke outline paths.
#define FT_STROKER_H <freetype/ftstroke.h>
* FT_SYNTHESIS_H
* FreeType~2 API which performs artificial obliquing and emboldening.
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
* FT_FONT_FORMATS_H
* FreeType~2 API which provides functions specific to font formats.
#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
@@ -699,67 +697,79 @@
#define FT_XFREE86_H FT_FONT_FORMATS_H
* FT_TRIGONOMETRY_H
* FreeType~2 API which performs trigonometric computations (e.g.,
* cosines and arc tangents).
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
* FT_LCD_FILTER_H
* FreeType~2 API which performs color filtering for subpixel rendering.
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
* FT_INCREMENTAL_H
* FreeType~2 API which performs incremental glyph loading.
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
* FT_GASP_H
* FreeType~2 API which returns entries from the TrueType GASP table.
#define FT_GASP_H <freetype/ftgasp.h>
* FT_ADVANCES_H
* FreeType~2 API which returns individual and ranged glyph advances.
#define FT_ADVANCES_H <freetype/ftadvanc.h>
+ * @macro:
+ * FT_COLOR_H
+ * FreeType~2 API which handles the OpenType `CPAL` table.
+#define FT_COLOR_H <freetype/ftcolor.h>
/* These header files don't need to be included by the user. */
@@ -770,14 +780,14 @@
#define FT_UNPATENTED_HINTING_H <freetype/ftparams.h>
#define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h>
- /* FT_CACHE_H is the only header file needed for the cache subsystem. */
+ /* `FT_CACHE_H` is the only header file needed for the cache subsystem. */
#define FT_CACHE_IMAGE_H FT_CACHE_H
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
#define FT_CACHE_CHARMAP_H FT_CACHE_H
/* The internals of the cache sub-system are no longer exposed. We */
- /* default to FT_CACHE_H at the moment just in case, but we know of */
- /* no rogue client that uses them. */
+ /* default to `FT_CACHE_H` at the moment just in case, but we know */
+ /* of no rogue client that uses them. */
#define FT_CACHE_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
@@ -789,8 +799,8 @@
/*
- * Include internal headers definitions from <internal/...>
- * only when building the library.
+ * Include internal headers definitions from `<internal/...>` only when
+ * building the library.
#ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
@@ -1,12 +1,12 @@
- * This file registers the FreeType modules compiled into the library.
+ * This file registers the FreeType modules compiled into the library.
- * If you use GNU make, this file IS NOT USED! Instead, it is created in
- * the objects directory (normally `<topdir>/objs/') based on information
- * from `<topdir>/modules.cfg'.
+ * If you use GNU make, this file IS NOT USED! Instead, it is created in
+ * the objects directory (normally `<topdir>/objs/`) based on information
+ * from `<topdir>/modules.cfg`.
- * Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
- * FreeType without GNU make.
+ * Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile
+ * FreeType without GNU make.
@@ -1,31 +1,31 @@
-/* ftstdlib.h */
-/* ANSI-specific library and header configuration file (specification */
-/* only). */
-/* Copyright 2002-2018 by */
- /* This file is used to group all #includes to the ANSI C library that */
- /* FreeType normally requires. It also defines macros to rename the */
- /* standard functions within the FreeType source code. */
- /* Load a file which defines FTSTDLIB_H_ before this one to override it. */
+ * ftstdlib.h
+ * ANSI-specific library and header configuration file (specification
+ * only).
+ * Copyright 2002-2019 by
+ * This file is used to group all `#includes` to the ANSI~C library that
+ * FreeType normally requires. It also defines macros to rename the
+ * standard functions within the FreeType source code.
+ * Load a file which defines `FTSTDLIB_H_` before this one to override it.
#ifndef FTSTDLIB_H_
@@ -37,23 +37,23 @@
#define ft_ptrdiff_t ptrdiff_t
- /**********************************************************************/
- /* integer limits */
- /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
- /* of `int' and `long' in bytes at compile-time. So far, this works */
- /* for all platforms the library has been tested on. */
- /* Note that on the extremely rare platforms that do not provide */
- /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
- /* old Crays where `int' is 36 bits), we do not make any guarantee */
- /* about the correct behaviour of FT2 with all fonts. */
- /* In these case, `ftconfig.h' will refuse to compile anyway with a */
- /* message like `couldn't find 32-bit type' or something similar. */
+ * integer limits
+ * `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
+ * `int` and `long` in bytes at compile-time. So far, this works for all
+ * platforms the library has been tested on.
+ * Note that on the extremely rare platforms that do not provide integer
+ * types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
+ * `int` is 36~bits), we do not make any guarantee about the correct
+ * behaviour of FreeType~2 with all fonts.
+ * In these cases, `ftconfig.h` will refuse to compile anyway with a
+ * message like 'couldn't find 32-bit type' or something similar.
#include <limits.h>
@@ -68,11 +68,11 @@
#define FT_ULONG_MAX ULONG_MAX
- /* character and string processing */
+ * character and string processing
#include <string.h>
@@ -92,11 +92,11 @@
#define ft_strstr strstr
- /* file handling */
+ * file handling
#include <stdio.h>
@@ -110,11 +110,11 @@
#define ft_sprintf sprintf
- /* sorting */
+ * sorting
#include <stdlib.h>
@@ -122,11 +122,11 @@
#define ft_qsort qsort
- /* memory allocation */
+ * memory allocation
#define ft_scalloc calloc
@@ -135,36 +135,36 @@
#define ft_srealloc realloc
#define ft_strtol strtol
#define ft_getenv getenv
- /* execution control */
+ * execution control
#include <setjmp.h>
-#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
- /* jmp_buf is defined as a macro */
- /* on certain platforms */
+#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
+ /* `jmp_buf` is defined as a macro */
+ /* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
- /* the following is only used for debugging purposes, i.e., if */
- /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
+ /* The following is only used for debugging purposes, i.e., if */
+ /* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
#include <stdarg.h>
-/* ftadvanc.h */
-/* Quick computation of advance widths (specification only). */
-/* Copyright 2008-2018 by */
+ * ftadvanc.h
+ * Quick computation of advance widths (specification only).
+ * Copyright 2008-2019 by
#ifndef FTADVANC_H_
@@ -56,68 +56,67 @@ FT_BEGIN_HEADER
- /* <Const> */
- /* FT_ADVANCE_FLAG_FAST_ONLY */
- /* A bit-flag to be OR-ed with the `flags' parameter of the */
- /* @FT_Get_Advance and @FT_Get_Advances functions. */
- /* If set, it indicates that you want these functions to fail if the */
- /* corresponding hinting mode or font driver doesn't allow for very */
- /* quick advance computation. */
- /* Typically, glyphs that are either unscaled, unhinted, bitmapped, */
- /* or light-hinted can have their advance width computed very */
- /* quickly. */
- /* Normal and bytecode hinted modes that require loading, scaling, */
- /* and hinting of the glyph outline, are extremely slow by */
- /* comparison. */
+ * @enum:
+ * FT_ADVANCE_FLAG_FAST_ONLY
+ * A bit-flag to be OR-ed with the `flags` parameter of the
+ * @FT_Get_Advance and @FT_Get_Advances functions.
+ * If set, it indicates that you want these functions to fail if the
+ * corresponding hinting mode or font driver doesn't allow for very quick
+ * advance computation.
+ * Typically, glyphs that are either unscaled, unhinted, bitmapped, or
+ * light-hinted can have their advance width computed very quickly.
+ * Normal and bytecode hinted modes that require loading, scaling, and
+ * hinting of the glyph outline, are extremely slow by comparison.
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
- /* <Function> */
- /* FT_Get_Advance */
- /* Retrieve the advance value of a given glyph outline in an */
- /* @FT_Face. */
- /* <Input> */
- /* face :: The source @FT_Face handle. */
- /* gindex :: The glyph index. */
- /* load_flags :: A set of bit flags similar to those used when */
- /* calling @FT_Load_Glyph, used to determine what kind */
- /* of advances you need. */
- /* <Output> */
- /* padvance :: The advance value. If scaling is performed (based on */
- /* the value of `load_flags'), the advance value is in */
- /* 16.16 format. Otherwise, it is in font units. */
- /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
- /* vertical advance corresponding to a vertical layout. */
- /* Otherwise, it is the horizontal advance in a */
- /* horizontal layout. */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* <Note> */
- /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
- /* if the corresponding font backend doesn't have a quick way to */
- /* retrieve the advances. */
- /* A scaled advance is returned in 16.16 format but isn't transformed */
- /* by the affine transformation specified by @FT_Set_Transform. */
+ * @function:
+ * FT_Get_Advance
+ * Retrieve the advance value of a given glyph outline in an @FT_Face.
+ * @input:
+ * face ::
+ * The source @FT_Face handle.
+ * gindex ::
+ * The glyph index.
+ * load_flags ::
+ * A set of bit flags similar to those used when calling
+ * @FT_Load_Glyph, used to determine what kind of advances you need.
+ * @output:
+ * padvance ::
+ * The advance value. If scaling is performed (based on the value of
+ * `load_flags`), the advance value is in 16.16 format. Otherwise, it
+ * is in font units.
+ * If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance
+ * corresponding to a vertical layout. Otherwise, it is the horizontal
+ * advance in a horizontal layout.
+ * @return:
+ * FreeType error code. 0 means success.
+ * @note:
+ * This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
+ * the corresponding font backend doesn't have a quick way to retrieve
+ * the advances.
+ * A scaled advance is returned in 16.16 format but isn't transformed by
+ * the affine transformation specified by @FT_Set_Transform.
FT_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
@@ -125,50 +124,52 @@ FT_BEGIN_HEADER
FT_Fixed *padvance );
- /* FT_Get_Advances */
- /* Retrieve the advance values of several glyph outlines in an */
- /* start :: The first glyph index. */
- /* count :: The number of advance values you want to retrieve. */
- /* calling @FT_Load_Glyph. */
- /* padvance :: The advance values. This array, to be provided by the */
- /* caller, must contain at least `count' elements. */
- /* If scaling is performed (based on the value of */
- /* `load_flags'), the advance values are in 16.16 format. */
- /* Otherwise, they are in font units. */
- /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
- /* vertical advances corresponding to a vertical layout. */
- /* Otherwise, they are the horizontal advances in a */
- /* Scaled advances are returned in 16.16 format but aren't */
- /* transformed by the affine transformation specified by */
- /* @FT_Set_Transform. */
+ * FT_Get_Advances
+ * Retrieve the advance values of several glyph outlines in an @FT_Face.
+ * start ::
+ * The first glyph index.
+ * count ::
+ * The number of advance values you want to retrieve.
+ * @FT_Load_Glyph.
+ * The advance values. This array, to be provided by the caller, must
+ * contain at least `count` elements.
+ * If scaling is performed (based on the value of `load_flags`), the
+ * advance values are in 16.16 format. Otherwise, they are in font
+ * units.
+ * If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances
+ * corresponding to a vertical layout. Otherwise, they are the
+ * horizontal advances in a horizontal layout.
+ * Scaled advances are returned in 16.16 format but aren't transformed by
FT_Get_Advances( FT_Face face,
FT_UInt start,
@@ -1,30 +1,30 @@
-/* ftbbox.h */
-/* FreeType exact bbox computation (specification). */
- /* This component has a _single_ role: to compute exact outline bounding */
- /* boxes. */
- /* It is separated from the rest of the engine for various technical */
- /* reasons. It may well be integrated in `ftoutln' later. */
+ * ftbbox.h
+ * FreeType exact bbox computation (specification).
+ * This component has a _single_ role: to compute exact outline bounding
+ * boxes.
+ * It is separated from the rest of the engine for various technical
+ * reasons. It may well be integrated in 'ftoutln' later.
#ifndef FTBBOX_H_
@@ -44,43 +44,44 @@
- /* outline_processing */
- /* FT_Outline_Get_BBox */
- /* Compute the exact bounding box of an outline. This is slower */
- /* than computing the control box. However, it uses an advanced */
- /* algorithm that returns _very_ quickly when the two boxes */
- /* coincide. Otherwise, the outline Bezier arcs are traversed to */
- /* extract their extrema. */
- /* outline :: A pointer to the source outline. */
- /* abbox :: The outline's exact bounding box. */
- /* FreeType error code. 0~means success. */
- /* If the font is tricky and the glyph has been loaded with */
- /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
- /* reasonable values for the BBox it is necessary to load the glyph */
- /* at a large ppem value (so that the hinting instructions can */
- /* properly shift and scale the subglyphs), then extracting the BBox, */
- /* which can be eventually converted back to font units. */
+ * outline_processing
+ * FT_Outline_Get_BBox
+ * Compute the exact bounding box of an outline. This is slower than
+ * computing the control box. However, it uses an advanced algorithm
+ * that returns _very_ quickly when the two boxes coincide. Otherwise,
+ * the outline Bezier arcs are traversed to extract their extrema.
+ * outline ::
+ * A pointer to the source outline.
+ * abbox ::
+ * The outline's exact bounding box.
+ * FreeType error code. 0~means success.
+ * If the font is tricky and the glyph has been loaded with
+ * @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get
+ * reasonable values for the BBox it is necessary to load the glyph at a
+ * large ppem value (so that the hinting instructions can properly shift
+ * and scale the subglyphs), then extracting the BBox, which can be
+ * eventually converted back to font units.
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
-/* ftbdf.h */
-/* FreeType API for accessing BDF-specific strings (specification). */
+ * ftbdf.h
+ * FreeType API for accessing BDF-specific strings (specification).
#ifndef FTBDF_H_
@@ -32,25 +32,25 @@
- /* bdf_fonts */
- /* BDF and PCF Files */
- /* BDF and PCF specific API. */
- /* This section contains the declaration of functions specific to BDF */
- /* and PCF fonts. */
+ * bdf_fonts
+ * BDF and PCF Files
+ * BDF and PCF specific API.
+ * This section contains the declaration of functions specific to BDF and
+ * PCF fonts.
- /**********************************************************************
* @enum:
* BDF_PropertyType
@@ -81,40 +81,40 @@ FT_BEGIN_HEADER
} BDF_PropertyType;
* @type:
* BDF_Property
- * A handle to a @BDF_PropertyRec structure to model a given
- * BDF/PCF property.
+ * A handle to a @BDF_PropertyRec structure to model a given BDF/PCF
+ * property.
typedef struct BDF_PropertyRec_* BDF_Property;
- *
- * @struct:
- * BDF_PropertyRec
- * @description:
- * This structure models a given BDF/PCF property.
- * @fields:
- * type ::
- * The property type.
- * u.atom ::
- * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
- * NULL, indicating an empty string.
- * u.integer ::
- * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
- * u.cardinal ::
- * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
- */
+ * @struct:
+ * BDF_PropertyRec
+ * This structure models a given BDF/PCF property.
+ * @fields:
+ * type ::
+ * The property type.
+ * u.atom ::
+ * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be NULL,
+ * indicating an empty string.
+ * u.integer ::
+ * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
+ * u.cardinal ::
+ * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
typedef struct BDF_PropertyRec_
{
BDF_PropertyType type;
@@ -128,73 +128,76 @@ FT_BEGIN_HEADER
} BDF_PropertyRec;
- * @function:
- * FT_Get_BDF_Charset_ID
- * Retrieve a BDF font character set identity, according to
- * the BDF specification.
- * @input:
- * face ::
- * A handle to the input face.
- * @output:
- * acharset_encoding ::
- * Charset encoding, as a C~string, owned by the face.
- * acharset_registry ::
- * Charset registry, as a C~string, owned by the face.
- * @return:
- * FreeType error code. 0~means success.
- * @note:
- * This function only works with BDF faces, returning an error otherwise.
+ * FT_Get_BDF_Charset_ID
+ * Retrieve a BDF font character set identity, according to the BDF
+ * specification.
+ * A handle to the input face.
+ * acharset_encoding ::
+ * Charset encoding, as a C~string, owned by the face.
+ * acharset_registry ::
+ * Charset registry, as a C~string, owned by the face.
+ * This function only works with BDF faces, returning an error otherwise.
FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry );
- * FT_Get_BDF_Property
- * Retrieve a BDF property from a BDF or PCF font file.
- * face :: A handle to the input face.
- * name :: The property name.
- * aproperty :: The property.
- * This function works with BDF _and_ PCF fonts. It returns an error
- * otherwise. It also returns an error if the property is not in the
- * font.
- * A `property' is a either key-value pair within the STARTPROPERTIES
- * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
- * `info->props' array within a `FontRec' structure of a PCF font.
- * Integer properties are always stored as `signed' within PCF fonts;
- * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
- * for BDF fonts only.
- * In case of error, `aproperty->type' is always set to
- * @BDF_PROPERTY_TYPE_NONE.
+ * FT_Get_BDF_Property
+ * Retrieve a BDF property from a BDF or PCF font file.
+ * name ::
+ * The property name.
+ * aproperty ::
+ * The property.
+ * This function works with BDF _and_ PCF fonts. It returns an error
+ * otherwise. It also returns an error if the property is not in the
+ * font.
+ * A 'property' is a either key-value pair within the STARTPROPERTIES
+ * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
+ * `info->props` array within a `FontRec` structure of a PCF font.
+ * Integer properties are always stored as 'signed' within PCF fonts;
+ * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
+ * for BDF fonts only.
+ * In case of error, `aproperty->type` is always set to
+ * @BDF_PROPERTY_TYPE_NONE.
FT_Get_BDF_Property( FT_Face face,
const char* prop_name,
-/* ftbitmap.h */
-/* FreeType utility functions for bitmaps (specification). */
-/* Copyright 2004-2018 by */
+ * ftbitmap.h
+ * FreeType utility functions for bitmaps (specification).
+ * Copyright 2004-2019 by
#ifndef FTBITMAP_H_
@@ -22,6 +22,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
+#include FT_COLOR_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@@ -33,39 +34,46 @@
- /* bitmap_handling */
- /* Bitmap Handling */
- /* Handling FT_Bitmap objects. */
- /* This section contains functions for handling @FT_Bitmap objects. */
- /* Note that none of the functions changes the bitmap's `flow' (as */
- /* indicated by the sign of the `pitch' field in `FT_Bitmap'). */
- /* FT_Bitmap_Init */
- /* Initialize a pointer to an @FT_Bitmap structure. */
- /* <InOut> */
- /* abitmap :: A pointer to the bitmap structure. */
- /* A deprecated name for the same function is `FT_Bitmap_New'. */
+ * bitmap_handling
+ * Bitmap Handling
+ * Handling FT_Bitmap objects.
+ * This section contains functions for handling @FT_Bitmap objects,
+ * automatically adjusting the target's bitmap buffer size as needed.
+ * Note that none of the functions changes the bitmap's 'flow' (as
+ * indicated by the sign of the `pitch` field in @FT_Bitmap).
+ * To set the flow, assign an appropriate positive or negative value to
+ * the `pitch` field of the target @FT_Bitmap object after calling
+ * @FT_Bitmap_Init but before calling any of the other functions
+ * described here.
+ * FT_Bitmap_Init
+ * Initialize a pointer to an @FT_Bitmap structure.
+ * @inout:
+ * abitmap ::
+ * A pointer to the bitmap structure.
+ * A deprecated name for the same function is `FT_Bitmap_New`.
FT_EXPORT( void )
FT_Bitmap_Init( FT_Bitmap *abitmap );
@@ -75,66 +83,77 @@ FT_BEGIN_HEADER
FT_Bitmap_New( FT_Bitmap *abitmap );
- /* FT_Bitmap_Copy */
- /* Copy a bitmap into another one. */
- /* library :: A handle to a library object. */
- /* source :: A handle to the source bitmap. */
- /* target :: A handle to the target bitmap. */
+ * FT_Bitmap_Copy
+ * Copy a bitmap into another one.
+ * library ::
+ * A handle to a library object.
+ * source ::
+ * A handle to the source bitmap.
+ * target ::
+ * A handle to the target bitmap.
+ * `source->buffer` and `target->buffer` must neither be equal nor
+ * overlap.
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target );
- /* FT_Bitmap_Embolden */
- /* Embolden a bitmap. The new bitmap will be about `xStrength' */
- /* pixels wider and `yStrength' pixels higher. The left and bottom */
- /* borders are kept unchanged. */
- /* xStrength :: How strong the glyph is emboldened horizontally. */
- /* Expressed in 26.6 pixel format. */
- /* yStrength :: How strong the glyph is emboldened vertically. */
- /* bitmap :: A handle to the target bitmap. */
- /* The current implementation restricts `xStrength' to be less than */
- /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
- /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
- /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
- /* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */
- /* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */
+ * FT_Bitmap_Embolden
+ * Embolden a bitmap. The new bitmap will be about `xStrength` pixels
+ * wider and `yStrength` pixels higher. The left and bottom borders are
+ * kept unchanged.
+ * xStrength ::
+ * How strong the glyph is emboldened horizontally. Expressed in 26.6
+ * pixel format.
+ * yStrength ::
+ * How strong the glyph is emboldened vertically. Expressed in 26.6
+ * bitmap ::
+ * The current implementation restricts `xStrength` to be less than or
+ * equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.
+ * If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, you
+ * should call @FT_GlyphSlot_Own_Bitmap on the slot first.
+ * Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format are
+ * converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp).
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
@@ -142,39 +161,46 @@ FT_BEGIN_HEADER
FT_Pos yStrength );
- /* FT_Bitmap_Convert */
- /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
- /* to a bitmap object with depth 8bpp, making the number of used */
- /* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */
- /* source :: The source bitmap. */
- /* alignment :: The pitch of the bitmap is a multiple of this */
- /* parameter. Common values are 1, 2, or 4. */
- /* target :: The target bitmap. */
- /* It is possible to call @FT_Bitmap_Convert multiple times without */
- /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
- /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
- /* The `library' argument is taken to have access to FreeType's */
- /* memory handling functions. */
+ * FT_Bitmap_Convert
+ * Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to
+ * a bitmap object with depth 8bpp, making the number of used bytes per
+ * line (a.k.a. the 'pitch') a multiple of `alignment`.
+ * The source bitmap.
+ * alignment ::
+ * The pitch of the bitmap is a multiple of this argument. Common
+ * values are 1, 2, or 4.
+ * The target bitmap.
+ * It is possible to call @FT_Bitmap_Convert multiple times without
+ * calling @FT_Bitmap_Done (the memory is simply reallocated).
+ * Use @FT_Bitmap_Done to finally remove the bitmap object.
+ * The `library` argument is taken to have access to FreeType's memory
+ * handling functions.
FT_Bitmap_Convert( FT_Library library,
@@ -182,48 +208,111 @@ FT_BEGIN_HEADER
FT_Int alignment );
- /* FT_GlyphSlot_Own_Bitmap */
- /* Make sure that a glyph slot owns `slot->bitmap'. */
- /* slot :: The glyph slot. */
- /* This function is to be used in combination with */
- /* @FT_Bitmap_Embolden. */
+ * FT_Bitmap_Blend
+ * Blend a bitmap onto another bitmap, using a given color.
+ * The source bitmap, which can have any @FT_Pixel_Mode format.
+ * source_offset ::
+ * The offset vector to the upper left corner of the source bitmap in
+ * 26.6 pixel format. This can be a fractional pixel value.
+ * color ::
+ * The color used to draw `source` onto `target`.
+ * A handle to an `FT_Bitmap` object. It should be either initialized
+ * as empty with a call to @FT_Bitmap_Init, or it should be of type
+ * @FT_PIXEL_MODE_BGRA.
+ * atarget_offset ::
+ * The offset vector to the upper left corner of the target bitmap in
+ * 26.6 pixel format. It should represent an integer offset; the
+ * function will set the lowest six bits to zero to enforce that.
+ * This function doesn't perform clipping.
+ * The bitmap in `target` gets allocated or reallocated as needed; the
+ * vector `atarget_offset` is updated accordingly.
+ * In case of allocation or reallocation, the bitmap's pitch is set to
+ * `4 * width`. Both `source` and `target` must have the same bitmap
+ * flow (as indicated by the sign of the `pitch` field).
+ * @since:
+ * 2.10
+ FT_EXPORT( FT_Error )
+ FT_Bitmap_Blend( FT_Library library,
+ const FT_Bitmap* source,
+ const FT_Vector source_offset,
+ FT_Bitmap* target,
+ FT_Vector *atarget_offset,
+ FT_Color color );
+ * FT_GlyphSlot_Own_Bitmap
+ * Make sure that a glyph slot owns `slot->bitmap`.
+ * slot ::
+ * The glyph slot.
+ * This function is to be used in combination with @FT_Bitmap_Embolden.
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
- /* FT_Bitmap_Done */
- /* Destroy a bitmap object initialized with @FT_Bitmap_Init. */
- /* bitmap :: The bitmap object to be freed. */
+ * FT_Bitmap_Done
+ * Destroy a bitmap object initialized with @FT_Bitmap_Init.
+ * The bitmap object to be freed.
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap );
-/* ftbzip2.h */
-/* Bzip2-compressed stream support. */
-/* Copyright 2010-2018 by */
-/* Joel Klinghed. */
+ * ftbzip2.h
+ * Bzip2-compressed stream support.
+ * Copyright 2010-2019 by
+ * Joel Klinghed.
#ifndef FTBZIP2_H_
@@ -31,62 +31,62 @@
- /* bzip2 */
- /* BZIP2 Streams */
- /* Using bzip2-compressed font files. */
- /* This section contains the declaration of Bzip2-specific functions. */
+ * bzip2
+ * BZIP2 Streams
+ * Using bzip2-compressed font files.
+ * This section contains the declaration of Bzip2-specific functions.
- /************************************************************************
- * FT_Stream_OpenBzip2
- * Open a new stream to parse bzip2-compressed font files. This is
- * mainly used to support the compressed `*.pcf.bz2' fonts that come
- * with XFree86.
- * stream ::
- * The target embedding stream.
- * source ::
- * The source stream.
- * The source stream must be opened _before_ calling this function.
- * Calling the internal function `FT_Stream_Close' on the new stream will
- * *not* call `FT_Stream_Close' on the source stream. None of the stream
- * objects will be released to the heap.
- * The stream implementation is very basic and resets the decompression
- * process each time seeking backwards is needed within the stream.
- * In certain builds of the library, bzip2 compression recognition is
- * automatically handled when calling @FT_New_Face or @FT_Open_Face.
- * This means that if no font driver is capable of handling the raw
- * compressed file, the library will try to open a bzip2 compressed stream
- * from it and re-open the face with it.
- * This function may return `FT_Err_Unimplemented_Feature' if your build
- * of FreeType was not compiled with bzip2 support.
+ * FT_Stream_OpenBzip2
+ * Open a new stream to parse bzip2-compressed font files. This is
+ * mainly used to support the compressed `*.pcf.bz2` fonts that come with
+ * XFree86.
+ * stream ::
+ * The target embedding stream.
+ * The source stream.
+ * The source stream must be opened _before_ calling this function.
+ * Calling the internal function `FT_Stream_Close` on the new stream will
+ * **not** call `FT_Stream_Close` on the source stream. None of the
+ * stream objects will be released to the heap.
+ * The stream implementation is very basic and resets the decompression
+ * process each time seeking backwards is needed within the stream.
+ * In certain builds of the library, bzip2 compression recognition is
+ * automatically handled when calling @FT_New_Face or @FT_Open_Face.
+ * This means that if no font driver is capable of handling the raw
+ * compressed file, the library will try to open a bzip2 compressed
+ * stream from it and re-open the face with it.
+ * This function may return `FT_Err_Unimplemented_Feature` if your build
+ * of FreeType was not compiled with bzip2 support.
FT_Stream_OpenBzip2( FT_Stream stream,
FT_Stream source );
@@ -1,139 +1,145 @@
-/* This file defines the structure of the FreeType reference. */
-/* It is used by the python script that generates the HTML files. */
-/* <Chapter> */
-/* general_remarks */
-/* <Title> */
-/* General Remarks */
-/* <Sections> */
-/* header_inclusion */
-/* user_allocation */
-/* core_api */
-/* Core API */
-/* version */
-/* basic_types */
-/* base_interface */
-/* glyph_variants */
-/* glyph_management */
-/* mac_specific */
-/* sizes_management */
-/* header_file_macros */
-/* format_specific */
-/* Format-Specific API */
-/* multiple_masters */
-/* truetype_tables */
-/* type1_tables */
-/* sfnt_names */
-/* bdf_fonts */
-/* cid_fonts */
-/* pfr_fonts */
-/* winfnt_fonts */
-/* font_formats */
-/* gasp_table */
-/* module_specific */
-/* Controlling FreeType Modules */
-/* auto_hinter */
-/* cff_driver */
-/* t1_cid_driver */
-/* tt_driver */
-/* pcf_driver */
-/* properties */
-/* parameter_tags */
-/* cache_subsystem */
-/* Cache Sub-System */
-/* support_api */
-/* Support API */
-/* computations */
-/* list_processing */
-/* outline_processing */
-/* quick_advance */
-/* bitmap_handling */
-/* raster */
-/* glyph_stroker */
-/* system_interface */
-/* module_management */
-/* gzip */
-/* lzw */
-/* bzip2 */
-/* lcd_filtering */
-/* error_codes */
-/* Error Codes */
-/* error_enumerations */
-/* error_code_values */
+ * This file defines the structure of the FreeType reference.
+ * It is used by the python script that generates the HTML files.
+ * @chapter:
+ * general_remarks
+ * General Remarks
+ * @sections:
+ * header_inclusion
+ * user_allocation
+ * core_api
+ * Core API
+ * version
+ * base_interface
+ * glyph_variants
+ * color_management
+ * layer_management
+ * glyph_management
+ * mac_specific
+ * sizes_management
+ * format_specific
+ * Format-Specific API
+ * multiple_masters
+ * truetype_tables
+ * type1_tables
+ * sfnt_names
+ * cid_fonts
+ * pfr_fonts
+ * winfnt_fonts
+ * font_formats
+ * gasp_table
+ * module_specific
+ * Controlling FreeType Modules
+ * auto_hinter
+ * cff_driver
+ * t1_cid_driver
+ * tt_driver
+ * pcf_driver
+ * properties
+ * parameter_tags
+ * lcd_rendering
+ * cache_subsystem
+ * Cache Sub-System
+ * support_api
+ * Support API
+ * computations
+ * list_processing
+ * quick_advance
+ * raster
+ * glyph_stroker
+ * system_interface
+ * module_management
+ * gzip
+ * lzw
+ * error_codes
+ * Error Codes
+ * error_enumerations
+ * error_code_values
+/* END */
-/* ftcid.h */
-/* FreeType API for accessing CID font information (specification). */
-/* Copyright 2007-2018 by */
-/* Dereg Clegg and Michael Toftdal. */
+ * ftcid.h
+ * FreeType API for accessing CID font information (specification).
+ * Copyright 2007-2019 by
+ * Dereg Clegg and Michael Toftdal.
#ifndef FTCID_H_
- /* cid_fonts */
- /* CID Fonts */
- /* CID-keyed font specific API. */
- /* This section contains the declaration of CID-keyed font specific */
- /* functions. */
+ * CID Fonts
+ * CID-keyed font-specific API.
+ * This section contains the declaration of CID-keyed font-specific
+ * functions.
* @function:
* FT_Get_CID_Registry_Ordering_Supplement
@@ -61,17 +61,17 @@ FT_BEGIN_HEADER
* @input:
* face ::
* @output:
* registry ::
- * The registry, as a C~string, owned by the face.
+ * The registry, as a C~string, owned by the face.
* ordering ::
- * The ordering, as a C~string, owned by the face.
+ * The ordering, as a C~string, owned by the face.
* supplement ::
- * The supplement.
+ * The supplement.
* @return:
* FreeType error code. 0~means success.
@@ -90,30 +90,30 @@ FT_BEGIN_HEADER
FT_Int *supplement );
* FT_Get_CID_Is_Internally_CID_Keyed
- * Retrieve the type of the input face, CID keyed or not. In
- * contrast to the @FT_IS_CID_KEYED macro this function returns
- * successfully also for CID-keyed fonts in an SFNT wrapper.
+ * Retrieve the type of the input face, CID keyed or not. In contrast
+ * to the @FT_IS_CID_KEYED macro this function returns successfully also
+ * for CID-keyed fonts in an SFNT wrapper.
* is_cid ::
- * The type of the face as an @FT_Bool.
+ * The type of the face as an @FT_Bool.
* @note:
- * This function only works with CID faces and OpenType fonts,
- * returning an error otherwise.
+ * This function only works with CID faces and OpenType fonts, returning
+ * an error otherwise.
* @since:
* 2.3.9
@@ -123,7 +123,7 @@ FT_BEGIN_HEADER
FT_Bool *is_cid );
* FT_Get_CID_From_Glyph_Index
@@ -133,21 +133,21 @@ FT_BEGIN_HEADER
* glyph_index ::
- * The input glyph index.
+ * The input glyph index.
* cid ::
- * The CID as an @FT_UInt.
+ * The CID as an @FT_UInt.
@@ -0,0 +1,313 @@
+ * ftcolor.h
+ * FreeType's glyph color management (specification).
+ * Copyright 2018-2019 by
+#ifndef FTCOLOR_H_
+#define FTCOLOR_H_
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+FT_BEGIN_HEADER
+ * Glyph Color Management
+ * Retrieving and manipulating OpenType's `CPAL` table data.
+ * The functions described here allow access and manipulation of color
+ * palette entries in OpenType's `CPAL` tables.
+ * FT_Color
+ * This structure models a BGRA color value of a `CPAL` palette entry.
+ * The used color space is sRGB; the colors are not pre-multiplied, and
+ * alpha values must be explicitly set.
+ * blue ::
+ * Blue value.
+ * green ::
+ * Green value.
+ * red ::
+ * Red value.
+ * alpha ::
+ * Alpha value, giving the red, green, and blue color's opacity.
+ typedef struct FT_Color_
+ {
+ FT_Byte blue;
+ FT_Byte green;
+ FT_Byte red;
+ FT_Byte alpha;
+ } FT_Color;
+ * FT_PALETTE_XXX
+ * A list of bit field constants used in the `palette_flags` array of the
+ * @FT_Palette_Data structure to indicate for which background a palette
+ * with a given index is usable.
+ * @values:
+ * FT_PALETTE_FOR_LIGHT_BACKGROUND ::
+ * The palette is appropriate to use when displaying the font on a
+ * light background such as white.
+ * FT_PALETTE_FOR_DARK_BACKGROUND ::
+ * The palette is appropriate to use when displaying the font on a dark
+ * background such as black.
+#define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01
+#define FT_PALETTE_FOR_DARK_BACKGROUND 0x02
+ * FT_Palette_Data
+ * This structure holds the data of the `CPAL` table.
+ * num_palettes ::
+ * 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 empty name ID in the `CPAL` table gets represented as value
+ * 0xFFFF.
+ * 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
+ * @FT_PALETTE_FOR_LIGHT_BACKGROUND and
+ * @FT_PALETTE_FOR_DARK_BACKGROUND.
+ * num_palette_entries ::
+ * The number of entries in a single palette. All palettes have the
+ * same size.
+ * palette_entry_name_ids ::
+ * A 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
+ * palette entry is used for outlines, index~1 might correspond to
+ * 'fill' to indicate the filling color palette entry, etc.
+ * An empty entry name ID in the `CPAL` table gets represented as value
+ * Use function @FT_Get_Sfnt_Name to map name IDs and entry name IDs to
+ * name strings.
+ typedef struct FT_Palette_Data_ {
+ FT_UShort num_palettes;
+ const FT_UShort* palette_name_ids;
+ const FT_UShort* palette_flags;
+ FT_UShort num_palette_entries;
+ const FT_UShort* palette_entry_name_ids;
+ } FT_Palette_Data;
+ * FT_Palette_Data_Get
+ * Retrieve the face's color palette data.
+ * The source face handle.
+ * apalette ::
+ * A pointer to an @FT_Palette_Data structure.
+ * All arrays in the returned @FT_Palette_Data structure are read-only.
+ * This function always returns an error if the config macro
+ * `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
+ FT_Palette_Data_Get( FT_Face face,
+ FT_Palette_Data *apalette );
+ * FT_Palette_Select
+ * This function has two purposes.
+ * (1) It activates a palette for rendering color glyphs, and
+ * (2) it retrieves all (unmodified) color entries of this palette. This
+ * function returns a read-write array, which means that a calling
+ * application can modify the palette entries on demand.
+ * A corollary of (2) is that calling the function, then modifying some
+ * values, then calling the function again with the same arguments resets
+ * all color entries to the original `CPAL` values; all user modifications
+ * are lost.
+ * palette_index ::
+ * The palette index.
+ * An array of color entries for a palette with index `palette_index`.
+ * If `apalette` is set to NULL, no array gets returned (and no color
+ * entries can be modified).
+ * In case the font doesn't support color palettes, NULL is returned.
+ * The number of color entries is given by the `num_palette_entries`
+ * field in the @FT_Palette_Data structure.
+ * The array pointed to by `apalette_entries` is owned and managed by
+ * FreeType.
+ FT_Palette_Select( FT_Face face,
+ FT_UShort palette_index,
+ FT_Color* *apalette );
+ * FT_Palette_Set_Foreground_Color
+ * `COLR` uses palette index 0xFFFF to indicate a 'text foreground
+ * color'. This function sets this value.
+ * foreground_color ::
+ * An `FT_Color` structure to define the text foreground color.
+ * If this function isn't called, the text foreground color is set to
+ * white opaque (BGRA value 0xFFFFFFFF) if
+ * @FT_PALETTE_FOR_DARK_BACKGROUND is present for the current palette,
+ * and black opaque (BGRA value 0x000000FF) otherwise, including the case
+ * that no palette types are available in the `CPAL` table.
+ FT_Palette_Set_Foreground_Color( FT_Face face,
+ FT_Color foreground_color );
+FT_END_HEADER
+#endif /* FTCOLOR_H_ */
@@ -1,58 +1,57 @@
-/* fterrdef.h */
-/* FreeType error codes (specification). */
+ * fterrdef.h
+ * FreeType error codes (specification).
- /* error_code_values */
- /* Error Code Values */
- /* All possible error codes returned by FreeType functions. */
- /* The list below is taken verbatim from the file `fterrdef.h' */
- /* (loaded automatically by including `FT_FREETYPE_H'). The first */
- /* argument of the `FT_ERROR_DEF_' macro is the error label; by */
- /* default, the prefix `FT_Err_' gets added so that you get error */
- /* names like `FT_Err_Cannot_Open_Resource'. The second argument is */
- /* the error code, and the last argument an error string, which is not */
- /* used by FreeType. */
- /* Within your application you should *only* use error names and */
- /* *never* its numeric values! The latter might (and actually do) */
- /* change in forthcoming FreeType versions. */
- /* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */
- /* See the `Error Enumerations' subsection how to automatically */
- /* generate a list of error strings. */
+ * Error Code Values
+ * All possible error codes returned by FreeType functions.
+ * The list below is taken verbatim from the file `fterrdef.h` (loaded
+ * automatically by including `FT_FREETYPE_H`). The first argument of the
+ * `FT_ERROR_DEF_` macro is the error label; by default, the prefix
+ * `FT_Err_` gets added so that you get error names like
+ * `FT_Err_Cannot_Open_Resource`. The second argument is the error code,
+ * and the last argument an error string, which is not used by FreeType.
+ * Within your application you should **only** use error names and
+ * **never** its numeric values! The latter might (and actually do)
+ * change in forthcoming FreeType versions.
+ * Macro `FT_NOERRORDEF_` defines `FT_Err_Ok`, which is always zero. See
+ * the 'Error Enumerations' subsection how to automatically generate a
+ * list of error strings.
- /* <Enum> */
- /* FT_Err_XXX */
+ * FT_Err_XXX
/* generic errors */
@@ -1,110 +1,120 @@
-/* fterrors.h */
-/* FreeType error code handling (specification). */
- /* error_enumerations */
- /* Error Enumerations */
- /* How to handle errors and error strings. */
- /* The header file `fterrors.h' (which is automatically included by */
- /* `freetype.h' defines the handling of FreeType's enumeration */
- /* constants. It can also be used to generate error message strings */
- /* with a small macro trick explained below. */
- /* *Error* *Formats* */
- /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
- /* defined in `ftoption.h' in order to make the higher byte indicate */
- /* the module where the error has happened (this is not compatible */
- /* with standard builds of FreeType~2, however). See the file */
- /* `ftmoderr.h' for more details. */
- /* *Error* *Message* *Strings* */
- /* Error definitions are set up with special macros that allow client */
- /* applications to build a table of error message strings. The */
- /* strings are not included in a normal build of FreeType~2 to save */
- /* space (most client applications do not use them). */
- /* To do so, you have to define the following macros before including */
- /* this file. */
- /* FT_ERROR_START_LIST */
- /* This macro is called before anything else to define the start of */
- /* the error list. It is followed by several FT_ERROR_DEF calls. */
- /* FT_ERROR_DEF( e, v, s ) */
- /* This macro is called to define one single error. `e' is the error */
- /* code identifier (e.g., `Invalid_Argument'), `v' is the error's */
- /* numerical value, and `s' is the corresponding error string. */
- /* FT_ERROR_END_LIST */
- /* This macro ends the list. */
- /* Additionally, you have to undefine `FTERRORS_H_' before #including */
- /* Here is a simple example. */
- /* #undef FTERRORS_H_ */
- /* #define FT_ERRORDEF( e, v, s ) { e, s }, */
- /* #define FT_ERROR_START_LIST { */
- /* #define FT_ERROR_END_LIST { 0, NULL } }; */
- /* const struct */
- /* int err_code; */
- /* const char* err_msg; */
- /* } ft_errors[] = */
- /* #include FT_ERRORS_H */
- /* Note that `FT_Err_Ok' is _not_ defined with `FT_ERRORDEF' but with */
- /* `FT_NOERRORDEF'; it is always zero. */
+ * fterrors.h
+ * FreeType error code handling (specification).
+ * Error Enumerations
+ * How to handle errors and error strings.
+ * The header file `fterrors.h` (which is automatically included by
+ * `freetype.h` defines the handling of FreeType's enumeration
+ * constants. It can also be used to generate error message strings
+ * with a small macro trick explained below.
+ * **Error Formats**
+ * The configuration macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` can be
+ * defined in `ftoption.h` in order to make the higher byte indicate the
+ * module where the error has happened (this is not compatible with
+ * standard builds of FreeType~2, however). See the file `ftmoderr.h`
+ * for more details.
+ * **Error Message Strings**
+ * Error definitions are set up with special macros that allow client
+ * applications to build a table of error message strings. The strings
+ * are not included in a normal build of FreeType~2 to save space (most
+ * client applications do not use them).
+ * To do so, you have to define the following macros before including
+ * this file.
+ * FT_ERROR_START_LIST
+ * This macro is called before anything else to define the start of the
+ * error list. It is followed by several `FT_ERROR_DEF` calls.
+ * FT_ERROR_DEF( e, v, s )
+ * This macro is called to define one single error. 'e' is the error
+ * code identifier (e.g., `Invalid_Argument`), 'v' is the error's
+ * numerical value, and 's' is the corresponding error string.
+ * FT_ERROR_END_LIST
+ * This macro ends the list.
+ * Additionally, you have to undefine `FTERRORS_H_` before #including
+ * Here is a simple example.
+ * #undef FTERRORS_H_
+ * #define FT_ERRORDEF( e, v, s ) { e, s },
+ * #define FT_ERROR_START_LIST {
+ * #define FT_ERROR_END_LIST { 0, NULL } };
+ * const struct
+ * {
+ * int err_code;
+ * const char* err_msg;
+ * } ft_errors[] =
+ * #include FT_ERRORS_H
+ * An alternative to using an array is a switch statement.
+ * #define FT_ERROR_START_LIST switch ( error_code ) {
+ * #define FT_ERRORDEF( e, v, s ) case v: return s;
+ * #define FT_ERROR_END_LIST }
+ * If you use `FT_CONFIG_OPTION_USE_MODULE_ERRORS`, `error_code` should
+ * be replaced with `FT_ERROR_BASE(error_code)` in the last example.
- /* In previous FreeType versions we used `__FTERRORS_H__'. However, */
+ /* In previous FreeType versions we used `__FTERRORS_H__`. However, */
/* using two successive underscores in a non-system symbol name */
/* violates the C (and C++) standard, so it was changed to the */
/* current form. In spite of this, we have to make */
/* #undefine __FTERRORS_H__ */
/* work for backward compatibility. */
@@ -130,7 +140,7 @@
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
- /* By default, we use `FT_Err_'. */
+ /* By default, we use `FT_Err_`. */
#ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIX FT_Err_
@@ -158,6 +168,8 @@
#ifndef FT_ERRORDEF
+#define FT_INCLUDE_ERR_PROTOS
#define FT_ERRORDEF( e, v, s ) e = v,
#define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
@@ -220,6 +232,53 @@
#undef FT_ERR_PREFIX
+ /* FT_INCLUDE_ERR_PROTOS: Control if function prototypes should be */
+ /* included with `#include FT_ERRORS_H'. This is */
+ /* only true where `FT_ERRORDEF` is undefined. */
+ /* FT_ERR_PROTOS_DEFINED: Actual multiple-inclusion protection of */
+ /* `fterrors.h`. */
+#ifdef FT_INCLUDE_ERR_PROTOS
+#undef FT_INCLUDE_ERR_PROTOS
+#ifndef FT_ERR_PROTOS_DEFINED
+#define FT_ERR_PROTOS_DEFINED
+ * FT_Error_String
+ * Retrieve the description of a valid FreeType error code.
+ * error_code ::
+ * A valid FreeType error code.
+ * A C~string or `NULL`, if any error occurred.
+ * FreeType has to be compiled with `FT_CONFIG_OPTION_ERROR_STRINGS` or
+ * `FT_DEBUG_LEVEL_ERROR` to get meaningful descriptions.
+ * 'error_string' will be `NULL` otherwise.
+ * Module identification will be ignored:
+ * ```c
+ * strcmp( FT_Error_String( FT_Err_Unknown_File_Format ),
+ * FT_Error_String( BDF_Err_Unknown_File_Format ) ) == 0;
+ FT_EXPORT( const char* )
+ FT_Error_String( FT_Error error_code );
+#endif /* FT_ERR_PROTOS_DEFINED */
+#endif /* FT_INCLUDE_ERR_PROTOS */
#endif /* !(FTERRORS_H_ && __FTERRORS_H__) */
-/* ftfntfmt.h */
-/* Support functions for font formats. */
+ * ftfntfmt.h
+ * Support functions for font formats.
#ifndef FTFNTFMT_H_
@@ -32,49 +32,48 @@
- /* font_formats */
- /* Font Formats */
- /* Getting the font format. */
- /* The single function in this section can be used to get the font */
- /* format. Note that this information is not needed normally; */
- /* however, there are special cases (like in PDF devices) where it is */
- /* important to differentiate, in spite of FreeType's uniform API. */
- /* FT_Get_Font_Format */
- /* Return a string describing the format of a given face. Possible */
- /* values are `TrueType', `Type~1', `BDF', `PCF', `Type~42', */
- /* `CID~Type~1', `CFF', `PFR', and `Windows~FNT'. */
- /* The return value is suitable to be used as an X11 FONT_PROPERTY. */
- /* face :: */
- /* Input face handle. */
- /* Font format string. NULL in case of error. */
- /* A deprecated name for the same function is */
- /* `FT_Get_X11_Font_Format'. */
+ * Font Formats
+ * Getting the font format.
+ * The single function in this section can be used to get the font format.
+ * Note that this information is not needed normally; however, there are
+ * special cases (like in PDF devices) where it is important to
+ * differentiate, in spite of FreeType's uniform API.
+ * FT_Get_Font_Format
+ * Return a string describing the format of a given face. Possible values
+ * are 'TrueType', 'Type~1', 'BDF', 'PCF', 'Type~42', 'CID~Type~1', 'CFF',
+ * 'PFR', and 'Windows~FNT'.
+ * The return value is suitable to be used as an X11 FONT_PROPERTY.
+ * Input face handle.
+ * Font format string. NULL in case of error.
+ * A deprecated name for the same function is `FT_Get_X11_Font_Format`.
FT_EXPORT( const char* )
FT_Get_Font_Format( FT_Face face );
-/* ftgasp.h */
-/* Access of TrueType's `gasp' table (specification). */
+ * ftgasp.h
+ * Access of TrueType's `gasp` table (specification).
#ifndef FTGASP_H_
@@ -29,7 +29,10 @@
- /***************************************************************************
* @section:
* gasp_table
@@ -38,16 +41,16 @@
* Gasp Table
* @abstract:
- * Retrieving TrueType `gasp' table entries.
+ * Retrieving TrueType `gasp` table entries.
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType
- * font for specific entries in its `gasp' table, if any. This is
- * mainly useful when implementing native TrueType hinting with the
- * bytecode interpreter to duplicate the Windows text rendering results.
+ * font for specific entries in its `gasp` table, if any. This is mainly
+ * useful when implementing native TrueType hinting with the bytecode
+ * interpreter to duplicate the Windows text rendering results.
* FT_GASP_XXX
@@ -63,7 +66,7 @@
* FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem.
- * This *really* means TrueType bytecode interpretation. If this bit
+ * This **really** means TrueType bytecode interpretation. If this bit
* is not set, no hinting gets applied.
* FT_GASP_DO_GRAY ::
@@ -77,13 +80,13 @@
* Grid-fitting must be used with ClearType's symmetric smoothing.
- * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
+ * The bit-flags `FT_GASP_DO_GRIDFIT` and `FT_GASP_DO_GRAY` are to be
* used for standard font rasterization only. Independently of that,
- * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
- * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
- * `FT_GASP_DO_GRAY' are consequently ignored).
+ * `FT_GASP_SYMMETRIC_SMOOTHING` and `FT_GASP_SYMMETRIC_GRIDFIT` are to
+ * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT` and
+ * `FT_GASP_DO_GRAY` are consequently ignored).
- * `ClearType' is Microsoft's implementation of LCD rendering, partly
+ * 'ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents.
@@ -96,29 +99,31 @@
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
- * @func:
* FT_Get_Gasp
* For a TrueType or OpenType font file, return the rasterizer behaviour
- * flags from the font's `gasp' table corresponding to a given
- * character pixel size.
+ * flags from the font's `gasp` table corresponding to a given character
+ * pixel size.
- * face :: The source face handle.
- * ppem :: The vertical character pixel size.
+ * ppem ::
+ * The vertical character pixel size.
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
- * `gasp' table in the face.
+ * `gasp` table in the face.
* If you want to use the MM functionality of OpenType variation fonts
* (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
- * function *after* setting an instance since the return values can
+ * function **after** setting an instance since the return values can
* change.
@@ -131,6 +136,8 @@
#endif /* FTGASP_H_ */
@@ -1,28 +1,28 @@
-/* ftgxval.h */
-/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
-/* Masatake YAMATO, Redhat K.K, */
-/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is supported by the Information-technology */
-/* Promotion Agency(IPA), Japan. */
+ * ftgxval.h
+ * FreeType API for validating TrueTypeGX/AAT tables (specification).
+ * Masatake YAMATO, Redhat K.K,
+ * gxvalid is derived from both gxlayout module and otvalid module.
+ * Development of gxlayout is supported by the Information-technology
+ * Promotion Agency(IPA), Japan.
#ifndef FTGXVAL_H_
@@ -41,43 +41,43 @@
- /* gx_validation */
- /* TrueTypeGX/AAT Validation */
- /* An API to validate TrueTypeGX/AAT tables. */
- /* This section contains the declaration of functions to validate */
- /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
- /* trak, prop, lcar). */
- /* <Order> */
- /* FT_TrueTypeGX_Validate */
- /* FT_TrueTypeGX_Free */
- /* FT_ClassicKern_Validate */
- /* FT_ClassicKern_Free */
- /* FT_VALIDATE_GX_LENGTH */
- /* FT_VALIDATE_GXXXX */
- /* FT_VALIDATE_CKERNXXX */
- /* Warning: Use FT_VALIDATE_XXX to validate a table. */
- /* Following definitions are for gxvalid developers. */
+ * gx_validation
+ * TrueTypeGX/AAT Validation
+ * An API to validate TrueTypeGX/AAT tables.
+ * This section contains the declaration of functions to validate some
+ * TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak,
+ * prop, lcar).
+ * @order:
+ * FT_TrueTypeGX_Validate
+ * FT_TrueTypeGX_Free
+ * FT_ClassicKern_Validate
+ * FT_ClassicKern_Free
+ * FT_VALIDATE_GX_LENGTH
+ * FT_VALIDATE_GXXXX
+ * FT_VALIDATE_CKERNXXX
+ * Warning: Use `FT_VALIDATE_XXX` to validate a table.
+ * Following definitions are for gxvalid developers.
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
@@ -92,14 +92,14 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
* FT_VALIDATE_GX_LENGTH
* The number of tables checked in this module. Use it as a parameter
- * for the `table-length' argument of function @FT_TrueTypeGX_Validate.
+ * for the `table-length` argument of function @FT_TrueTypeGX_Validate.
#define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
@@ -112,51 +112,51 @@ FT_BEGIN_HEADER
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
- * @enum:
- * FT_VALIDATE_GXXXX
- * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
- * indicate which TrueTypeGX/AAT Type tables should be validated.
- * @values:
- * FT_VALIDATE_feat ::
- * Validate `feat' table.
- * FT_VALIDATE_mort ::
- * Validate `mort' table.
- * FT_VALIDATE_morx ::
- * Validate `morx' table.
- * FT_VALIDATE_bsln ::
- * Validate `bsln' table.
- * FT_VALIDATE_just ::
- * Validate `just' table.
- * FT_VALIDATE_kern ::
- * Validate `kern' table.
- * FT_VALIDATE_opbd ::
- * Validate `opbd' table.
- * FT_VALIDATE_trak ::
- * Validate `trak' table.
- * FT_VALIDATE_prop ::
- * Validate `prop' table.
- * FT_VALIDATE_lcar ::
- * Validate `lcar' table.
- * FT_VALIDATE_GX ::
- * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
- * opbd, trak, prop and lcar).
+ * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
+ * indicate which TrueTypeGX/AAT Type tables should be validated.
+ * FT_VALIDATE_feat ::
+ * Validate `feat` table.
+ * FT_VALIDATE_mort ::
+ * Validate `mort` table.
+ * FT_VALIDATE_morx ::
+ * Validate `morx` table.
+ * FT_VALIDATE_bsln ::
+ * Validate `bsln` table.
+ * FT_VALIDATE_just ::
+ * Validate `just` table.
+ * FT_VALIDATE_kern ::
+ * Validate `kern` table.
+ * FT_VALIDATE_opbd ::
+ * Validate `opbd` table.
+ * FT_VALIDATE_trak ::
+ * Validate `trak` table.
+ * FT_VALIDATE_prop ::
+ * Validate `prop` table.
+ * FT_VALIDATE_lcar ::
+ * Validate `lcar` table.
+ * FT_VALIDATE_GX ::
+ * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
+ * opbd, trak, prop and lcar).
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
@@ -181,47 +181,47 @@ FT_BEGIN_HEADER
FT_VALIDATE_lcar )
- * FT_TrueTypeGX_Validate
- * Validate various TrueTypeGX tables to assure that all offsets and
- * indices are valid. The idea is that a higher-level library that
- * actually does the text layout can access those tables without
- * error checking (which can be quite time consuming).
- * validation_flags ::
- * A bit field that specifies the tables to be validated. See
- * @FT_VALIDATE_GXXXX for possible values.
- * table_length ::
- * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
- * should be passed.
- * tables ::
- * The array where all validated sfnt tables are stored.
- * The array itself must be allocated by a client.
- * This function only works with TrueTypeGX fonts, returning an error
- * otherwise.
- * After use, the application should deallocate the buffers pointed to by
- * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
- * indicates that the table either doesn't exist in the font, the
- * application hasn't asked for validation, or the validator doesn't have
- * the ability to validate the sfnt table.
+ * Validate various TrueTypeGX tables to assure that all offsets and
+ * indices are valid. The idea is that a higher-level library that
+ * actually does the text layout can access those tables without error
+ * checking (which can be quite time consuming).
+ * validation_flags ::
+ * A bit field that specifies the tables to be validated. See
+ * @FT_VALIDATE_GXXXX for possible values.
+ * table_length ::
+ * The size of the `tables` array. Normally, @FT_VALIDATE_GX_LENGTH
+ * should be passed.
+ * tables ::
+ * The array where all validated sfnt tables are stored. The array
+ * itself must be allocated by a client.
+ * This function only works with TrueTypeGX fonts, returning an error
+ * otherwise.
+ * After use, the application should deallocate the buffers pointed to by
+ * each `tables` element, by calling @FT_TrueTypeGX_Free. A NULL value
+ * indicates that the table either doesn't exist in the font, the
+ * application hasn't asked for validation, or the validator doesn't have
+ * the ability to validate the sfnt table.
FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags,
@@ -229,119 +229,117 @@ FT_BEGIN_HEADER
FT_UInt table_length );
- * FT_TrueTypeGX_Free
- * Free the buffer allocated by TrueTypeGX validator.
- * table ::
- * The pointer to the buffer allocated by
- * @FT_TrueTypeGX_Validate.
- * This function must be used to free the buffer allocated by
- * @FT_TrueTypeGX_Validate only.
+ * Free the buffer allocated by TrueTypeGX validator.
+ * table ::
+ * The pointer to the buffer allocated by @FT_TrueTypeGX_Validate.
+ * This function must be used to free the buffer allocated by
+ * @FT_TrueTypeGX_Validate only.
FT_TrueTypeGX_Free( FT_Face face,
FT_Bytes table );
- * FT_VALIDATE_CKERNXXX
- * A list of bit-field constants used with @FT_ClassicKern_Validate
- * to indicate the classic kern dialect or dialects. If the selected
- * type doesn't fit, @FT_ClassicKern_Validate regards the table as
- * invalid.
- * FT_VALIDATE_MS ::
- * Handle the `kern' table as a classic Microsoft kern table.
- * FT_VALIDATE_APPLE ::
- * Handle the `kern' table as a classic Apple kern table.
- * FT_VALIDATE_CKERN ::
- * Handle the `kern' as either classic Apple or Microsoft kern table.
+ * A list of bit-field constants used with @FT_ClassicKern_Validate to
+ * indicate the classic kern dialect or dialects. If the selected type
+ * doesn't fit, @FT_ClassicKern_Validate regards the table as invalid.
+ * FT_VALIDATE_MS ::
+ * Handle the `kern` table as a classic Microsoft kern table.
+ * FT_VALIDATE_APPLE ::
+ * Handle the `kern` table as a classic Apple kern table.
+ * FT_VALIDATE_CKERN ::
+ * Handle the `kern` as either classic Apple or Microsoft kern table.
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
- * FT_ClassicKern_Validate
- * Validate classic (16-bit format) kern table to assure that the offsets
- * and indices are valid. The idea is that a higher-level library that
- * actually does the text layout can access those tables without error
- * checking (which can be quite time consuming).
- * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
- * the new 32-bit format and the classic 16-bit format, while
- * FT_ClassicKern_Validate only supports the classic 16-bit format.
- * A bit field that specifies the dialect to be validated. See
- * @FT_VALIDATE_CKERNXXX for possible values.
- * ckern_table ::
- * A pointer to the kern table.
- * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
- * indicates that the table doesn't exist in the font.
+ * Validate classic (16-bit format) kern table to assure that the
+ * offsets and indices are valid. The idea is that a higher-level
+ * library that actually does the text layout can access those tables
+ * without error checking (which can be quite time consuming).
+ * The `kern` table validator in @FT_TrueTypeGX_Validate deals with both
+ * the new 32-bit format and the classic 16-bit format, while
+ * FT_ClassicKern_Validate only supports the classic 16-bit format.
+ * A bit field that specifies the dialect to be validated. See
+ * @FT_VALIDATE_CKERNXXX for possible values.
+ * ckern_table ::
+ * A pointer to the kern table.
+ * `ckern_table`, by calling @FT_ClassicKern_Free. A NULL value
+ * indicates that the table doesn't exist in the font.
FT_ClassicKern_Validate( FT_Face face,
FT_Bytes *ckern_table );
- * FT_ClassicKern_Free
- * Free the buffer allocated by classic Kern validator.
- * The pointer to the buffer that is allocated by
- * @FT_ClassicKern_Validate.
- * @FT_ClassicKern_Validate only.
+ * Free the buffer allocated by classic Kern validator.
+ * The pointer to the buffer that is allocated by
+ * @FT_ClassicKern_Validate.
+ * @FT_ClassicKern_Validate only.
FT_ClassicKern_Free( FT_Face face,
-/* ftgzip.h */
-/* Gzip-compressed stream support. */
+ * ftgzip.h
+ * Gzip-compressed stream support.
#ifndef FTGZIP_H_
@@ -31,108 +31,108 @@
- /* gzip */
- /* GZIP Streams */
- /* Using gzip-compressed font files. */
- /* This section contains the declaration of Gzip-specific functions. */
- * FT_Stream_OpenGzip
- * Open a new stream to parse gzip-compressed font files. This is
- * mainly used to support the compressed `*.pcf.gz' fonts that come
- * In certain builds of the library, gzip compression recognition is
- * compressed file, the library will try to open a gzipped stream from
- * it and re-open the face with it.
- * of FreeType was not compiled with zlib support.
+ * GZIP Streams
+ * Using gzip-compressed font files.
+ * This section contains the declaration of Gzip-specific functions.
+ * FT_Stream_OpenGzip
+ * Open a new stream to parse gzip-compressed font files. This is mainly
+ * used to support the compressed `*.pcf.gz` fonts that come with
+ * In certain builds of the library, gzip compression recognition is
+ * compressed file, the library will try to open a gzipped stream from it
+ * and re-open the face with it.
+ * of FreeType was not compiled with zlib support.
FT_Stream_OpenGzip( FT_Stream stream,
- * FT_Gzip_Uncompress
- * Decompress a zipped input buffer into an output buffer. This function
- * is modeled after zlib's `uncompress' function.
- * memory ::
- * A FreeType memory handle.
- * input ::
- * The input buffer.
- * input_len ::
- * The length of the input buffer.
- * output::
- * The output buffer.
- * @inout:
- * output_len ::
- * Before calling the function, this is the total size of the output
- * buffer, which must be large enough to hold the entire uncompressed
- * data (so the size of the uncompressed data must be known in
- * advance). After calling the function, `output_len' is the size of
- * the used data in `output'.
- * @since:
- * 2.5.1
+ * FT_Gzip_Uncompress
+ * Decompress a zipped input buffer into an output buffer. This function
+ * is modeled after zlib's `uncompress` function.
+ * memory ::
+ * A FreeType memory handle.
+ * input ::
+ * The input buffer.
+ * input_len ::
+ * The length of the input buffer.
+ * output ::
+ * The output buffer.
+ * output_len ::
+ * Before calling the function, this is the total size of the output
+ * buffer, which must be large enough to hold the entire uncompressed
+ * data (so the size of the uncompressed data must be known in
+ * advance). After calling the function, `output_len` is the size of
+ * the used data in `output`.
+ * 2.5.1
FT_Gzip_Uncompress( FT_Memory memory,
FT_Byte* output,
-/* ftincrem.h */
-/* FreeType incremental loading (specification). */
+ * ftincrem.h
+ * FreeType incremental loading (specification).
#ifndef FTINCREM_H_
@@ -32,7 +32,7 @@
* incremental
@@ -45,7 +45,7 @@ FT_BEGIN_HEADER
* This section contains various functions used to perform so-called
- * `incremental' glyph loading. This is a mode where all glyphs loaded
+ * 'incremental' glyph loading. This is a mode where all glyphs loaded
* from a given @FT_Face are provided by the client application.
* Apart from that, all other tables are loaded normally from the font
@@ -60,23 +60,24 @@ FT_BEGIN_HEADER
* FT_Incremental
* An opaque type describing a user-provided object used to implement
- * `incremental' glyph loading within FreeType. This is used to support
- * embedded fonts in certain environments (e.g., PostScript interpreters),
- * where the glyph data isn't in the font file, or must be overridden by
- * different values.
+ * 'incremental' glyph loading within FreeType. This is used to support
+ * embedded fonts in certain environments (e.g., PostScript
+ * interpreters), where the glyph data isn't in the font file, or must be
+ * overridden by different values.
- * It is up to client applications to create and implement @FT_Incremental
- * objects, as long as they provide implementations for the methods
- * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
- * and @FT_Incremental_GetGlyphMetricsFunc.
+ * It is up to client applications to create and implement
+ * @FT_Incremental objects, as long as they provide implementations for
+ * the methods @FT_Incremental_GetGlyphDataFunc,
+ * @FT_Incremental_FreeGlyphDataFunc and
+ * @FT_Incremental_GetGlyphMetricsFunc.
* See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType.
@@ -85,14 +86,14 @@ FT_BEGIN_HEADER
typedef struct FT_IncrementalRec_* FT_Incremental;
* @struct:
* FT_Incremental_MetricsRec
- * A small structure used to contain the basic glyph metrics returned
- * by the @FT_Incremental_GetGlyphMetricsFunc method.
+ * A small structure used to contain the basic glyph metrics returned by
+ * the @FT_Incremental_GetGlyphMetricsFunc method.
* @fields:
* bearing_x ::
@@ -109,7 +110,7 @@ FT_BEGIN_HEADER
* These correspond to horizontal or vertical metrics depending on the
- * value of the `vertical' argument to the function
+ * value of the `vertical` argument to the function
* @FT_Incremental_GetGlyphMetricsFunc.
@@ -123,7 +124,7 @@ FT_BEGIN_HEADER
} FT_Incremental_MetricsRec;
* FT_Incremental_Metrics
@@ -135,7 +136,7 @@ FT_BEGIN_HEADER
typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
* FT_Incremental_GetGlyphDataFunc
@@ -147,8 +148,8 @@ FT_BEGIN_HEADER
* Note that the format of the glyph's data bytes depends on the font
* file format. For TrueType, it must correspond to the raw bytes within
- * the `glyf' table. For PostScript formats, it must correspond to the
- * *unencrypted* charstring bytes, without any `lenIV' header. It is
+ * the `glyf` table. For PostScript formats, it must correspond to the
+ * **unencrypted** charstring bytes, without any `lenIV` header. It is
* undefined for any other format.
@@ -169,8 +170,8 @@ FT_BEGIN_HEADER
* If this function returns successfully the method
- * @FT_Incremental_FreeGlyphDataFunc will be called later to release
- * the data bytes.
+ * @FT_Incremental_FreeGlyphDataFunc will be called later to release the
+ * data bytes.
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
* compound glyphs.
@@ -182,7 +183,7 @@ FT_BEGIN_HEADER
FT_Data* adata );
* FT_Incremental_FreeGlyphDataFunc
@@ -206,7 +207,7 @@ FT_BEGIN_HEADER
FT_Data* data );
* FT_Incremental_GetGlyphMetricsFunc
@@ -214,8 +215,8 @@ FT_BEGIN_HEADER
* A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain
- * formats like TrueType, the metrics are stored in a different place from
- * the glyph images proper.
+ * formats like TrueType, the metrics are stored in a different place
+ * from the glyph images proper.
* incremental ::
@@ -229,9 +230,9 @@ FT_BEGIN_HEADER
* If true, return vertical metrics.
* ametrics ::
- * This parameter is used for both input and output.
- * The original glyph metrics, if any, in font units. If metrics are
- * not available all the values must be set to zero.
+ * This parameter is used for both input and output. The original
+ * glyph metrics, if any, in font units. If metrics are not available
+ * all the values must be set to zero.
@@ -252,8 +253,8 @@ FT_BEGIN_HEADER
* FT_Incremental_FuncsRec
- * A table of functions for accessing fonts that load data
- * incrementally. Used in @FT_Incremental_InterfaceRec.
+ * A table of functions for accessing fonts that load data incrementally.
+ * Used in @FT_Incremental_InterfaceRec.
* get_glyph_data ::
@@ -263,8 +264,8 @@ FT_BEGIN_HEADER
* The function to release glyph data. Must not be null.
* get_glyph_metrics ::
- * The function to get glyph metrics. May be null if the font does
- * not provide overriding glyph metrics.
+ * The function to get glyph metrics. May be null if the font does not
+ * provide overriding glyph metrics.
typedef struct FT_Incremental_FuncsRec_
@@ -276,7 +277,7 @@ FT_BEGIN_HEADER
} FT_Incremental_FuncsRec;
* FT_Incremental_InterfaceRec
@@ -286,30 +287,30 @@ FT_BEGIN_HEADER
* wants to support incremental glyph loading. You should use it with
* @FT_PARAM_TAG_INCREMENTAL as in the following example:
- * {
- * FT_Incremental_InterfaceRec inc_int;
- * FT_Parameter parameter;
- * FT_Open_Args open_args;
+ * FT_Incremental_InterfaceRec inc_int;
+ * FT_Parameter parameter;
+ * FT_Open_Args open_args;
- * // set up incremental descriptor
- * inc_int.funcs = my_funcs;
- * inc_int.object = my_object;
+ * // set up incremental descriptor
+ * inc_int.funcs = my_funcs;
+ * inc_int.object = my_object;
- * // set up optional parameter
- * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
- * parameter.data = &inc_int;
+ * // set up optional parameter
+ * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
+ * parameter.data = &inc_int;
- * // set up FT_Open_Args structure
- * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
- * open_args.pathname = my_font_pathname;
- * open_args.num_params = 1;
- * open_args.params = ¶meter; // we use one optional argument
+ * // set up FT_Open_Args structure
+ * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
+ * open_args.pathname = my_font_pathname;
+ * open_args.num_params = 1;
+ * open_args.params = ¶meter; // we use one optional argument
- * // open the font
- * error = FT_Open_Face( library, &open_args, index, &face );
- * ...
- * }
+ * // open the font
+ * error = FT_Open_Face( library, &open_args, index, &face );
+ * ...
typedef struct FT_Incremental_InterfaceRec_
@@ -320,7 +321,7 @@ FT_BEGIN_HEADER
} FT_Incremental_InterfaceRec;
* FT_Incremental_Interface
@@ -1,20 +1,20 @@
-/* ftlcdfil.h */
-/* FreeType API for color filtering of subpixel bitmap glyphs */
-/* (specification). */
-/* Copyright 2006-2018 by */
+ * ftlcdfil.h
+ * FreeType API for color filtering of subpixel bitmap glyphs
+ * (specification).
+ * Copyright 2006-2019 by
#ifndef FTLCDFIL_H_
@@ -33,105 +33,98 @@
- * lcd_filtering
* @title:
- * LCD Filtering
+ * Subpixel Rendering
- * Reduce color fringes of subpixel-rendered bitmaps.
+ * API to control subpixel rendering.
- * Should you #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your
- * `ftoption.h', which enables patented ClearType-style rendering,
- * the LCD-optimized glyph bitmaps should be filtered to reduce color
- * fringes inherent to this technology. The default FreeType LCD
- * rendering uses different technology, and API described below,
- * although available, does nothing.
+ * FreeType provides two alternative subpixel rendering technologies.
+ * Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
+ * `ftoption.h` file, this enables patented ClearType-style rendering.
+ * Otherwise, Harmony LCD rendering is enabled. These technologies are
+ * controlled differently and API described below, although always
+ * available, performs its function when appropriate method is enabled
+ * and does nothing otherwise.
* ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of
- * the stripe (usually horizontal RGB) by a factor of~3. Since these
- * subpixels are color pixels, using them unfiltered creates severe
- * color fringes. Use the @FT_Library_SetLcdFilter API to specify a
- * low-pass filter, which is then applied to subpixel-rendered bitmaps
- * generated through @FT_Render_Glyph. The filter sacrifices some of
- * the higher resolution to reduce color fringes, making the glyph image
- * slightly blurrier. Positional improvements will remain.
- * A filter should have two properties:
- * 1) It should be normalized, meaning the sum of the 5~components
- * should be 256 (0x100). It is possible to go above or under this
- * target sum, however: going under means tossing out contrast, going
- * over means invoking clamping and thereby non-linearities that
- * increase contrast somewhat at the expense of greater distortion
- * and color-fringing. Contrast is better enhanced through stem
- * darkening.
- * 2) It should be color-balanced, meaning a filter `{~a, b, c, b, a~}'
- * where a~+ b~=~c. It distributes the computed coverage for one
- * subpixel to all subpixels equally, sacrificing some won resolution
- * but drastically reducing color-fringing. Positioning improvements
- * remain! Note that color-fringing can only really be minimized
- * when using a color-balanced filter and alpha-blending the glyph
- * onto a surface in linear space; see @FT_Render_Glyph.
- * Regarding the form, a filter can be a `boxy' filter or a `beveled'
- * filter. Boxy filters are sharper but are less forgiving of non-ideal
- * gamma curves of a screen (viewing angles!), beveled filters are
- * fuzzier but more tolerant.
- * Examples:
- * - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor
- * normalized.
- * - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not
- * - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not
- * balanced.
- * - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not
- * - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost
- * - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost
- * The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
- * @FT_Load_Glyph, and @FT_Load_Char. It does _not_ affect the output
- * of @FT_Outline_Render and @FT_Outline_Get_Bitmap.
- * If this feature is activated, the dimensions of LCD glyph bitmaps are
- * either wider or taller than the dimensions of the corresponding
- * outline with regard to the pixel grid. For example, for
- * @FT_RENDER_MODE_LCD, the filter adds 3~subpixels to the left, and
- * 3~subpixels to the right. The bitmap offset values are adjusted
- * accordingly, so clients shouldn't need to modify their layout and
- * glyph positioning code when enabling the filter.
- * It is important to understand that linear alpha blending and gamma
- * correction is critical for correctly rendering glyphs onto surfaces
- * without artifacts and even more critical when subpixel rendering is
- * involved.
- * Each of the 3~alpha values (subpixels) is independently used to blend
- * one color channel. That is, red alpha blends the red channel of the
- * text color with the red channel of the background pixel. The
- * distribution of density values by the color-balanced filter assumes
- * alpha blending is done in linear space; only then color artifacts
- * cancel out.
+ * the stripe (usually horizontal RGB) by a factor of~3. Using the
+ * subpixels coverages unfiltered can create severe color fringes
+ * especially when rendering thin features. Indeed, to produce
+ * black-on-white text, the nearby color subpixels must be dimmed
+ * equally.
+ * A good 5-tap FIR filter should be applied to subpixel coverages
+ * regardless of pixel boundaries and should have these properties:
+ * 1) It should be symmetrical, like {~a, b, c, b, a~}, to avoid
+ * any shifts in appearance.
+ * 2) It should be color-balanced, meaning a~+ b~=~c, to reduce color
+ * fringes by distributing the computed coverage for one subpixel to
+ * all subpixels equally.
+ * 3) It should be normalized, meaning 2a~+ 2b~+ c~=~1.0 to maintain
+ * overall brightness.
+ * Boxy 3-tap filter {0, 1/3, 1/3, 1/3, 0} is sharper but is less
+ * forgiving of non-ideal gamma curves of a screen (and viewing angles),
+ * beveled filters are fuzzier but more tolerant.
+ * Use the @FT_Library_SetLcdFilter or @FT_Library_SetLcdFilterWeights
+ * API to specify a low-pass filter, which is then applied to
+ * subpixel-rendered bitmaps generated through @FT_Render_Glyph.
+ * Harmony LCD rendering is suitable to panels with any regular subpixel
+ * structure, not just monitors with 3 color striped subpixels, as long
+ * as the color subpixels have fixed positions relative to the pixel
+ * center. In this case, each color channel is then rendered separately
+ * after shifting the outline opposite to the subpixel shift so that the
+ * coverage maps are aligned. This method is immune to color fringes
+ * because the shifts do not change integral coverage.
+ * The subpixel geometry must be specified by xy-coordinates for each
+ * subpixel. By convention they may come in the RGB order: {{-1/3, 0},
+ * {0, 0}, {1/3, 0}} for standard RGB striped panel or {{-1/6, 1/4},
+ * {-1/6, -1/4}, {1/3, 0}} for a certain PenTile panel.
+ * Use the @FT_Library_SetLcdGeometry API to specify subpixel positions.
+ * If one follows the RGB order convention, the same order applies to the
+ * resulting @FT_PIXEL_MODE_LCD and @FT_PIXEL_MODE_LCD_V bitmaps. Note,
+ * however, that the coordinate frame for the latter must be rotated
+ * clockwise. Harmony with default LCD geometry is equivalent to
+ * ClearType with light filter.
+ * As a result of ClearType filtering or Harmony rendering, the
+ * dimensions of LCD bitmaps can be either wider or taller than the
+ * dimensions of the corresponding outline with regard to the pixel grid.
+ * For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
+ * the left, and 2~subpixels to the right. The bitmap offset values are
+ * adjusted accordingly, so clients shouldn't need to modify their layout
+ * and glyph positioning code when enabling the filter.
+ * The ClearType and Harmony rendering is applicable to glyph bitmaps
+ * rendered through @FT_Render_Glyph, @FT_Load_Glyph, @FT_Load_Char, and
+ * @FT_Glyph_To_Bitmap, when @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V
+ * is specified. This API does not control @FT_Outline_Render and
+ * @FT_Outline_Get_Bitmap.
+ * The described algorithms can completely remove color artefacts when
+ * combined with gamma-corrected alpha blending in linear space. Each of
+ * the 3~alpha values (subpixels) must by independently used to blend one
+ * color channel. That is, red alpha blends the red channel of the text
+ * color with the red channel of the background pixel.
- /****************************************************************************
* FT_LcdFilter
@@ -145,47 +138,25 @@ FT_BEGIN_HEADER
* results in sometimes severe color fringes.
* FT_LCD_FILTER_DEFAULT ::
- * The default filter reduces color fringes considerably, at the cost
- * of a slight blurriness in the output.
- * It is a beveled, normalized, and color-balanced five-tap filter
- * that is more forgiving to screens with non-ideal gamma curves and
- * viewing angles. Note that while color-fringing is reduced, it can
- * only be minimized by using linear alpha blending and gamma
- * correction to render glyphs onto surfaces. The default filter
- * weights are [0x08 0x4D 0x56 0x4D 0x08].
+ * This is a beveled, normalized, and color-balanced five-tap filter
+ * with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units.
* FT_LCD_FILTER_LIGHT ::
- * The light filter is a variant that is sharper at the cost of
- * slightly more color fringes than the default one.
- * It is a boxy, normalized, and color-balanced three-tap filter that
- * is less forgiving to screens with non-ideal gamma curves and
- * viewing angles. This filter works best when the rendering system
- * uses linear alpha blending and gamma correction to render glyphs
- * onto surfaces. The light filter weights are
- * [0x00 0x55 0x56 0x55 0x00].
+ * this is a boxy, normalized, and color-balanced three-tap filter with
+ * weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units.
* FT_LCD_FILTER_LEGACY ::
+ * FT_LCD_FILTER_LEGACY1 ::
* This filter corresponds to the original libXft color filter. It
* provides high contrast output but can exhibit really bad color
* fringes if glyphs are not extremely well hinted to the pixel grid.
- * In other words, it only works well if the TrueType bytecode
- * interpreter is enabled *and* high-quality hinted fonts are used.
* This filter is only provided for comparison purposes, and might be
- * disabled or stay unsupported in the future.
- * FT_LCD_FILTER_LEGACY1 ::
- * For historical reasons, the FontConfig library returns a different
- * enumeration value for legacy LCD filtering. To make code work that
- * (incorrectly) forwards FontConfig's enumeration value to
- * @FT_Library_SetLcdFilter without proper mapping, it is thus easiest
- * to have another enumeration value, which is completely equal to
- * `FT_LCD_FILTER_LEGACY'.
+ * disabled or stay unsupported in the future. The second value is
+ * provided for compatibility with FontConfig, which historically used
+ * different enumeration, sometimes incorrectly forwarded to FreeType.
- * 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2)
+ * 2.3.0 (`FT_LCD_FILTER_LEGACY1` since 2.6.2)
typedef enum FT_LcdFilter_
@@ -202,7 +173,7 @@ FT_BEGIN_HEADER
/**************************************************************************
* FT_Library_SetLcdFilter
@@ -218,20 +189,20 @@ FT_BEGIN_HEADER
* The filter type.
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or
- * @FT_LCD_FILTER_DEFAULT to use a default filter that should work
- * well on most LCD screens.
+ * @FT_LCD_FILTER_DEFAULT to use a default filter that should work well
+ * on most LCD screens.
* This feature is always disabled by default. Clients must make an
- * explicit call to this function with a `filter' value other than
+ * explicit call to this function with a `filter` value other than
* @FT_LCD_FILTER_NONE in order to enable it.
- * Due to *PATENTS* covering subpixel rendering, this function doesn't
- * do anything except returning `FT_Err_Unimplemented_Feature' if the
- * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
+ * Due to **PATENTS** covering subpixel rendering, this function doesn't
+ * do anything except returning `FT_Err_Unimplemented_Feature` if the
+ * configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
@@ -245,7 +216,7 @@ FT_BEGIN_HEADER
* FT_Library_SetLcdFilterWeights
@@ -258,15 +229,15 @@ FT_BEGIN_HEADER
* weights ::
* A pointer to an array; the function copies the first five bytes and
- * uses them to specify the filter weights.
+ * uses them to specify the filter weights in 1/256th units.
@@ -281,7 +252,8 @@ FT_BEGIN_HEADER
unsigned char *weights );
- /*
* FT_LcdFiveTapFilter
@@ -298,6 +270,53 @@ FT_BEGIN_HEADER
typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];
+ * FT_Library_SetLcdGeometry
+ * This function can be used to modify default positions of color
+ * subpixels, which controls Harmony LCD rendering.
+ * A handle to the target library instance.
+ * sub ::
+ * A pointer to an array of 3 vectors in 26.6 fractional pixel format;
+ * the function modifies the default values, see the note below.
+ * Subpixel geometry examples:
+ * - {{-21, 0}, {0, 0}, {21, 0}} is the default, corresponding to 3 color
+ * stripes shifted by a third of a pixel. This could be an RGB panel.
+ * - {{21, 0}, {0, 0}, {-21, 0}} looks the same as the default but can
+ * specify a BGR panel instead, while keeping the bitmap in the same
+ * RGB888 format.
+ * - {{0, 21}, {0, 0}, {0, -21}} is the vertical RGB, but the bitmap
+ * stays RGB888 as a result.
+ * - {{-11, 16}, {-11, -16}, {22, 0}} is a certain PenTile arrangement.
+ * This function does nothing and returns `FT_Err_Unimplemented_Feature`
+ * in the context of ClearType-style subpixel rendering when
+ * `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is defined in your build of the
+ * 2.10.0
+ FT_Library_SetLcdGeometry( FT_Library library,
+ FT_Vector sub[3] );
@@ -1,27 +1,27 @@
-/* ftlist.h */
-/* Generic list support for FreeType (specification). */
- /* This file implements functions relative to list processing. Its */
- /* data structures are defined in `freetype.h'. */
+ * ftlist.h
+ * Generic list support for FreeType (specification).
+ * This file implements functions relative to list processing. Its data
+ * structures are defined in `freetype.h`.
#ifndef FTLIST_H_
@@ -41,224 +41,245 @@
- /* list_processing */
- /* List Processing */
- /* Simple management of lists. */
- /* This section contains various definitions related to list */
- /* processing using doubly-linked nodes. */
- /* FT_List */
- /* FT_ListNode */
- /* FT_ListRec */
- /* FT_ListNodeRec */
- /* FT_List_Add */
- /* FT_List_Insert */
- /* FT_List_Find */
- /* FT_List_Remove */
- /* FT_List_Up */
- /* FT_List_Iterate */
- /* FT_List_Iterator */
- /* FT_List_Finalize */
- /* FT_List_Destructor */
- /* Find the list node for a given listed object. */
- /* list :: A pointer to the parent list. */
- /* data :: The address of the listed object. */
- /* List node. NULL if it wasn't found. */
+ * List Processing
+ * Simple management of lists.
+ * This section contains various definitions related to list processing
+ * using doubly-linked nodes.
+ * FT_List
+ * FT_ListNode
+ * FT_ListRec
+ * FT_ListNodeRec
+ * FT_List_Add
+ * FT_List_Insert
+ * FT_List_Find
+ * FT_List_Remove
+ * FT_List_Up
+ * FT_List_Iterate
+ * FT_List_Iterator
+ * FT_List_Finalize
+ * FT_List_Destructor
+ * Find the list node for a given listed object.
+ * list ::
+ * A pointer to the parent list.
+ * data ::
+ * The address of the listed object.
+ * List node. NULL if it wasn't found.
FT_EXPORT( FT_ListNode )
FT_List_Find( FT_List list,
void* data );
- /* Append an element to the end of a list. */
- /* node :: The node to append. */
+ * Append an element to the end of a list.
+ * node ::
+ * The node to append.
FT_List_Add( FT_List list,
FT_ListNode node );
- /* Insert an element at the head of a list. */
- /* list :: A pointer to parent list. */
- /* node :: The node to insert. */
+ * Insert an element at the head of a list.
+ * A pointer to parent list.
+ * The node to insert.
FT_List_Insert( FT_List list,
- /* Remove a node from a list. This function doesn't check whether */
- /* the node is in the list! */
- /* node :: The node to remove. */
+ * Remove a node from a list. This function doesn't check whether the
+ * node is in the list!
+ * The node to remove.
FT_List_Remove( FT_List list,
- /* Move a node to the head/top of a list. Used to maintain LRU */
- /* lists. */
- /* node :: The node to move. */
+ * Move a node to the head/top of a list. Used to maintain LRU lists.
+ * The node to move.
FT_List_Up( FT_List list,
- /* <FuncType> */
- /* An FT_List iterator function that is called during a list parse */
- /* by @FT_List_Iterate. */
- /* node :: The current iteration list node. */
- /* user :: A typeless pointer passed to @FT_List_Iterate. */
- /* Can be used to point to the iteration's state. */
+ * @functype:
+ * An FT_List iterator function that is called during a list parse by
+ * @FT_List_Iterate.
+ * The current iteration list node.
+ * user ::
+ * A typeless pointer passed to @FT_List_Iterate. Can be used to point
+ * to the iteration's state.
typedef FT_Error
(*FT_List_Iterator)( FT_ListNode node,
void* user );
- /* Parse a list and calls a given iterator function on each element. */
- /* Note that parsing is stopped as soon as one of the iterator calls */
- /* returns a non-zero value. */
- /* list :: A handle to the list. */
- /* iterator :: An iterator function, called on each node of the list. */
- /* user :: A user-supplied field that is passed as the second */
- /* argument to the iterator. */
- /* The result (a FreeType error code) of the last iterator call. */
+ * Parse a list and calls a given iterator function on each element.
+ * Note that parsing is stopped as soon as one of the iterator calls
+ * returns a non-zero value.
+ * A handle to the list.
+ * iterator ::
+ * An iterator function, called on each node of the list.
+ * A user-supplied field that is passed as the second argument to the
+ * iterator.
+ * The result (a FreeType error code) of the last iterator call.
FT_List_Iterate( FT_List list,
FT_List_Iterator iterator,
- /* An @FT_List iterator function that is called during a list */
- /* finalization by @FT_List_Finalize to destroy all elements in a */
- /* given list. */
- /* system :: The current system object. */
- /* data :: The current object to destroy. */
- /* user :: A typeless pointer passed to @FT_List_Iterate. It can */
- /* be used to point to the iteration's state. */
+ * An @FT_List iterator function that is called during a list
+ * finalization by @FT_List_Finalize to destroy all elements in a given
+ * list.
+ * system ::
+ * The current system object.
+ * The current object to destroy.
+ * A typeless pointer passed to @FT_List_Iterate. It can be used to
+ * point to the iteration's state.
typedef void
(*FT_List_Destructor)( FT_Memory memory,
void* data,
- /* Destroy all elements in the list as well as the list itself. */
- /* destroy :: A list destructor that will be applied to each element */
- /* of the list. Set this to NULL if not needed. */
- /* memory :: The current memory object that handles deallocation. */
- /* user :: A user-supplied field that is passed as the last */
- /* argument to the destructor. */
- /* This function expects that all nodes added by @FT_List_Add or */
- /* @FT_List_Insert have been dynamically allocated. */
+ * Destroy all elements in the list as well as the list itself.
+ * destroy ::
+ * A list destructor that will be applied to each element of the list.
+ * Set this to NULL if not needed.
+ * The current memory object that handles deallocation.
+ * A user-supplied field that is passed as the last argument to the
+ * destructor.
+ * This function expects that all nodes added by @FT_List_Add or
+ * @FT_List_Insert have been dynamically allocated.
FT_List_Finalize( FT_List list,
FT_List_Destructor destroy,
-/* ftlzw.h */
-/* LZW-compressed stream support. */
+ * ftlzw.h
+ * LZW-compressed stream support.
#ifndef FTLZW_H_
@@ -31,59 +31,60 @@
- /* lzw */
- /* LZW Streams */
- /* Using LZW-compressed font files. */
- /* This section contains the declaration of LZW-specific functions. */
+ * LZW Streams
+ * Using LZW-compressed font files.
+ * This section contains the declaration of LZW-specific functions.
- * FT_Stream_OpenLZW
- * Open a new stream to parse LZW-compressed font files. This is
- * mainly used to support the compressed `*.pcf.Z' fonts that come
- * stream :: The target embedding stream.
- * source :: The source stream.
- * process each time seeking backwards is needed within the stream
- * In certain builds of the library, LZW compression recognition is
- * compressed file, the library will try to open a LZW stream from it
- * and re-open the face with it.
- * of FreeType was not compiled with LZW support.
+ * FT_Stream_OpenLZW
+ * Open a new stream to parse LZW-compressed font files. This is mainly
+ * used to support the compressed `*.pcf.Z` fonts that come with XFree86.
+ * process each time seeking backwards is needed within the stream
+ * In certain builds of the library, LZW compression recognition is
+ * compressed file, the library will try to open a LZW stream from it and
+ * re-open the face with it.
+ * of FreeType was not compiled with LZW support.
FT_Stream_OpenLZW( FT_Stream stream,
-/* ftmac.h */
-/* Additional Mac-specific API. */
-/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
+ * ftmac.h
+ * Additional Mac-specific API.
+ * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
-/* NOTE: Include this file after FT_FREETYPE_H and after any */
-/* Mac-specific headers (because this header uses Mac types such as */
-/* Handle, FSSpec, FSRef, etc.) */
+ * NOTE: Include this file after `FT_FREETYPE_H` and after any
+ * Mac-specific headers (because this header uses Mac types such as
+ * 'Handle', 'FSSpec', 'FSRef', etc.)
#ifndef FTMAC_H_
@@ -47,56 +47,59 @@ FT_BEGIN_HEADER
- /* mac_specific */
- /* Mac Specific Interface */
- /* Only available on the Macintosh. */
- /* The following definitions are only available if FreeType is */
- /* compiled on a Macintosh. */
+ * Mac Specific Interface
+ * Only available on the Macintosh.
+ * The following definitions are only available if FreeType is compiled
+ * on a Macintosh.
- /* FT_New_Face_From_FOND */
- /* Create a new face object from a FOND resource. */
- /* library :: A handle to the library resource. */
- /* fond :: A FOND resource. */
- /* face_index :: Only supported for the -1 `sanity check' special */
- /* case. */
- /* aface :: A handle to a new face object. */
- /* <Notes> */
- /* This function can be used to create @FT_Face objects from fonts */
- /* that are installed in the system as follows. */
- /* fond = GetResource( 'FOND', fontName ); */
- /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
+ * FT_New_Face_From_FOND
+ * Create a new face object from a FOND resource.
+ * A handle to the library resource.
+ * fond ::
+ * A FOND resource.
+ * face_index ::
+ * Only supported for the -1 'sanity check' special case.
+ * aface ::
+ * A handle to a new face object.
+ * @example:
+ * This function can be used to create @FT_Face objects from fonts that
+ * are installed in the system as follows.
+ * fond = GetResource( 'FOND', fontName );
+ * error = FT_New_Face_From_FOND( library, fond, 0, &face );
FT_New_Face_From_FOND( FT_Library library,
Handle fond,
@@ -105,28 +108,28 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE;
- /* FT_GetFile_From_Mac_Name */
- /* Return an FSSpec for the disk file containing the named font. */
- /* fontName :: Mac OS name of the font (e.g., Times New Roman */
- /* Bold). */
- /* pathSpec :: FSSpec to the file. For passing to */
- /* @FT_New_Face_From_FSSpec. */
- /* face_index :: Index of the face. For passing to */
+ * FT_GetFile_From_Mac_Name
+ * Return an FSSpec for the disk file containing the named font.
+ * fontName ::
+ * Mac OS name of the font (e.g., Times New Roman Bold).
+ * pathSpec ::
+ * FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
+ * Index of the face. For passing to @FT_New_Face_From_FSSpec.
FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec,
@@ -134,27 +137,28 @@ FT_BEGIN_HEADER
- /* FT_GetFile_From_Mac_ATS_Name */
- /* fontName :: Mac OS name of the font in ATS framework. */
+ * FT_GetFile_From_Mac_ATS_Name
+ * Mac OS name of the font in ATS framework.
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
@@ -162,30 +166,33 @@ FT_BEGIN_HEADER
- /* FT_GetFilePath_From_Mac_ATS_Name */
- /* Return a pathname of the disk file and face index for given font */
- /* name that is handled by ATS framework. */
- /* path :: Buffer to store pathname of the file. For passing */
- /* to @FT_New_Face. The client must allocate this */
- /* buffer before calling this function. */
- /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
- /* face_index :: Index of the face. For passing to @FT_New_Face. */
+ * FT_GetFilePath_From_Mac_ATS_Name
+ * Return a pathname of the disk file and face index for given font name
+ * that is handled by ATS framework.
+ * path ::
+ * Buffer to store pathname of the file. For passing to @FT_New_Face.
+ * The client must allocate this buffer before calling this function.
+ * maxPathSize ::
+ * Lengths of the buffer `path` that client allocated.
+ * Index of the face. For passing to @FT_New_Face.
FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
UInt8* path,
@@ -194,33 +201,37 @@ FT_BEGIN_HEADER
- /* FT_New_Face_From_FSSpec */
- /* Create a new face object from a given resource and typeface index */
- /* using an FSSpec to the font file. */
- /* spec :: FSSpec to the font file. */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index~0. */
- /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
- /* it accepts an FSSpec instead of a path. */
+ * FT_New_Face_From_FSSpec
+ * Create a new face object from a given resource and typeface index
+ * using an FSSpec to the font file.
+ * spec ::
+ * FSSpec to the font file.
+ * The index of the face within the resource. The first face has
+ * index~0.
+ * @FT_New_Face_From_FSSpec is identical to @FT_New_Face except it
+ * accepts an FSSpec instead of a path.
FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec,
@@ -229,33 +240,37 @@ FT_BEGIN_HEADER
- /* FT_New_Face_From_FSRef */
- /* using an FSRef to the font file. */
- /* spec :: FSRef to the font file. */
- /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
- /* it accepts an FSRef instead of a path. */
+ * FT_New_Face_From_FSRef
+ * using an FSRef to the font file.
+ * FSRef to the font file.
+ * @FT_New_Face_From_FSRef is identical to @FT_New_Face except it accepts
+ * an FSRef instead of a path.
FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref,
-/* ftmm.h */
-/* FreeType Multiple Master font interface (specification). */
+ * ftmm.h
+ * FreeType Multiple Master font interface (specification).
#ifndef FTMM_H_
@@ -27,49 +27,52 @@
- /* multiple_masters */
- /* Multiple Masters */
- /* How to manage Multiple Masters fonts. */
- /* The following types and functions are used to manage Multiple */
- /* Master fonts, i.e., the selection of specific design instances by */
- /* setting design axis coordinates. */
- /* Besides Adobe MM fonts, the interface supports Apple's TrueType GX */
- /* and OpenType variation fonts. Some of the routines only work with */
- /* Adobe MM fonts, others will work with all three types. They are */
- /* similar enough that a consistent interface makes sense. */
- /* <Struct> */
- /* FT_MM_Axis */
- /* A structure to model a given axis in design space for Multiple */
- /* Masters fonts. */
- /* This structure can't be used for TrueType GX or OpenType variation */
- /* fonts. */
- /* <Fields> */
- /* name :: The axis's name. */
- /* minimum :: The axis's minimum design coordinate. */
- /* maximum :: The axis's maximum design coordinate. */
+ * Multiple Masters
+ * How to manage Multiple Masters fonts.
+ * The following types and functions are used to manage Multiple Master
+ * fonts, i.e., the selection of specific design instances by setting
+ * design axis coordinates.
+ * Besides Adobe MM fonts, the interface supports Apple's TrueType GX and
+ * OpenType variation fonts. Some of the routines only work with Adobe
+ * MM fonts, others will work with all three types. They are similar
+ * enough that a consistent interface makes sense.
+ * FT_MM_Axis
+ * A structure to model a given axis in design space for Multiple Masters
+ * fonts.
+ * This structure can't be used for TrueType GX or OpenType variation
+ * The axis's name.
+ * minimum ::
+ * The axis's minimum design coordinate.
+ * maximum ::
+ * The axis's maximum design coordinate.
typedef struct FT_MM_Axis_
FT_String* name;
@@ -79,28 +82,29 @@ FT_BEGIN_HEADER
} FT_MM_Axis;
- /* FT_Multi_Master */
- /* A structure to model the axes and space of a Multiple Masters */
- /* font. */
- /* num_axis :: Number of axes. Cannot exceed~4. */
- /* num_designs :: Number of designs; should be normally 2^num_axis */
- /* even though the Type~1 specification strangely */
- /* allows for intermediate designs to be present. */
- /* This number cannot exceed~16. */
- /* axis :: A table of axis descriptors. */
+ * FT_Multi_Master
+ * A structure to model the axes and space of a Multiple Masters font.
+ * num_axis ::
+ * Number of axes. Cannot exceed~4.
+ * num_designs ::
+ * Number of designs; should be normally 2^num_axis even though the
+ * Type~1 specification strangely allows for intermediate designs to be
+ * present. This number cannot exceed~16.
+ * axis ::
+ * A table of axis descriptors.
typedef struct FT_Multi_Master_
FT_UInt num_axis;
@@ -110,42 +114,45 @@ FT_BEGIN_HEADER
} FT_Multi_Master;
- /* FT_Var_Axis */
- /* Masters, TrueType GX, and OpenType variation fonts. */
- /* Not always meaningful for TrueType GX or OpenType */
- /* variation fonts. */
- /* def :: The axis's default design coordinate. */
- /* FreeType computes meaningful default values for Adobe */
- /* MM fonts. */
- /* tag :: The axis's tag (the equivalent to `name' for TrueType */
- /* GX and OpenType variation fonts). FreeType provides */
- /* default values for Adobe MM fonts if possible. */
- /* strid :: The axis name entry in the font's `name' table. This */
- /* is another (and often better) version of the `name' */
- /* field for TrueType GX or OpenType variation fonts. Not */
- /* meaningful for Adobe MM fonts. */
- /* The fields `minimum', `def', and `maximum' are 16.16 fractional */
- /* values for TrueType GX and OpenType variation fonts. For Adobe MM */
- /* fonts, the values are integers. */
+ * FT_Var_Axis
+ * A structure to model a given axis in design space for Multiple
+ * Masters, TrueType GX, and OpenType variation fonts.
+ * The axis's name. Not always meaningful for TrueType GX or OpenType
+ * variation fonts.
+ * def ::
+ * The axis's default design coordinate. FreeType computes meaningful
+ * default values for Adobe MM fonts.
+ * tag ::
+ * The axis's tag (the equivalent to 'name' for TrueType GX and
+ * OpenType variation fonts). FreeType provides default values for
+ * Adobe MM fonts if possible.
+ * strid ::
+ * The axis name entry in the font's `name` table. This is another
+ * (and often better) version of the 'name' field for TrueType GX or
+ * OpenType variation fonts. Not meaningful for Adobe MM fonts.
+ * The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
+ * for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
+ * values are integers.
typedef struct FT_Var_Axis_
@@ -160,27 +167,29 @@ FT_BEGIN_HEADER
} FT_Var_Axis;
- /* FT_Var_Named_Style */
- /* A structure to model a named instance in a TrueType GX or OpenType */
- /* variation font. */
- /* This structure can't be used for Adobe MM fonts. */
- /* coords :: The design coordinates for this instance. */
- /* This is an array with one entry for each axis. */
- /* strid :: The entry in `name' table identifying this instance. */
- /* psid :: The entry in `name' table identifying a PostScript name */
- /* for this instance. Value 0xFFFF indicates a missing */
- /* entry. */
+ * FT_Var_Named_Style
+ * A structure to model a named instance in a TrueType GX or OpenType
+ * variation font.
+ * This structure can't be used for Adobe MM fonts.
+ * coords ::
+ * The design coordinates for this instance. This is an array with one
+ * entry for each axis.
+ * The entry in `name` table identifying this instance.
+ * psid ::
+ * The entry in `name` table identifying a PostScript name for this
+ * instance. Value 0xFFFF indicates a missing entry.
typedef struct FT_Var_Named_Style_
FT_Fixed* coords;
@@ -190,50 +199,47 @@ FT_BEGIN_HEADER
} FT_Var_Named_Style;
- /* FT_MM_Var */
- /* A structure to model the axes and space of an Adobe MM, TrueType */
- /* GX, or OpenType variation font. */
- /* Some fields are specific to one format and not to the others. */
- /* num_axis :: The number of axes. The maximum value is~4 for */
- /* Adobe MM fonts; no limit in TrueType GX or */
- /* OpenType variation fonts. */
- /* num_designs :: The number of designs; should be normally */
- /* 2^num_axis for Adobe MM fonts. Not meaningful */
- /* for TrueType GX or OpenType variation fonts */
- /* (where every glyph could have a different */
- /* number of designs). */
- /* num_namedstyles :: The number of named styles; a `named style' is */
- /* a tuple of design coordinates that has a string */
- /* ID (in the `name' table) associated with it. */
- /* The font can tell the user that, for example, */
- /* [Weight=1.5,Width=1.1] is `Bold'. Another name */
- /* for `named style' is `named instance'. */
- /* For Adobe Multiple Masters fonts, this value is */
- /* always zero because the format does not support */
- /* named styles. */
- /* axis :: An axis descriptor table. */
- /* TrueType GX and OpenType variation fonts */
- /* contain slightly more data than Adobe MM fonts. */
- /* Memory management of this pointer is done */
- /* internally by FreeType. */
- /* namedstyle :: A named style (instance) table. */
- /* Only meaningful for TrueType GX and OpenType */
- /* variation fonts. Memory management of this */
- /* pointer is done internally by FreeType. */
+ * FT_MM_Var
+ * A structure to model the axes and space of an Adobe MM, TrueType GX,
+ * or OpenType variation font.
+ * Some fields are specific to one format and not to the others.
+ * The number of axes. The maximum value is~4 for Adobe MM fonts; no
+ * limit in TrueType GX or OpenType variation fonts.
+ * The number of designs; should be normally 2^num_axis for Adobe MM
+ * fonts. Not meaningful for TrueType GX or OpenType variation fonts
+ * (where every glyph could have a different number of designs).
+ * num_namedstyles ::
+ * The number of named styles; a 'named style' is a tuple of design
+ * coordinates that has a string ID (in the `name` table) associated
+ * with it. The font can tell the user that, for example,
+ * [Weight=1.5,Width=1.1] is 'Bold'. Another name for 'named style' is
+ * 'named instance'.
+ * For Adobe Multiple Masters fonts, this value is always zero because
+ * the format does not support named styles.
+ * An axis descriptor table. TrueType GX and OpenType variation fonts
+ * contain slightly more data than Adobe MM fonts. Memory management
+ * of this pointer is done internally by FreeType.
+ * namedstyle ::
+ * A named style (instance) table. Only meaningful for TrueType GX and
+ * OpenType variation fonts. Memory management of this pointer is done
+ * internally by FreeType.
typedef struct FT_MM_Var_
@@ -245,384 +251,493 @@ FT_BEGIN_HEADER
} FT_MM_Var;
- /* FT_Get_Multi_Master */
- /* Retrieve a variation descriptor of a given Adobe MM font. */
- /* This function can't be used with TrueType GX or OpenType variation */
- /* face :: A handle to the source face. */
- /* amaster :: The Multiple Masters descriptor. */
+ * FT_Get_Multi_Master
+ * Retrieve a variation descriptor of a given Adobe MM font.
+ * This function can't be used with TrueType GX or OpenType variation
+ * A handle to the source face.
+ * amaster ::
+ * The Multiple Masters descriptor.
FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master *amaster );
- /* FT_Get_MM_Var */
- /* Retrieve a variation descriptor for a given font. */
- /* This function works with all supported variation formats. */
- /* amaster :: The variation descriptor. */
- /* Allocates a data structure, which the user must */
- /* deallocate with a call to @FT_Done_MM_Var after use. */
+ * FT_Get_MM_Var
+ * Retrieve a variation descriptor for a given font.
+ * This function works with all supported variation formats.
+ * The variation descriptor. Allocates a data structure, which the
+ * user must deallocate with a call to @FT_Done_MM_Var after use.
FT_Get_MM_Var( FT_Face face,
FT_MM_Var* *amaster );
- /* FT_Done_MM_Var */
- /* Free the memory allocated by @FT_Get_MM_Var. */
- /* library :: A handle of the face's parent library object that was */
- /* used in the call to @FT_Get_MM_Var to create `amaster'. */
+ * FT_Done_MM_Var
+ * Free the memory allocated by @FT_Get_MM_Var.
+ * A handle of the face's parent library object that was used in the
+ * call to @FT_Get_MM_Var to create `amaster`.
FT_Done_MM_Var( FT_Library library,
FT_MM_Var *amaster );
- /* FT_Set_MM_Design_Coordinates */
- /* For Adobe MM fonts, choose an interpolated font design through */
- /* design coordinates. */
- /* num_coords :: The number of available design coordinates. If it */
- /* is larger than the number of axes, ignore the excess */
- /* values. If it is smaller than the number of axes, */
- /* use default values for the remaining axes. */
- /* coords :: An array of design coordinates. */
- /* [Since 2.8.1] To reset all axes to the default values, call the */
- /* function with `num_coords' set to zero and `coords' set to NULL. */
- /* [Since 2.9] If `num_coords' is larger than zero, this function */
- /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
- /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
- /* is zero, this bit flag gets unset. */
+ * FT_Set_MM_Design_Coordinates
+ * For Adobe MM fonts, choose an interpolated font design through design
+ * coordinates.
+ * num_coords ::
+ * The number of available design coordinates. If it is larger than
+ * the number of axes, ignore the excess values. If it is smaller than
+ * the number of axes, use default values for the remaining axes.
+ * An array of design coordinates.
+ * [Since 2.8.1] To reset all axes to the default values, call the
+ * function with `num_coords` set to zero and `coords` set to NULL.
+ * [Since 2.9] If `num_coords` is larger than zero, this function sets
+ * the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
+ * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero,
+ * this bit flag gets unset.
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
- /* FT_Set_Var_Design_Coordinates */
- /* Choose an interpolated font design through design coordinates. */
- /* [Since 2.9] `Default values' means the currently selected named */
- /* instance (or the base font if no named instance is selected). */
+ * FT_Set_Var_Design_Coordinates
+ * Choose an interpolated font design through design coordinates.
+ * [Since 2.9] 'Default values' means the currently selected named
+ * instance (or the base font if no named instance is selected).
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_Fixed* coords );
- /* FT_Get_Var_Design_Coordinates */
- /* Get the design coordinates of the currently selected interpolated */
- /* num_coords :: The number of design coordinates to retrieve. If it */
- /* is larger than the number of axes, set the excess */
- /* values to~0. */
- /* coords :: The design coordinates array. */
- /* <Since> */
- /* 2.7.1 */
+ * FT_Get_Var_Design_Coordinates
+ * Get the design coordinates of the currently selected interpolated
+ * The number of design coordinates to retrieve. If it is larger than
+ * the number of axes, set the excess values to~0.
+ * The design coordinates array.
+ * 2.7.1
FT_Get_Var_Design_Coordinates( FT_Face face,
- /* FT_Set_MM_Blend_Coordinates */
- /* Choose an interpolated font design through normalized blend */
- /* coordinates. */
- /* coords :: The design coordinates array (each element must be */
- /* between 0 and 1.0 for Adobe MM fonts, and between */
- /* -1.0 and 1.0 for TrueType GX and OpenType variation */
- /* fonts). */
+ * FT_Set_MM_Blend_Coordinates
+ * Choose an interpolated font design through normalized blend
+ * The design coordinates array (each element must be between 0 and 1.0
+ * for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and
+ * OpenType variation fonts).
FT_Set_MM_Blend_Coordinates( FT_Face face,
- /* FT_Get_MM_Blend_Coordinates */
- /* Get the normalized blend coordinates of the currently selected */
- /* interpolated font. */
- /* num_coords :: The number of normalized blend coordinates to */
- /* retrieve. If it is larger than the number of axes, */
- /* set the excess values to~0.5 for Adobe MM fonts, and */
- /* to~0 for TrueType GX and OpenType variation fonts. */
- /* coords :: The normalized blend coordinates array. */
+ * FT_Get_MM_Blend_Coordinates
+ * Get the normalized blend coordinates of the currently selected
+ * interpolated font.
+ * The number of normalized blend coordinates to retrieve. If it is
+ * larger than the number of axes, set the excess values to~0.5 for
+ * Adobe MM fonts, and to~0 for TrueType GX and OpenType variation
+ * The normalized blend coordinates array.
FT_Get_MM_Blend_Coordinates( FT_Face face,
- /* FT_Set_Var_Blend_Coordinates */
- /* This is another name of @FT_Set_MM_Blend_Coordinates. */
+ * FT_Set_Var_Blend_Coordinates
+ * This is another name of @FT_Set_MM_Blend_Coordinates.
FT_Set_Var_Blend_Coordinates( FT_Face face,
- /* FT_Get_Var_Blend_Coordinates */
- /* This is another name of @FT_Get_MM_Blend_Coordinates. */
+ * FT_Get_Var_Blend_Coordinates
+ * This is another name of @FT_Get_MM_Blend_Coordinates.
FT_Get_Var_Blend_Coordinates( FT_Face face,
- /* FT_VAR_AXIS_FLAG_XXX */
- /* A list of bit flags used in the return value of */
- /* @FT_Get_Var_Axis_Flags. */
- /* <Values> */
- /* FT_VAR_AXIS_FLAG_HIDDEN :: */
- /* The variation axis should not be exposed to user interfaces. */
- /* 2.8.1 */
+ * FT_Set_MM_WeightVector
+ * For Adobe MM fonts, choose an interpolated font design by directly
+ * setting the weight vector.
+ * len ::
+ * The length of the weight vector array. If it is larger than the
+ * number of designs, the extra values are ignored. If it is less than
+ * the number of designs, the remaining values are set to zero.
+ * weightvector ::
+ * An array representing the weight vector.
+ * Adobe Multiple Master fonts limit the number of designs, and thus the
+ * length of the weight vector to~16.
+ * If `len` is zero and `weightvector` is NULL, the weight vector array
+ * is reset to the default values.
+ * The Adobe documentation also states that the values in the
+ * WeightVector array must total 1.0 +/-~0.001. In practice this does
+ * not seem to be enforced, so is not enforced here, either.
+ FT_Set_MM_WeightVector( FT_Face face,
+ FT_UInt len,
+ FT_Fixed* weightvector );
+ * FT_Get_MM_WeightVector
+ * For Adobe MM fonts, retrieve the current weight vector of the font.
+ * A pointer to the size of the array to be filled. If the size of the
+ * array is less than the number of designs, `FT_Err_Invalid_Argument`
+ * is returned, and `len` is set to the required size (the number of
+ * designs). If the size of the array is greater than the number of
+ * designs, the remaining entries are set to~0. On successful
+ * completion, `len` is set to the number of designs (i.e., the number
+ * of values written to the array).
+ * An array to be filled.
+ * length of the WeightVector to~16.
+ FT_Get_MM_WeightVector( FT_Face face,
+ FT_UInt* len,
+ * FT_VAR_AXIS_FLAG_XXX
+ * A list of bit flags used in the return value of
+ * @FT_Get_Var_Axis_Flags.
+ * FT_VAR_AXIS_FLAG_HIDDEN ::
+ * The variation axis should not be exposed to user interfaces.
+ * 2.8.1
#define FT_VAR_AXIS_FLAG_HIDDEN 1
- /* FT_Get_Var_Axis_Flags */
- /* Get the `flags' field of an OpenType Variation Axis Record. */
- /* Not meaningful for Adobe MM fonts (`*flags' is always zero). */
- /* master :: The variation descriptor. */
- /* axis_index :: The index of the requested variation axis. */
- /* flags :: The `flags' field. See @FT_VAR_AXIS_FLAG_XXX for */
- /* possible values. */
+ * FT_Get_Var_Axis_Flags
+ * Get the 'flags' field of an OpenType Variation Axis Record.
+ * Not meaningful for Adobe MM fonts (`*flags` is always zero).
+ * master ::
+ * The variation descriptor.
+ * axis_index ::
+ * The index of the requested variation axis.
+ * flags ::
+ * The 'flags' field. See @FT_VAR_AXIS_FLAG_XXX for possible values.
FT_Get_Var_Axis_Flags( FT_MM_Var* master,
FT_UInt axis_index,
FT_UInt* flags );
- /* FT_Set_Named_Instance */
- /* Set or change the current named instance. */
- /* instance_index :: The index of the requested instance, starting */
- /* with value 1. If set to value 0, FreeType */
- /* switches to font access without a named */
- /* instance. */
- /* The function uses the value of `instance_index' to set bits 16-30 */
- /* of the face's `face_index' field. It also resets any variation */
- /* applied to the font, and the @FT_FACE_FLAG_VARIATION bit of the */
- /* face's `face_flags' field gets reset to zero (i.e., */
- /* @FT_IS_VARIATION will return false). */
- /* For Adobe MM fonts (which don't have named instances) this */
- /* function simply resets the current face to the default instance. */
- /* 2.9 */
+ * FT_Set_Named_Instance
+ * Set or change the current named instance.
+ * instance_index ::
+ * The index of the requested instance, starting with value 1. If set
+ * to value 0, FreeType switches to font access without a named
+ * instance.
+ * The function uses the value of `instance_index` to set bits 16-30 of
+ * the face's `face_index` field. It also resets any variation applied
+ * to the font, and the @FT_FACE_FLAG_VARIATION bit of the face's
+ * `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION will
+ * return false).
+ * For Adobe MM fonts (which don't have named instances) this function
+ * simply resets the current face to the default instance.
+ * 2.9
FT_Set_Named_Instance( FT_Face face,
FT_UInt instance_index );
@@ -1,94 +1,103 @@
-/* ftmoderr.h */
-/* FreeType module error offsets (specification). */
-/* Copyright 2001-2018 by */
- /* This file is used to define the FreeType module error codes. */
- /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */
- /* set, the lower byte of an error value identifies the error code as */
- /* usual. In addition, the higher byte identifies the module. For */
- /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
- /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */
- /* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */
- /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */
- /* including the high byte. */
- /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */
- /* an error value is set to zero. */
- /* To hide the various `XXX_Err_' prefixes in the source code, FreeType */
- /* provides some macros in `fttypes.h'. */
- /* FT_ERR( err ) */
- /* Add current error module prefix (as defined with the */
- /* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */
- /* the line */
- /* error = FT_ERR( Invalid_Outline ); */
- /* expands to */
- /* error = BDF_Err_Invalid_Outline; */
- /* For simplicity, you can always use `FT_Err_Ok' directly instead */
- /* of `FT_ERR( Ok )'. */
- /* FT_ERR_EQ( errcode, err ) */
- /* FT_ERR_NEQ( errcode, err ) */
- /* Compare error code `errcode' with the error `err' for equality */
- /* and inequality, respectively. Example: */
- /* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */
- /* ... */
- /* Using this macro you don't have to think about error prefixes. */
- /* Of course, if module errors are not active, the above example is */
- /* the same as */
- /* if ( error == FT_Err_Invalid_Outline ) */
- /* FT_ERROR_BASE( errcode ) */
- /* FT_ERROR_MODULE( errcode ) */
- /* Get base error and module error code, respectively. */
- /* It can also be used to create a module error message table easily */
- /* with something like */
- /* #undef FTMODERR_H_ */
- /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
- /* #define FT_MODERR_START_LIST { */
- /* #define FT_MODERR_END_LIST { 0, 0 } }; */
- /* int mod_err_offset; */
- /* const char* mod_err_msg */
- /* } ft_mod_errors[] = */
- /* #include FT_MODULE_ERRORS_H */
+ * ftmoderr.h
+ * FreeType module error offsets (specification).
+ * Copyright 2001-2019 by
+ * This file is used to define the FreeType module error codes.
+ * If the macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` in `ftoption.h` is
+ * set, the lower byte of an error value identifies the error code as
+ * usual. In addition, the higher byte identifies the module. For
+ * example, the error `FT_Err_Invalid_File_Format` has value 0x0003, the
+ * error `TT_Err_Invalid_File_Format` has value 0x1303, the error
+ * `T1_Err_Invalid_File_Format` has value 0x1403, etc.
+ * Note that `FT_Err_Ok`, `TT_Err_Ok`, etc. are always equal to zero,
+ * including the high byte.
+ * If `FT_CONFIG_OPTION_USE_MODULE_ERRORS` isn't set, the higher byte of an
+ * error value is set to zero.
+ * To hide the various `XXX_Err_` prefixes in the source code, FreeType
+ * provides some macros in `fttypes.h`.
+ * FT_ERR( err )
+ * Add current error module prefix (as defined with the `FT_ERR_PREFIX`
+ * macro) to `err`. For example, in the BDF module the line
+ * error = FT_ERR( Invalid_Outline );
+ * expands to
+ * error = BDF_Err_Invalid_Outline;
+ * For simplicity, you can always use `FT_Err_Ok` directly instead of
+ * `FT_ERR( Ok )`.
+ * FT_ERR_EQ( errcode, err )
+ * FT_ERR_NEQ( errcode, err )
+ * Compare error code `errcode` with the error `err` for equality and
+ * inequality, respectively. Example:
+ * if ( FT_ERR_EQ( error, Invalid_Outline ) )
+ * Using this macro you don't have to think about error prefixes. Of
+ * course, if module errors are not active, the above example is the
+ * same as
+ * if ( error == FT_Err_Invalid_Outline )
+ * FT_ERROR_BASE( errcode )
+ * FT_ERROR_MODULE( errcode )
+ * Get base error and module error code, respectively.
+ * It can also be used to create a module error message table easily with
+ * something like
+ * #undef FTMODERR_H_
+ * #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s },
+ * #define FT_MODERR_START_LIST {
+ * #define FT_MODERR_END_LIST { 0, 0 } };
+ * int mod_err_offset;
+ * const char* mod_err_msg
+ * } ft_mod_errors[] =
+ * #include FT_MODULE_ERRORS_H
#ifndef FTMODERR_H_
-/* ftotval.h */
-/* FreeType API for validating OpenType tables (specification). */
-/* Warning: This module might be moved to a different library in the */
-/* future to avoid a tight dependency between FreeType and the */
-/* OpenType specification. */
+ * ftotval.h
+ * FreeType API for validating OpenType tables (specification).
+ * Warning: This module might be moved to a different library in the
+ * future to avoid a tight dependency between FreeType and the
+ * OpenType specification.
#ifndef FTOTVAL_H_
@@ -43,62 +43,62 @@
- /* ot_validation */
- /* OpenType Validation */
- /* An API to validate OpenType tables. */
- /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
- /* FT_OpenType_Validate */
- /* FT_OpenType_Free */
- /* FT_VALIDATE_OTXXX */
- * FT_VALIDATE_OTXXX
- * A list of bit-field constants used with @FT_OpenType_Validate to
- * indicate which OpenType tables should be validated.
- * FT_VALIDATE_BASE ::
- * Validate BASE table.
- * FT_VALIDATE_GDEF ::
- * Validate GDEF table.
- * FT_VALIDATE_GPOS ::
- * Validate GPOS table.
- * FT_VALIDATE_GSUB ::
- * Validate GSUB table.
- * FT_VALIDATE_JSTF ::
- * Validate JSTF table.
- * FT_VALIDATE_MATH ::
- * Validate MATH table.
- * FT_VALIDATE_OT ::
- * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
+ * ot_validation
+ * OpenType Validation
+ * An API to validate OpenType tables.
+ * OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
+ * FT_OpenType_Validate
+ * FT_OpenType_Free
+ * FT_VALIDATE_OTXXX
+ * A list of bit-field constants used with @FT_OpenType_Validate to
+ * indicate which OpenType tables should be validated.
+ * FT_VALIDATE_BASE ::
+ * Validate BASE table.
+ * FT_VALIDATE_GDEF ::
+ * Validate GDEF table.
+ * FT_VALIDATE_GPOS ::
+ * Validate GPOS table.
+ * FT_VALIDATE_GSUB ::
+ * Validate GSUB table.
+ * FT_VALIDATE_JSTF ::
+ * Validate JSTF table.
+ * FT_VALIDATE_MATH ::
+ * Validate MATH table.
+ * FT_VALIDATE_OT ::
+ * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
#define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400
@@ -113,53 +113,54 @@ FT_BEGIN_HEADER
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH )
- * FT_OpenType_Validate
- * Validate various OpenType tables to assure that all offsets and
- * @FT_VALIDATE_OTXXX for possible values.
- * BASE_table ::
- * A pointer to the BASE table.
- * GDEF_table ::
- * A pointer to the GDEF table.
- * GPOS_table ::
- * A pointer to the GPOS table.
- * GSUB_table ::
- * A pointer to the GSUB table.
- * JSTF_table ::
- * A pointer to the JSTF table.
- * This function only works with OpenType fonts, returning an error
- * After use, the application should deallocate the five tables with
- * @FT_OpenType_Free. A NULL value indicates that the table either
- * doesn't exist in the font, or the application hasn't asked for
- * validation.
+ * Validate various OpenType tables to assure that all offsets and
+ * @FT_VALIDATE_OTXXX for possible values.
+ * BASE_table ::
+ * A pointer to the BASE table.
+ * GDEF_table ::
+ * A pointer to the GDEF table.
+ * GPOS_table ::
+ * A pointer to the GPOS table.
+ * GSUB_table ::
+ * A pointer to the GSUB table.
+ * JSTF_table ::
+ * A pointer to the JSTF table.
+ * This function only works with OpenType fonts, returning an error
+ * After use, the application should deallocate the five tables with
+ * @FT_OpenType_Free. A NULL value indicates that the table either
+ * doesn't exist in the font, or the application hasn't asked for
+ * validation.
FT_OpenType_Validate( FT_Face face,
@@ -169,30 +170,32 @@ FT_BEGIN_HEADER
FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table );
- * FT_OpenType_Free
- * Free the buffer allocated by OpenType validator.
- * @FT_OpenType_Validate.
- * @FT_OpenType_Validate only.
+ * Free the buffer allocated by OpenType validator.
+ * @FT_OpenType_Validate.
+ * @FT_OpenType_Validate only.
FT_OpenType_Free( FT_Face face,
-/* ftoutln.h */
-/* Support for the FT_Outline type used to store glyph shapes of */
-/* most scalable font formats (specification). */
+ * ftoutln.h
+ * Support for the FT_Outline type used to store glyph shapes of
+ * most scalable font formats (specification).
#ifndef FTOUTLN_H_
@@ -34,127 +34,131 @@
- /* Outline Processing */
- /* Functions to create, transform, and render vectorial glyph images. */
- /* This section contains routines used to create and destroy scalable */
- /* glyph images known as `outlines'. These can also be measured, */
- /* transformed, and converted into bitmaps and pixmaps. */
- /* FT_Outline */
- /* FT_Outline_New */
- /* FT_Outline_Done */
- /* FT_Outline_Copy */
- /* FT_Outline_Translate */
- /* FT_Outline_Transform */
- /* FT_Outline_Embolden */
- /* FT_Outline_EmboldenXY */
- /* FT_Outline_Reverse */
- /* FT_Outline_Check */
- /* FT_Outline_Get_CBox */
- /* FT_Outline_Get_Bitmap */
- /* FT_Outline_Render */
- /* FT_Outline_Decompose */
- /* FT_Outline_Funcs */
- /* FT_Outline_MoveToFunc */
- /* FT_Outline_LineToFunc */
- /* FT_Outline_ConicToFunc */
- /* FT_Outline_CubicToFunc */
- /* FT_Orientation */
- /* FT_Outline_Get_Orientation */
- /* FT_OUTLINE_XXX */
- /* Walk over an outline's structure to decompose it into individual */
- /* segments and Bezier arcs. This function also emits `move to' */
- /* operations to indicate the start of new contours in the outline. */
- /* outline :: A pointer to the source target. */
- /* func_interface :: A table of `emitters', i.e., function pointers */
- /* called during decomposition to indicate path */
- /* operations. */
- /* user :: A typeless pointer that is passed to each */
- /* emitter during the decomposition. It can be */
- /* used to store the state during the */
- /* decomposition. */
- /* A contour that contains a single point only is represented by a */
- /* `move to' operation followed by `line to' to the same point. In */
- /* most cases, it is best to filter this out before using the */
- /* outline for stroking purposes (otherwise it would result in a */
- /* visible dot when round caps are used). */
- /* Similarly, the function returns success for an empty outline also */
- /* (doing nothing, this is, not calling any emitter); if necessary, */
- /* you should filter this out, too. */
+ * Outline Processing
+ * Functions to create, transform, and render vectorial glyph images.
+ * This section contains routines used to create and destroy scalable
+ * glyph images known as 'outlines'. These can also be measured,
+ * transformed, and converted into bitmaps and pixmaps.
+ * FT_Outline
+ * FT_Outline_New
+ * FT_Outline_Done
+ * FT_Outline_Copy
+ * FT_Outline_Translate
+ * FT_Outline_Transform
+ * FT_Outline_Embolden
+ * FT_Outline_EmboldenXY
+ * FT_Outline_Reverse
+ * FT_Outline_Check
+ * FT_Outline_Get_CBox
+ * FT_Outline_Get_Bitmap
+ * FT_Outline_Render
+ * FT_Outline_Decompose
+ * FT_Outline_Funcs
+ * FT_Outline_MoveToFunc
+ * FT_Outline_LineToFunc
+ * FT_Outline_ConicToFunc
+ * FT_Outline_CubicToFunc
+ * FT_Orientation
+ * FT_Outline_Get_Orientation
+ * FT_OUTLINE_XXX
+ * Walk over an outline's structure to decompose it into individual
+ * segments and Bezier arcs. This function also emits 'move to'
+ * operations to indicate the start of new contours in the outline.
+ * A pointer to the source target.
+ * func_interface ::
+ * A table of 'emitters', i.e., function pointers called during
+ * decomposition to indicate path operations.
+ * A typeless pointer that is passed to each emitter during the
+ * decomposition. It can be used to store the state during the
+ * decomposition.
+ * A contour that contains a single point only is represented by a 'move
+ * to' operation followed by 'line to' to the same point. In most cases,
+ * it is best to filter this out before using the outline for stroking
+ * purposes (otherwise it would result in a visible dot when round caps
+ * are used).
+ * Similarly, the function returns success for an empty outline also
+ * (doing nothing, this is, not calling any emitter); if necessary, you
+ * should filter this out, too.
FT_Outline_Decompose( FT_Outline* outline,
const FT_Outline_Funcs* func_interface,
- /* Create a new outline of a given size. */
- /* library :: A handle to the library object from where the */
- /* outline is allocated. Note however that the new */
- /* outline will *not* necessarily be *freed*, when */
- /* destroying the library, by @FT_Done_FreeType. */
- /* numPoints :: The maximum number of points within the outline. */
- /* Must be smaller than or equal to 0xFFFF (65535). */
- /* numContours :: The maximum number of contours within the outline. */
- /* This value must be in the range 0 to `numPoints'. */
- /* anoutline :: A handle to the new outline. */
- /* The reason why this function takes a `library' parameter is simply */
- /* to use the library's memory allocator. */
+ * Create a new outline of a given size.
+ * A handle to the library object from where the outline is allocated.
+ * Note however that the new outline will **not** necessarily be
+ * **freed**, when destroying the library, by @FT_Done_FreeType.
+ * numPoints ::
+ * The maximum number of points within the outline. Must be smaller
+ * than or equal to 0xFFFF (65535).
+ * numContours ::
+ * The maximum number of contours within the outline. This value must
+ * be in the range 0 to `numPoints`.
+ * anoutline ::
+ * A handle to the new outline.
+ * The reason why this function takes a `library` parameter is simply to
+ * use the library's memory allocator.
FT_Outline_New( FT_Library library,
FT_UInt numPoints,
@@ -162,372 +166,378 @@ FT_BEGIN_HEADER
FT_Outline *anoutline );
- FT_EXPORT( FT_Error )
- FT_Outline_New_Internal( FT_Memory memory,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline *anoutline );
- /* Destroy an outline created with @FT_Outline_New. */
- /* library :: A handle of the library object used to allocate the */
- /* outline. */
- /* outline :: A pointer to the outline object to be discarded. */
- /* If the outline's `owner' field is not set, only the outline */
- /* descriptor will be released. */
+ * Destroy an outline created with @FT_Outline_New.
+ * A handle of the library object used to allocate the outline.
+ * A pointer to the outline object to be discarded.
+ * If the outline's 'owner' field is not set, only the outline descriptor
+ * will be released.
FT_Outline_Done( FT_Library library,
FT_Outline* outline );
- FT_Outline_Done_Internal( FT_Memory memory,
- FT_Outline* outline );
- /* Check the contents of an outline descriptor. */
- /* outline :: A handle to a source outline. */
- /* An empty outline, or an outline with a single point only is also */
- /* valid. */
+ * Check the contents of an outline descriptor.
+ * A handle to a source outline.
+ * An empty outline, or an outline with a single point only is also
+ * valid.
FT_Outline_Check( FT_Outline* outline );
- /* Return an outline's `control box'. The control box encloses all */
- /* the outline's points, including Bezier control points. Though it */
- /* coincides with the exact bounding box for most glyphs, it can be */
- /* slightly larger in some situations (like when rotating an outline */
- /* that contains Bezier outside arcs). */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component, which is dedicated to this single task. */
- /* outline :: A pointer to the source outline descriptor. */
- /* acbox :: The outline's control box. */
- /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
+ * Return an outline's 'control box'. The control box encloses all the
+ * outline's points, including Bezier control points. Though it
+ * coincides with the exact bounding box for most glyphs, it can be
+ * slightly larger in some situations (like when rotating an outline that
+ * contains Bezier outside arcs).
+ * Computing the control box is very fast, while getting the bounding box
+ * can take much more time as it needs to walk over all segments and arcs
+ * in the outline. To get the latter, you can use the 'ftbbox'
+ * component, which is dedicated to this single task.
+ * A pointer to the source outline descriptor.
+ * acbox ::
+ * The outline's control box.
+ * See @FT_Glyph_Get_CBox for a discussion of tricky fonts.
FT_Outline_Get_CBox( const FT_Outline* outline,
FT_BBox *acbox );
- /* Apply a simple translation to the points of an outline. */
- /* outline :: A pointer to the target outline descriptor. */
- /* xOffset :: The horizontal offset. */
- /* yOffset :: The vertical offset. */
+ * Apply a simple translation to the points of an outline.
+ * A pointer to the target outline descriptor.
+ * xOffset ::
+ * The horizontal offset.
+ * yOffset ::
+ * The vertical offset.
FT_Outline_Translate( const FT_Outline* outline,
FT_Pos xOffset,
FT_Pos yOffset );
- /* Copy an outline into another one. Both objects must have the */
- /* same sizes (number of points & number of contours) when this */
- /* function is called. */
- /* source :: A handle to the source outline. */
- /* target :: A handle to the target outline. */
+ * Copy an outline into another one. Both objects must have the same
+ * sizes (number of points & number of contours) when this function is
+ * called.
+ * A handle to the source outline.
+ * A handle to the target outline.
FT_Outline_Copy( const FT_Outline* source,
FT_Outline *target );
- /* Apply a simple 2x2 matrix to all of an outline's points. Useful */
- /* for applying rotations, slanting, flipping, etc. */
- /* matrix :: A pointer to the transformation matrix. */
- /* You can use @FT_Outline_Translate if you need to translate the */
- /* outline's points. */
+ * Apply a simple 2x2 matrix to all of an outline's points. Useful for
+ * applying rotations, slanting, flipping, etc.
+ * matrix ::
+ * A pointer to the transformation matrix.
+ * You can use @FT_Outline_Translate if you need to translate the
+ * outline's points.
FT_Outline_Transform( const FT_Outline* outline,
const FT_Matrix* matrix );
- /* Embolden an outline. The new outline will be at most 4~times */
- /* `strength' pixels wider and higher. You may think of the left and */
- /* bottom borders as unchanged. */
- /* Negative `strength' values to reduce the outline thickness are */
- /* possible also. */
- /* outline :: A handle to the target outline. */
- /* strength :: How strong the glyph is emboldened. Expressed in */
- /* 26.6 pixel format. */
- /* The used algorithm to increase or decrease the thickness of the */
- /* glyph doesn't change the number of points; this means that certain */
- /* situations like acute angles or intersections are sometimes */
- /* handled incorrectly. */
- /* If you need `better' metrics values you should call */
- /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */
- /* Example call: */
- /* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
- /* if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) */
- /* FT_Outline_Embolden( &face->glyph->outline, strength ); */
- /* To get meaningful results, font scaling values must be set with */
- /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
+ * Embolden an outline. The new outline will be at most 4~times
+ * `strength` pixels wider and higher. You may think of the left and
+ * bottom borders as unchanged.
+ * Negative `strength` values to reduce the outline thickness are
+ * possible also.
+ * strength ::
+ * How strong the glyph is emboldened. Expressed in 26.6 pixel format.
+ * The used algorithm to increase or decrease the thickness of the glyph
+ * doesn't change the number of points; this means that certain
+ * situations like acute angles or intersections are sometimes handled
+ * incorrectly.
+ * If you need 'better' metrics values you should call
+ * @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.
+ * To get meaningful results, font scaling values must be set with
+ * functions like @FT_Set_Char_Size before calling FT_Render_Glyph.
+ * FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );
+ * if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE )
+ * FT_Outline_Embolden( &face->glyph->outline, strength );
FT_Outline_Embolden( FT_Outline* outline,
FT_Pos strength );
- /* Embolden an outline. The new outline will be `xstrength' pixels */
- /* wider and `ystrength' pixels higher. Otherwise, it is similar to */
- /* @FT_Outline_Embolden, which uses the same strength in both */
- /* directions. */
- /* 2.4.10 */
+ * Embolden an outline. The new outline will be `xstrength` pixels wider
+ * and `ystrength` pixels higher. Otherwise, it is similar to
+ * @FT_Outline_Embolden, which uses the same strength in both directions.
+ * 2.4.10
FT_Outline_EmboldenXY( FT_Outline* outline,
FT_Pos xstrength,
FT_Pos ystrength );
- /* Reverse the drawing direction of an outline. This is used to */
- /* ensure consistent fill conventions for mirrored glyphs. */
- /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
- /* the outline's `flags' field. */
- /* It shouldn't be used by a normal client application, unless it */
- /* knows what it is doing. */
+ * Reverse the drawing direction of an outline. This is used to ensure
+ * consistent fill conventions for mirrored glyphs.
+ * This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in the
+ * outline's `flags` field.
+ * It shouldn't be used by a normal client application, unless it knows
+ * what it is doing.
FT_Outline_Reverse( FT_Outline* outline );
- /* Render an outline within a bitmap. The outline's image is simply */
- /* OR-ed to the target bitmap. */
- /* library :: A handle to a FreeType library object. */
- /* abitmap :: A pointer to the target bitmap descriptor. */
- /* This function does NOT CREATE the bitmap, it only renders an */
- /* outline image within the one you pass to it! Consequently, the */
- /* various fields in `abitmap' should be set accordingly. */
- /* It will use the raster corresponding to the default glyph format. */
- /* The value of the `num_grays' field in `abitmap' is ignored. If */
- /* you select the gray-level rasterizer, and you want less than 256 */
- /* gray levels, you have to use @FT_Outline_Render directly. */
+ * Render an outline within a bitmap. The outline's image is simply
+ * OR-ed to the target bitmap.
+ * A handle to a FreeType library object.
+ * A pointer to the target bitmap descriptor.
+ * This function does **not create** the bitmap, it only renders an
+ * outline image within the one you pass to it! Consequently, the
+ * various fields in `abitmap` should be set accordingly.
+ * It will use the raster corresponding to the default glyph format.
+ * The value of the `num_grays` field in `abitmap` is ignored. If you
+ * select the gray-level rasterizer, and you want less than 256 gray
+ * levels, you have to use @FT_Outline_Render directly.
FT_Outline_Get_Bitmap( FT_Library library,
FT_Outline* outline,
const FT_Bitmap *abitmap );
- /* Render an outline within a bitmap using the current scan-convert. */
- /* This function uses an @FT_Raster_Params structure as an argument, */
- /* allowing advanced features like direct composition, translucency, */
- /* etc. */
- /* params :: A pointer to an @FT_Raster_Params structure used to */
- /* describe the rendering operation. */
- /* You should know what you are doing and how @FT_Raster_Params works */
- /* to use this function. */
- /* The field `params.source' will be set to `outline' before the scan */
- /* converter is called, which means that the value you give to it is */
- /* actually ignored. */
- /* The gray-level rasterizer always uses 256 gray levels. If you */
- /* want less gray levels, you have to provide your own span callback. */
- /* See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the */
- /* @FT_Raster_Params structure for more details. */
+ * Render an outline within a bitmap using the current scan-convert.
+ * This function uses an @FT_Raster_Params structure as an argument,
+ * allowing advanced features like direct composition, translucency, etc.
+ * params ::
+ * A pointer to an @FT_Raster_Params structure used to describe the
+ * rendering operation.
+ * You should know what you are doing and how @FT_Raster_Params works to
+ * use this function.
+ * The field `params.source` will be set to `outline` before the scan
+ * converter is called, which means that the value you give to it is
+ * actually ignored.
+ * The gray-level rasterizer always uses 256 gray levels. If you want
+ * less gray levels, you have to provide your own span callback. See the
+ * @FT_RASTER_FLAG_DIRECT value of the `flags` field in the
+ * @FT_Raster_Params structure for more details.
FT_Outline_Render( FT_Library library,
FT_Raster_Params* params );
- /**************************************************************************
- * FT_Orientation
- * A list of values used to describe an outline's contour orientation.
- * The TrueType and PostScript specifications use different conventions
- * to determine whether outline contours should be filled or unfilled.
- * FT_ORIENTATION_TRUETYPE ::
- * According to the TrueType specification, clockwise contours must
- * be filled, and counter-clockwise ones must be unfilled.
- * FT_ORIENTATION_POSTSCRIPT ::
- * According to the PostScript specification, counter-clockwise contours
- * must be filled, and clockwise ones must be unfilled.
- * FT_ORIENTATION_FILL_RIGHT ::
- * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
- * remember that in TrueType, everything that is to the right of
- * the drawing direction of a contour must be filled.
- * FT_ORIENTATION_FILL_LEFT ::
- * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
- * remember that in PostScript, everything that is to the left of
- * FT_ORIENTATION_NONE ::
- * The orientation cannot be determined. That is, different parts of
- * the glyph have different orientation.
+ * A list of values used to describe an outline's contour orientation.
+ * The TrueType and PostScript specifications use different conventions
+ * to determine whether outline contours should be filled or unfilled.
+ * FT_ORIENTATION_TRUETYPE ::
+ * According to the TrueType specification, clockwise contours must be
+ * filled, and counter-clockwise ones must be unfilled.
+ * FT_ORIENTATION_POSTSCRIPT ::
+ * According to the PostScript specification, counter-clockwise
+ * contours must be filled, and clockwise ones must be unfilled.
+ * FT_ORIENTATION_FILL_RIGHT ::
+ * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
+ * remember that in TrueType, everything that is to the right of the
+ * drawing direction of a contour must be filled.
+ * FT_ORIENTATION_FILL_LEFT ::
+ * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
+ * remember that in PostScript, everything that is to the left of the
+ * FT_ORIENTATION_NONE ::
+ * The orientation cannot be determined. That is, different parts of
+ * the glyph have different orientation.
typedef enum FT_Orientation_
FT_ORIENTATION_TRUETYPE = 0,
@@ -539,33 +549,34 @@ FT_BEGIN_HEADER
} FT_Orientation;
- * FT_Outline_Get_Orientation
- * This function analyzes a glyph outline and tries to compute its
- * fill orientation (see @FT_Orientation). This is done by integrating
- * the total area covered by the outline. The positive integral
- * corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT
- * is returned. The negative integral corresponds to the counter-clockwise
- * orientation and @FT_ORIENTATION_TRUETYPE is returned.
- * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
- * outlines.
- * outline ::
- * A handle to the source outline.
- * The orientation.
+ * This function analyzes a glyph outline and tries to compute its fill
+ * orientation (see @FT_Orientation). This is done by integrating the
+ * total area covered by the outline. The positive integral corresponds
+ * to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT is
+ * returned. The negative integral corresponds to the counter-clockwise
+ * orientation and @FT_ORIENTATION_TRUETYPE is returned.
+ * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
+ * outlines.
+ * The orientation.
FT_EXPORT( FT_Orientation )
FT_Outline_Get_Orientation( FT_Outline* outline );
-/* ftparams.h */
-/* FreeType API for possible FT_Parameter tags (specification only). */
-/* Copyright 2017-2018 by */
+ * ftparams.h
+ * FreeType API for possible FT_Parameter tags (specification only).
+ * Copyright 2017-2019 by
#ifndef FTPARAMS_H_
@@ -51,16 +51,16 @@ FT_BEGIN_HEADER
- * @constant:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
- * family names in the `name' table (introduced in OpenType version
- * 1.4). Use this for backward compatibility with legacy systems that
- * have a four-faces-per-family restriction.
+ * family names in the `name` table (introduced in OpenType version 1.4).
+ * Use this for backward compatibility with legacy systems that have a
+ * four-faces-per-family restriction.
* 2.8
@@ -75,14 +75,14 @@ FT_BEGIN_HEADER
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
- * subfamily names in the `name' table (introduced in OpenType version
+ * subfamily names in the `name` table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
@@ -99,9 +99,9 @@ FT_BEGIN_HEADER
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
* FT_PARAM_TAG_INCREMENTAL
@@ -115,14 +115,14 @@ FT_BEGIN_HEADER
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding argument specifies the five LCD filter weights for a
- * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding
- * the global default values or the values set up with
+ * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding the
+ * global default values or the values set up with
* @FT_Library_SetLcdFilterWeights.
@@ -135,14 +135,13 @@ FT_BEGIN_HEADER
* FT_PARAM_TAG_RANDOM_SEED
* corresponding 32bit signed integer argument overrides the font
- * driver's random seed value with a face-specific one; see
- * @random-seed.
+ * driver's random seed value with a face-specific one; see @random-seed.
@@ -154,7 +153,7 @@ FT_BEGIN_HEADER
* FT_PARAM_TAG_STEM_DARKENING
@@ -163,10 +162,10 @@ FT_BEGIN_HEADER
* darkening, overriding the global default values or the values set up
* with @FT_Property_Set (see @no-stem-darkening).
- * This is a passive setting that only takes effect if the font driver
- * or autohinter honors it, which the CFF, Type~1, and CID drivers
- * always do, but the autohinter only in `light' hinting mode (as of
- * version 2.9).
+ * This is a passive setting that only takes effect if the font driver or
+ * autohinter honors it, which the CFF, Type~1, and CID drivers always
+ * do, but the autohinter only in 'light' hinting mode (as of version
+ * 2.9).
@@ -176,19 +175,19 @@ FT_BEGIN_HEADER
FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
- * FT_PARAM_TAG_UNPATENTED_HINTING
- * Deprecated, no effect.
- * Previously: A constant used as the tag of an @FT_Parameter structure to
- * indicate that unpatented methods only should be used by the TrueType
- * bytecode interpreter for a typeface opened by @FT_Open_Face.
+ * FT_PARAM_TAG_UNPATENTED_HINTING
+ * Deprecated, no effect.
+ * Previously: A constant used as the tag of an @FT_Parameter structure
+ * to indicate that unpatented methods only should be used by the
+ * TrueType bytecode interpreter for a typeface opened by @FT_Open_Face.
#define FT_PARAM_TAG_UNPATENTED_HINTING \
FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
-/* ftpfr.h */
-/* FreeType API for accessing PFR-specific data (specification only). */
+ * ftpfr.h
+ * FreeType API for accessing PFR-specific data (specification only).
#ifndef FTPFR_H_
@@ -32,60 +32,61 @@
- /* pfr_fonts */
- /* PFR Fonts */
- /* PFR/TrueDoc specific API. */
- /* This section contains the declaration of PFR-specific functions. */
- * FT_Get_PFR_Metrics
- * Return the outline and metrics resolutions of a given PFR face.
- * face :: Handle to the input face. It can be a non-PFR face.
- * aoutline_resolution ::
- * Outline resolution. This is equivalent to `face->units_per_EM'
- * for non-PFR fonts. Optional (parameter can be NULL).
- * ametrics_resolution ::
- * Metrics resolution. This is equivalent to `outline_resolution'
- * ametrics_x_scale ::
- * A 16.16 fixed-point number used to scale distance expressed
- * in metrics units to device sub-pixels. This is equivalent to
- * `face->size->x_scale', but for metrics only. Optional (parameter
- * can be NULL).
- * ametrics_y_scale ::
- * Same as `ametrics_x_scale' but for the vertical direction.
- * optional (parameter can be NULL).
- * If the input face is not a PFR, this function will return an error.
- * However, in all cases, it will return valid values.
+ * PFR Fonts
+ * PFR/TrueDoc-specific API.
+ * This section contains the declaration of PFR-specific functions.
+ * FT_Get_PFR_Metrics
+ * Return the outline and metrics resolutions of a given PFR face.
+ * Handle to the input face. It can be a non-PFR face.
+ * aoutline_resolution ::
+ * Outline resolution. This is equivalent to `face->units_per_EM` for
+ * non-PFR fonts. Optional (parameter can be NULL).
+ * ametrics_resolution ::
+ * Metrics resolution. This is equivalent to `outline_resolution` for
+ * ametrics_x_scale ::
+ * A 16.16 fixed-point number used to scale distance expressed in
+ * metrics units to device subpixels. This is equivalent to
+ * `face->size->x_scale`, but for metrics only. Optional (parameter
+ * can be NULL).
+ * ametrics_y_scale ::
+ * Same as `ametrics_x_scale` but for the vertical direction.
+ * optional (parameter can be NULL).
+ * If the input face is not a PFR, this function will return an error.
+ * However, in all cases, it will return valid values.
FT_Get_PFR_Metrics( FT_Face face,
FT_UInt *aoutline_resolution,
@@ -94,37 +95,41 @@ FT_BEGIN_HEADER
FT_Fixed *ametrics_y_scale );
- * FT_Get_PFR_Kerning
- * Return the kerning pair corresponding to two glyphs in a PFR face.
- * The distance is expressed in metrics units, unlike the result of
- * @FT_Get_Kerning.
- * left :: Index of the left glyph.
- * right :: Index of the right glyph.
- * avector :: A kerning vector.
- * This function always return distances in original PFR metrics
- * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
- * mode, which always returns distances converted to outline units.
- * You can use the value of the `x_scale' and `y_scale' parameters
- * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
+ * FT_Get_PFR_Kerning
+ * Return the kerning pair corresponding to two glyphs in a PFR face.
+ * The distance is expressed in metrics units, unlike the result of
+ * @FT_Get_Kerning.
+ * left ::
+ * Index of the left glyph.
+ * right ::
+ * Index of the right glyph.
+ * avector ::
+ * A kerning vector.
+ * This function always return distances in original PFR metrics units.
+ * This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED mode,
+ * which always returns distances converted to outline units.
+ * You can use the value of the `x_scale` and `y_scale` parameters
+ * returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
FT_Get_PFR_Kerning( FT_Face face,
FT_UInt left,
@@ -132,30 +137,33 @@ FT_BEGIN_HEADER
FT_Vector *avector );
- * FT_Get_PFR_Advance
- * Return a given glyph advance, expressed in original metrics units,
- * from a PFR font.
- * gindex :: The glyph index.
- * aadvance :: The glyph advance in metrics units.
- * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
- * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
+ * FT_Get_PFR_Advance
+ * Return a given glyph advance, expressed in original metrics units,
+ * from a PFR font.
+ * aadvance ::
+ * The glyph advance in metrics units.
+ * You can use the `x_scale` or `y_scale` results of @FT_Get_PFR_Metrics
+ * to convert the advance to device subpixels (i.e., 1/64th of pixels).
FT_Get_PFR_Advance( FT_Face face,
-/* ftrender.h */
-/* FreeType renderer modules public interface (specification). */
+ * ftrender.h
+ * FreeType renderer modules public interface (specification).
#ifndef FTRENDER_H_
@@ -28,12 +28,12 @@
- /* module_management */
/* create a new glyph object */
@@ -116,32 +116,38 @@ FT_BEGIN_HEADER
#define FTRenderer_setMode FT_Renderer_SetModeFunc
- /* FT_Renderer_Class */
- /* The renderer module class descriptor. */
- /* root :: The root @FT_Module_Class fields. */
- /* glyph_format :: The glyph image format this renderer handles. */
- /* render_glyph :: A method used to render the image that is in a */
- /* given glyph slot into a bitmap. */
- /* transform_glyph :: A method used to transform the image that is in */
- /* a given glyph slot. */
- /* get_glyph_cbox :: A method used to access the glyph's cbox. */
- /* set_mode :: A method used to pass additional parameters. */
- /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
- /* This is a pointer to its raster's class. */
+ * FT_Renderer_Class
+ * The renderer module class descriptor.
+ * root ::
+ * The root @FT_Module_Class fields.
+ * glyph_format ::
+ * The glyph image format this renderer handles.
+ * render_glyph ::
+ * A method used to render the image that is in a given glyph slot into
+ * a bitmap.
+ * transform_glyph ::
+ * A method used to transform the image that is in a given glyph slot.
+ * get_glyph_cbox ::
+ * A method used to access the glyph's cbox.
+ * set_mode ::
+ * A method used to pass additional parameters.
+ * raster_class ::
+ * For @FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to
+ * its raster's class.
typedef struct FT_Renderer_Class_
FT_Module_Class root;
@@ -158,64 +164,70 @@ FT_BEGIN_HEADER
} FT_Renderer_Class;
- /* FT_Get_Renderer */
- /* Retrieve the current renderer for a given glyph format. */
- /* library :: A handle to the library object. */
- /* format :: The glyph format. */
- /* A renderer handle. 0~if none found. */
- /* An error will be returned if a module already exists by that name, */
- /* or if the module requires a version of FreeType that is too great. */
- /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
- /* renderer by its name, use @FT_Get_Module. */
+ * FT_Get_Renderer
+ * Retrieve the current renderer for a given glyph format.
+ * A handle to the library object.
+ * format ::
+ * The glyph format.
+ * A renderer handle. 0~if none found.
+ * An error will be returned if a module already exists by that name, or
+ * if the module requires a version of FreeType that is too great.
+ * To add a new renderer, simply use @FT_Add_Module. To retrieve a
+ * renderer by its name, use @FT_Get_Module.
FT_EXPORT( FT_Renderer )
FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format );
- /* FT_Set_Renderer */
- /* Set the current renderer to use, and set additional mode. */
- /* renderer :: A handle to the renderer object. */
- /* num_params :: The number of additional parameters. */
- /* parameters :: Additional parameters. */
- /* In case of success, the renderer will be used to convert glyph */
- /* images in the renderer's known format into bitmaps. */
- /* This doesn't change the current renderer for other formats. */
- /* Currently, no FreeType renderer module uses `parameters'; you */
- /* should thus always pass NULL as the value. */
+ * FT_Set_Renderer
+ * Set the current renderer to use, and set additional mode.
+ * renderer ::
+ * A handle to the renderer object.
+ * num_params ::
+ * The number of additional parameters.
+ * parameters ::
+ * Additional parameters.
+ * In case of success, the renderer will be used to convert glyph images
+ * in the renderer's known format into bitmaps.
+ * This doesn't change the current renderer for other formats.
+ * Currently, no FreeType renderer module uses `parameters`; you should
+ * thus always pass NULL as the value.
FT_Set_Renderer( FT_Library library,
FT_Renderer renderer,
-/* ftsizes.h */
-/* FreeType size objects management (specification). */
- /* Typical application would normally not need to use these functions. */
- /* However, they have been placed in a public API for the rare cases */
- /* where they are needed. */
+ * ftsizes.h
+ * FreeType size objects management (specification).
+ * Typical application would normally not need to use these functions.
+ * However, they have been placed in a public API for the rare cases where
+ * they are needed.
#ifndef FTSIZES_H_
@@ -42,109 +42,110 @@
- /* sizes_management */
- /* Size Management */
- /* Managing multiple sizes per face. */
- /* When creating a new face object (e.g., with @FT_New_Face), an */
- /* @FT_Size object is automatically created and used to store all */
- /* pixel-size dependent information, available in the `face->size' */
- /* field. */
- /* It is however possible to create more sizes for a given face, */
- /* mostly in order to manage several character pixel sizes of the */
- /* same font family and style. See @FT_New_Size and @FT_Done_Size. */
- /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
- /* modify the contents of the current `active' size; you thus need */
- /* to use @FT_Activate_Size to change it. */
- /* 99% of applications won't need the functions provided here, */
- /* especially if they use the caching sub-system, so be cautious */
- /* when using these. */
- /* FT_New_Size */
- /* Create a new size object from a given face object. */
- /* face :: A handle to a parent face object. */
- /* asize :: A handle to a new size object. */
- /* You need to call @FT_Activate_Size in order to select the new size */
- /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
- /* @FT_Load_Glyph, @FT_Load_Char, etc. */
+ * Size Management
+ * Managing multiple sizes per face.
+ * When creating a new face object (e.g., with @FT_New_Face), an @FT_Size
+ * object is automatically created and used to store all pixel-size
+ * dependent information, available in the `face->size` field.
+ * It is however possible to create more sizes for a given face, mostly
+ * in order to manage several character pixel sizes of the same font
+ * family and style. See @FT_New_Size and @FT_Done_Size.
+ * Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only modify the
+ * contents of the current 'active' size; you thus need to use
+ * @FT_Activate_Size to change it.
+ * 99% of applications won't need the functions provided here, especially
+ * if they use the caching sub-system, so be cautious when using these.
+ * FT_New_Size
+ * Create a new size object from a given face object.
+ * A handle to a parent face object.
+ * asize ::
+ * A handle to a new size object.
+ * You need to call @FT_Activate_Size in order to select the new size for
+ * upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,
+ * @FT_Load_Glyph, @FT_Load_Char, etc.
FT_New_Size( FT_Face face,
FT_Size* size );
- /* FT_Done_Size */
- /* Discard a given size object. Note that @FT_Done_Face */
- /* automatically discards all size objects allocated with */
- /* @FT_New_Size. */
- /* size :: A handle to a target size object. */
+ * FT_Done_Size
+ * Discard a given size object. Note that @FT_Done_Face automatically
+ * discards all size objects allocated with @FT_New_Size.
+ * size ::
+ * A handle to a target size object.
FT_Done_Size( FT_Size size );
- /* FT_Activate_Size */
- /* Even though it is possible to create several size objects for a */
- /* given face (see @FT_New_Size for details), functions like */
- /* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */
- /* activated last to determine the `current character pixel size'. */
- /* This function can be used to `activate' a previously created size */
- /* object. */
- /* If `face' is the size's parent face object, this function changes */
- /* the value of `face->size' to the input size handle. */
+ * FT_Activate_Size
+ * Even though it is possible to create several size objects for a given
+ * face (see @FT_New_Size for details), functions like @FT_Load_Glyph or
+ * @FT_Load_Char only use the one that has been activated last to
+ * determine the 'current character pixel size'.
+ * This function can be used to 'activate' a previously created size
+ * object.
+ * If `face` is the size's parent face object, this function changes the
+ * value of `face->size` to the input size handle.
FT_Activate_Size( FT_Size size );
@@ -1,22 +1,22 @@
-/* ftsnames.h */
-/* Simple interface to access SFNT `name' tables (which are used */
-/* to hold font names, copyright info, notices, etc.) (specification). */
-/* This is _not_ used to retrieve glyph names! */
+ * ftsnames.h
+ * Simple interface to access SFNT `name` tables (which are used
+ * to hold font names, copyright info, notices, etc.) (specification).
+ * This is _not_ used to retrieve glyph names!
#ifndef FTSNAMES_H_
@@ -37,72 +37,74 @@
- /* sfnt_names */
- /* SFNT Names */
- /* Access the names embedded in TrueType and OpenType files. */
- /* The TrueType and OpenType specifications allow the inclusion of */
- /* a special names table (`name') in font files. This table contains */
- /* textual (and internationalized) information regarding the font, */
- /* like family name, copyright, version, etc. */
- /* The definitions below are used to access them if available. */
- /* Note that this has nothing to do with glyph names! */
- /* FT_SfntName */
- /* A structure used to model an SFNT `name' table entry. */
- /* platform_id :: The platform ID for `string'. */
- /* See @TT_PLATFORM_XXX for possible values. */
- /* encoding_id :: The encoding ID for `string'. */
- /* See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
- /* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX */
- /* for possible values. */
- /* language_id :: The language ID for `string'. */
- /* See @TT_MAC_LANGID_XXX and @TT_MS_LANGID_XXX for */
- /* Registered OpenType values for `language_id' are */
- /* always smaller than 0x8000; values equal or larger */
- /* than 0x8000 usually indicate a language tag string */
- /* (introduced in OpenType version 1.6). Use function */
- /* @FT_Get_Sfnt_LangTag with `language_id' as its */
- /* argument to retrieve the associated language tag. */
- /* name_id :: An identifier for `string'. */
- /* See @TT_NAME_ID_XXX for possible values. */
- /* string :: The `name' string. Note that its format differs */
- /* depending on the (platform,encoding) pair, being */
- /* either a string of bytes (without a terminating */
- /* NULL byte) or containing UTF-16BE entities. */
- /* string_len :: The length of `string' in bytes. */
- /* Please refer to the TrueType or OpenType specification for more */
- /* details. */
+ * SFNT Names
+ * Access the names embedded in TrueType and OpenType files.
+ * The TrueType and OpenType specifications allow the inclusion of a
+ * special names table (`name`) in font files. This table contains
+ * textual (and internationalized) information regarding the font, like
+ * family name, copyright, version, etc.
+ * The definitions below are used to access them if available.
+ * Note that this has nothing to do with glyph names!
+ * FT_SfntName
+ * A structure used to model an SFNT `name` table entry.
+ * platform_id ::
+ * The platform ID for `string`. See @TT_PLATFORM_XXX for possible
+ * values.
+ * encoding_id ::
+ * The encoding ID for `string`. See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,
+ * @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX for possible
+ * language_id ::
+ * The language ID for `string`. See @TT_MAC_LANGID_XXX and
+ * @TT_MS_LANGID_XXX for possible values.
+ * Registered OpenType values for `language_id` are always smaller than
+ * 0x8000; values equal or larger than 0x8000 usually indicate a
+ * language tag string (introduced in OpenType version 1.6). Use
+ * function @FT_Get_Sfnt_LangTag with `language_id` as its argument to
+ * retrieve the associated language tag.
+ * name_id ::
+ * An identifier for `string`. See @TT_NAME_ID_XXX for possible
+ * string ::
+ * The 'name' string. Note that its format differs depending on the
+ * (platform,encoding) pair, being either a string of bytes (without a
+ * terminating NULL byte) or containing UTF-16BE entities.
+ * string_len ::
+ * The length of `string` in bytes.
+ * Please refer to the TrueType or OpenType specification for more
+ * details.
typedef struct FT_SfntName_
FT_UShort platform_id;
@@ -116,83 +118,95 @@ FT_BEGIN_HEADER
} FT_SfntName;
- /* FT_Get_Sfnt_Name_Count */
- /* Retrieve the number of name strings in the SFNT `name' table. */
- /* The number of strings in the `name' table. */
+ * FT_Get_Sfnt_Name_Count
+ * Retrieve the number of name strings in the SFNT `name` table.
+ * The number of strings in the `name` table.
+ * `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
FT_EXPORT( FT_UInt )
FT_Get_Sfnt_Name_Count( FT_Face face );
- /* FT_Get_Sfnt_Name */
- /* Retrieve a string of the SFNT `name' table for a given index. */
- /* idx :: The index of the `name' string. */
- /* aname :: The indexed @FT_SfntName structure. */
- /* The `string' array returned in the `aname' structure is not */
- /* null-terminated. Note that you don't have to deallocate `string' */
- /* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
- /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
- /* `name' table entries, then do a loop until you get the right */
- /* platform, encoding, and name ID. */
- /* `name' table format~1 entries can use language tags also, see */
- /* @FT_Get_Sfnt_LangTag. */
+ * FT_Get_Sfnt_Name
+ * Retrieve a string of the SFNT `name` table for a given index.
+ * idx ::
+ * The index of the 'name' string.
+ * aname ::
+ * The indexed @FT_SfntName structure.
+ * The `string` array returned in the `aname` structure is not
+ * null-terminated. Note that you don't have to deallocate `string` by
+ * yourself; FreeType takes care of it if you call @FT_Done_Face.
+ * Use @FT_Get_Sfnt_Name_Count to get the total number of available
+ * `name` table entries, then do a loop until you get the right platform,
+ * encoding, and name ID.
+ * `name` table format~1 entries can use language tags also, see
+ * @FT_Get_Sfnt_LangTag.
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
FT_SfntName *aname );
- /* FT_SfntLangTag */
- /* A structure to model a language tag entry from an SFNT `name' */
- /* table. */
- /* string :: The language tag string, encoded in UTF-16BE */
- /* (without trailing NULL bytes). */
- /* string_len :: The length of `string' in *bytes*. */
- /* 2.8 */
+ * FT_SfntLangTag
+ * A structure to model a language tag entry from an SFNT `name` table.
+ * The language tag string, encoded in UTF-16BE (without trailing NULL
+ * bytes).
+ * The length of `string` in **bytes**.
+ * 2.8
typedef struct FT_SfntLangTag_
FT_Byte* string; /* this string is *not* null-terminated! */
@@ -201,41 +215,47 @@ FT_BEGIN_HEADER
} FT_SfntLangTag;
- /* FT_Get_Sfnt_LangTag */
- /* Retrieve the language tag associated with a language ID of an SFNT */
- /* `name' table entry. */
- /* langID :: The language ID, as returned by @FT_Get_Sfnt_Name. */
- /* This is always a value larger than 0x8000. */
- /* alangTag :: The language tag associated with the `name' table */
- /* entry's language ID. */
- /* The `string' array returned in the `alangTag' structure is not */
- /* Only `name' table format~1 supports language tags. For format~0 */
- /* tables, this function always returns FT_Err_Invalid_Table. For */
- /* invalid format~1 language ID values, FT_Err_Invalid_Argument is */
- /* returned. */
+ * FT_Get_Sfnt_LangTag
+ * Retrieve the language tag associated with a language ID of an SFNT
+ * `name` table entry.
+ * langID ::
+ * The language ID, as returned by @FT_Get_Sfnt_Name. This is always a
+ * value larger than 0x8000.
+ * alangTag ::
+ * The language tag associated with the `name` table entry's language
+ * ID.
+ * The `string` array returned in the `alangTag` structure is not
+ * Only `name` table format~1 supports language tags. For format~0
+ * tables, this function always returns FT_Err_Invalid_Table. For
+ * invalid format~1 language ID values, FT_Err_Invalid_Argument is
+ * returned.
FT_Get_Sfnt_LangTag( FT_Face face,
FT_UInt langID,
-/* ftstroke.h */
-/* FreeType path stroker (specification). */
+ * ftstroke.h
+ * FreeType path stroker (specification).
#ifndef FTSTROKE_H_
@@ -27,116 +27,113 @@
- * @section:
- * glyph_stroker
- * @title:
- * Glyph Stroker
- * @abstract:
- * Generating bordered and stroked glyphs.
- * This component generates stroked outlines of a given vectorial
- * glyph. It also allows you to retrieve the `outside' and/or the
- * `inside' borders of the stroke.
- * This can be useful to generate `bordered' glyph, i.e., glyphs
- * displayed with a coloured (and anti-aliased) border around their
- * shape.
- * @order:
- * FT_Stroker
- * FT_Stroker_LineJoin
- * FT_Stroker_LineCap
- * FT_StrokerBorder
- * FT_Outline_GetInsideBorder
- * FT_Outline_GetOutsideBorder
- * FT_Glyph_Stroke
- * FT_Glyph_StrokeBorder
- * FT_Stroker_New
- * FT_Stroker_Set
- * FT_Stroker_Rewind
- * FT_Stroker_ParseOutline
- * FT_Stroker_Done
- * FT_Stroker_BeginSubPath
- * FT_Stroker_EndSubPath
- * FT_Stroker_LineTo
- * FT_Stroker_ConicTo
- * FT_Stroker_CubicTo
- * FT_Stroker_GetBorderCounts
- * FT_Stroker_ExportBorder
- * FT_Stroker_GetCounts
- * FT_Stroker_Export
- /**************************************************************
- * @type:
- * Opaque handle to a path stroker object.
+ * Glyph Stroker
+ * Generating bordered and stroked glyphs.
+ * This component generates stroked outlines of a given vectorial glyph.
+ * It also allows you to retrieve the 'outside' and/or the 'inside'
+ * borders of the stroke.
+ * This can be useful to generate 'bordered' glyph, i.e., glyphs
+ * displayed with a coloured (and anti-aliased) border around their
+ * shape.
+ * FT_Stroker
+ * FT_Stroker_LineJoin
+ * FT_Stroker_LineCap
+ * FT_StrokerBorder
+ * FT_Outline_GetInsideBorder
+ * FT_Outline_GetOutsideBorder
+ * FT_Glyph_Stroke
+ * FT_Glyph_StrokeBorder
+ * FT_Stroker_New
+ * FT_Stroker_Set
+ * FT_Stroker_Rewind
+ * FT_Stroker_ParseOutline
+ * FT_Stroker_Done
+ * FT_Stroker_BeginSubPath
+ * FT_Stroker_EndSubPath
+ * FT_Stroker_LineTo
+ * FT_Stroker_ConicTo
+ * FT_Stroker_CubicTo
+ * FT_Stroker_GetBorderCounts
+ * FT_Stroker_ExportBorder
+ * FT_Stroker_GetCounts
+ * FT_Stroker_Export
+ * Opaque handle to a path stroker object.
typedef struct FT_StrokerRec_* FT_Stroker;
* FT_Stroker_LineJoin
- * These values determine how two joining lines are rendered
- * in a stroker.
+ * These values determine how two joining lines are rendered in a
+ * stroker.
* @values:
* FT_STROKER_LINEJOIN_ROUND ::
- * Used to render rounded line joins. Circular arcs are used
- * to join two lines smoothly.
+ * Used to render rounded line joins. Circular arcs are used to join
+ * two lines smoothly.
* FT_STROKER_LINEJOIN_BEVEL ::
- * Used to render beveled line joins. The outer corner of
- * the joined lines is filled by enclosing the triangular
- * region of the corner with a straight line between the
- * outer corners of each stroke.
+ * Used to render beveled line joins. The outer corner of the joined
+ * lines is filled by enclosing the triangular region of the corner
+ * with a straight line between the outer corners of each stroke.
* 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.
+ * 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.
* 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.
- * 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 compatibility.
+ * 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.
+ * `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
+ * compatibility.
typedef enum FT_Stroker_LineJoin_
@@ -149,27 +146,25 @@ FT_BEGIN_HEADER
} FT_Stroker_LineJoin;
* FT_Stroker_LineCap
- * These values determine how the end of opened sub-paths are
- * rendered in a stroke.
+ * These values determine how the end of opened sub-paths are rendered in
+ * a stroke.
* FT_STROKER_LINECAP_BUTT ::
- * The end of lines is rendered as a full stop on the last
- * point itself.
+ * The end of lines is rendered as a full stop on the last point
+ * itself.
* FT_STROKER_LINECAP_ROUND ::
- * The end of lines is rendered as a half-circle around the
- * last point.
+ * The end of lines is rendered as a half-circle around the last point.
* FT_STROKER_LINECAP_SQUARE ::
- * The end of lines is rendered as a square around the
+ * The end of lines is rendered as a square around the last point.
typedef enum FT_Stroker_LineCap_
@@ -180,14 +175,14 @@ FT_BEGIN_HEADER
} FT_Stroker_LineCap;
* FT_StrokerBorder
- * These values are used to select a given stroke border
- * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
+ * These values are used to select a given stroke border in
+ * @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
* FT_STROKER_BORDER_LEFT ::
@@ -197,9 +192,9 @@ FT_BEGIN_HEADER
* Select the right border, relative to the drawing direction.
- * Applications are generally interested in the `inside' and `outside'
+ * Applications are generally interested in the 'inside' and 'outside'
* borders. However, there is no direct mapping between these and the
- * `left' and `right' ones, since this really depends on the glyph's
+ * 'left' and 'right' ones, since this really depends on the glyph's
* drawing orientation, which varies between font formats.
* You can however use @FT_Outline_GetInsideBorder and
@@ -213,14 +208,14 @@ FT_BEGIN_HEADER
} FT_StrokerBorder;
* FT_Outline_GetInsideBorder
- * Retrieve the @FT_StrokerBorder value corresponding to the
- * `inside' borders of a given outline.
+ * Retrieve the @FT_StrokerBorder value corresponding to the 'inside'
+ * borders of a given outline.
* outline ::
@@ -234,14 +229,14 @@ FT_BEGIN_HEADER
FT_Outline_GetInsideBorder( FT_Outline* outline );
* FT_Outline_GetOutsideBorder
- * `outside' borders of a given outline.
+ * Retrieve the @FT_StrokerBorder value corresponding to the 'outside'
@@ -255,7 +250,7 @@ FT_BEGIN_HEADER
FT_Outline_GetOutsideBorder( FT_Outline* outline );
* FT_Stroker_New
@@ -279,7 +274,7 @@ FT_BEGIN_HEADER
FT_Stroker *astroker );
* FT_Stroker_Set
@@ -301,13 +296,12 @@ 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 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 radius is expressed in the same units as the outline
- * coordinates.
+ * The radius is expressed in the same units as the outline coordinates.
* This function calls @FT_Stroker_Rewind automatically.
@@ -319,16 +313,15 @@ FT_BEGIN_HEADER
FT_Fixed miter_limit );
* FT_Stroker_Rewind
- * Reset a stroker object without changing its attributes.
- * You should call this function before beginning a new
- * series of calls to @FT_Stroker_BeginSubPath or
- * @FT_Stroker_EndSubPath.
+ * Reset a stroker object without changing its attributes. You should
+ * call this function before beginning a new series of calls to
+ * @FT_Stroker_BeginSubPath or @FT_Stroker_EndSubPath.
* stroker ::
@@ -338,15 +331,15 @@ FT_BEGIN_HEADER
FT_Stroker_Rewind( FT_Stroker stroker );
* FT_Stroker_ParseOutline
- * A convenience function used to parse a whole outline with
- * the stroker. The resulting outline(s) can be retrieved
- * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
+ * A convenience function used to parse a whole outline with the stroker.
+ * The resulting outline(s) can be retrieved later by functions like
+ * @FT_Stroker_GetCounts and @FT_Stroker_Export.
@@ -356,18 +349,18 @@ FT_BEGIN_HEADER
* The source outline.
* opened ::
- * A boolean. If~1, the outline is treated as an open path instead
- * of a closed one.
+ * A boolean. If~1, the outline is treated as an open path instead of
+ * a closed one.
- * If `opened' is~0 (the default), the outline is treated as a closed
- * path, and the stroker generates two distinct `border' outlines.
+ * If `opened` is~0 (the default), the outline is treated as a closed
+ * path, and the stroker generates two distinct 'border' outlines.
- * If `opened' is~1, the outline is processed as an open path, and the
- * stroker generates a single `stroke' outline.
+ * If `opened` is~1, the outline is processed as an open path, and the
+ * stroker generates a single 'stroke' outline.
@@ -377,7 +370,7 @@ FT_BEGIN_HEADER
FT_Bool opened );
* FT_Stroker_BeginSubPath
@@ -399,8 +392,8 @@ FT_BEGIN_HEADER
- * This function is useful when you need to stroke a path that is
- * not stored as an @FT_Outline object.
+ * This function is useful when you need to stroke a path that is not
+ * stored as an @FT_Outline object.
FT_Stroker_BeginSubPath( FT_Stroker stroker,
@@ -408,7 +401,7 @@ FT_BEGIN_HEADER
FT_Bool open );
* FT_Stroker_EndSubPath
@@ -424,22 +417,22 @@ FT_BEGIN_HEADER
- * You should call this function after @FT_Stroker_BeginSubPath.
- * If the subpath was not `opened', this function `draws' a
- * single line segment to the start position when needed.
+ * You should call this function after @FT_Stroker_BeginSubPath. If the
+ * subpath was not 'opened', this function 'draws' a single line segment
+ * to the start position when needed.
FT_Stroker_EndSubPath( FT_Stroker stroker );
* FT_Stroker_LineTo
- * `Draw' a single line segment in the stroker's current sub-path,
- * from the last position.
+ * 'Draw' a single line segment in the stroker's current sub-path, from
+ * the last position.
@@ -460,13 +453,13 @@ FT_BEGIN_HEADER
FT_Vector* to );
* FT_Stroker_ConicTo
- * `Draw' a single quadratic Bezier in the stroker's current sub-path,
+ * 'Draw' a single quadratic Bezier in the stroker's current sub-path,
* from the last position.
@@ -492,14 +485,14 @@ FT_BEGIN_HEADER
* FT_Stroker_CubicTo
- * `Draw' a single cubic Bezier in the stroker's current sub-path,
+ * 'Draw' a single cubic Bezier in the stroker's current sub-path, from
@@ -528,16 +521,16 @@ FT_BEGIN_HEADER
* FT_Stroker_GetBorderCounts
- * Call this function once you have finished parsing your paths
- * with the stroker. It returns the number of points and
- * contours necessary to export one of the `border' or `stroke'
- * outlines generated by the stroker.
+ * Call this function once you have finished parsing your paths with the
+ * stroker. It returns the number of points and contours necessary to
+ * export one of the 'border' or 'stroke' outlines generated by the
@@ -557,15 +550,15 @@ FT_BEGIN_HEADER
- * When an outline, or a sub-path, is `closed', the stroker generates
- * two independent `border' outlines, named `left' and `right'.
+ * When an outline, or a sub-path, is 'closed', the stroker generates two
+ * independent 'border' outlines, named 'left' and 'right'.
- * When the outline, or a sub-path, is `opened', the stroker merges
- * the `border' outlines with caps. The `left' border receives all
- * points, while the `right' border becomes empty.
+ * When the outline, or a sub-path, is 'opened', the stroker merges the
+ * 'border' outlines with caps. The 'left' border receives all points,
+ * while the 'right' border becomes empty.
- * Use the function @FT_Stroker_GetCounts instead if you want to
- * retrieve the counts associated to both borders.
+ * Use the function @FT_Stroker_GetCounts instead if you want to retrieve
+ * the counts associated to both borders.
FT_Stroker_GetBorderCounts( FT_Stroker stroker,
@@ -574,19 +567,17 @@ FT_BEGIN_HEADER
FT_UInt *anum_contours );
* FT_Stroker_ExportBorder
- * Call this function after @FT_Stroker_GetBorderCounts to
- * export the corresponding border to your own @FT_Outline
- * structure.
+ * Call this function after @FT_Stroker_GetBorderCounts to export the
+ * corresponding border to your own @FT_Outline structure.
- * Note that this function appends the border points and
- * contours to your outline, but does not try to resize its
- * arrays.
+ * Note that this function appends the border points and contours to your
+ * outline, but does not try to resize its arrays.
@@ -599,19 +590,19 @@ FT_BEGIN_HEADER
* The target outline handle.
- * Always call this function after @FT_Stroker_GetBorderCounts to
- * get sure that there is enough room in your @FT_Outline object to
- * receive all new data.
+ * Always call this function after @FT_Stroker_GetBorderCounts to get
+ * sure that there is enough room in your @FT_Outline object to receive
+ * all new data.
- * Use the function @FT_Stroker_Export instead if you want to
- * retrieve all borders at once.
+ * Use the function @FT_Stroker_Export instead if you want to retrieve
+ * all borders at once.
FT_Stroker_ExportBorder( FT_Stroker stroker,
@@ -619,16 +610,15 @@ FT_BEGIN_HEADER
* FT_Stroker_GetCounts
- * contours necessary to export all points/borders from the stroked
- * outline/path.
+ * export all points/borders from the stroked outline/path.
@@ -650,18 +640,17 @@ FT_BEGIN_HEADER
* FT_Stroker_Export
- * export all borders to your own @FT_Outline structure.
+ * Call this function after @FT_Stroker_GetBorderCounts to export all
+ * borders to your own @FT_Outline structure.
@@ -675,7 +664,7 @@ FT_BEGIN_HEADER
* FT_Stroker_Done
@@ -691,7 +680,7 @@ FT_BEGIN_HEADER
FT_Stroker_Done( FT_Stroker stroker );
* FT_Glyph_Stroke
@@ -708,8 +697,7 @@ FT_BEGIN_HEADER
* A stroker handle.
* destroy ::
- * A Boolean. If~1, the source glyph object is destroyed
- * on success.
+ * A Boolean. If~1, the source glyph object is destroyed on success.
@@ -719,8 +707,8 @@ FT_BEGIN_HEADER
* Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You
- * may need to manually adjust horizontal and vertical advance amounts
- * to account for this added size.
+ * may need to manually adjust horizontal and vertical advance amounts to
+ * account for this added size.
FT_Glyph_Stroke( FT_Glyph *pglyph,
@@ -728,14 +716,14 @@ FT_BEGIN_HEADER
FT_Bool destroy );
* FT_Glyph_StrokeBorder
- * Stroke a given outline glyph object with a given stroker, but
- * only return either its inside or outside border.
+ * Stroke a given outline glyph object with a given stroker, but only
+ * return either its inside or outside border.
* @inout:
* pglyph ::
@@ -746,12 +734,11 @@ FT_BEGIN_HEADER
* inside ::
- * A Boolean. If~1, return the inside border, otherwise
- * the outside border.
+ * A Boolean. If~1, return the inside border, otherwise the outside
+ * border.
@@ -761,8 +748,8 @@ FT_BEGIN_HEADER
FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
-/* ftsynth.h */
-/* FreeType synthesizing code for emboldening and slanting */
-/* Copyright 2000-2018 by */
+ * ftsynth.h
+ * FreeType synthesizing code for emboldening and slanting
+ * Copyright 2000-2019 by
/*************************************************************************/
@@ -35,7 +35,7 @@
/* Main reason for not lifting the functions in this module to a */
- /* `standard' API is that the used parameters for emboldening and */
+ /* 'standard' API is that the used parameters for emboldening and */
/* slanting are not configurable. Consider the functions as a */
/* code resource that should be copied into the application and */
/* adapted to the particular needs. */
@@ -57,7 +57,7 @@
- /* Embolden a glyph by a `reasonable' value (which is highly a matter of */
+ /* Embolden a glyph by a 'reasonable' value (which is highly a matter of */
/* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
-/* ftsystem.h */
-/* FreeType low-level system interface definition (specification). */
+ * ftsystem.h
+ * FreeType low-level system interface definition (specification).
#ifndef FTSYSTEM_H_
@@ -26,34 +26,33 @@
- /* system_interface */
- /* System Interface */
- /* How FreeType manages memory and i/o. */
- /* This section contains various definitions related to memory */
- /* management and i/o access. You need to understand this */
- /* information if you want to use a custom memory manager or you own */
- /* i/o streams. */
+ * System Interface
+ * How FreeType manages memory and i/o.
+ * This section contains various definitions related to memory management
+ * and i/o access. You need to understand this information if you want to
+ * use a custom memory manager or you own i/o streams.
- /* M E M O R Y M A N A G E M E N T */
+ * M E M O R Y M A N A G E M E N T
* FT_Memory
@@ -66,13 +65,13 @@ FT_BEGIN_HEADER
typedef struct FT_MemoryRec_* FT_Memory;
* @functype:
* FT_Alloc_Func
- * A function used to allocate `size' bytes from `memory'.
+ * A function used to allocate `size` bytes from `memory`.
* memory ::
@@ -90,7 +89,7 @@ FT_BEGIN_HEADER
long size );
* FT_Free_Func
@@ -111,7 +110,7 @@ FT_BEGIN_HEADER
void* block );
* FT_Realloc_Func
@@ -146,7 +145,7 @@ FT_BEGIN_HEADER
* FT_MemoryRec
@@ -177,14 +176,14 @@ FT_BEGIN_HEADER
};
- /* I / O M A N A G E M E N T */
+ * I / O M A N A G E M E N T
* FT_Stream
@@ -193,21 +192,21 @@ FT_BEGIN_HEADER
* A handle to an input stream.
* @also:
- * See @FT_StreamRec for the publicly accessible fields of a given
- * stream object.
+ * See @FT_StreamRec for the publicly accessible fields of a given stream
typedef struct FT_StreamRec_* FT_Stream;
* FT_StreamDesc
* A union type used to store either a long or a pointer. This is used
- * to store a file descriptor or a `FILE*' in an input stream.
+ * to store a file descriptor or a `FILE*` in an input stream.
typedef union FT_StreamDesc_
@@ -218,7 +217,7 @@ FT_BEGIN_HEADER
} FT_StreamDesc;
* FT_Stream_IoFunc
@@ -243,9 +242,8 @@ FT_BEGIN_HEADER
* The number of bytes effectively read by the stream.
- * This function might be called to perform a seek or skip operation
- * with a `count' of~0. A non-zero return value then indicates an
- * error.
+ * This function might be called to perform a seek or skip operation with
+ * a `count` of~0. A non-zero return value then indicates an error.
typedef unsigned long
@@ -255,7 +253,7 @@ FT_BEGIN_HEADER
unsigned long count );
* FT_Stream_CloseFunc
@@ -265,14 +263,14 @@ FT_BEGIN_HEADER
* stream ::
- * A handle to the target stream.
+ * A handle to the target stream.
(*FT_Stream_CloseFunc)( FT_Stream stream );
* FT_StreamRec
@@ -299,7 +297,7 @@ FT_BEGIN_HEADER
* descriptor ::
* This field is a union that can hold an integer or a pointer. It is
- * used by stream implementations to store file descriptors or `FILE*'
+ * used by stream implementations to store file descriptors or `FILE*`
* pointers.
* pathname ::
@@ -314,13 +312,13 @@ FT_BEGIN_HEADER
* The stream's close function.
- * The memory manager to use to preload frames. This is set
- * internally by FreeType and shouldn't be touched by stream
- * implementations.
+ * The memory manager to use to preload frames. This is set internally
+ * by FreeType and shouldn't be touched by stream implementations.
* cursor ::
* This field is set and used internally by FreeType when parsing
- * frames.
+ * frames. In particular, the `FT_GET_XXX` macros use this instead of
+ * the `pos` field.
* limit ::
-/* fttrigon.h */
-/* FreeType trigonometric functions (specification). */
+ * fttrigon.h
+ * FreeType trigonometric functions (specification).
#ifndef FTTRIGON_H_
@@ -31,15 +31,15 @@
- /* computations */
* FT_Angle
@@ -52,7 +52,7 @@ FT_BEGIN_HEADER
typedef FT_Fixed FT_Angle;
* FT_ANGLE_PI
@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI ( 180L << 16 )
* FT_ANGLE_2PI
@@ -76,7 +76,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
* FT_ANGLE_PI2
@@ -88,7 +88,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
* FT_ANGLE_PI4
@@ -100,7 +100,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
* FT_Sin
@@ -124,7 +124,7 @@ FT_BEGIN_HEADER
FT_Sin( FT_Angle angle );
* FT_Cos
@@ -148,7 +148,7 @@ FT_BEGIN_HEADER
FT_Cos( FT_Angle angle );
* FT_Tan
@@ -168,14 +168,14 @@ FT_BEGIN_HEADER
FT_Tan( FT_Angle angle );
* FT_Atan2
- * Return the arc-tangent corresponding to a given vector (x,y) in
- * the 2d plane.
+ * Return the arc-tangent corresponding to a given vector (x,y) in the 2d
+ * plane.
* x ::
@@ -193,7 +193,7 @@ FT_BEGIN_HEADER
FT_Fixed y );
* FT_Angle_Diff
@@ -210,7 +210,7 @@ FT_BEGIN_HEADER
* Second angle.
- * Constrained value of `value2-value1'.
+ * Constrained value of `angle2-angle1`.
FT_EXPORT( FT_Angle )
@@ -218,15 +218,15 @@ FT_BEGIN_HEADER
FT_Angle angle2 );
* FT_Vector_Unit
* Return the unit vector corresponding to a given angle. After the
- * call, the value of `vec.x' will be `cos(angle)', and the value of
- * `vec.y' will be `sin(angle)'.
+ * call, the value of `vec.x` will be `cos(angle)`, and the value of
+ * `vec.y` will be `sin(angle)`.
* This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly.
@@ -245,7 +245,7 @@ FT_BEGIN_HEADER
FT_Angle angle );
* FT_Vector_Rotate
@@ -267,7 +267,7 @@ FT_BEGIN_HEADER
* FT_Vector_Length
@@ -288,7 +288,7 @@ FT_BEGIN_HEADER
FT_Vector_Length( FT_Vector* vec );
* FT_Vector_Polarize
@@ -314,7 +314,7 @@ FT_BEGIN_HEADER
FT_Angle *angle );
* FT_Vector_From_Polar
-/* fttypes.h */
-/* FreeType simple types definitions (specification only). */
+ * fttypes.h
+ * FreeType simple types definitions (specification only).
#ifndef FTTYPES_H_
@@ -31,326 +31,327 @@
- /* Basic Data Types */
- /* The basic data types defined by the library. */
- /* This section contains the basic data types defined by FreeType~2, */
- /* ranging from simple scalar types to bitmap descriptors. More */
- /* font-specific structures are defined in a different section. */
- /* FT_Byte */
- /* FT_Bytes */
- /* FT_Char */
- /* FT_Int */
- /* FT_UInt */
- /* FT_Short */
- /* FT_UShort */
- /* FT_Long */
- /* FT_ULong */
- /* FT_Bool */
- /* FT_Offset */
- /* FT_PtrDist */
- /* FT_String */
- /* FT_Tag */
- /* FT_Error */
- /* FT_Fixed */
- /* FT_Pointer */
- /* FT_Pos */
- /* FT_Vector */
- /* FT_BBox */
- /* FT_Matrix */
- /* FT_FWord */
- /* FT_UFWord */
- /* FT_F2Dot14 */
- /* FT_UnitVector */
- /* FT_F26Dot6 */
- /* FT_Data */
- /* FT_MAKE_TAG */
- /* FT_Generic */
- /* FT_Generic_Finalizer */
- /* FT_Bitmap */
- /* FT_Pixel_Mode */
- /* FT_Palette_Mode */
- /* FT_Glyph_Format */
- /* FT_IMAGE_TAG */
- /* A typedef of unsigned char, used for simple booleans. As usual, */
- /* values 1 and~0 represent true and false, respectively. */
+ * Basic Data Types
+ * The basic data types defined by the library.
+ * This section contains the basic data types defined by FreeType~2,
+ * ranging from simple scalar types to bitmap descriptors. More
+ * font-specific structures are defined in a different section.
+ * FT_Byte
+ * FT_Bytes
+ * FT_Char
+ * FT_Int
+ * FT_UInt
+ * FT_Short
+ * FT_UShort
+ * FT_Long
+ * FT_ULong
+ * FT_Bool
+ * FT_Offset
+ * FT_PtrDist
+ * FT_String
+ * FT_Tag
+ * FT_Error
+ * FT_Fixed
+ * FT_Pointer
+ * FT_Pos
+ * FT_Vector
+ * FT_BBox
+ * FT_Matrix
+ * FT_FWord
+ * FT_UFWord
+ * FT_F2Dot14
+ * FT_UnitVector
+ * FT_F26Dot6
+ * FT_Data
+ * FT_MAKE_TAG
+ * FT_Generic
+ * FT_Generic_Finalizer
+ * FT_Bitmap
+ * FT_Pixel_Mode
+ * FT_Palette_Mode
+ * FT_Glyph_Format
+ * FT_IMAGE_TAG
+ * A typedef of unsigned char, used for simple booleans. As usual,
+ * values 1 and~0 represent true and false, respectively.
typedef unsigned char FT_Bool;
- /* A signed 16-bit integer used to store a distance in original font */
- /* units. */
+ * A signed 16-bit integer used to store a distance in original font
typedef signed short FT_FWord; /* distance in FUnits */
- /* An unsigned 16-bit integer used to store a distance in original */
- /* font units. */
+ * An unsigned 16-bit integer used to store a distance in original font
typedef unsigned short FT_UFWord; /* unsigned distance */
- /* A simple typedef for the _signed_ char type. */
+ * A simple typedef for the _signed_ char type.
typedef signed char FT_Char;
- /* A simple typedef for the _unsigned_ char type. */
+ * A simple typedef for the _unsigned_ char type.
typedef unsigned char FT_Byte;
- /* A typedef for constant memory areas. */
+ * A typedef for constant memory areas.
typedef const FT_Byte* FT_Bytes;
- /* A typedef for 32-bit tags (as used in the SFNT format). */
+ * A typedef for 32-bit tags (as used in the SFNT format).
typedef FT_UInt32 FT_Tag;
- /* A simple typedef for the char type, usually used for strings. */
+ * A simple typedef for the char type, usually used for strings.
typedef char FT_String;
- /* A typedef for signed short. */
+ * A typedef for signed short.
typedef signed short FT_Short;
- /* A typedef for unsigned short. */
+ * A typedef for unsigned short.
typedef unsigned short FT_UShort;
- /* A typedef for the int type. */
+ * A typedef for the int type.
typedef signed int FT_Int;
- /* A typedef for the unsigned int type. */
+ * A typedef for the unsigned int type.
typedef unsigned int FT_UInt;
- /* A typedef for signed long. */
+ * A typedef for signed long.
typedef signed long FT_Long;
- /* A typedef for unsigned long. */
+ * A typedef for unsigned long.
typedef unsigned long FT_ULong;
- /* A signed 2.14 fixed-point type used for unit vectors. */
+ * A signed 2.14 fixed-point type used for unit vectors.
typedef signed short FT_F2Dot14;
- /* A signed 26.6 fixed-point type used for vectorial pixel */
+ * A signed 26.6 fixed-point type used for vectorial pixel coordinates.
typedef signed long FT_F26Dot6;
- /* This type is used to store 16.16 fixed-point values, like scaling */
- /* values or matrix coefficients. */
+ * This type is used to store 16.16 fixed-point values, like scaling
+ * values or matrix coefficients.
typedef signed long FT_Fixed;
- /* The FreeType error code type. A value of~0 is always interpreted */
- /* as a successful operation. */
+ * The FreeType error code type. A value of~0 is always interpreted as a
+ * successful operation.
typedef int FT_Error;
- /* A simple typedef for a typeless pointer. */
+ * A simple typedef for a typeless pointer.
typedef void* FT_Pointer;
- /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */
- /* _unsigned_ integer type used to express a file size or position, */
- /* or a memory block size. */
+ * This is equivalent to the ANSI~C `size_t` type, i.e., the largest
+ * _unsigned_ integer type used to express a file size or position, or a
+ * memory block size.
typedef size_t FT_Offset;
- /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */
- /* largest _signed_ integer type used to express the distance */
- /* between two pointers. */
+ * This is equivalent to the ANSI~C `ptrdiff_t` type, i.e., the largest
+ * _signed_ integer type used to express the distance between two
+ * pointers.
typedef ft_ptrdiff_t FT_PtrDist;
- /* A simple structure used to store a 2D vector unit vector. Uses */
- /* FT_F2Dot14 types. */
- /* x :: Horizontal coordinate. */
- /* y :: Vertical coordinate. */
+ * A simple structure used to store a 2D vector unit vector. Uses
+ * FT_F2Dot14 types.
+ * x ::
+ * Horizontal coordinate.
+ * y ::
+ * Vertical coordinate.
typedef struct FT_UnitVector_
FT_F2Dot14 x;
@@ -359,29 +360,33 @@ FT_BEGIN_HEADER
} FT_UnitVector;
- /* A simple structure used to store a 2x2 matrix. Coefficients are */
- /* in 16.16 fixed-point format. The computation performed is: */
- /* x' = x*xx + y*xy */
- /* y' = x*yx + y*yy */
- /* xx :: Matrix coefficient. */
- /* xy :: Matrix coefficient. */
- /* yx :: Matrix coefficient. */
- /* yy :: Matrix coefficient. */
+ * A simple structure used to store a 2x2 matrix. Coefficients are in
+ * 16.16 fixed-point format. The computation performed is:
+ * x' = x*xx + y*xy
+ * y' = x*yx + y*yy
+ * xx ::
+ * Matrix coefficient.
+ * xy ::
+ * yx ::
+ * yy ::
typedef struct FT_Matrix_
FT_Fixed xx, xy;
@@ -390,19 +395,21 @@ FT_BEGIN_HEADER
} FT_Matrix;
- /* Read-only binary data represented as a pointer and a length. */
- /* pointer :: The data. */
- /* length :: The length of the data in bytes. */
+ * Read-only binary data represented as a pointer and a length.
+ * pointer ::
+ * The data.
+ * length ::
+ * The length of the data in bytes.
typedef struct FT_Data_
const FT_Byte* pointer;
@@ -411,51 +418,52 @@ FT_BEGIN_HEADER
} FT_Data;
- /* Describe a function used to destroy the `client' data of any */
- /* FreeType object. See the description of the @FT_Generic type for */
- /* details of usage. */
- /* The address of the FreeType object that is under finalization. */
- /* Its client data is accessed through its `generic' field. */
+ * Describe a function used to destroy the 'client' data of any FreeType
+ * object. See the description of the @FT_Generic type for details of
+ * usage.
+ * The address of the FreeType object that is under finalization. Its
+ * client data is accessed through its `generic` field.
typedef void (*FT_Generic_Finalizer)( void* object );
- /* Client applications often need to associate their own data to a */
- /* variety of FreeType core objects. For example, a text layout API */
- /* might want to associate a glyph cache to a given size object. */
- /* Some FreeType object contains a `generic' field, of type */
- /* FT_Generic, which usage is left to client applications and font */
- /* servers. */
- /* It can be used to store a pointer to client-specific data, as well */
- /* as the address of a `finalizer' function, which will be called by */
- /* FreeType when the object is destroyed (for example, the previous */
- /* client example would put the address of the glyph cache destructor */
- /* in the `finalizer' field). */
- /* data :: A typeless pointer to any client-specified data. This */
- /* field is completely ignored by the FreeType library. */
- /* finalizer :: A pointer to a `generic finalizer' function, which */
- /* will be called when the object is destroyed. If this */
- /* field is set to NULL, no code will be called. */
+ * Client applications often need to associate their own data to a
+ * variety of FreeType core objects. For example, a text layout API
+ * might want to associate a glyph cache to a given size object.
+ * Some FreeType object contains a `generic` field, of type `FT_Generic`,
+ * which usage is left to client applications and font servers.
+ * It can be used to store a pointer to client-specific data, as well as
+ * the address of a 'finalizer' function, which will be called by
+ * FreeType when the object is destroyed (for example, the previous
+ * client example would put the address of the glyph cache destructor in
+ * the `finalizer` field).
+ * A typeless pointer to any client-specified data. This field is
+ * completely ignored by the FreeType library.
+ * finalizer ::
+ * A pointer to a 'generic finalizer' function, which will be called
+ * when the object is destroyed. If this field is set to NULL, no code
+ * will be called.
typedef struct FT_Generic_
void* data;
@@ -464,19 +472,19 @@ FT_BEGIN_HEADER
} FT_Generic;
- /* <Macro> */
- /* This macro converts four-letter tags that are used to label */
- /* TrueType tables into an unsigned long, to be used within FreeType. */
- /* The produced values *must* be 32-bit integers. Don't redefine */
- /* this macro. */
+ * This macro converts four-letter tags that are used to label TrueType
+ * tables into an unsigned long, to be used within FreeType.
+ * The produced values **must** be 32-bit integers. Don't redefine this
+ * macro.
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
(FT_Tag) \
( ( (FT_ULong)_x1 << 24 ) | \
@@ -494,53 +502,56 @@ FT_BEGIN_HEADER
- /* Many elements and objects in FreeType are listed through an */
- /* @FT_List record (see @FT_ListRec). As its name suggests, an */
- /* FT_ListNode is a handle to a single list element. */
+ * Many elements and objects in FreeType are listed through an @FT_List
+ * record (see @FT_ListRec). As its name suggests, an FT_ListNode is a
+ * handle to a single list element.
typedef struct FT_ListNodeRec_* FT_ListNode;
- /* A handle to a list record (see @FT_ListRec). */
+ * A handle to a list record (see @FT_ListRec).
typedef struct FT_ListRec_* FT_List;
- /* A structure used to hold a single list element. */
- /* prev :: The previous element in the list. NULL if first. */
- /* next :: The next element in the list. NULL if last. */
- /* data :: A typeless pointer to the listed object. */
+ * A structure used to hold a single list element.
+ * prev ::
+ * The previous element in the list. NULL if first.
+ * next ::
+ * The next element in the list. NULL if last.
+ * A typeless pointer to the listed object.
typedef struct FT_ListNodeRec_
FT_ListNode prev;
@@ -550,20 +561,22 @@ FT_BEGIN_HEADER
} FT_ListNodeRec;
- /* A structure used to hold a simple doubly-linked list. These are */
- /* used in many parts of FreeType. */
- /* head :: The head (first element) of doubly-linked list. */
- /* tail :: The tail (last element) of doubly-linked list. */
+ * A structure used to hold a simple doubly-linked list. These are used
+ * in many parts of FreeType.
+ * head ::
+ * The head (first element) of doubly-linked list.
+ * tail ::
+ * The tail (last element) of doubly-linked list.
typedef struct FT_ListRec_
FT_ListNode head;
@@ -575,13 +588,13 @@ FT_BEGIN_HEADER
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
-#define FT_BOOL( x ) ( (FT_Bool)( x ) )
+#define FT_BOOL( x ) ( (FT_Bool)( (x) != 0 ) )
/* concatenate C tokens */
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
- /* see `ftmoderr.h' for descriptions of the following macros */
+ /* see `ftmoderr.h` for descriptions of the following macros */
#define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
-/* ftwinfnt.h */
-/* FreeType API for accessing Windows fnt-specific data. */
-/* Copyright 2003-2018 by */
+ * ftwinfnt.h
+ * FreeType API for accessing Windows fnt-specific data.
+ * Copyright 2003-2019 by
#ifndef FTWINFNT_H_
@@ -32,44 +32,43 @@
- /* winfnt_fonts */
- /* Window FNT Files */
- /* Windows FNT specific API. */
- /* This section contains the declaration of Windows FNT specific */
+ * Window FNT Files
+ * Windows FNT-specific API.
+ * This section contains the declaration of Windows FNT-specific
* FT_WinFNT_ID_XXX
- * A list of valid values for the `charset' byte in
- * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
- * encodings (except for cp1361) can be found at
- * ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
- * subdirectory. cp1361 is roughly a superset of
- * MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
+ * A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
+ * Exact mapping tables for the various 'cpXXXX' encodings (except for
+ * 'cp1361') can be found at 'ftp://ftp.unicode.org/Public' in the
+ * `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a
+ * superset of `MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT`.
* FT_WinFNT_ID_DEFAULT ::
- * This is used for font enumeration and font creation as a
- * `don't care' value. Valid font files don't contain this value.
- * When querying for information about the character set of the font
- * that is currently selected into a specified device context, this
- * return value (of the related Windows API) simply denotes failure.
+ * This is used for font enumeration and font creation as a 'don't
+ * care' value. Valid font files don't contain this value. When
+ * querying for information about the character set of the font that is
+ * currently selected into a specified device context, this return
+ * value (of the related Windows API) simply denotes failure.
* FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available.
@@ -80,26 +79,27 @@ FT_BEGIN_HEADER
* FT_WinFNT_ID_OEM ::
* From Michael Poettgen <[email protected]>:
- * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
- * is used for the charset of vector fonts, like `modern.fon',
- * `roman.fon', and `script.fon' on Windows.
+ * The 'Windows Font Mapping' article says that `FT_WinFNT_ID_OEM` is
+ * used for the charset of vector fonts, like `modern.fon`,
+ * `roman.fon`, and `script.fon` on Windows.
- * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
- * specifies a character set that is operating-system dependent.
+ * The 'CreateFont' documentation says: The `FT_WinFNT_ID_OEM` value
+ * specifies a character set that is operating-system dependent.
- * The `IFIMETRICS' documentation from the `Windows Driver
- * Development Kit' says: This font supports an OEM-specific
- * character set. The OEM character set is system dependent.
+ * The 'IFIMETRICS' documentation from the 'Windows Driver Development
+ * Kit' says: This font supports an OEM-specific character set. The
+ * OEM character set is system dependent.
- * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
- * second default codepage that most international versions of
- * Windows have. It is one of the OEM codepages from
+ * In general OEM, as opposed to ANSI (i.e., 'cp1252'), denotes the
+ * second default codepage that most international versions of Windows
+ * have. It is one of the OEM codepages from
- * https://msdn.microsoft.com/en-us/goglobal/bb964655,
+ * https://docs.microsoft.com/en-us/windows/desktop/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 and OEM codepage 850.
+ * and is used for the 'DOS boxes', to support legacy applications. A
+ * German Windows version for example usually uses ANSI codepage 1252
+ * and OEM codepage 850.
* FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11.
@@ -112,8 +112,8 @@ FT_BEGIN_HEADER
* ordering and minor deviations).
* FT_WinFNT_ID_CP949 ::
- * A superset of Korean Hangul KS~C 5601-1987 (with different
- * ordering and minor deviations).
+ * A superset of Korean Hangul KS~C 5601-1987 (with different ordering
+ * and minor deviations).
* FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big~5 ETen (with different
@@ -173,14 +173,14 @@ FT_BEGIN_HEADER
#define FT_WinFNT_ID_OEM 255
- /* FT_WinFNT_HeaderRec */
- /* Windows FNT Header info. */
+ * FT_WinFNT_HeaderRec
+ * Windows FNT Header info.
typedef struct FT_WinFNT_HeaderRec_
FT_UShort version;
@@ -223,18 +223,18 @@ FT_BEGIN_HEADER
} FT_WinFNT_HeaderRec;
- /* FT_WinFNT_Header */
- /* A handle to an @FT_WinFNT_HeaderRec structure. */
+ * FT_WinFNT_Header
+ * A handle to an @FT_WinFNT_HeaderRec structure.
typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
* FT_Get_WinFNT_Header
@@ -243,10 +243,12 @@ FT_BEGIN_HEADER
* Retrieve a Windows FNT font info header.
- * aheader :: The WinFNT header.
+ * aheader ::
+ * The WinFNT header.
@@ -1,73 +1,73 @@
-/* autohint.h */
-/* High-level `autohint' module-specific interface (specification). */
- /* The auto-hinter is used to load and automatically hint glyphs if a */
- /* format-specific hinter isn't available. */
+ * autohint.h
+ * High-level 'autohint' module-specific interface (specification).
+ * The auto-hinter is used to load and automatically hint glyphs if a
+ * format-specific hinter isn't available.
#ifndef AUTOHINT_H_
#define AUTOHINT_H_
- /* A small technical note regarding automatic hinting in order to */
- /* clarify this module interface. */
- /* An automatic hinter might compute two kinds of data for a given face: */
- /* - global hints: Usually some metrics that describe global properties */
- /* of the face. It is computed by scanning more or less */
- /* aggressively the glyphs in the face, and thus can be */
- /* very slow to compute (even if the size of global */
- /* hints is really small). */
- /* - glyph hints: These describe some important features of the glyph */
- /* outline, as well as how to align them. They are */
- /* generally much faster to compute than global hints. */
- /* The current FreeType auto-hinter does a pretty good job while */
- /* performing fast computations for both global and glyph hints. */
- /* However, we might be interested in introducing more complex and */
- /* powerful algorithms in the future, like the one described in the John */
- /* D. Hobby paper, which unfortunately requires a lot more horsepower. */
- /* Because a sufficiently sophisticated font management system would */
- /* typically implement an LRU cache of opened face objects to reduce */
- /* memory usage, it is a good idea to be able to avoid recomputing */
- /* global hints every time the same face is re-opened. */
- /* We thus provide the ability to cache global hints outside of the face */
- /* object, in order to speed up font re-opening time. Of course, this */
- /* feature is purely optional, so most client programs won't even notice */
- /* it. */
- /* I initially thought that it would be a good idea to cache the glyph */
- /* hints too. However, my general idea now is that if you really need */
- /* to cache these too, you are simply in need of a new font format, */
- /* where all this information could be stored within the font file and */
- /* decoded on the fly. */
+ * A small technical note regarding automatic hinting in order to clarify
+ * this module interface.
+ * An automatic hinter might compute two kinds of data for a given face:
+ * - global hints: Usually some metrics that describe global properties
+ * of the face. It is computed by scanning more or less
+ * aggressively the glyphs in the face, and thus can be
+ * very slow to compute (even if the size of global hints
+ * is really small).
+ * - glyph hints: These describe some important features of the glyph
+ * outline, as well as how to align them. They are
+ * generally much faster to compute than global hints.
+ * The current FreeType auto-hinter does a pretty good job while performing
+ * fast computations for both global and glyph hints. However, we might be
+ * interested in introducing more complex and powerful algorithms in the
+ * future, like the one described in the John D. Hobby paper, which
+ * unfortunately requires a lot more horsepower.
+ * Because a sufficiently sophisticated font management system would
+ * typically implement an LRU cache of opened face objects to reduce memory
+ * usage, it is a good idea to be able to avoid recomputing global hints
+ * every time the same face is re-opened.
+ * We thus provide the ability to cache global hints outside of the face
+ * object, in order to speed up font re-opening time. Of course, this
+ * feature is purely optional, so most client programs won't even notice
+ * it.
+ * I initially thought that it would be a good idea to cache the glyph
+ * hints too. However, my general idea now is that if you really need to
+ * cache these too, you are simply in need of a new font format, where all
+ * this information could be stored within the font file and decoded on the
+ * fly.
@@ -80,27 +80,31 @@ FT_BEGIN_HEADER
typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
- /* FT_AutoHinter_GlobalGetFunc */
- /* Retrieve the global hints computed for a given face object. The */
- /* resulting data is dissociated from the face and will survive a */
- /* call to FT_Done_Face(). It must be discarded through the API */
- /* FT_AutoHinter_GlobalDoneFunc(). */
- /* hinter :: A handle to the source auto-hinter. */
- /* face :: A handle to the source face object. */
- /* global_hints :: A typeless pointer to the global hints. */
- /* global_len :: The size in bytes of the global hints. */
+ * FT_AutoHinter_GlobalGetFunc
+ * Retrieve the global hints computed for a given face object. The
+ * resulting data is dissociated from the face and will survive a call to
+ * FT_Done_Face(). It must be discarded through the API
+ * FT_AutoHinter_GlobalDoneFunc().
+ * hinter ::
+ * A handle to the source auto-hinter.
+ * A handle to the source face object.
+ * global_hints ::
+ * A typeless pointer to the global hints.
+ * global_len ::
+ * The size in bytes of the global hints.
(*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
FT_Face face,
@@ -108,69 +112,76 @@ FT_BEGIN_HEADER
long* global_len );
- /* FT_AutoHinter_GlobalDoneFunc */
- /* Discard the global hints retrieved through */
- /* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */
- /* are freed from memory. */
- /* hinter :: A handle to the auto-hinter module. */
- /* global :: A pointer to retrieved global hints to discard. */
+ * FT_AutoHinter_GlobalDoneFunc
+ * Discard the global hints retrieved through
+ * FT_AutoHinter_GlobalGetFunc(). This is the only way these hints are
+ * freed from memory.
+ * A handle to the auto-hinter module.
+ * global ::
+ * A pointer to retrieved global hints to discard.
(*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
void* global );
- /* FT_AutoHinter_GlobalResetFunc */
- /* This function is used to recompute the global metrics in a given */
- /* font. This is useful when global font data changes (e.g. Multiple */
- /* Masters fonts where blend coordinates change). */
- /* face :: A handle to the face. */
+ * FT_AutoHinter_GlobalResetFunc
+ * This function is used to recompute the global metrics in a given font.
+ * This is useful when global font data changes (e.g. Multiple Masters
+ * fonts where blend coordinates change).
+ * A handle to the face.
(*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
FT_Face face );
- /* FT_AutoHinter_GlyphLoadFunc */
- /* This function is used to load, scale, and automatically hint a */
- /* glyph from a given face. */
- /* glyph_index :: The glyph index. */
- /* load_flags :: The load flags. */
- /* This function is capable of loading composite glyphs by hinting */
- /* each sub-glyph independently (which improves quality). */
- /* It will call the font driver with @FT_Load_Glyph, with */
- /* @FT_LOAD_NO_SCALE set. */
+ * FT_AutoHinter_GlyphLoadFunc
+ * This function is used to load, scale, and automatically hint a glyph
+ * from a given face.
+ * glyph_index ::
+ * The load flags.
+ * This function is capable of loading composite glyphs by hinting each
+ * sub-glyph independently (which improves quality).
+ * It will call the font driver with @FT_Load_Glyph, with
+ * @FT_LOAD_NO_SCALE set.
(*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
FT_GlyphSlot slot,
@@ -179,14 +190,14 @@ FT_BEGIN_HEADER
FT_Int32 load_flags );
- /* FT_AutoHinter_InterfaceRec */
- /* The auto-hinter module's interface. */
+ * FT_AutoHinter_InterfaceRec
+ * The auto-hinter module's interface.
typedef struct FT_AutoHinter_InterfaceRec_
FT_AutoHinter_GlobalResetFunc reset_face;
@@ -197,8 +208,6 @@ FT_BEGIN_HEADER
} FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
-#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
class_, \
reset_face_, \
@@ -214,27 +223,6 @@ FT_BEGIN_HEADER
load_glyph_ \
-#else /* FT_CONFIG_OPTION_PIC */
-#define FT_DEFINE_AUTOHINTER_INTERFACE( \
- class_, \
- reset_face_, \
- get_global_hints_, \
- done_global_hints_, \
- load_glyph_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- FT_AutoHinter_InterfaceRec* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- clazz->reset_face = reset_face_; \
- clazz->get_global_hints = get_global_hints_; \
- clazz->done_global_hints = done_global_hints_; \
- clazz->load_glyph = load_glyph_; \
- }
-#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER
-/* cffotypes.h */
-/* Basic OpenType/CFF object type definitions (specification). */
+ * cffotypes.h
+ * Basic OpenType/CFF object type definitions (specification).
#ifndef CFFOTYPES_H_
@@ -33,14 +33,14 @@ FT_BEGIN_HEADER
typedef TT_Face CFF_Face;
- /* CFF_Size */
- /* A handle to an OpenType size object. */
+ * CFF_Size
+ * A handle to an OpenType size object.
typedef struct CFF_SizeRec_
FT_SizeRec root;
@@ -49,14 +49,14 @@ FT_BEGIN_HEADER
} CFF_SizeRec, *CFF_Size;
- /* CFF_GlyphSlot */
- /* A handle to an OpenType glyph slot object. */
+ * CFF_GlyphSlot
+ * A handle to an OpenType glyph slot object.
typedef struct CFF_GlyphSlotRec_
FT_GlyphSlotRec root;
@@ -70,14 +70,14 @@ FT_BEGIN_HEADER
} CFF_GlyphSlotRec, *CFF_GlyphSlot;
- /* CFF_Internal */
- /* The interface to the `internal' field of `FT_Size'. */
+ * CFF_Internal
+ * The interface to the 'internal' field of `FT_Size`.
typedef struct CFF_InternalRec_
PSH_Globals topfont;
@@ -86,10 +86,10 @@ FT_BEGIN_HEADER
} CFF_InternalRec, *CFF_Internal;
- /* Subglyph transformation record. */
+ * Subglyph transformation record.
typedef struct CFF_Transform_
FT_Fixed xx, xy; /* transformation matrix coefficients */
-/* cfftypes.h */
-/* Basic OpenType/CFF type definitions and interface (specification */
+ * cfftypes.h
+ * Basic OpenType/CFF type definitions and interface (specification
#ifndef CFFTYPES_H_
@@ -33,34 +33,39 @@
- /* CFF_IndexRec */
- /* A structure used to model a CFF Index table. */
- /* stream :: The source input stream. */
- /* start :: The position of the first index byte in the */
- /* input stream. */
- /* count :: The number of elements in the index. */
- /* off_size :: The size in bytes of object offsets in index. */
- /* data_offset :: The position of first data byte in the index's */
- /* bytes. */
- /* data_size :: The size of the data table in this index. */
- /* offsets :: A table of element offsets in the index. Must be */
- /* loaded explicitly. */
- /* bytes :: If the index is loaded in memory, its bytes. */
+ * CFF_IndexRec
+ * A structure used to model a CFF Index table.
+ * The source input stream.
+ * The position of the first index byte in the input stream.
+ * The number of elements in the index.
+ * off_size ::
+ * The size in bytes of object offsets in index.
+ * data_offset ::
+ * The position of first data byte in the index's bytes.
+ * data_size ::
+ * The size of the data table in this index.
+ * offsets ::
+ * A table of element offsets in the index. Must be loaded explicitly.
+ * bytes ::
+ * If the index is loaded in memory, its bytes.
typedef struct CFF_IndexRec_
FT_Stream stream;
-/* ftcalc.h */
-/* Arithmetic computations (specification). */
+ * ftcalc.h
+ * Arithmetic computations (specification).
#ifndef FTCALC_H_
@@ -27,11 +27,11 @@
- /* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
+ * FT_MulDiv() and FT_MulFix() are declared in freetype.h.
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
/* Provide assembler fragments for performance-critical functions. */
@@ -246,29 +246,32 @@ FT_BEGIN_HEADER
- /* FT_MulDiv_No_Round */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* (without rounding) with maximum accuracy (it uses a 64-bit */
- /* intermediate integer whenever necessary). */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
+ * FT_MulDiv_No_Round
+ * A very simple function used to perform the computation '(a*b)/c'
+ * (without rounding) with maximum accuracy (it uses a 64-bit
+ * intermediate integer whenever necessary).
+ * This function isn't necessarily as fast as some processor-specific
+ * operations, but is at least completely portable.
+ * a ::
+ * The first multiplier.
+ * b ::
+ * The second multiplier.
+ * c ::
+ * The divisor.
+ * The result of '(a*b)/c'. This function never traps when trying to
+ * divide by zero; it simply returns 'MaxInt' or 'MinInt' depending on
+ * the signs of 'a' and 'b'.
FT_BASE( FT_Long )
FT_MulDiv_No_Round( FT_Long a,
FT_Long b,
@@ -276,12 +279,11 @@ FT_BEGIN_HEADER
- * 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 values are as precise as possible to get a correct result during
- * the 64bit multiplication. Let `sa' and `sb' be the scaling factors of
- * `a' and `b', respectively, then the scaling factor of the result is
- * `sa*sb'.
+ * 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
+ * values are as precise as possible to get a correct result during the
+ * 64bit multiplication. Let `sa' and `sb' be the scaling factors of `a'
+ * and `b', respectively, then the scaling factor of the result is `sa*sb'.
FT_BASE( void )
FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
@@ -290,8 +292,23 @@ FT_BEGIN_HEADER
- * A variant of FT_Vector_Transform. See comments for
- * FT_Matrix_Multiply_Scaled.
+ * Check a matrix. If the transformation would lead to extreme shear or
+ * extreme scaling, for example, return 0. If everything is OK, return 1.
+ * Based on geometric considerations we use the following inequality to
+ * identify a degenerate matrix.
+ * 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
+ * Value 50 is heuristic.
+ FT_BASE( FT_Bool )
+ FT_Matrix_Check( const FT_Matrix* matrix );
+ /*
+ * A variant of FT_Vector_Transform. See comments for
+ * FT_Matrix_Multiply_Scaled.
FT_Vector_Transform_Scaled( FT_Vector* vector,
@@ -300,22 +317,22 @@ FT_BEGIN_HEADER
- * This function normalizes a vector and returns its original length.
- * The normalized vector is a 16.16 fixed-point unit vector with length
- * close to 0x10000. The accuracy of the returned length is limited to
- * 16 bits also. The function utilizes quick inverse square root
- * approximation without divisions and square roots relying on Newton's
- * iterations instead.
+ * This function normalizes a vector and returns its original length. The
+ * normalized vector is a 16.16 fixed-point unit vector with length close
+ * to 0x10000. The accuracy of the returned length is limited to 16 bits
+ * also. The function utilizes quick inverse square root approximation
+ * without divisions and square roots relying on Newton's iterations
+ * instead.
FT_BASE( FT_UInt32 )
FT_Vector_NormLen( FT_Vector* vector );
- * Return -1, 0, or +1, depending on the orientation of a given corner.
- * We use the Cartesian coordinate system, with positive vertical values
- * going upwards. The function returns +1 if the corner turns to the
- * left, -1 to the right, and 0 for undecidable cases.
+ * Return -1, 0, or +1, depending on the orientation of a given corner. We
+ * use the Cartesian coordinate system, with positive vertical values going
+ * upwards. The function returns +1 if the corner turns to the left, -1 to
+ * the right, and 0 for undecidable cases.
FT_BASE( FT_Int )
ft_corner_orientation( FT_Pos in_x,
@@ -325,9 +342,9 @@ FT_BEGIN_HEADER
- * Return TRUE if a corner is flat or nearly flat. This is equivalent to
- * saying that the corner point is close to its neighbors, or inside an
- * ellipse defined by the neighbor focal points to be more precise.
+ * Return TRUE if a corner is flat or nearly flat. This is equivalent to
+ * saying that the corner point is close to its neighbors, or inside an
+ * ellipse defined by the neighbor focal points to be more precise.
ft_corner_is_flat( FT_Pos in_x,
@@ -337,10 +354,11 @@ FT_BEGIN_HEADER
- * Return the most significant bit index.
+ * Return the most significant bit index.
#if defined( __GNUC__ ) && \
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
@@ -352,9 +370,34 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
+#endif /* __GNUC__ */
+#elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
+#if FT_SIZEOF_INT == 4
+#include <intrin.h>
+ static __inline FT_Int32
+ FT_MSB_i386( FT_UInt32 x )
+ unsigned long where;
+ /* not available in older VC versions */
+ _BitScanReverse( &where, x );
+ return (FT_Int32)where;
+ }
+#define FT_MSB( x ) ( FT_MSB_i386( x ) )
-#endif /* __GNUC__ */
+#endif /* _MSC_VER */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
#ifndef FT_MSB
@@ -366,8 +409,8 @@ FT_BEGIN_HEADER
- * Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
- * two fixed-point arguments instead.
+ * Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
+ * two fixed-point arguments instead.
FT_BASE( FT_Fixed )
FT_Hypot( FT_Fixed x,
@@ -376,23 +419,24 @@ FT_BEGIN_HEADER
- /* FT_SqrtFixed */
- /* Computes the square root of a 16.16 fixed-point value. */
- /* x :: The value to compute the root for. */
- /* The result of `sqrt(x)'. */
- /* This function is not very fast. */
+ * FT_SqrtFixed
+ * Computes the square root of a 16.16 fixed-point value.
+ * The value to compute the root for.
+ * The result of 'sqrt(x)'.
+ * This function is not very fast.
FT_BASE( FT_Int32 )
FT_SqrtFixed( FT_Int32 x );
@@ -409,14 +453,23 @@ FT_BEGIN_HEADER
: ( -( ( 32 - (x) ) & -64 ) ) )
- * The following macros have two purposes.
+ * The following macros have two purposes.
- * . Tag places where overflow is expected and harmless.
+ * - Tag places where overflow is expected and harmless.
- * . Avoid run-time sanitizer errors.
+ * - Avoid run-time sanitizer errors.
- * Use with care!
+ * 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 ) \
@@ -435,6 +488,19 @@ FT_BEGIN_HEADER
#define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
+#ifdef FT_LONG64
+#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_LONG64 */
@@ -1,24 +1,24 @@
-/* ftdebug.h */
-/* Debugging and logging component (specification). */
-/* IMPORTANT: A description of FreeType's debugging support can be */
-/* found in `docs/DEBUG.TXT'. Read it if you need to use or */
-/* understand this code. */
+ * ftdebug.h
+ * Debugging and logging component (specification).
+ * IMPORTANT: A description of FreeType's debugging support can be
+ * found in 'docs/DEBUG.TXT'. Read it if you need to use or
+ * understand this code.
#ifndef FTDEBUG_H_
@@ -42,12 +42,12 @@ FT_BEGIN_HEADER
- /* Define the trace enums as well as the trace levels array when they */
- /* are needed. */
+ * Define the trace enums as well as the trace levels array when they are
+ * needed.
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -62,32 +62,37 @@ FT_BEGIN_HEADER
} FT_Trace;
- /* defining the array of trace levels, provided by `src/base/ftdebug.c' */
- extern int ft_trace_levels[trace_count];
+ /* a pointer to the array of trace levels, */
+ /* provided by `src/base/ftdebug.c' */
+ extern int* ft_trace_levels;
#undef FT_TRACE_DEF
#endif /* FT_DEBUG_LEVEL_TRACE */
- /* Define the FT_TRACE macro */
- /* IMPORTANT! */
- /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
- /* value before using any TRACE macro. */
+ * Define the FT_TRACE macro
+ * IMPORTANT!
+ * Each component must define the macro FT_COMPONENT to a valid FT_Trace
+ * value before using any TRACE macro.
-#define FT_TRACE( level, varformat ) \
- do \
- if ( ft_trace_levels[FT_COMPONENT] >= level ) \
- FT_Message varformat; \
+ /* we need two macros here to make cpp expand `FT_COMPONENT' */
+#define FT_TRACE_COMP( x ) FT_TRACE_COMP_( x )
+#define FT_TRACE_COMP_( x ) trace_ ## x
+#define FT_TRACE( level, varformat ) \
+ do \
+ { \
+ if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
+ FT_Message varformat; \
} while ( 0 )
#else /* !FT_DEBUG_LEVEL_TRACE */
@@ -97,62 +102,85 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_TRACE */
- /* FT_Trace_Get_Count */
- /* Return the number of available trace components. */
- /* The number of trace components. 0 if FreeType 2 is not built with */
- /* FT_DEBUG_LEVEL_TRACE definition. */
- /* This function may be useful if you want to access elements of */
- /* the internal `ft_trace_levels' array by an index. */
+ * FT_Trace_Get_Count
+ * Return the number of available trace components.
+ * The number of trace components. 0 if FreeType 2 is not built with
+ * FT_DEBUG_LEVEL_TRACE definition.
+ * This function may be useful if you want to access elements of the
+ * internal trace levels array by an index.
FT_Trace_Get_Count( void );
- /* FT_Trace_Get_Name */
- /* Return the name of a trace component. */
- /* The index of the trace component. */
- /* The name of the trace component. This is a statically allocated */
- /* C string, so do not free it after use. NULL if FreeType 2 is not */
- /* built with FT_DEBUG_LEVEL_TRACE definition. */
- /* Use @FT_Trace_Get_Count to get the number of available trace */
- /* components. */
- /* This function may be useful if you want to control FreeType 2's */
- /* debug level in your application. */
+ * FT_Trace_Get_Name
+ * Return the name of a trace component.
+ * The index of the trace component.
+ * The name of the trace component. This is a statically allocated
+ * C~string, so do not free it after use. NULL if FreeType is not built
+ * with FT_DEBUG_LEVEL_TRACE definition.
+ * Use @FT_Trace_Get_Count to get the number of available trace
+ * components.
FT_BASE( const char* )
FT_Trace_Get_Name( FT_Int idx );
- /* You need two opening and closing parentheses! */
- /* Example: FT_TRACE0(( "Value is %i", foo )) */
- /* Output of the FT_TRACEX macros is sent to stderr. */
+ * FT_Trace_Disable
+ * Switch off tracing temporarily. It can be activated again with
+ * @FT_Trace_Enable.
+ FT_BASE( void )
+ FT_Trace_Disable( void );
+ * FT_Trace_Enable
+ * Activate tracing. Use it after tracing has been switched off with
+ * @FT_Trace_Disable.
+ FT_Trace_Enable( void );
+ * You need two opening and closing parentheses!
+ * Example: FT_TRACE0(( "Value is %i", foo ))
+ * Output of the FT_TRACEX macros is sent to stderr.
#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
@@ -164,13 +192,13 @@ FT_BEGIN_HEADER
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
- /* Define the FT_ERROR macro. */
- /* Output of this macro is sent to stderr. */
+ * Define the FT_ERROR macro.
+ * Output of this macro is sent to stderr.
#ifdef FT_DEBUG_LEVEL_ERROR
@@ -183,12 +211,12 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_ERROR */
- /* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw' */
- /* makes it possible to easily set a breakpoint at this function. */
+ * Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw` makes
+ * it possible to easily set a breakpoint at this function.
@@ -215,11 +243,11 @@ FT_BEGIN_HEADER
- /* Define `FT_Message' and `FT_Panic' when needed. */
+ * Define `FT_Message` and `FT_Panic` when needed.
-/* ftdrv.h */
-/* FreeType internal font driver interface (specification). */
+ * ftdrv.h
+ * FreeType internal font driver interface (specification).
#ifndef FTDRV_H_
@@ -87,73 +87,80 @@ FT_BEGIN_HEADER
FT_Fixed* advances );
- /* FT_Driver_ClassRec */
- /* The font driver class. This structure mostly contains pointers to */
- /* driver methods. */
- /* root :: The parent module. */
- /* face_object_size :: The size of a face object in bytes. */
- /* size_object_size :: The size of a size object in bytes. */
- /* slot_object_size :: The size of a glyph object in bytes. */
- /* init_face :: The format-specific face constructor. */
- /* done_face :: The format-specific face destructor. */
- /* init_size :: The format-specific size constructor. */
- /* done_size :: The format-specific size destructor. */
- /* init_slot :: The format-specific slot constructor. */
- /* done_slot :: The format-specific slot destructor. */
- /* load_glyph :: A function handle to load a glyph to a slot. */
- /* This field is mandatory! */
- /* get_kerning :: A function handle to return the unscaled */
- /* kerning for a given pair of glyphs. Can be */
- /* set to 0 if the format doesn't support */
- /* kerning. */
- /* attach_file :: This function handle is used to read */
- /* additional data for a face from another */
- /* file/stream. For example, this can be used to */
- /* add data from AFM or PFM files on a Type 1 */
- /* face, or a CIDMap on a CID-keyed face. */
- /* get_advances :: A function handle used to return advance */
- /* widths of `count' glyphs (in font units), */
- /* starting at `first'. The `vertical' flag must */
- /* be set to get vertical advance heights. The */
- /* `advances' buffer is caller-allocated. */
- /* The idea of this function is to be able to */
- /* perform device-independent text layout without */
- /* loading a single glyph image. */
- /* request_size :: A handle to a function used to request the new */
- /* character size. Can be set to 0 if the */
- /* scaling done in the base layer suffices. */
- /* select_size :: A handle to a function used to select a new */
- /* fixed size. It is used only if */
- /* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
- /* to 0 if the scaling done in the base layer */
- /* suffices. */
- /* Most function pointers, with the exception of `load_glyph', can be */
- /* set to 0 to indicate a default behaviour. */
+ * FT_Driver_ClassRec
+ * The font driver class. This structure mostly contains pointers to
+ * driver methods.
+ * The parent module.
+ * face_object_size ::
+ * The size of a face object in bytes.
+ * size_object_size ::
+ * The size of a size object in bytes.
+ * slot_object_size ::
+ * The size of a glyph object in bytes.
+ * init_face ::
+ * The format-specific face constructor.
+ * done_face ::
+ * The format-specific face destructor.
+ * init_size ::
+ * The format-specific size constructor.
+ * done_size ::
+ * The format-specific size destructor.
+ * init_slot ::
+ * The format-specific slot constructor.
+ * done_slot ::
+ * The format-specific slot destructor.
+ * load_glyph ::
+ * A function handle to load a glyph to a slot. This field is
+ * mandatory!
+ * get_kerning ::
+ * A function handle to return the unscaled kerning for a given pair of
+ * glyphs. Can be set to 0 if the format doesn't support kerning.
+ * attach_file ::
+ * This function handle is used to read additional data for a face from
+ * another file/stream. For example, this can be used to add data from
+ * AFM or PFM files on a Type 1 face, or a CIDMap on a CID-keyed face.
+ * get_advances ::
+ * A function handle used to return advance widths of 'count' glyphs
+ * (in font units), starting at 'first'. The 'vertical' flag must be
+ * set to get vertical advance heights. The 'advances' buffer is
+ * caller-allocated. The idea of this function is to be able to
+ * perform device-independent text layout without loading a single
+ * glyph image.
+ * request_size ::
+ * A handle to a function used to request the new character size. Can
+ * be set to 0 if the scaling done in the base layer suffices.
+ * select_size ::
+ * A handle to a function used to select a new fixed size. It is used
+ * only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
+ * scaling done in the base layer suffices.
+ * Most function pointers, with the exception of `load_glyph`, can be set
+ * to 0 to indicate a default behaviour.
typedef struct FT_Driver_ClassRec_
@@ -184,45 +191,28 @@ FT_BEGIN_HEADER
} FT_Driver_ClassRec, *FT_Driver_Class;
- /* FT_DECLARE_DRIVER */
- /* Used to create a forward declaration of an FT_Driver_ClassRec */
- /* struct instance. */
- /* FT_DEFINE_DRIVER */
- /* Used to initialize an instance of FT_Driver_ClassRec struct. */
- /* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
- /* called with a pointer where the allocated structure is returned. */
- /* And when it is no longer needed a `destroy' function needs to be */
- /* called to release that allocation. */
- /* `ftinit.c' (ft_create_default_module_classes) already contains a */
- /* mechanism to call these functions for the default modules */
- /* described in `ftmodule.h'. */
- /* Notice that the created `create' and `destroy' functions call */
- /* `pic_init' and `pic_free' to allow you to manually allocate and */
- /* initialize any additional global data, like a module specific */
- /* interface, and put them in the global pic container defined in */
- /* `ftpic.h'. If you don't need them just implement the functions as */
- /* empty to resolve the link error. Also the `pic_init' and */
- /* `pic_free' functions should be declared in `pic.h', to be referred */
- /* by driver definition calling `FT_DEFINE_DRIVER' in following. */
- /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
- /* allocated in the global scope (or the scope where the macro is */
- /* used). */
+ * FT_DECLARE_DRIVER
+ * Used to create a forward declaration of an FT_Driver_ClassRec struct
+ * FT_DEFINE_DRIVER
+ * Used to initialize an instance of FT_Driver_ClassRec struct.
+ * `ftinit.c` (ft_create_default_module_classes) already contains a
+ * mechanism to call these functions for the default modules described in
+ * `ftmodule.h`.
+ * The struct will be allocated in the global scope (or the scope where
+ * the macro is used).
#define FT_DECLARE_DRIVER( class_ ) \
FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_;
@@ -289,108 +279,6 @@ FT_BEGIN_HEADER
select_size_ \
-#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
-#define FT_DEFINE_DRIVER( \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_, \
- face_object_size_, \
- size_object_size_, \
- slot_object_size_, \
- init_face_, \
- done_face_, \
- init_size_, \
- done_size_, \
- init_slot_, \
- done_slot_, \
- load_glyph_, \
- get_kerning_, \
- attach_file_, \
- get_advances_, \
- request_size_, \
- select_size_ ) \
- FT_Destroy_Class_ ## class_( FT_Library library, \
- FT_Module_Class* clazz ) \
- FT_Memory memory = library->memory; \
- FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
- class_ ## _pic_free( library ); \
- if ( dclazz ) \
- FT_FREE( dclazz ); \
- } \
- FT_Error \
- FT_Create_Class_ ## class_( FT_Library library, \
- FT_Module_Class** output_class ) \
- FT_Driver_Class clazz = NULL; \
- FT_Error error; \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
- return error; \
- error = class_ ## _pic_init( library ); \
- if ( error ) \
- FT_FREE( clazz ); \
- FT_DEFINE_ROOT_MODULE( flags_, \
- get_interface_ ) \
- clazz->face_object_size = face_object_size_; \
- clazz->size_object_size = size_object_size_; \
- clazz->slot_object_size = slot_object_size_; \
- clazz->init_face = init_face_; \
- clazz->done_face = done_face_; \
- clazz->init_size = init_size_; \
- clazz->done_size = done_size_; \
- clazz->init_slot = init_slot_; \
- clazz->done_slot = done_slot_; \
- clazz->get_kerning = get_kerning_; \
- clazz->attach_file = attach_file_; \
- clazz->get_advances = get_advances_; \
- clazz->request_size = request_size_; \
- clazz->select_size = select_size_; \
- *output_class = (FT_Module_Class*)clazz; \
- return FT_Err_Ok; \
-/* ftgloadr.h */
-/* The FreeType glyph loader (specification). */
-/* David Turner, Robert Wilhelm, and Werner Lemberg */
+ * ftgloadr.h
+ * The FreeType glyph loader (specification).
+ * David Turner, Robert Wilhelm, and Werner Lemberg
#ifndef FTGLOADR_H_
@@ -27,15 +27,15 @@
- /* FT_GlyphLoader */
- /* The glyph loader is an internal object used to load several glyphs */
- /* together (for example, in the case of composites). */
+ * FT_GlyphLoader
+ * The glyph loader is an internal object used to load several glyphs
+ * together (for example, in the case of composites).
typedef struct FT_SubGlyphRec_
FT_Int index;
@@ -138,11 +138,6 @@ FT_BEGIN_HEADER
FT_GlyphLoader_Add( FT_GlyphLoader loader );
- /* copy points from one glyph loader to another */
- FT_BASE( FT_Error )
- FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
- FT_GlyphLoader source );
@@ -1,10 +1,10 @@
-/* fthash.h */
-/* Hashing functions (specification). */
+ * fthash.h
+ * Hashing functions (specification).
* Copyright 2000 Computing Research Labs, New Mexico State University
@@ -30,13 +30,13 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- /* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 */
- /* taken from Mark Leisher's xmbdfed package */
+ * This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50
+ * taken from Mark Leisher's xmbdfed package
#ifndef FTHASH_H_
-/* ftmemory.h */
-/* The FreeType memory management macros (specification). */
+ * ftmemory.h
+ * The FreeType memory management macros (specification).
#ifndef FTMEMORY_H_
@@ -28,16 +28,16 @@
- /* FT_SET_ERROR */
- /* This macro is used to set an implicit `error' variable to a given */
- /* expression's value (usually a function call), and convert it to a */
- /* boolean which is set whenever the value is != 0. */
+ * FT_SET_ERROR
+ * This macro is used to set an implicit 'error' variable to a given
+ * expression's value (usually a function call), and convert it to a
+ * boolean which is set whenever the value is != 0.
#undef FT_SET_ERROR
#define FT_SET_ERROR( expression ) \
( ( error = (expression) ) != 0 )
@@ -58,9 +58,9 @@ FT_BEGIN_HEADER
- * 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++, we have to use a template to emulate it.
+ * 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++,
+ * we have to use a template to emulate it.
@@ -107,8 +107,8 @@ extern "C++"
- * The allocation functions return a pointer, and the error code
- * is written to through the `p_error' parameter.
+ * The allocation functions return a pointer, and the error code is written
+ * to through the `p_error' parameter.
/* The `q' variants of the functions below (`q' for `quick') don't fill */
@@ -253,20 +253,19 @@ extern "C++"
- * Return the maximum number of addressable elements in an array.
- * We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid
- * any problems.
+ * Return the maximum number of addressable elements in an array. We limit
+ * ourselves to INT_MAX, rather than UINT_MAX, to avoid any problems.
#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
- /* The following functions macros expect that their pointer argument is */
- /* _typed_ in order to automatically compute array element sizes. */
+ * The following functions macros expect that their pointer argument is
+ * _typed_ in order to automatically compute array element sizes.
#define FT_MEM_NEW_ARRAY( ptr, count ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
@@ -1,71 +0,0 @@
-/* ftpic.h */
-/* The FreeType position independent code services (declaration). */
-/* Copyright 2009-2018 by */
-/* Oran Agra and Mickey Gabel. */
- /* Modules that ordinarily have const global data that need address */
- /* can instead define pointers here. */
-#ifndef FTPIC_H_
-#define FTPIC_H_
-FT_BEGIN_HEADER
-#ifdef FT_CONFIG_OPTION_PIC
- typedef struct FT_PIC_Container_
- {
- /* pic containers for base */
- void* base;
- /* pic containers for modules */
- void* autofit;
- void* cff;
- void* pshinter;
- void* psnames;
- void* raster;
- void* sfnt;
- void* smooth;
- void* truetype;
- } FT_PIC_Container;
- /* Initialize the various function tables, structs, etc. */
- /* stored in the container. */
- ft_pic_container_init( FT_Library library );
- /* Destroy the contents of the container. */
- FT_BASE( void )
- ft_pic_container_destroy( FT_Library library );
-FT_END_HEADER
-#endif /* FTPIC_H_ */
-/* END */
-/* ftpsprop.h */
-/* Get and set properties of PostScript drivers (specification). */
+ * ftpsprop.h
+ * Get and set properties of PostScript drivers (specification).
#ifndef FTPSPROP_H_
-/* ftrfork.h */
-/* Embedded resource forks accessor (specification). */
-/* Masatake YAMATO and Redhat K.K. */
-/* Development of the code in this file is support of */
-/* Information-technology Promotion Agency, Japan. */
+ * ftrfork.h
+ * Embedded resource forks accessor (specification).
+ * Masatake YAMATO and Redhat K.K.
+ * Development of the code in this file is support of
+ * Information-technology Promotion Agency, Japan.
#ifndef FTRFORK_H_
@@ -72,85 +72,65 @@ FT_BEGIN_HEADER
} FT_RFork_Rule;
/* For fast translation between rule index and rule type,
- * the macros FT_RFORK_xxx should be kept consistent with
- * the raccess_guess_funcs table
+ * the macros FT_RFORK_xxx should be kept consistent with the
+ * raccess_guess_funcs table
typedef struct ft_raccess_guess_rec_ {
ft_raccess_guess_func func;
FT_RFork_Rule type;
} ft_raccess_guess_rec;
- /* this array is a storage in non-PIC mode, so ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
static const type name[] = {
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
{ raccess_guess_ ## func_suffix, \
FT_RFork_Rule_ ## type_suffix },
+ /* this array is a storage, thus a final `;' is needed */
#define CONST_FT_RFORK_RULE_ARRAY_END };
- /* this array is a function in PIC mode, so no ; is needed in END */
-#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
- FT_Init_Table_ ## name( type* storage ) \
- type* local = storage; \
- int i = 0;
-#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
- local[i].func = raccess_guess_ ## func_suffix; \
- local[i].type = FT_RFork_Rule_ ## type_suffix; \
- i++;
-#define CONST_FT_RFORK_RULE_ARRAY_END }
#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
- /* FT_Raccess_Guess */
- /* Guess a file name and offset where the actual resource fork is */
- /* stored. The macro FT_RACCESS_N_RULES holds the number of */
- /* guessing rules; the guessed result for the Nth rule is */
- /* represented as a triplet: a new file name (new_names[N]), a file */
- /* offset (offsets[N]), and an error code (errors[N]). */
- /* library :: */
- /* A FreeType library instance. */
- /* stream :: */
- /* A file stream containing the resource fork. */
- /* base_name :: */
- /* The (base) file name of the resource fork used for some */
- /* guessing rules. */
- /* new_names :: */
- /* An array of guessed file names in which the resource forks may */
- /* exist. If `new_names[N]' is NULL, the guessed file name is */
- /* equal to `base_name'. */
- /* offsets :: */
- /* An array of guessed file offsets. `offsets[N]' holds the file */
- /* offset of the possible start of the resource fork in file */
- /* `new_names[N]'. */
- /* errors :: */
- /* An array of FreeType error codes. `errors[N]' is the error */
- /* code of Nth guessing rule function. If `errors[N]' is not */
- /* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
+ * FT_Raccess_Guess
+ * Guess a file name and offset where the actual resource fork is stored.
+ * The macro FT_RACCESS_N_RULES holds the number of guessing rules; the
+ * guessed result for the Nth rule is represented as a triplet: a new
+ * file name (new_names[N]), a file offset (offsets[N]), and an error
+ * code (errors[N]).
+ * A FreeType library instance.
+ * A file stream containing the resource fork.
+ * base_name ::
+ * The (base) file name of the resource fork used for some guessing
+ * rules.
+ * new_names ::
+ * An array of guessed file names in which the resource forks may
+ * exist. If 'new_names[N]' is NULL, the guessed file name is equal to
+ * `base_name`.
+ * An array of guessed file offsets. 'offsets[N]' holds the file
+ * offset of the possible start of the resource fork in file
+ * 'new_names[N]'.
+ * errors ::
+ * An array of FreeType error codes. 'errors[N]' is the error code of
+ * Nth guessing rule function. If 'errors[N]' is not FT_Err_Ok,
+ * 'new_names[N]' and 'offsets[N]' are meaningless.
FT_Raccess_Guess( FT_Library library,
FT_Stream stream,
@@ -160,37 +140,37 @@ FT_BEGIN_HEADER
FT_Error* errors );
- /* FT_Raccess_Get_HeaderInfo */
- /* Get the information from the header of resource fork. The */
- /* information includes the file offset where the resource map */
- /* starts, and the file offset where the resource data starts. */
- /* `FT_Raccess_Get_DataOffsets' requires these two data. */
- /* rfork_offset :: */
- /* The file offset where the resource fork starts. */
- /* map_offset :: */
- /* The file offset where the resource map starts. */
- /* rdata_pos :: */
- /* The file offset where the resource data starts. */
- /* FreeType error code. FT_Err_Ok means success. */
+ * FT_Raccess_Get_HeaderInfo
+ * Get the information from the header of resource fork. The information
+ * includes the file offset where the resource map starts, and the file
+ * offset where the resource data starts. `FT_Raccess_Get_DataOffsets`
+ * requires these two data.
+ * rfork_offset ::
+ * The file offset where the resource fork starts.
+ * map_offset ::
+ * The file offset where the resource map starts.
+ * rdata_pos ::
+ * The file offset where the resource data starts.
+ * FreeType error code. FT_Err_Ok means success.
FT_BASE( FT_Error )
FT_Raccess_Get_HeaderInfo( FT_Library library,
@@ -199,55 +179,54 @@ FT_BEGIN_HEADER
FT_Long *rdata_pos );
- /* FT_Raccess_Get_DataOffsets */
- /* Get the data offsets for a tag in a resource fork. Offsets are */
- /* stored in an array because, in some cases, resources in a resource */
- /* fork have the same tag. */
- /* tag :: */
- /* The resource tag. */
- /* sort_by_res_id :: */
- /* A Boolean to sort the fragmented resource by their ids. */
- /* The fragmented resources for `POST' resource should be sorted */
- /* to restore Type1 font properly. For `sfnt' resources, sorting */
- /* may induce a different order of the faces in comparison to that */
- /* by QuickDraw API. */
- /* The stream offsets for the resource data specified by `tag'. */
- /* This array is allocated by the function, so you have to call */
- /* @ft_mem_free after use. */
- /* count :: */
- /* The length of offsets array. */
- /* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
- /* value for `map_offset' and `rdata_pos'. */
+ * FT_Raccess_Get_DataOffsets
+ * Get the data offsets for a tag in a resource fork. Offsets are stored
+ * in an array because, in some cases, resources in a resource fork have
+ * the same tag.
+ * The resource tag.
+ * sort_by_res_id ::
+ * A Boolean to sort the fragmented resource by their ids. The
+ * fragmented resources for 'POST' resource should be sorted to restore
+ * Type1 font properly. For 'sfnt' resources, sorting may induce a
+ * different order of the faces in comparison to that by QuickDraw API.
+ * The stream offsets for the resource data specified by 'tag'. This
+ * array is allocated by the function, so you have to call @ft_mem_free
+ * after use.
+ * The length of offsets array.
+ * Normally you should use `FT_Raccess_Get_HeaderInfo` to get the value
+ * for `map_offset` and `rdata_pos`.
FT_Raccess_Get_DataOffsets( FT_Library library,
-/* ftserv.h */
-/* The FreeType services (specification only). */
- /* Each module can export one or more `services'. Each service is */
- /* identified by a constant string and modeled by a pointer; the latter */
- /* generally corresponds to a structure containing function pointers. */
- /* Note that a service's data cannot be a mere function pointer because */
- /* in C it is possible that function pointers might be implemented */
- /* differently than data pointers (e.g. 48 bits instead of 32). */
+ * ftserv.h
+ * The FreeType services (specification only).
+ * Each module can export one or more 'services'. Each service is
+ * identified by a constant string and modeled by a pointer; the latter
+ * generally corresponds to a structure containing function pointers.
+ * Note that a service's data cannot be a mere function pointer because in
+ * C it is possible that function pointers might be implemented differently
+ * than data pointers (e.g. 48 bits instead of 32).
#ifndef FTSERV_H_
@@ -34,7 +34,8 @@
* FT_FACE_FIND_SERVICE
@@ -46,15 +47,15 @@ FT_BEGIN_HEADER
* The source face handle.
* id ::
- * A string describing the service as defined in the service's
- * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
- * `multi-masters'). It is automatically prefixed with
- * `FT_SERVICE_ID_'.
+ * A string describing the service as defined in the service's header
+ * files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
+ * 'multi-masters'). It is automatically prefixed with
+ * `FT_SERVICE_ID_`.
* ptr ::
- * A variable that receives the service pointer. Will be NULL
- * if not found.
+ * A variable that receives the service pointer. Will be NULL if not
+ * found.
@@ -85,7 +86,8 @@ FT_BEGIN_HEADER
#endif /* !C++ */
* FT_FACE_FIND_GLOBAL_SERVICE
@@ -97,15 +99,15 @@ FT_BEGIN_HEADER
@@ -144,8 +146,8 @@ FT_BEGIN_HEADER
- * The following structure is used to _describe_ a given service
- * to the library. This is useful to build simple static service lists.
+ * The following structure is used to _describe_ a given service to the
+ * library. This is useful to build simple static service lists.
typedef struct FT_ServiceDescRec_
@@ -157,35 +159,26 @@ FT_BEGIN_HEADER
typedef const FT_ServiceDescRec* FT_ServiceDesc;
- /* FT_DEFINE_SERVICEDESCREC1 */
- /* FT_DEFINE_SERVICEDESCREC2 */
- /* FT_DEFINE_SERVICEDESCREC3 */
- /* FT_DEFINE_SERVICEDESCREC4 */
- /* FT_DEFINE_SERVICEDESCREC5 */
- /* FT_DEFINE_SERVICEDESCREC6 */
- /* FT_DEFINE_SERVICEDESCREC7 */
- /* FT_DEFINE_SERVICEDESCREC8 */
- /* Used to initialize an array of FT_ServiceDescRec structures. */
- /* When FT_CONFIG_OPTION_PIC is defined a `create' function needs to */
- /* be called with a pointer to return an allocated array. As soon as */
- /* it is no longer needed, a `destroy' function needs to be called to */
- /* release that allocation. */
- /* These functions should be manually called from the `pic_init' and */
- /* `pic_free' functions of your module (see FT_DEFINE_MODULE). */
- /* When FT_CONFIG_OPTION_PIC is not defined the array will be */
+ * FT_DEFINE_SERVICEDESCREC1
+ * FT_DEFINE_SERVICEDESCREC2
+ * FT_DEFINE_SERVICEDESCREC3
+ * FT_DEFINE_SERVICEDESCREC4
+ * FT_DEFINE_SERVICEDESCREC5
+ * FT_DEFINE_SERVICEDESCREC6
+ * FT_DEFINE_SERVICEDESCREC7
+ * FT_DEFINE_SERVICEDESCREC8
+ * FT_DEFINE_SERVICEDESCREC9
+ * FT_DEFINE_SERVICEDESCREC10
+ * Used to initialize an array of FT_ServiceDescRec structures.
+ * The array will be allocated in the global scope (or the scope where
#define FT_DEFINE_SERVICEDESCREC1( class_, \
serv_id_1, serv_data_1 ) \
static const FT_ServiceDescRec class_[] = \
@@ -356,504 +349,15 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
-#define FT_DEFINE_SERVICEDESCREC1( class_, \
- serv_id_1, serv_data_1 ) \
- FT_ServiceDescRec* clazz ) \
- if ( clazz ) \
- FT_ServiceDescRec** output_class ) \
- FT_ServiceDescRec* clazz = NULL; \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) ) \
- clazz[0].serv_id = serv_id_1; \
- clazz[0].serv_data = serv_data_1; \
- clazz[1].serv_id = NULL; \
- clazz[1].serv_data = NULL; \
- *output_class = clazz; \
-#define FT_DEFINE_SERVICEDESCREC2( class_, \
- serv_id_1, serv_data_1, \
- serv_id_2, serv_data_2 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) ) \
- clazz[1].serv_id = serv_id_2; \
- clazz[1].serv_data = serv_data_2; \
- clazz[2].serv_id = NULL; \
- clazz[2].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC3( class_, \
- serv_id_2, serv_data_2, \
- serv_id_3, serv_data_3 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) ) \
- clazz[2].serv_id = serv_id_3; \
- clazz[2].serv_data = serv_data_3; \
- clazz[3].serv_id = NULL; \
- clazz[3].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC4( class_, \
- serv_id_3, serv_data_3, \
- serv_id_4, serv_data_4 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) ) \
- clazz[3].serv_id = serv_id_4; \
- clazz[3].serv_data = serv_data_4; \
- clazz[4].serv_id = NULL; \
- clazz[4].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC5( class_, \
- serv_id_4, serv_data_4, \
- serv_id_5, serv_data_5 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) ) \
- clazz[4].serv_id = serv_id_5; \
- clazz[4].serv_data = serv_data_5; \
- clazz[5].serv_id = NULL; \
- clazz[5].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC6( class_, \
- serv_id_5, serv_data_5, \
- serv_id_6, serv_data_6 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) ) \
- clazz[5].serv_id = serv_id_6; \
- clazz[5].serv_data = serv_data_6; \
- clazz[6].serv_id = NULL; \
- clazz[6].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC7( class_, \
- serv_id_6, serv_data_6, \
- serv_id_7, serv_data_7 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
- clazz[6].serv_id = serv_id_7; \
- clazz[6].serv_data = serv_data_7; \
- clazz[7].serv_id = NULL; \
- clazz[7].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC8( class_, \
- serv_id_7, serv_data_7, \
- serv_id_8, serv_data_8 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 9 ) ) \
- clazz[7].serv_id = serv_id_8; \
- clazz[7].serv_data = serv_data_8; \
- clazz[8].serv_id = NULL; \
- clazz[8].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC9( class_, \
- serv_id_8, serv_data_8, \
- serv_id_9, serv_data_9 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 10 ) ) \
- clazz[8].serv_id = serv_id_9; \
- clazz[8].serv_data = serv_data_9; \
- clazz[9].serv_id = NULL; \
- clazz[9].serv_data = NULL; \
-#define FT_DEFINE_SERVICEDESCREC10( class_, \
- serv_id_9, serv_data_9, \
- serv_id_10, serv_data_10 ) \
- if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 11 ) ) \
- clazz[ 0].serv_id = serv_id_1; \
- clazz[ 0].serv_data = serv_data_1; \
- clazz[ 1].serv_id = serv_id_2; \
- clazz[ 1].serv_data = serv_data_2; \
- clazz[ 2].serv_id = serv_id_3; \
- clazz[ 2].serv_data = serv_data_3; \
- clazz[ 3].serv_id = serv_id_4; \
- clazz[ 3].serv_data = serv_data_4; \
- clazz[ 4].serv_id = serv_id_5; \
- clazz[ 4].serv_data = serv_data_5; \
- clazz[ 5].serv_id = serv_id_6; \
- clazz[ 5].serv_data = serv_data_6; \
- clazz[ 6].serv_id = serv_id_7; \
- clazz[ 6].serv_data = serv_data_7; \
- clazz[ 7].serv_id = serv_id_8; \
- clazz[ 7].serv_data = serv_data_8; \
- clazz[ 8].serv_id = serv_id_9; \
- clazz[ 8].serv_data = serv_data_9; \
- clazz[ 9].serv_id = serv_id_10; \
- clazz[ 9].serv_data = serv_data_10; \
- clazz[10].serv_id = NULL; \
- clazz[10].serv_data = NULL; \
- * Parse a list of FT_ServiceDescRec descriptors and look for
- * a specific service by ID. Note that the last element in the
- * array must be { NULL, NULL }, and that the function should
- * return NULL if the service isn't available.
+ * Parse a list of FT_ServiceDescRec descriptors and look for a specific
+ * service by ID. Note that the last element in the array must be { NULL,
+ * NULL }, and that the function should return NULL if the service isn't
+ * available.
- * This function can be used by modules to implement their
- * `get_service' method.
+ * This function can be used by modules to implement their `get_service'
+ * method.
FT_BASE( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
@@ -869,16 +373,16 @@ FT_BEGIN_HEADER
- * This structure is used to store a cache for several frequently used
- * services. It is the type of `face->internal->services'. You
- * should only use FT_FACE_LOOKUP_SERVICE to access it.
+ * This structure is used to store a cache for several frequently used
+ * services. It is the type of `face->internal->services'. You should
+ * only use FT_FACE_LOOKUP_SERVICE to access it.
- * All fields should have the type FT_Pointer to relax compilation
- * dependencies. We assume the developer isn't completely stupid.
+ * All fields should have the type FT_Pointer to relax compilation
+ * dependencies. We assume the developer isn't completely stupid.
- * Each field must be named `service_XXXX' where `XXX' corresponds to
- * the correct FT_SERVICE_ID_XXXX macro. See the definition of
- * FT_FACE_LOOKUP_SERVICE below how this is implemented.
+ * Each field must be named `service_XXXX' where `XXX' corresponds to the
+ * correct FT_SERVICE_ID_XXXX macro. See the definition of
+ * FT_FACE_LOOKUP_SERVICE below how this is implemented.
typedef struct FT_ServiceCacheRec_
@@ -894,14 +398,15 @@ FT_BEGIN_HEADER
- * A magic number used within the services cache.
+ * A magic number used within the services cache.
/* ensure that value `1' has the same width as a pointer */
#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
* FT_FACE_LOOKUP_SERVICE
@@ -910,7 +415,7 @@ FT_BEGIN_HEADER
* using its cache.
- * face::
* The source face handle containing the cache.
* field ::
@@ -969,7 +474,7 @@ FT_BEGIN_HEADER
- * A macro used to define new service structure types.
+ * A macro used to define new service structure types.
#define FT_DEFINE_SERVICE( name ) \
@@ -982,7 +487,7 @@ FT_BEGIN_HEADER
- * The header files containing the services.
+ * The header files containing the services.
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
-/* ftstream.h */
-/* Stream handling (specification). */
+ * ftstream.h
+ * Stream handling (specification).
#ifndef FTSTREAM_H_
@@ -96,13 +96,13 @@ FT_BEGIN_HEADER
/* The structure type must be set in the FT_STRUCTURE macro before */
/* calling the FT_FRAME_START() macro. */
-#define FT_FIELD_SIZE( f ) \
+#define FT_FIELD_SIZE( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
-#define FT_FIELD_SIZE_DELTA( f ) \
+#define FT_FIELD_SIZE_DELTA( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
-#define FT_FIELD_OFFSET( f ) \
+#define FT_FIELD_OFFSET( f ) \
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
#define FT_FRAME_FIELD( frame_op, field ) \
@@ -147,11 +147,11 @@ FT_BEGIN_HEADER
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
- /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */
- /* type `char*' or equivalent (1-byte elements). */
+ * Integer extraction macros -- the 'buffer' parameter must ALWAYS be of
+ * type 'char*' or equivalent (1-byte elements).
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
@@ -165,6 +165,10 @@ FT_BEGIN_HEADER
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
+ * `FT_PEEK_XXX' are generic macros to get data from a buffer position. No
+ * safety checks are performed.
#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
@@ -213,7 +217,10 @@ FT_BEGIN_HEADER
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
+ * `FT_NEXT_XXX' are generic macros to get data from a buffer position
+ * which is then increased appropriately. No safety checks are performed.
#define FT_NEXT_CHAR( buffer ) \
( (signed char)*buffer++ )
@@ -258,10 +265,14 @@ FT_BEGIN_HEADER
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
- /* Each GET_xxxx() macro uses an implicit `stream' variable. */
+ * The `FT_GET_XXX` macros use an implicit 'stream' variable.
+ * Note that a call to `FT_STREAM_SEEK` or `FT_STREAM_POS` has **no**
+ * effect on `FT_GET_XXX`! They operate on `stream->pos`, while
+ * `FT_GET_XXX` use `stream->cursor`.
#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
@@ -299,10 +310,18 @@ FT_BEGIN_HEADER
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
#define FT_READ_MACRO( func, type, var ) \
( var = (type)func( stream, &error ), \
error != FT_Err_Ok )
+ * The `FT_READ_XXX' macros use implicit `stream' and `error' variables.
+ * `FT_READ_XXX' can be controlled with `FT_STREAM_SEEK' and
+ * `FT_STREAM_POS'. They use the full machinery to check whether a read is
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
@@ -387,12 +406,14 @@ FT_BEGIN_HEADER
/* Enter a frame of `count' consecutive bytes in a stream. Returns an */
/* error if the frame could not be read/accessed. The caller can use */
- /* the FT_Stream_Get_XXX functions to retrieve frame data without */
+ /* the `FT_Stream_GetXXX' functions to retrieve frame data without */
/* error checks. */
- /* You must _always_ call FT_Stream_ExitFrame() once you have entered */
+ /* You must _always_ call `FT_Stream_ExitFrame' once you have entered */
/* a stream frame! */
+ /* Nested frames are not permitted. */
FT_Stream_EnterFrame( FT_Stream stream,
FT_ULong count );
@@ -401,25 +422,29 @@ FT_BEGIN_HEADER
FT_Stream_ExitFrame( FT_Stream stream );
/* Extract a stream frame. If the stream is disk-based, a heap block */
/* is allocated and the frame bytes are read into it. If the stream */
- /* is memory-based, this function simply set a pointer to the data. */
+ /* is memory-based, this function simply sets a pointer to the data. */
/* Useful to optimize access to memory-based streams transparently. */
- /* All extracted frames must be `freed' with a call to the function */
- /* FT_Stream_ReleaseFrame(). */
+ /* `FT_Stream_GetXXX' functions can't be used. */
+ /* An extracted frame must be `freed' with a call to the function */
+ /* `FT_Stream_ReleaseFrame'. */
FT_Stream_ExtractFrame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes );
- /* release an extract frame (see FT_Stream_ExtractFrame) */
+ /* release an extract frame (see `FT_Stream_ExtractFrame') */
FT_Stream_ReleaseFrame( FT_Stream stream,
/* read a byte from an entered frame */
FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream );
-/* fttrace.h */
-/* Tracing handling (specification only). */
+ * fttrace.h
+ * Tracing handling (specification only).
/* definitions of trace levels for FreeType 2 */
@@ -23,23 +23,24 @@ FT_TRACE_DEF( any )
/* base components */
FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
+FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
+FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
-FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
+FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */
FT_TRACE_DEF( list ) /* list management (ftlist.c) */
-FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */
FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
-FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
-FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
+FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
-FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
-FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
+FT_TRACE_DEF( bitmap ) /* bitmap manipulation (ftbitmap.c) */
+FT_TRACE_DEF( checksum ) /* bitmap checksum (ftobjs.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
+FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
+FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
+FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
-FT_TRACE_DEF( bitmap ) /* bitmap checksum (ftobjs.c) */
-FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
/* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
@@ -47,21 +48,23 @@ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
/* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.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) */
+FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
-FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
/* TrueType driver components */
FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */
+FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */
FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */
-FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
/* Type 1 driver components */
FT_TRACE_DEF( t1afm )
@@ -72,14 +75,14 @@ FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */
-FT_TRACE_DEF( t1decode )
FT_TRACE_DEF( cffdecode )
-FT_TRACE_DEF( psobjs )
FT_TRACE_DEF( psconv )
+FT_TRACE_DEF( psobjs )
+FT_TRACE_DEF( t1decode )
/* PostScript hinting module `pshinter' */
-FT_TRACE_DEF( pshrec )
FT_TRACE_DEF( pshalgo )
+FT_TRACE_DEF( pshrec )
/* Type 2 driver components */
FT_TRACE_DEF( cffdriver )
@@ -117,7 +120,6 @@ FT_TRACE_DEF( bdflib )
FT_TRACE_DEF( pfr )
/* OpenType validation components */
-FT_TRACE_DEF( otvmodule )
FT_TRACE_DEF( otvcommon )
FT_TRACE_DEF( otvbase )
FT_TRACE_DEF( otvgdef )
@@ -125,29 +127,30 @@ FT_TRACE_DEF( otvgpos )
FT_TRACE_DEF( otvgsub )
FT_TRACE_DEF( otvjstf )
FT_TRACE_DEF( otvmath )
+FT_TRACE_DEF( otvmodule )
/* TrueTypeGX/AAT validation components */
-FT_TRACE_DEF( gxvmodule )
+FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvcommon )
FT_TRACE_DEF( gxvfeat )
-FT_TRACE_DEF( gxvmort )
-FT_TRACE_DEF( gxvmorx )
-FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvjust )
FT_TRACE_DEF( gxvkern )
+FT_TRACE_DEF( gxvmodule )
+FT_TRACE_DEF( gxvmort )
+FT_TRACE_DEF( gxvmorx )
+FT_TRACE_DEF( gxvlcar )
FT_TRACE_DEF( gxvopbd )
-FT_TRACE_DEF( gxvtrak )
FT_TRACE_DEF( gxvprop )
-FT_TRACE_DEF( gxvlcar )
+FT_TRACE_DEF( gxvtrak )
/* autofit components */
-FT_TRACE_DEF( afmodule )
-FT_TRACE_DEF( afhints )
FT_TRACE_DEF( afcjk )
+FT_TRACE_DEF( afglobal )
+FT_TRACE_DEF( afhints )
+FT_TRACE_DEF( afmodule )
FT_TRACE_DEF( aflatin )
FT_TRACE_DEF( aflatin2 )
-FT_TRACE_DEF( afwarp )
FT_TRACE_DEF( afshaper )
-FT_TRACE_DEF( afglobal )
+FT_TRACE_DEF( afwarp )
/* END */
-/* ftvalid.h */
-/* FreeType validation support (specification). */
+ * ftvalid.h
+ * FreeType validation support (specification).
#ifndef FTVALID_H_
@@ -42,31 +42,31 @@ FT_BEGIN_HEADER
typedef struct FT_ValidatorRec_ volatile* FT_Validator;
- /* There are three distinct validation levels defined here: */
- /* FT_VALIDATE_DEFAULT :: */
- /* A table that passes this validation level can be used reliably by */
- /* FreeType. It generally means that all offsets have been checked to */
- /* prevent out-of-bound reads, that array counts are correct, etc. */
- /* FT_VALIDATE_TIGHT :: */
- /* A table that passes this validation level can be used reliably and */
- /* doesn't contain invalid data. For example, a charmap table that */
- /* returns invalid glyph indices will not pass, even though it can */
- /* be used with FreeType in default mode (the library will simply */
- /* return an error later when trying to load the glyph). */
- /* It also checks that fields which must be a multiple of 2, 4, or 8, */
- /* don't have incorrect values, etc. */
- /* FT_VALIDATE_PARANOID :: */
- /* Only for font debugging. Checks that a table follows the */
- /* specification by 100%. Very few fonts will be able to pass this */
- /* level anyway but it can be useful for certain tools like font */
- /* editors/converters. */
+ * There are three distinct validation levels defined here:
+ * FT_VALIDATE_DEFAULT ::
+ * A table that passes this validation level can be used reliably by
+ * FreeType. It generally means that all offsets have been checked to
+ * prevent out-of-bound reads, that array counts are correct, etc.
+ * FT_VALIDATE_TIGHT ::
+ * A table that passes this validation level can be used reliably and
+ * doesn't contain invalid data. For example, a charmap table that
+ * returns invalid glyph indices will not pass, even though it can be
+ * used with FreeType in default mode (the library will simply return an
+ * error later when trying to load the glyph).
+ * It also checks that fields which must be a multiple of 2, 4, or 8,
+ * don't have incorrect values, etc.
+ * FT_VALIDATE_PARANOID ::
+ * Only for font debugging. Checks that a table follows the
+ * specification by 100%. Very few fonts will be able to pass this level
+ * anyway but it can be useful for certain tools like font
+ * editors/converters.
typedef enum FT_ValidationLevel_
FT_VALIDATE_DEFAULT = 0,
@@ -1,31 +1,30 @@
-/* internal.h */
-/* Internal header files (specification only). */
+ * internal.h
+ * Internal header files (specification only).
- /* This file is automatically included by `ft2build.h'. */
- /* Do not include it manually! */
+ * This file is automatically included by `ft2build.h`. Do not include it
+ * manually!
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
-#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h>
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
-/* psaux.h */
-/* Auxiliary functions and data structures related to PostScript fonts */
+ * psaux.h
+ * Auxiliary functions and data structures related to PostScript fonts
#ifndef PSAUX_H_
@@ -35,10 +35,10 @@
- /***********************************************************************/
- /* PostScript modules driver class. */
+ * PostScript modules driver class.
typedef struct PS_DriverRec_
FT_DriverRec root;
@@ -64,23 +64,27 @@ FT_BEGIN_HEADER
typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
- /* PS_Table_FuncsRec */
- /* A set of function pointers to manage PS_Table objects. */
- /* table_init :: Used to initialize a table. */
- /* table_done :: Finalizes resp. destroy a given table. */
- /* table_add :: Adds a new object to a table. */
- /* table_release :: Releases table data, then finalizes it. */
+ * PS_Table_FuncsRec
+ * A set of function pointers to manage PS_Table objects.
+ * table_init ::
+ * Used to initialize a table.
+ * table_done ::
+ * Finalizes resp. destroy a given table.
+ * table_add ::
+ * Adds a new object to a table.
+ * table_release ::
+ * Releases table data, then finalizes it.
typedef struct PS_Table_FuncsRec_
FT_Error
@@ -103,41 +107,47 @@ FT_BEGIN_HEADER
} PS_Table_FuncsRec;
- /* PS_TableRec */
- /* A PS_Table is a simple object used to store an array of objects in */
- /* a single memory block. */
- /* block :: The address in memory of the growheap's block. This */
- /* can change between two object adds, due to */
- /* reallocation. */
- /* cursor :: The current top of the grow heap within its block. */
- /* capacity :: The current size of the heap block. Increments by */
- /* 1kByte chunks. */
- /* init :: Set to 0xDEADBEEF if `elements' and `lengths' have */
- /* been allocated. */
- /* max_elems :: The maximum number of elements in table. */
- /* num_elems :: The current number of elements in table. */
- /* elements :: A table of element addresses within the block. */
- /* lengths :: A table of element sizes within the block. */
- /* memory :: The object used for memory operations */
- /* (alloc/realloc). */
- /* funcs :: A table of method pointers for this object. */
+ * PS_TableRec
+ * A PS_Table is a simple object used to store an array of objects in a
+ * single memory block.
+ * block ::
+ * The address in memory of the growheap's block. This can change
+ * between two object adds, due to reallocation.
+ * cursor ::
+ * The current top of the grow heap within its block.
+ * capacity ::
+ * The current size of the heap block. Increments by 1kByte chunks.
+ * init ::
+ * Set to 0xDEADBEEF if 'elements' and 'lengths' have been allocated.
+ * max_elems ::
+ * The maximum number of elements in table.
+ * num_elems ::
+ * The current number of elements in table.
+ * elements ::
+ * A table of element addresses within the block.
+ * lengths ::
+ * A table of element sizes within the block.
+ * The object used for memory operations (alloc/realloc).
+ * funcs ::
+ * A table of method pointers for this object.
typedef struct PS_TableRec_
FT_Byte* block; /* current memory block */
@@ -425,27 +435,33 @@ FT_BEGIN_HEADER
} PS_Parser_FuncsRec;
- /* PS_ParserRec */
- /* A PS_Parser is an object used to parse a Type 1 font very quickly. */
- /* cursor :: The current position in the text. */
- /* base :: Start of the processed text. */
- /* limit :: End of the processed text. */
- /* error :: The last error returned. */
- /* memory :: The object used for memory operations (alloc/realloc). */
- /* funcs :: A table of functions for the parser. */
+ * PS_ParserRec
+ * A PS_Parser is an object used to parse a Type 1 font very quickly.
+ * The current position in the text.
+ * base ::
+ * Start of the processed text.
+ * limit ::
+ * End of the processed text.
+ * error ::
+ * The last error returned.
+ * A table of functions for the parser.
typedef struct PS_ParserRec_
FT_Byte* cursor;
@@ -484,51 +500,67 @@ FT_BEGIN_HEADER
} PS_Builder_FuncsRec;
- /* <Structure> */
- /* PS_Builder */
- /* A structure used during glyph loading to store its outline. */
- /* memory :: The current memory object. */
- /* face :: The current face object. */
- /* glyph :: The current glyph slot. */
- /* loader :: XXX */
- /* base :: The base glyph outline. */
- /* current :: The current glyph outline. */
- /* pos_x :: The horizontal translation (if composite glyph). */
- /* pos_y :: The vertical translation (if composite glyph). */
- /* left_bearing :: The left side bearing point. */
- /* advance :: The horizontal advance vector. */
- /* bbox :: Unused. */
- /* path_begun :: A flag which indicates that a new path has begun. */
- /* load_points :: If this flag is not set, no points are loaded. */
- /* no_recurse :: Set but not used. */
- /* metrics_only :: A boolean indicating that we only want to compute */
- /* the metrics of a given glyph, not load all of its */
- /* points. */
- /* is_t1 :: Set if current font type is Type 1. */
- /* funcs :: An array of function pointers for the builder. */
+ * PS_Builder
+ * A structure used during glyph loading to store its outline.
+ * The current memory object.
+ * The current face object.
+ * glyph ::
+ * The current glyph slot.
+ * loader ::
+ * XXX
+ * The base glyph outline.
+ * current ::
+ * The current glyph outline.
+ * pos_x ::
+ * The horizontal translation (if composite glyph).
+ * pos_y ::
+ * The vertical translation (if composite glyph).
+ * left_bearing ::
+ * The left side bearing point.
+ * advance ::
+ * The horizontal advance vector.
+ * bbox ::
+ * Unused.
+ * path_begun ::
+ * A flag which indicates that a new path has begun.
+ * load_points ::
+ * If this flag is not set, no points are loaded.
+ * no_recurse ::
+ * Set but not used.
+ * metrics_only ::
+ * A boolean indicating that we only want to compute the metrics of a
+ * given glyph, not load all of its points.
+ * is_t1 ::
+ * Set if current font type is Type 1.
+ * An array of function pointers for the builder.
struct PS_Builder_
FT_Memory memory;
@@ -729,54 +761,70 @@ FT_BEGIN_HEADER
} T1_ParseState;
- /* T1_BuilderRec */
- /* max_points :: maximum points in builder outline */
- /* max_contours :: Maximum number of contours in builder outline. */
- /* parse_state :: An enumeration which controls the charstring */
- /* parsing state. */
+ * T1_BuilderRec
+ * max_points ::
+ * maximum points in builder outline
+ * max_contours ::
+ * Maximum number of contours in builder outline.
+ * parse_state ::
+ * An enumeration which controls the charstring parsing state.
typedef struct T1_BuilderRec_
@@ -817,19 +865,19 @@ FT_BEGIN_HEADER
- /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
- /* calls during glyph loading. */
+ * T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine
+ * calls during glyph loading.
#define T1_MAX_SUBRS_CALLS 8
- /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
- /* minimum of 16 is required. */
+ * T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A
+ * minimum of 16 is required.
#define T1_MAX_CHARSTRINGS_OPERANDS 32
#endif /* 0 */
@@ -993,53 +1041,70 @@ FT_BEGIN_HEADER
} CFF_Builder_FuncsRec;
- /* CFF_Builder */
- /* loader :: The current glyph loader. */
- /* hints_funcs :: Auxiliary pointer for hinting. */
- /* hints_globals :: Auxiliary pointer for hinting. */
+ * CFF_Builder
+ * The current glyph loader.
+ * hints_funcs ::
+ * Auxiliary pointer for hinting.
+ * hints_globals ::
struct CFF_Builder_
@@ -1211,25 +1276,27 @@ FT_BEGIN_HEADER
typedef struct AFM_StreamRec_* AFM_Stream;
- /* AFM_ParserRec */
- /* An AFM_Parser is a parser for the AFM files. */
- /* memory :: The object used for memory operations (alloc and */
- /* realloc). */
- /* stream :: This is an opaque object. */
- /* FontInfo :: The result will be stored here. */
- /* get_index :: A user provided function to get a glyph index by its */
- /* name. */
+ * AFM_ParserRec
+ * An AFM_Parser is a parser for the AFM files.
+ * The object used for memory operations (alloc and realloc).
+ * This is an opaque object.
+ * FontInfo ::
+ * The result will be stored here.
+ * get_index ::
+ * A user provided function to get a glyph index by its name.
typedef struct AFM_ParserRec_
@@ -1,21 +1,21 @@
-/* pshints.h */
-/* Interface to Postscript-specific (Type 1 and Type 2) hints */
-/* recorders (specification only). These are used to support native */
-/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
+ * pshints.h
+ * Interface to Postscript-specific (Type 1 and Type 2) hints
+ * recorders (specification only). These are used to support native
+ * T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
#ifndef PSHINTS_H_
@@ -73,7 +73,7 @@ FT_BEGIN_HEADER
* T1_Hints
@@ -86,16 +86,16 @@ FT_BEGIN_HEADER
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally
* achieved through the following scheme:
- * - Open a new hint recording session by calling the `open' method.
+ * - Open a new hint recording session by calling the 'open' method.
* This rewinds the recorder and prepare it for new input.
* - For each hint found in the glyph charstring, call the corresponding
- * method (`stem', `stem3', or `reset'). Note that these functions do
+ * method ('stem', 'stem3', or 'reset'). Note that these functions do
* not return an error code.
- * - Close the recording session by calling the `close' method. It
- * returns an error code if the hints were invalid or something
- * strange happened (e.g., memory shortage).
+ * - Close the recording session by calling the 'close' method. It
+ * returns an error code if the hints were invalid or something strange
+ * happened (e.g., memory shortage).
* The hints accumulated in the object can later be used by the
* PostScript hinter.
@@ -104,7 +104,7 @@ FT_BEGIN_HEADER
typedef struct T1_HintsRec_* T1_Hints;
* T1_Hints_Funcs
@@ -117,7 +117,7 @@ FT_BEGIN_HEADER
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
* T1_Hints_OpenFunc
@@ -139,14 +139,14 @@ FT_BEGIN_HEADER
(*T1_Hints_OpenFunc)( T1_Hints hints );
* T1_Hints_SetStemFunc
* A method of the @T1_Hints class used to record a new horizontal or
- * vertical stem. This corresponds to the Type 1 `hstem' and `vstem'
+ * vertical stem. This corresponds to the Type 1 'hstem' and 'vstem'
* operators.
@@ -164,15 +164,15 @@ FT_BEGIN_HEADER
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1).
- * `coords[0]' is the absolute stem position (lowest coordinate);
- * `coords[1]' is the length.
+ * 'coords[0]' is the absolute stem position (lowest coordinate);
+ * 'coords[1]' is the length.
* The length can be negative, in which case it must be either -20 or
- * -21. It is interpreted as a `ghost' stem, according to the Type 1
+ * -21. It is interpreted as a 'ghost' stem, according to the Type 1
* specification.
- * If the length is -21 (corresponding to a bottom ghost stem), then
- * the real stem position is `coords[0]+coords[1]'.
+ * If the length is -21 (corresponding to a bottom ghost stem), then the
+ * real stem position is 'coords[0]+coords[1]'.
@@ -181,7 +181,7 @@ FT_BEGIN_HEADER
* T1_Hints_SetStem3Func
@@ -215,7 +215,7 @@ FT_BEGIN_HEADER
* T1_Hints_ResetFunc
@@ -238,7 +238,7 @@ FT_BEGIN_HEADER
FT_UInt end_point );
* T1_Hints_CloseFunc
* T1_Hints_ApplyFunc
@@ -297,7 +297,7 @@ FT_BEGIN_HEADER
* On input, all points within the outline are in font coordinates. On
* output, they are in 1/64th of pixels.
- * The scaling transformation is taken from the `globals' object which
+ * The scaling transformation is taken from the 'globals' object which
* must correspond to the same font as the glyph.
@@ -308,7 +308,7 @@ FT_BEGIN_HEADER
FT_Render_Mode hint_mode );
* T1_Hints_FuncsRec
@@ -360,7 +360,7 @@ FT_BEGIN_HEADER
* T2_Hints
@@ -373,16 +373,16 @@ FT_BEGIN_HEADER
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally
- * method (`stems', `hintmask', `counters'). Note that these
- * functions do not return an error code.
+ * method ('stems', 'hintmask', 'counters'). Note that these functions
+ * do not return an error code.
* Postscript hinter.
@@ -391,7 +391,7 @@ FT_BEGIN_HEADER
typedef struct T2_HintsRec_* T2_Hints;
* T2_Hints_Funcs
@@ -404,7 +404,7 @@ FT_BEGIN_HEADER
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
* T2_Hints_OpenFunc
@@ -426,7 +426,7 @@ FT_BEGIN_HEADER
(*T2_Hints_OpenFunc)( T2_Hints hints );
* T2_Hints_StemsFunc
@@ -434,7 +434,7 @@ FT_BEGIN_HEADER
* A method of the @T2_Hints class used to set the table of stems in
* either the vertical or horizontal dimension. Equivalent to the
- * `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
+ * 'hstem', 'vstem', 'hstemhm', and 'vstemhm' Type 2 operators.
* hints ::
@@ -447,18 +447,18 @@ FT_BEGIN_HEADER
* The number of stems.
* coords ::
- * An array of `count' (position,length) pairs in 16.16 format.
+ * An array of 'count' (position,length) pairs in 16.16 format.
- * There are `2*count' elements in the `coords' array. Each even
- * element is an absolute position in font units, each odd element is a
- * length in font units.
+ * There are '2*count' elements in the 'coords' array. Each even element
+ * is an absolute position in font units, each odd element is a length in
+ * font units.
- * A length can be negative, in which case it must be either -20 or
+ * A length can be negative, in which case it must be either -20 or -21.
+ * It is interpreted as a 'ghost' stem, according to the Type 1
@@ -469,22 +469,22 @@ FT_BEGIN_HEADER
FT_Fixed* coordinates );
* T2_Hints_MaskFunc
* A method of the @T2_Hints class used to set a given hintmask (this
- * corresponds to the `hintmask' Type 2 operator).
+ * corresponds to the 'hintmask' Type 2 operator).
* A handle to the Type 2 hints recorder.
* end_point ::
- * The glyph index of the last point to which the previously defined
- * or activated hints apply.
+ * The glyph index of the last point to which the previously defined or
+ * activated hints apply.
* bit_count ::
* The number of bits in the hint mask.
@@ -494,13 +494,13 @@ FT_BEGIN_HEADER
* If the hintmask starts the charstring (before any glyph point
- * definition), the value of `end_point' should be 0.
+ * definition), the value of `end_point` should be 0.
- * `bit_count' is the number of meaningful bits in the `bytes' array; it
+ * `bit_count` is the number of meaningful bits in the 'bytes' array; it
* must be equal to the total number of hints defined so far (i.e.,
* horizontal+verticals).
- * The `bytes' array can come directly from the Type 2 charstring and
+ * The 'bytes' array can come directly from the Type 2 charstring and
* respects the same format.
@@ -511,14 +511,14 @@ FT_BEGIN_HEADER
const FT_Byte* bytes );
* T2_Hints_CounterFunc
- * A method of the @T2_Hints class used to set a given counter mask
- * (this corresponds to the `hintmask' Type 2 operator).
+ * A method of the @T2_Hints class used to set a given counter mask (this
@@ -536,13 +536,13 @@ FT_BEGIN_HEADER
@@ -552,7 +552,7 @@ FT_BEGIN_HEADER
* T2_Hints_CloseFunc
@@ -581,15 +581,14 @@ FT_BEGIN_HEADER
* T2_Hints_ApplyFunc
* A method of the @T2_Hints class used to apply hints to the
- * corresponding glyph outline. Must be called after the `close'
- * method.
+ * corresponding glyph outline. Must be called after the 'close' method.
@@ -611,7 +610,7 @@ FT_BEGIN_HEADER
* must correspond to the same font than the glyph.
@@ -622,7 +621,7 @@ FT_BEGIN_HEADER
* T2_Hints_FuncsRec
@@ -680,8 +679,6 @@ FT_BEGIN_HEADER
typedef PSHinter_Interface* PSHinter_Service;
#define FT_DEFINE_PSHINTER_INTERFACE( \
get_globals_funcs_, \
@@ -694,25 +691,6 @@ FT_BEGIN_HEADER
get_t2_funcs_ \
-#define FT_DEFINE_PSHINTER_INTERFACE( \
- get_globals_funcs_, \
- get_t1_funcs_, \
- get_t2_funcs_ ) \
- PSHinter_Interface* clazz ) \
- clazz->get_globals_funcs = get_globals_funcs_; \
- clazz->get_t1_funcs = get_t1_funcs_; \
- clazz->get_t2_funcs = get_t2_funcs_; \
-/* svbdf.h */
-/* The FreeType BDF services (specification). */
+ * svbdf.h
+ * The FreeType BDF services (specification).
#ifndef SVBDF_H_
@@ -46,8 +46,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_BDFRec( class_, \
get_charset_id_, \
get_property_ ) \
@@ -56,20 +54,6 @@ FT_BEGIN_HEADER
get_charset_id_, get_property_ \
-#define FT_DEFINE_SERVICE_BDFRec( class_, \
- get_charset_id_, \
- get_property_ ) \
- FT_Init_Class_ ## class_( FT_Service_BDFRec* clazz ) \
- clazz->get_charset_id = get_charset_id_; \
- clazz->get_property = get_property_; \
-/* svcfftl.h */
-/* The FreeType CFF tables loader service (specification). */
+ * svcfftl.h
+ * The FreeType CFF tables loader service (specification).
#ifndef SVCFFTL_H_
@@ -65,8 +65,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
@@ -82,26 +80,6 @@ FT_BEGIN_HEADER
blend_build_vector_ \
-#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
- get_standard_encoding_, \
- load_private_dict_, \
- fd_select_get_, \
- blend_check_vector_, \
- blend_build_vector_ ) \
- FT_Init_Class_ ## class_( FT_Service_CFFLoadRec* clazz ) \
- clazz->get_standard_encoding = get_standard_encoding_; \
- clazz->load_private_dict = load_private_dict_; \
- clazz->fd_select_get = fd_select_get_; \
- clazz->blend_check_vector = blend_check_vector_; \
- clazz->blend_build_vector = blend_build_vector_; \
-/* svcid.h */
-/* The FreeType CID font services (specification). */
-/* Derek Clegg and Michael Toftdal. */
+ * svcid.h
+ * The FreeType CID font services (specification).
+ * Derek Clegg and Michael Toftdal.
#ifndef SVCID_H_
@@ -48,8 +48,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_CIDREC( class_, \
get_ros_, \
get_is_cid_, \
@@ -59,25 +57,6 @@ FT_BEGIN_HEADER
get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
-#define FT_DEFINE_SERVICE_CIDREC( class_, \
- get_ros_, \
- get_is_cid_, \
- get_cid_from_glyph_index_ ) \
- FT_Service_CIDRec* clazz ) \
- clazz->get_ros = get_ros_; \
- clazz->get_is_cid = get_is_cid_; \
- clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
-/* svfntfmt.h */
-/* The FreeType font format service (specification only). */
+ * svfntfmt.h
+ * The FreeType font format service (specification only).
#ifndef SVFNTFMT_H_
@@ -26,9 +26,9 @@ FT_BEGIN_HEADER
- * A trivial service used to return the name of a face's font driver,
- * according to the XFree86 nomenclature. Note that the service data
- * is a simple constant string pointer.
+ * A trivial service used to return the name of a face's font driver,
+ * according to the XFree86 nomenclature. Note that the service data is a
+ * simple constant string pointer.
#define FT_SERVICE_ID_FONT_FORMAT "font-format"
-/* svgldict.h */
-/* The FreeType glyph dictionary services (specification). */
+ * svgldict.h
+ * The FreeType glyph dictionary services (specification).
#ifndef SVGLDICT_H_
@@ -26,8 +26,8 @@ FT_BEGIN_HEADER
- * A service used to retrieve glyph names, as well as to find the
- * index of a given glyph name in a font.
+ * A service used to retrieve glyph names, as well as to find the index of
+ * a given glyph name in a font.
@@ -52,8 +52,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_ ) \
@@ -62,23 +60,6 @@ FT_BEGIN_HEADER
get_name_, name_index_ \
-#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
- get_name_, \
- name_index_ ) \
- FT_Service_GlyphDictRec* clazz ) \
- clazz->get_name = get_name_; \
- clazz->name_index = name_index_; \
-/* svgxval.h */
-/* Masatake YAMATO, Red Hat K.K., */
+ * svgxval.h
+ * Masatake YAMATO, Red Hat K.K.,
#ifndef SVGXVAL_H_
-/* svkern.h */
-/* The FreeType Kerning service (specification). */
+ * svkern.h
+ * The FreeType Kerning service (specification).
#ifndef SVKERN_H_
-/* svmetric.h */
-/* The FreeType services for metrics variations (specification). */
-/* Copyright 2016-2018 by */
+ * svmetric.h
+ * The FreeType services for metrics variations (specification).
+ * Copyright 2016-2019 by
#ifndef SVMETRIC_H_
@@ -26,7 +26,7 @@ FT_BEGIN_HEADER
- * A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
+ * A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
@@ -93,8 +93,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
@@ -116,32 +114,6 @@ FT_BEGIN_HEADER
metrics_adjust_ \
-#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
- hadvance_adjust_, \
- lsb_adjust_, \
- rsb_adjust_, \
- vadvance_adjust_, \
- tsb_adjust_, \
- bsb_adjust_, \
- vorg_adjust_, \
- metrics_adjust_ ) \
- FT_Init_Class_ ## class_( FT_Service_MetricsVariationsRec* clazz ) \
- clazz->hadvance_adjust = hadvance_adjust_; \
- clazz->lsb_adjust = lsb_adjust_; \
- clazz->rsb_adjust = rsb_adjust_; \
- clazz->vadvance_adjust = vadvance_adjust_; \
- clazz->tsb_adjust = tsb_adjust_; \
- clazz->bsb_adjust = bsb_adjust_; \
- clazz->vorg_adjust = vorg_adjust_; \
- clazz->metrics_adjust = metrics_adjust_; \
-/* svmm.h */
-/* The FreeType Multiple Masters and GX var services (specification). */
+ * svmm.h
+ * The FreeType Multiple Masters and GX var services (specification).
#ifndef SVMM_H_
- * A service used to manage multiple-masters data in a given face.
+ * A service used to manage multiple-masters data in a given face.
- * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
+ * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
@@ -86,81 +86,65 @@ FT_BEGIN_HEADER
(*FT_Done_Blend_Func)( FT_Face );
+ typedef FT_Error
+ (*FT_Set_MM_WeightVector_Func)( FT_Face face,
+ FT_Fixed* weight_vector );
+ (*FT_Get_MM_WeightVector_Func)( FT_Face face,
FT_DEFINE_SERVICE( MultiMasters )
- FT_Get_MM_Func get_mm;
- FT_Set_MM_Design_Func set_mm_design;
- FT_Set_MM_Blend_Func set_mm_blend;
- FT_Get_MM_Blend_Func get_mm_blend;
- FT_Get_MM_Var_Func get_mm_var;
- FT_Set_Var_Design_Func set_var_design;
- FT_Get_Var_Design_Func get_var_design;
- FT_Set_Instance_Func set_instance;
+ FT_Get_MM_Func get_mm;
+ FT_Set_MM_Design_Func set_mm_design;
+ FT_Set_MM_Blend_Func set_mm_blend;
+ FT_Get_MM_Blend_Func get_mm_blend;
+ FT_Get_MM_Var_Func get_mm_var;
+ FT_Set_Var_Design_Func set_var_design;
+ FT_Get_Var_Design_Func get_var_design;
+ FT_Set_Instance_Func set_instance;
+ FT_Set_MM_WeightVector_Func set_mm_weightvector;
+ FT_Get_MM_WeightVector_Func get_mm_weightvector;
/* for internal use; only needed for code sharing between modules */
- FT_Get_Var_Blend_Func get_var_blend;
- FT_Done_Blend_Func done_blend;
+ FT_Get_Var_Blend_Func get_var_blend;
+ FT_Done_Blend_Func done_blend;
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_blend_, \
- get_mm_var_, \
- set_var_design_, \
- get_var_design_, \
- set_instance_, \
- get_var_blend_, \
- done_blend_ ) \
- static const FT_Service_MultiMastersRec class_ = \
- done_blend_ \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ set_instance_, \
+ set_weightvector_, \
+ get_weightvector_, \
+ get_var_blend_, \
+ done_blend_ ) \
+ static const FT_Service_MultiMastersRec class_ = \
+ done_blend_ \
- FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
- clazz->get_mm = get_mm_; \
- clazz->set_mm_design = set_mm_design_; \
- clazz->set_mm_blend = set_mm_blend_; \
- clazz->get_mm_blend = get_mm_blend_; \
- clazz->get_mm_var = get_mm_var_; \
- clazz->set_var_design = set_var_design_; \
- clazz->get_var_design = get_var_design_; \
- clazz->set_instance = set_instance_; \
- clazz->get_var_blend = get_var_blend_; \
- clazz->done_blend = done_blend_; \
-/* svotval.h */
-/* The FreeType OpenType validation service (specification). */
+ * svotval.h
+ * The FreeType OpenType validation service (specification).
#ifndef SVOTVAL_H_
-/* svpfr.h */
-/* Internal PFR service functions (specification). */
+ * svpfr.h
+ * Internal PFR service functions (specification).
#ifndef SVPFR_H_
-/* svpostnm.h */
-/* The FreeType PostScript name services (specification). */
+ * svpostnm.h
+ * The FreeType PostScript name services (specification).
#ifndef SVPOSTNM_H_
@@ -25,13 +25,13 @@
- * A trivial service used to retrieve the PostScript name of a given
- * font when available. The `get_name' field should never be NULL.
+ * A trivial service used to retrieve the PostScript name of a given font
+ * when available. The `get_name' field should never be NULL.
- * The corresponding function can return NULL to indicate that the
- * PostScript name is not available.
+ * The corresponding function can return NULL to indicate that the
+ * PostScript name is not available.
- * The name is owned by the face and will be destroyed with it.
+ * The name is owned by the face and will be destroyed with it.
#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name"
@@ -47,28 +47,12 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
static const FT_Service_PsFontNameRec class_ = \
{ \
get_ps_font_name_ \
-#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
- FT_Service_PsFontNameRec* clazz ) \
- clazz->get_ps_font_name = get_ps_font_name_; \
-/* svprop.h */
-/* The FreeType property service (specification). */
-/* Copyright 2012-2018 by */
+ * svprop.h
+ * The FreeType property service (specification).
+ * Copyright 2012-2019 by
#ifndef SVPROP_H_
@@ -45,8 +45,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
set_property_, \
get_property_ \
-#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
- set_property_, \
- FT_Init_Class_ ## class_( FT_Service_PropertiesRec* clazz ) \
- clazz->set_property = set_property_; \
-/* svpscmap.h */
-/* The FreeType PostScript charmap service (specification). */
+ * svpscmap.h
+ * The FreeType PostScript charmap service (specification).
#ifndef SVPSCMAP_H_
@@ -29,27 +29,26 @@ FT_BEGIN_HEADER
- * Adobe glyph name to unicode value.
+ * Adobe glyph name to unicode value.
typedef FT_UInt32
(*PS_Unicode_ValueFunc)( const char* glyph_name );
- * Macintosh name id to glyph name. NULL if invalid index.
+ * Macintosh name id to glyph name. NULL if invalid index.
typedef const char*
(*PS_Macintosh_NameFunc)( FT_UInt name_index );
- * Adobe standard string ID to glyph name. NULL if invalid index.
+ * Adobe standard string ID to glyph name. NULL if invalid index.
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
- * Simple unicode -> glyph index charmap built from font glyph names
- * table.
+ * Simple unicode -> glyph index charmap built from font glyph names table.
typedef struct PS_UniMap_
@@ -71,16 +70,16 @@ FT_BEGIN_HEADER
- * A function which returns a glyph name for a given index. Returns
- * NULL if invalid index.
+ * A function which returns a glyph name for a given index. Returns NULL
+ * if invalid index.
(*PS_GetGlyphNameFunc)( FT_Pointer data,
FT_UInt string_index );
- * A function used to release the glyph name returned by
- * PS_GetGlyphNameFunc, when needed
+ * A function used to release the glyph name returned by
+ * PS_GetGlyphNameFunc, when needed
(*PS_FreeGlyphNameFunc)( FT_Pointer data,
@@ -118,8 +117,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
unicode_value_, \
unicodes_init_, \
@@ -136,35 +133,6 @@ FT_BEGIN_HEADER
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
-#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
- unicode_value_, \
- unicodes_init_, \
- unicodes_char_index_, \
- unicodes_char_next_, \
- macintosh_name_, \
- adobe_std_strings_, \
- adobe_std_encoding_, \
- adobe_expert_encoding_ ) \
- FT_Service_PsCMapsRec* clazz ) \
- clazz->unicode_value = unicode_value_; \
- clazz->unicodes_init = unicodes_init_; \
- clazz->unicodes_char_index = unicodes_char_index_; \
- clazz->unicodes_char_next = unicodes_char_next_; \
- clazz->macintosh_name = macintosh_name_; \
- clazz->adobe_std_strings = adobe_std_strings_; \
- clazz->adobe_std_encoding = adobe_std_encoding_; \
- clazz->adobe_expert_encoding = adobe_expert_encoding_; \
-/* svpsinfo.h */
-/* The FreeType PostScript info service (specification). */
+ * svpsinfo.h
+ * The FreeType PostScript info service (specification).
#ifndef SVPSINFO_H_
@@ -62,8 +62,6 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
get_font_info_, \
ps_get_font_extra_, \
@@ -76,29 +74,6 @@ FT_BEGIN_HEADER
get_font_private_, get_font_value_ \
-#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
- get_font_info_, \
- ps_get_font_extra_, \
- has_glyph_names_, \
- get_font_private_, \
- get_font_value_ ) \
- FT_Service_PsInfoRec* clazz ) \
- clazz->ps_get_font_info = get_font_info_; \
- clazz->ps_get_font_extra = ps_get_font_extra_; \
- clazz->ps_has_glyph_names = has_glyph_names_; \
- clazz->ps_get_font_private = get_font_private_; \
- clazz->ps_get_font_value = get_font_value_; \
-/* svsfnt.h */
-/* The FreeType SFNT table loading service (specification). */
+ * svsfnt.h
+ * The FreeType SFNT table loading service (specification).
#ifndef SVSFNT_H_
@@ -27,7 +27,7 @@ FT_BEGIN_HEADER
- * SFNT table loading service.
+ * SFNT table loading service.
#define FT_SERVICE_ID_SFNT_TABLE "sfnt-table"
@@ -70,27 +70,12 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
static const FT_Service_SFNT_TableRec class_ = \
load_, get_, info_ \
-#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
- FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec* clazz ) \
- clazz->load_table = load_; \
- clazz->get_table = get_; \
- clazz->table_info = info_; \
-/* svttcmap.h */
-/* The FreeType TrueType/sfnt cmap extra information service. */
-/* Masatake YAMATO, Redhat K.K., */
+ * svttcmap.h
+ * The FreeType TrueType/sfnt cmap extra information service.
+ * Masatake YAMATO, Redhat K.K.,
/* Development of this service is support of
Information-technology Promotion Agency, Japan. */
@@ -32,29 +32,28 @@ FT_BEGIN_HEADER
#define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
- /* TT_CMapInfo */
- /* A structure used to store TrueType/sfnt specific cmap information */
- /* which is not covered by the generic @FT_CharMap structure. This */
- /* structure can be accessed with the @FT_Get_TT_CMap_Info function. */
- /* language :: */
- /* The language ID used in Mac fonts. Definitions of values are in */
- /* `ttnameid.h'. */
- /* format :: */
- /* The cmap format. OpenType 1.6 defines the formats 0 (byte */
- /* encoding table), 2~(high-byte mapping through table), 4~(segment */
- /* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */
- /* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */
- /* coverage), 13~(last resort font), and 14 (Unicode Variation */
- /* Sequences). */
+ * TT_CMapInfo
+ * A structure used to store TrueType/sfnt specific cmap information
+ * which is not covered by the generic @FT_CharMap structure. This
+ * structure can be accessed with the @FT_Get_TT_CMap_Info function.
+ * language ::
+ * The language ID used in Mac fonts. Definitions of values are in
+ * `ttnameid.h`.
+ * The cmap format. OpenType 1.6 defines the formats 0 (byte encoding
+ * table), 2~(high-byte mapping through table), 4~(segment mapping to
+ * delta values), 6~(trimmed table mapping), 8~(mixed 16-bit and 32-bit
+ * coverage), 10~(trimmed array), 12~(segmented coverage), 13~(last
+ * resort font), and 14 (Unicode Variation Sequences).
typedef struct TT_CMapInfo_
FT_ULong language;
@@ -73,7 +72,6 @@ FT_BEGIN_HEADER
TT_CMap_Info_GetFunc get_cmap_info;
#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
static const FT_Service_TTCMapsRec class_ = \
@@ -81,20 +79,6 @@ FT_BEGIN_HEADER
get_cmap_info_ \
-#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
- FT_Service_TTCMapsRec* clazz ) \
- clazz->get_cmap_info = get_cmap_info_; \
-/* svtteng.h */
-/* The FreeType TrueType engine query service (specification). */
+ * svtteng.h
+ * The FreeType TrueType engine query service (specification).
#ifndef SVTTENG_H_
#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
-/* svttglyf.h */
-/* The FreeType TrueType glyph service. */
-/* David Turner. */
+ * svttglyf.h
+ * The FreeType TrueType glyph service.
+ * David Turner.
#ifndef SVTTGLYF_H_
#define SVTTGLYF_H_
@@ -39,25 +39,12 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
static const FT_Service_TTGlyfRec class_ = \
get_location_ \
-#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
- FT_Init_Class_ ## class_( FT_Service_TTGlyfRec* clazz ) \
- clazz->get_location = get_location_; \
-/* svwinfnt.h */
-/* The FreeType Windows FNT/FONT service (specification). */
+ * svwinfnt.h
+ * The FreeType Windows FNT/FONT service (specification).
#ifndef SVWINFNT_H_
-/* t1types.h */
-/* Basic Type1/Type2 type definitions and interface (specification */
+ * t1types.h
+ * Basic Type1/Type2 type definitions and interface (specification
#ifndef T1TYPES_H_
@@ -45,28 +45,31 @@ FT_BEGIN_HEADER
- /* T1_EncodingRec */
- /* A structure modeling a custom encoding. */
- /* num_chars :: The number of character codes in the encoding. */
- /* Usually 256. */
- /* code_first :: The lowest valid character code in the encoding. */
- /* code_last :: The highest valid character code in the encoding */
- /* + 1. When equal to code_first there are no valid */
- /* character codes. */
- /* char_index :: An array of corresponding glyph indices. */
- /* char_name :: An array of corresponding glyph names. */
+ * T1_EncodingRec
+ * A structure modeling a custom encoding.
+ * num_chars ::
+ * The number of character codes in the encoding. Usually 256.
+ * code_first ::
+ * The lowest valid character code in the encoding.
+ * code_last ::
+ * The highest valid character code in the encoding + 1. When equal to
+ * code_first there are no valid character codes.
+ * char_index ::
+ * An array of corresponding glyph indices.
+ * char_name ::
+ * An array of corresponding glyph names.
typedef struct T1_EncodingRecRec_
FT_Int num_chars;
-/* t1tables.h */
-/* Basic Type 1/Type 2 tables definitions and interface (specification */
+ * t1tables.h
+ * Basic Type 1/Type 2 tables definitions and interface (specification
#ifndef T1TABLES_H_
@@ -34,58 +34,58 @@
- /* type1_tables */
- /* Type 1 Tables */
- /* Type~1 (PostScript) specific font tables. */
- /* This section contains the definition of Type 1-specific tables, */
- /* including structures related to other PostScript font formats. */
- /* PS_FontInfoRec */
- /* PS_FontInfo */
- /* PS_PrivateRec */
- /* PS_Private */
- /* CID_FaceDictRec */
- /* CID_FaceDict */
- /* CID_FaceInfoRec */
- /* CID_FaceInfo */
- /* FT_Has_PS_Glyph_Names */
- /* FT_Get_PS_Font_Info */
- /* FT_Get_PS_Font_Private */
- /* FT_Get_PS_Font_Value */
- /* T1_Blend_Flags */
- /* T1_EncodingType */
- /* PS_Dict_Keys */
+ * Type 1 Tables
+ * Type~1-specific font tables.
+ * This section contains the definition of Type~1-specific tables,
+ * including structures related to other PostScript font formats.
+ * PS_FontInfoRec
+ * PS_FontInfo
+ * PS_PrivateRec
+ * PS_Private
+ * CID_FaceDictRec
+ * CID_FaceDict
+ * CID_FaceInfoRec
+ * CID_FaceInfo
+ * FT_Has_PS_Glyph_Names
+ * FT_Get_PS_Font_Info
+ * FT_Get_PS_Font_Private
+ * FT_Get_PS_Font_Value
+ * T1_Blend_Flags
+ * T1_EncodingType
+ * PS_Dict_Keys
/* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
/* structures in order to support Multiple Master fonts. */
- /* A structure used to model a Type~1 or Type~2 FontInfo dictionary. */
- /* Note that for Multiple Master fonts, each instance has its own */
- /* FontInfo dictionary. */
+ * A structure used to model a Type~1 or Type~2 FontInfo dictionary.
+ * Note that for Multiple Master fonts, each instance has its own
+ * FontInfo dictionary.
typedef struct PS_FontInfoRec_
FT_String* version;
@@ -101,40 +101,39 @@ FT_BEGIN_HEADER
} PS_FontInfoRec;
- /* A handle to a @PS_FontInfoRec structure. */
+ * A handle to a @PS_FontInfoRec structure.
typedef struct PS_FontInfoRec_* PS_FontInfo;
- /* T1_FontInfo */
- /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
- /* kept to maintain source compatibility between various versions of */
- /* FreeType. */
+ * T1_FontInfo
+ * This type is equivalent to @PS_FontInfoRec. It is deprecated but kept
+ * to maintain source compatibility between various versions of FreeType.
typedef PS_FontInfoRec T1_FontInfo;
- /* A structure used to model a Type~1 or Type~2 private dictionary. */
- /* Private dictionary. */
+ * A structure used to model a Type~1 or Type~2 private dictionary. Note
+ * that for Multiple Master fonts, each instance has its own Private
+ * dictionary.
typedef struct PS_PrivateRec_
FT_Int unique_id;
@@ -176,56 +175,55 @@ FT_BEGIN_HEADER
} PS_PrivateRec;
- /* A handle to a @PS_PrivateRec structure. */
+ * A handle to a @PS_PrivateRec structure.
typedef struct PS_PrivateRec_* PS_Private;
- /* T1_Private */
- /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
+ * T1_Private
+ * This type is equivalent to @PS_PrivateRec. It is deprecated but kept
typedef PS_PrivateRec T1_Private;
- /* A set of flags used to indicate which fields are present in a */
- /* given blend dictionary (font info or private). Used to support */
- /* Multiple Masters fonts. */
- /* T1_BLEND_UNDERLINE_POSITION :: */
- /* T1_BLEND_UNDERLINE_THICKNESS :: */
- /* T1_BLEND_ITALIC_ANGLE :: */
- /* T1_BLEND_BLUE_VALUES :: */
- /* T1_BLEND_OTHER_BLUES :: */
- /* T1_BLEND_STANDARD_WIDTH :: */
- /* T1_BLEND_STANDARD_HEIGHT :: */
- /* T1_BLEND_STEM_SNAP_WIDTHS :: */
- /* T1_BLEND_STEM_SNAP_HEIGHTS :: */
- /* T1_BLEND_BLUE_SCALE :: */
- /* T1_BLEND_BLUE_SHIFT :: */
- /* T1_BLEND_FAMILY_BLUES :: */
- /* T1_BLEND_FAMILY_OTHER_BLUES :: */
- /* T1_BLEND_FORCE_BOLD :: */
+ * A set of flags used to indicate which fields are present in a given
+ * blend dictionary (font info or private). Used to support Multiple
+ * Masters fonts.
+ * T1_BLEND_UNDERLINE_POSITION ::
+ * T1_BLEND_UNDERLINE_THICKNESS ::
+ * T1_BLEND_ITALIC_ANGLE ::
+ * T1_BLEND_BLUE_VALUES ::
+ * T1_BLEND_OTHER_BLUES ::
+ * T1_BLEND_STANDARD_WIDTH ::
+ * T1_BLEND_STANDARD_HEIGHT ::
+ * T1_BLEND_STEM_SNAP_WIDTHS ::
+ * T1_BLEND_STEM_SNAP_HEIGHTS ::
+ * T1_BLEND_BLUE_SCALE ::
+ * T1_BLEND_BLUE_SHIFT ::
+ * T1_BLEND_FAMILY_BLUES ::
+ * T1_BLEND_FAMILY_OTHER_BLUES ::
+ * T1_BLEND_FORCE_BOLD ::
typedef enum T1_Blend_Flags_
/* required fields in a FontInfo blend dictionary */
@@ -252,7 +250,7 @@ FT_BEGIN_HEADER
/* these constants are deprecated; use the corresponding */
- /* `T1_Blend_Flags' values instead */
+ /* `T1_Blend_Flags` values instead */
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
@@ -330,14 +328,23 @@ FT_BEGIN_HEADER
typedef PS_BlendRec T1_Blend;
- /* A structure used to represent data in a CID top-level dictionary. */
+ * A structure used to represent data in a CID top-level dictionary. In
+ * most cases, they are part of the font's '/FDArray' array. Within a
+ * CID font file, such (internal) subfont dictionaries are enclosed by
+ * '%ADOBeginFontDict' and '%ADOEndFontDict' comments.
+ * Note that `CID_FaceDictRec` misses a field for the '/FontName'
+ * keyword, specifying the subfont's name (the top-level font name is
+ * given by the '/CIDFontName' keyword). This is an oversight, but it
+ * doesn't limit the 'cid' font module's functionality because FreeType
+ * neither needs this entry nor gives access to CID subfonts.
typedef struct CID_FaceDictRec_
PS_PrivateRec private_dict;
@@ -345,8 +352,8 @@ FT_BEGIN_HEADER
FT_UInt len_buildchar;
FT_Fixed forcebold_threshold;
FT_Pos stroke_width;
- FT_Fixed expansion_factor;
+ FT_Fixed expansion_factor; /* this is a duplicate of */
+ /* `private_dict->expansion_factor' */
FT_Byte paint_type;
FT_Byte font_type;
FT_Matrix font_matrix;
@@ -359,38 +366,38 @@ FT_BEGIN_HEADER
} CID_FaceDictRec;
- /* A handle to a @CID_FaceDictRec structure. */
+ * A handle to a @CID_FaceDictRec structure.
typedef struct CID_FaceDictRec_* CID_FaceDict;
- /* CID_FontDict */
- /* This type is equivalent to @CID_FaceDictRec. It is deprecated but */
+ * CID_FontDict
+ * This type is equivalent to @CID_FaceDictRec. It is deprecated but
+ * kept to maintain source compatibility between various versions of
typedef CID_FaceDictRec CID_FontDict;
- /* A structure used to represent CID Face information. */
+ * A structure used to represent CID Face information.
typedef struct CID_FaceInfoRec_
FT_String* cid_font_name;
@@ -421,47 +428,45 @@ FT_BEGIN_HEADER
} CID_FaceInfoRec;
- /* A handle to a @CID_FaceInfoRec structure. */
+ * A handle to a @CID_FaceInfoRec structure.
typedef struct CID_FaceInfoRec_* CID_FaceInfo;
- /* CID_Info */
- /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
+ * CID_Info
+ * This type is equivalent to @CID_FaceInfoRec. It is deprecated but kept
typedef CID_FaceInfoRec CID_Info;
* FT_Has_PS_Glyph_Names
- * Return true if a given face provides reliable PostScript glyph
- * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
- * except that certain fonts (mostly TrueType) contain incorrect
- * glyph name tables.
+ * Return true if a given face provides reliable PostScript glyph names.
+ * This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
+ * certain fonts (mostly TrueType) contain incorrect glyph name tables.
* When this function returns true, the caller is sure that the glyph
* names returned by @FT_Get_Glyph_Name are reliable.
- * face handle
+ * face handle
* Boolean. True if glyph names are reliable.
@@ -471,7 +476,7 @@ FT_BEGIN_HEADER
FT_Has_PS_Glyph_Names( FT_Face face );
* FT_Get_PS_Font_Info
@@ -482,22 +487,22 @@ FT_BEGIN_HEADER
- * PostScript face handle.
+ * PostScript face handle.
* afont_info ::
- * Output font info structure pointer.
+ * Output font info structure pointer.
- * String pointers within the @PS_FontInfoRec structure are owned by
- * the face and don't need to be freed by the caller. Missing entries
- * in the font's FontInfo dictionary are represented by NULL pointers.
+ * String pointers within the @PS_FontInfoRec structure are owned by the
+ * face and don't need to be freed by the caller. Missing entries in
+ * the font's FontInfo dictionary are represented by NULL pointers.
* If the font's format is not PostScript-based, this function will
- * return the `FT_Err_Invalid_Argument' error code.
+ * return the `FT_Err_Invalid_Argument` error code.
@@ -505,7 +510,7 @@ FT_BEGIN_HEADER
PS_FontInfo afont_info );
* FT_Get_PS_Font_Private
@@ -516,11 +521,11 @@ FT_BEGIN_HEADER
* afont_private ::
- * Output private dictionary structure pointer.
+ * Output private dictionary structure pointer.
@@ -530,7 +535,7 @@ FT_BEGIN_HEADER
* the face and don't need to be freed by the caller.
* If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument' error code.
+ * the `FT_Err_Invalid_Argument` error code.
@@ -538,25 +543,24 @@ FT_BEGIN_HEADER
PS_Private afont_private );
- /* An enumeration describing the `Encoding' entry in a Type 1 */
- /* dictionary. */
- /* T1_ENCODING_TYPE_NONE :: */
- /* T1_ENCODING_TYPE_ARRAY :: */
- /* T1_ENCODING_TYPE_STANDARD :: */
- /* T1_ENCODING_TYPE_ISOLATIN1 :: */
- /* T1_ENCODING_TYPE_EXPERT :: */
- /* 2.4.8 */
+ * An enumeration describing the 'Encoding' entry in a Type 1 dictionary.
+ * T1_ENCODING_TYPE_NONE ::
+ * T1_ENCODING_TYPE_ARRAY ::
+ * T1_ENCODING_TYPE_STANDARD ::
+ * T1_ENCODING_TYPE_ISOLATIN1 ::
+ * T1_ENCODING_TYPE_EXPERT ::
+ * 2.4.8
typedef enum T1_EncodingType_
T1_ENCODING_TYPE_NONE = 0,
@@ -568,66 +572,66 @@ FT_BEGIN_HEADER
} T1_EncodingType;
- /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
- /* the Type~1 dictionary entry to retrieve. */
- /* PS_DICT_FONT_TYPE :: */
- /* PS_DICT_FONT_MATRIX :: */
- /* PS_DICT_FONT_BBOX :: */
- /* PS_DICT_PAINT_TYPE :: */
- /* PS_DICT_FONT_NAME :: */
- /* PS_DICT_UNIQUE_ID :: */
- /* PS_DICT_NUM_CHAR_STRINGS :: */
- /* PS_DICT_CHAR_STRING_KEY :: */
- /* PS_DICT_CHAR_STRING :: */
- /* PS_DICT_ENCODING_TYPE :: */
- /* PS_DICT_ENCODING_ENTRY :: */
- /* PS_DICT_NUM_SUBRS :: */
- /* PS_DICT_SUBR :: */
- /* PS_DICT_STD_HW :: */
- /* PS_DICT_STD_VW :: */
- /* PS_DICT_NUM_BLUE_VALUES :: */
- /* PS_DICT_BLUE_VALUE :: */
- /* PS_DICT_BLUE_FUZZ :: */
- /* PS_DICT_NUM_OTHER_BLUES :: */
- /* PS_DICT_OTHER_BLUE :: */
- /* PS_DICT_NUM_FAMILY_BLUES :: */
- /* PS_DICT_FAMILY_BLUE :: */
- /* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */
- /* PS_DICT_FAMILY_OTHER_BLUE :: */
- /* PS_DICT_BLUE_SCALE :: */
- /* PS_DICT_BLUE_SHIFT :: */
- /* PS_DICT_NUM_STEM_SNAP_H :: */
- /* PS_DICT_STEM_SNAP_H :: */
- /* PS_DICT_NUM_STEM_SNAP_V :: */
- /* PS_DICT_STEM_SNAP_V :: */
- /* PS_DICT_FORCE_BOLD :: */
- /* PS_DICT_RND_STEM_UP :: */
- /* PS_DICT_MIN_FEATURE :: */
- /* PS_DICT_LEN_IV :: */
- /* PS_DICT_PASSWORD :: */
- /* PS_DICT_LANGUAGE_GROUP :: */
- /* PS_DICT_VERSION :: */
- /* PS_DICT_NOTICE :: */
- /* PS_DICT_FULL_NAME :: */
- /* PS_DICT_FAMILY_NAME :: */
- /* PS_DICT_WEIGHT :: */
- /* PS_DICT_IS_FIXED_PITCH :: */
- /* PS_DICT_UNDERLINE_POSITION :: */
- /* PS_DICT_UNDERLINE_THICKNESS :: */
- /* PS_DICT_FS_TYPE :: */
- /* PS_DICT_ITALIC_ANGLE :: */
+ * An enumeration used in calls to @FT_Get_PS_Font_Value to identify the
+ * Type~1 dictionary entry to retrieve.
+ * PS_DICT_FONT_TYPE ::
+ * PS_DICT_FONT_MATRIX ::
+ * PS_DICT_FONT_BBOX ::
+ * PS_DICT_PAINT_TYPE ::
+ * PS_DICT_FONT_NAME ::
+ * PS_DICT_UNIQUE_ID ::
+ * PS_DICT_NUM_CHAR_STRINGS ::
+ * PS_DICT_CHAR_STRING_KEY ::
+ * PS_DICT_CHAR_STRING ::
+ * PS_DICT_ENCODING_TYPE ::
+ * PS_DICT_ENCODING_ENTRY ::
+ * PS_DICT_NUM_SUBRS ::
+ * PS_DICT_SUBR ::
+ * PS_DICT_STD_HW ::
+ * PS_DICT_STD_VW ::
+ * PS_DICT_NUM_BLUE_VALUES ::
+ * PS_DICT_BLUE_VALUE ::
+ * PS_DICT_BLUE_FUZZ ::
+ * PS_DICT_NUM_OTHER_BLUES ::
+ * PS_DICT_OTHER_BLUE ::
+ * PS_DICT_NUM_FAMILY_BLUES ::
+ * PS_DICT_FAMILY_BLUE ::
+ * PS_DICT_NUM_FAMILY_OTHER_BLUES ::
+ * PS_DICT_FAMILY_OTHER_BLUE ::
+ * PS_DICT_BLUE_SCALE ::
+ * PS_DICT_BLUE_SHIFT ::
+ * PS_DICT_NUM_STEM_SNAP_H ::
+ * PS_DICT_STEM_SNAP_H ::
+ * PS_DICT_NUM_STEM_SNAP_V ::
+ * PS_DICT_STEM_SNAP_V ::
+ * PS_DICT_FORCE_BOLD ::
+ * PS_DICT_RND_STEM_UP ::
+ * PS_DICT_MIN_FEATURE ::
+ * PS_DICT_LEN_IV ::
+ * PS_DICT_PASSWORD ::
+ * PS_DICT_LANGUAGE_GROUP ::
+ * PS_DICT_VERSION ::
+ * PS_DICT_NOTICE ::
+ * PS_DICT_FULL_NAME ::
+ * PS_DICT_FAMILY_NAME ::
+ * PS_DICT_WEIGHT ::
+ * PS_DICT_IS_FIXED_PITCH ::
+ * PS_DICT_UNDERLINE_POSITION ::
+ * PS_DICT_UNDERLINE_THICKNESS ::
+ * PS_DICT_FS_TYPE ::
+ * PS_DICT_ITALIC_ANGLE ::
typedef enum PS_Dict_Keys_
/* conventionally in the font dictionary */
@@ -687,7 +691,7 @@ FT_BEGIN_HEADER
} PS_Dict_Keys;
* FT_Get_PS_Font_Value
@@ -697,57 +701,57 @@ FT_BEGIN_HEADER
* key ::
- * An enumeration value representing the dictionary key to retrieve.
+ * An enumeration value representing the dictionary key to retrieve.
* idx ::
- * For array values, this specifies the index to be returned.
+ * For array values, this specifies the index to be returned.
* value ::
- * A pointer to memory into which to write the value.
+ * A pointer to memory into which to write the value.
* valen_len ::
- * The size, in bytes, of the memory supplied for the value.
+ * The size, in bytes, of the memory supplied for the value.
- * The value matching the above key, if it exists.
+ * The value matching the above key, if it exists.
- * The amount of memory (in bytes) required to hold the requested
- * value (if it exists, -1 otherwise).
+ * The amount of memory (in bytes) required to hold the requested value
+ * (if it exists, -1 otherwise).
* The values returned are not pointers into the internal structures of
- * the face, but are `fresh' copies, so that the memory containing them
+ * the face, but are 'fresh' copies, so that the memory containing them
* belongs to the calling application. This also enforces the
- * `read-only' nature of these values, i.e., this function cannot be
+ * 'read-only' nature of these values, i.e., this function cannot be
* used to manipulate the face.
- * `value' is a void pointer because the values returned can be of
+ * `value` is a void pointer because the values returned can be of
* various types.
- * If either `value' is NULL or `value_len' is too small, just the
+ * If either `value` is NULL or `value_len` is too small, just the
* required memory size for the requested entry is returned.
- * The `idx' parameter is used, not only to retrieve elements of, for
+ * The `idx` parameter is used, not only to retrieve elements of, for
* example, the FontMatrix or FontBBox, but also to retrieve name keys
* from the CharStrings dictionary, and the charstrings themselves. It
* is ignored for atomic values.
- * PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To
- * get the value as in the font stream, you need to divide by
- * 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
+ * `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
+ * get the value as in the font stream, you need to divide by 65536000.0
+ * (to remove the FT_Fixed scale, and the x1000 scale).
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
- * be retrieved. So, for example, PostScript procedures such as NP,
- * ND, and RD are not available. Arbitrary keys are, obviously, not be
+ * be retrieved. So, for example, PostScript procedures such as NP, ND,
+ * and RD are not available. Arbitrary keys are, obviously, not be
* available either.
* 2.4.8
-/* ttnameid.h */
-/* TrueType name ID definitions (specification only). */
+ * ttnameid.h
+ * TrueType name ID definitions (specification only).
#ifndef TTNAMEID_H_
@@ -26,53 +26,54 @@
- /* truetype_tables */
- /* Possible values for the `platform' identifier code in the name */
- /* records of an SFNT `name' table. */
+ * Possible values for the 'platform' identifier code in the name records
+ * of an SFNT `name` table.
- /***********************************************************************
* TT_PLATFORM_XXX
- * A list of valid values for the `platform_id' identifier code in
+ * A list of valid values for the `platform_id` identifier code in
* @FT_CharMapRec and @FT_SfntName structures.
* TT_PLATFORM_APPLE_UNICODE ::
* Used by Apple to indicate a Unicode character map and/or name entry.
- * See @TT_APPLE_ID_XXX for corresponding `encoding_id' values. Note
+ * See @TT_APPLE_ID_XXX for corresponding `encoding_id` values. Note
* that name entries in this format are coded as big-endian UCS-2
* character codes _only_.
* TT_PLATFORM_MACINTOSH ::
- * Used by Apple to indicate a MacOS-specific charmap and/or name entry.
- * See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that
- * most TrueType fonts contain an Apple roman charmap to be usable on
- * MacOS systems (even if they contain a Microsoft charmap as well).
+ * Used by Apple to indicate a MacOS-specific charmap and/or name
+ * entry. See @TT_MAC_ID_XXX for corresponding `encoding_id` values.
+ * Note that most TrueType fonts contain an Apple roman charmap to be
+ * usable on MacOS systems (even if they contain a Microsoft charmap as
+ * well).
* TT_PLATFORM_ISO ::
- * This value was used to specify ISO/IEC 10646 charmaps. It is however
- * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
- * `encoding_id' values.
+ * This value was used to specify ISO/IEC 10646 charmaps. It is
+ * however now deprecated. See @TT_ISO_ID_XXX for a list of
+ * corresponding `encoding_id` values.
* TT_PLATFORM_MICROSOFT ::
* Used by Microsoft to indicate Windows-specific charmaps. See
- * @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
+ * @TT_MS_ID_XXX for a list of corresponding `encoding_id` values.
* Note that most fonts contain a Unicode charmap using
- * (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
+ * (`TT_PLATFORM_MICROSOFT`, @TT_MS_ID_UNICODE_CS).
* TT_PLATFORM_CUSTOM ::
* Used to indicate application-specific charmaps.
@@ -91,13 +92,13 @@ FT_BEGIN_HEADER
#define TT_PLATFORM_ADOBE 7 /* artificial */
* TT_APPLE_ID_XXX
- * A list of valid values for the `encoding_id' for
+ * A list of valid values for the `encoding_id` for
* @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
@@ -117,8 +118,8 @@ FT_BEGIN_HEADER
* Unicode 3.1 and beyond, using UTF-32.
* TT_APPLE_ID_VARIANT_SELECTOR ::
- * From Adobe, not Apple. Not a normal cmap. Specifies variations
- * on a real cmap.
+ * From Adobe, not Apple. Not a normal cmap. Specifies variations on
+ * a real cmap.
* TT_APPLE_ID_FULL_UNICODE ::
* Used for fallback fonts that provide complete Unicode coverage with
@@ -134,13 +135,13 @@ FT_BEGIN_HEADER
#define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */
* TT_MAC_ID_XXX
* @TT_PLATFORM_MACINTOSH charmaps and name entries.
@@ -180,14 +181,14 @@ FT_BEGIN_HEADER
#define TT_MAC_ID_UNINTERP 32
* TT_ISO_ID_XXX
- * @TT_PLATFORM_ISO charmaps and name entries.
+ * A list of valid values for the `encoding_id` for @TT_PLATFORM_ISO
+ * charmaps and name entries.
* Their use is now deprecated.
@@ -205,13 +206,13 @@ FT_BEGIN_HEADER
#define TT_ISO_ID_8859_1 2
* TT_MS_ID_XXX
* @TT_PLATFORM_MICROSOFT charmaps and name entries.
@@ -219,16 +220,15 @@ FT_BEGIN_HEADER
* Microsoft symbol encoding. See @FT_ENCODING_MS_SYMBOL.
* TT_MS_ID_UNICODE_CS ::
- * Microsoft WGL4 charmap, matching Unicode. See
- * @FT_ENCODING_UNICODE.
+ * Microsoft WGL4 charmap, matching Unicode. See @FT_ENCODING_UNICODE.
* TT_MS_ID_SJIS ::
* Shift JIS Japanese encoding. See @FT_ENCODING_SJIS.
* TT_MS_ID_PRC ::
* Chinese encodings as used in the People's Republic of China (PRC).
- * This means the encodings GB~2312 and its supersets GBK and
- * GB~18030. See @FT_ENCODING_PRC.
+ * This means the encodings GB~2312 and its supersets GBK and GB~18030.
+ * See @FT_ENCODING_PRC.
* TT_MS_ID_BIG_5 ::
* Traditional Chinese as used in Taiwan and Hong Kong. See
@@ -258,14 +258,14 @@ FT_BEGIN_HEADER
#define TT_MS_ID_GB2312 TT_MS_ID_PRC
* TT_ADOBE_ID_XXX
- * @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!
+ * A list of valid values for the `encoding_id` for @TT_PLATFORM_ADOBE
+ * charmaps. This is a FreeType-specific extension!
* TT_ADOBE_ID_STANDARD ::
@@ -284,14 +284,14 @@ FT_BEGIN_HEADER
#define TT_ADOBE_ID_LATIN_1 3
* TT_MAC_LANGID_XXX
* Possible values of the language identifier field in the name records
- * of the SFNT `name' table if the `platform' identifier code is
+ * of the SFNT `name` table if the 'platform' identifier code is
* @TT_PLATFORM_MACINTOSH. These values are also used as return values
* for function @FT_Get_CMap_Language_ID.
@@ -424,24 +424,24 @@ FT_BEGIN_HEADER
#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
* TT_MS_LANGID_XXX
* @TT_PLATFORM_MICROSOFT. These values are also used as return values
* The canonical source for Microsoft's IDs is
- * https://www.microsoft.com/globaldev/reference/lcid-all.mspx ,
+ * https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings ,
* however, we only provide macros for language identifiers present in
* the OpenType specification: Microsoft has abandoned the concept of
- * LCIDs (language code identifiers), and format~1 of the `name' table
+ * LCIDs (language code identifiers), and format~1 of the `name` table
* provides a better mechanism for languages not covered here.
* More legacy values not listed in the reference can be found in the
@@ -780,14 +780,14 @@ FT_BEGIN_HEADER
TT_MS_LANGID_UIGHUR_PRC
* TT_NAME_ID_XXX
- * Possible values of the `name' identifier field in the name records of
- * an SFNT `name' table. These values are platform independent.
+ * Possible values of the 'name' identifier field in the name records of
+ * an SFNT `name` table. These values are platform independent.
#define TT_NAME_ID_COPYRIGHT 0
@@ -834,14 +834,14 @@ FT_BEGIN_HEADER
#define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY
* TT_UCR_XXX
- * Possible bit mask values for the `ulUnicodeRangeX' fields in an SFNT
- * `OS/2' table.
+ * Possible bit mask values for the `ulUnicodeRangeX` fields in an SFNT
+ * `OS/2` table.
/* ulUnicodeRange1 */
-/* tttags.h */
-/* Tags for TrueType and OpenType tables (specification only). */
+ * tttags.h
+ * Tags for TrueType and OpenType tables (specification only).
#ifndef TTAGS_H_
@@ -46,6 +46,8 @@ FT_BEGIN_HEADER
#define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
+#define TTAG_COLR FT_MAKE_TAG( 'C', 'O', 'L', 'R' )
+#define TTAG_CPAL FT_MAKE_TAG( 'C', 'P', 'A', 'L' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
@@ -1,34 +1,36 @@
-/* ft2build.h */
-/* FreeType 2 build and setup macros. */
- /* This is the `entry point' for FreeType header file inclusions. It is */
- /* the only header file which should be included directly; all other */
- /* FreeType header files should be accessed with macro names (after */
- /* including `ft2build.h'). */
- /* A typical example is */
- /* #include <ft2build.h> */
+ * ft2build.h
+ * FreeType 2 build and setup macros.
+ * This is the 'entry point' for FreeType header file inclusions. It is
+ * the only header file which should be included directly; all other
+ * FreeType header files should be accessed with macro names (after
+ * including `ft2build.h`).
+ * A typical example is
+ * #include <ft2build.h>
#ifndef FT2BUILD_H_
@@ -15,7 +15,6 @@ Import "include/*.h"
Import "src/base/ftbase.c"
-Import "src/base/ftapi.c"
Import "src/base/ftbbox.c"
Import "src/base/ftbdf.c"
Import "src/base/ftbitmap.c"
@@ -1,6 +1,6 @@
# FreeType 2 src Jamfile
#
-# Copyright 2001-2018 by
+# Copyright 2001-2019 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
# This file is part of the FreeType project, and may only be used, modified,
# FreeType 2 src/autofit Jamfile
-# Copyright 2003-2018 by
+# Copyright 2003-2019 by
-/* afangles.c */
-/* Routines used to compute vector angles with limited accuracy */
-/* and very high speed. It also contains sorting routines (body). */
+ * afangles.c
+ * Routines used to compute vector angles with limited accuracy
+ * and very high speed. It also contains sorting routines (body).
#include "aftypes.h"
- * We are not using `af_angle_atan' anymore, but we keep the source
- * code below just in case...
+ * We are not using `af_angle_atan' anymore, but we keep the source
+ * code below just in case...
@@ -30,16 +30,16 @@
- * The trick here is to realize that we don't need a very accurate angle
- * approximation. We are going to use the result of `af_angle_atan' to
- * only compare the sign of angle differences, or check whether its
- * magnitude is very small.
+ * The trick here is to realize that we don't need a very accurate angle
+ * approximation. We are going to use the result of `af_angle_atan' to
+ * only compare the sign of angle differences, or check whether its
+ * magnitude is very small.
- * The approximation
+ * The approximation
- * dy * PI / (|dx|+|dy|)
+ * dy * PI / (|dx|+|dy|)
- * should be enough, and much faster to compute.
+ * should be enough, and much faster to compute.
FT_LOCAL_DEF( AF_Angle )
af_angle_atan( FT_Fixed dx,
@@ -1,7 +1,7 @@
- * afangles.h
+ * afangles.h
- * This is a dummy file, used to please the build system. It is never
- * included by the auto-fitter sources.
+ * This is a dummy file, used to please the build system. It is never
+ * included by the auto-fitter sources.
/* This file has been generated by the Perl script `afblue.pl', */
/* using data from file `afblue.dat'. */
-/* afblue.c */
-/* Auto-fitter data for blue strings (body). */
-/* Copyright 2013-2018 by */
+ * afblue.c
+ * Auto-fitter data for blue strings (body).
+ * Copyright 2013-2019 by
@@ -166,6 +166,10 @@
'\0',
'\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D', /* ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ */
+ '\xE1', '\xB2', '\x9C', ' ', '\xE1', '\xB2', '\x9F', ' ', '\xE1', '\xB2', '\xB3', ' ', '\xE1', '\xB2', '\xB8', ' ', '\xE1', '\xB2', '\x92', ' ', '\xE1', '\xB2', '\x94', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xB4', /* Ნ Ჟ Ჳ Ჸ Გ Ე Ო Ჴ */
+ '\0',
+ '\xE1', '\xB2', '\x98', ' ', '\xE1', '\xB2', '\xB2', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xA9', ' ', '\xE1', '\xB2', '\x9B', ' ', '\xE1', '\xB2', '\xA8', ' ', '\xE1', '\xB2', '\xAF', ' ', '\xE1', '\xB2', '\xBD', /* Ი Ჲ Ო Ჩ Მ Შ Ჯ Ჽ */
'\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x94', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\xAB', ' ', '\xE2', '\xB0', '\x8B', /* Ⰵ Ⱄ Ⱚ Ⰴ Ⰲ Ⰺ Ⱛ Ⰻ */
'\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x9E', ' ', '\xE2', '\xB0', '\xA1', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\x94', /* Ⰵ Ⰴ Ⰲ Ⱚ Ⱎ Ⱑ Ⰺ Ⱄ */
@@ -539,6 +543,8 @@
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 },
+ { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 },