Update freetype to 2.10.0

This commit is contained in:
volzhs 2019-03-31 23:00:55 +09:00
parent 5b00cd89d3
commit a6300b454d
515 changed files with 35894 additions and 45456 deletions

View file

@ -12,7 +12,6 @@ if env['builtin_freetype']:
thirdparty_dir = "#thirdparty/freetype/" thirdparty_dir = "#thirdparty/freetype/"
thirdparty_sources = [ thirdparty_sources = [
"src/autofit/autofit.c", "src/autofit/autofit.c",
"src/base/ftapi.c",
"src/base/ftbase.c", "src/base/ftbase.c",
"src/base/ftbbox.c", "src/base/ftbbox.c",
"src/base/ftbdf.c", "src/base/ftbdf.c",

View file

@ -115,7 +115,7 @@ Use UI font variant if available, because it has tight vertical metrics and good
## freetype ## freetype
- Upstream: https://www.freetype.org - Upstream: https://www.freetype.org
- Version: 2.9.1 - Version: 2.10.0
- License: FreeType License (BSD-like) - License: FreeType License (BSD-like)
Files extracted from upstream source: Files extracted from upstream source:

View file

@ -1,39 +1,38 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftconfig.h */ * ftconfig.h
/* */ *
/* ANSI-specific configuration file (specification only). */ * ANSI-specific configuration file (specification only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* This header file contains a number of macro definitions that are used */ * This header file contains a number of macro definitions that are used by
/* by the rest of the engine. Most of the macros here are automatically */ * 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 */ * determined at compile time, and you should not need to change it to port
/* port FreeType, except to compile the library with a non-ANSI */ * FreeType, except to compile the library with a non-ANSI compiler.
/* compiler. */ *
/* */ * Note however that if some specific modifications are needed, we advise
/* Note however that if some specific modifications are needed, we */ * you to place a modified copy in your build directory.
/* advise you to place a modified copy in your build directory. */ *
/* */ * The build directory is usually `builds/<system>`, and contains
/* The build directory is usually `builds/<system>', and contains */ * system-specific files that are always included first when building the
/* system-specific files that are always included first when building */ * library.
/* the library. */ *
/* */ * This ANSI version should stay in `include/config/`.
/* This ANSI version should stay in `include/config/'. */ *
/* */ */
/*************************************************************************/
#ifndef FTCONFIG_H_ #ifndef FTCONFIG_H_
#define FTCONFIG_H_ #define FTCONFIG_H_
@ -46,32 +45,32 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */ * PLATFORM-SPECIFIC CONFIGURATION MACROS
/* */ *
/* These macros can be toggled to suit a specific system. The current */ * These macros can be toggled to suit a specific system. The current ones
/* ones are defaults used to compile FreeType in an ANSI C environment */ * are defaults used to compile FreeType in an ANSI C environment (16bit
/* (16bit compilers are also supported). Copy this file to your own */ * compilers are also supported). Copy this file to your own
/* `builds/<system>' directory, and edit it to port the engine. */ * `builds/<system>` directory, and edit it to port the engine.
/* */ *
/*************************************************************************/ */
/* There are systems (like the Texas Instruments 'C54x) where a `char' */ /* 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 */ /* 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 */ /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
/* is probably unexpected. */ /* is probably unexpected. */
/* */ /* */
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */ /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
/* `char' type. */ /* `char` type. */
#ifndef FT_CHAR_BIT #ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT #define FT_CHAR_BIT CHAR_BIT
#endif #endif
/* The size of an `int' type. */ /* The size of an `int` type. */
#if FT_UINT_MAX == 0xFFFFUL #if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT ) #define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
#elif FT_UINT_MAX == 0xFFFFFFFFUL #elif FT_UINT_MAX == 0xFFFFFFFFUL
@ -82,7 +81,7 @@ FT_BEGIN_HEADER
#error "Unsupported size of `int' type!" #error "Unsupported size of `int' type!"
#endif #endif
/* 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. */ /* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL #if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT ) #define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
@ -95,35 +94,35 @@ FT_BEGIN_HEADER
#endif #endif
/* FT_UNUSED is a macro used to indicate that a given parameter is not */ /* `FT_UNUSED` indicates that a given parameter is not used -- */
/* used -- this is only used to get rid of unpleasant compiler warnings */ /* this is only used to get rid of unpleasant compiler warnings. */
#ifndef FT_UNUSED #ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) ) #define FT_UNUSED( arg ) ( (arg) = (arg) )
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* AUTOMATIC CONFIGURATION MACROS */ * AUTOMATIC CONFIGURATION MACROS
/* */ *
/* These macros are computed from the ones defined above. Don't touch */ * These macros are computed from the ones defined above. Don't touch
/* their definition, unless you know precisely what you are doing. No */ * their definition, unless you know precisely what you are doing. No
/* porter should need to mess with them. */ * porter should need to mess with them.
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Mac support */ * Mac support
/* */ *
/* This is the only necessary change, so it is defined here instead */ * This is the only necessary change, so it is defined here instead
/* providing a new configuration file. */ * providing a new configuration file.
/* */ */
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */ /* No Carbon frameworks for 64bit 10.4.x. */
/* AvailabilityMacros.h is available since Mac OS X 10.2, */ /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
/* so guess the system version by maximum errno before inclusion */ /* so guess the system version by maximum errno before inclusion. */
#include <errno.h> #include <errno.h>
#ifdef ECANCELED /* defined since 10.2 */ #ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h" #include "AvailabilityMacros.h"
@ -143,7 +142,7 @@ FT_BEGIN_HEADER
#endif #endif
/* Fix compiler warning with sgi compiler */ /* Fix compiler warning with sgi compiler. */
#if defined( __sgi ) && !defined( __GNUC__ ) #if defined( __sgi ) && !defined( __GNUC__ )
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
#pragma set woff 3505 #pragma set woff 3505
@ -151,33 +150,33 @@ FT_BEGIN_HEADER
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* basic_types */ * basic_types
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Int16 */ * FT_Int16
/* */ *
/* <Description> */ * @description:
/* A typedef for a 16bit signed integer type. */ * A typedef for a 16bit signed integer type.
/* */ */
typedef signed short FT_Int16; typedef signed short FT_Int16;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_UInt16 */ * FT_UInt16
/* */ *
/* <Description> */ * @description:
/* A typedef for a 16bit unsigned integer type. */ * A typedef for a 16bit unsigned integer type.
/* */ */
typedef unsigned short FT_UInt16; typedef unsigned short FT_UInt16;
/* */ /* */
@ -186,50 +185,50 @@ FT_BEGIN_HEADER
/* this #if 0 ... #endif clause is for documentation purposes */ /* this #if 0 ... #endif clause is for documentation purposes */
#if 0 #if 0
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Int32 */ * FT_Int32
/* */ *
/* <Description> */ * @description:
/* A typedef for a 32bit signed integer type. The size depends on */ * A typedef for a 32bit signed integer type. The size depends on the
/* the configuration. */ * configuration.
/* */ */
typedef signed XXX FT_Int32; typedef signed XXX FT_Int32;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_UInt32 */ * FT_UInt32
/* */ *
/* A typedef for a 32bit unsigned integer type. The size depends on */ * A typedef for a 32bit unsigned integer type. The size depends on the
/* the configuration. */ * configuration.
/* */ */
typedef unsigned XXX FT_UInt32; typedef unsigned XXX FT_UInt32;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Int64 */ * FT_Int64
/* */ *
/* A typedef for a 64bit signed integer type. The size depends on */ * A typedef for a 64bit signed integer type. The size depends on the
/* the configuration. Only defined if there is real 64bit support; */ * configuration. Only defined if there is real 64bit support;
/* otherwise, it gets emulated with a structure (if necessary). */ * otherwise, it gets emulated with a structure (if necessary).
/* */ */
typedef signed XXX FT_Int64; typedef signed XXX FT_Int64;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_UInt64 */ * FT_UInt64
/* */ *
/* A typedef for a 64bit unsigned integer type. The size depends on */ * A typedef for a 64bit unsigned integer type. The size depends on the
/* the configuration. Only defined if there is real 64bit support; */ * configuration. Only defined if there is real 64bit support;
/* otherwise, it gets emulated with a structure (if necessary). */ * otherwise, it gets emulated with a structure (if necessary).
/* */ */
typedef unsigned XXX FT_UInt64; typedef unsigned XXX FT_UInt64;
/* */ /* */
@ -251,7 +250,7 @@ FT_BEGIN_HEADER
#endif #endif
/* 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 ) #if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
typedef int FT_Fast; typedef int FT_Fast;
@ -265,22 +264,22 @@ FT_BEGIN_HEADER
#endif #endif
/* determine whether we have a 64-bit int type for platforms without */ /* determine whether we have a 64-bit `int` type for platforms without */
/* Autoconf */ /* Autoconf */
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT ) #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_LONG64
#define FT_INT64 long #define FT_INT64 long
#define FT_UINT64 unsigned long #define FT_UINT64 unsigned long
/*************************************************************************/ /**************************************************************************
/* */ *
/* A 64-bit data type may create compilation problems if you compile */ * A 64-bit data type may create compilation problems if you compile in
/* in strict ANSI mode. To avoid them, we disable other 64-bit data */ * strict ANSI mode. To avoid them, we disable other 64-bit data types if
/* types if __STDC__ is defined. You can however ignore this rule */ * `__STDC__` is defined. You can however ignore this rule by defining the
/* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
/* */ */
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L #if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
@ -291,17 +290,17 @@ FT_BEGIN_HEADER
#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_LONG64 #define FT_LONG64
#define FT_INT64 __int64 #define FT_INT64 __int64
#define FT_UINT64 unsigned __int64 #define FT_UINT64 unsigned __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */ #elif defined( __BORLANDC__ ) /* Borland C++ */
/* XXXX: We should probably check the value of __BORLANDC__ in order */ /* XXXX: We should probably check the value of `__BORLANDC__` in order */
/* to test the compiler version. */ /* to test the compiler version. */
/* this compiler provides the __int64 type */ /* this compiler provides the `__int64` type */
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 __int64 #define FT_INT64 __int64
#define FT_UINT64 unsigned __int64 #define FT_UINT64 unsigned __int64
@ -318,7 +317,7 @@ FT_BEGIN_HEADER
#elif defined( __GNUC__ ) #elif defined( __GNUC__ )
/* GCC provides the `long long' type */ /* GCC provides the `long long` type */
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 long long int #define FT_INT64 long long int
#define FT_UINT64 unsigned long long int #define FT_UINT64 unsigned long long int
@ -342,11 +341,11 @@ FT_BEGIN_HEADER
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* miscellaneous */ * miscellaneous
/* */ *
/*************************************************************************/ */
#define FT_BEGIN_STMNT do { #define FT_BEGIN_STMNT do {
@ -354,7 +353,7 @@ FT_BEGIN_HEADER
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT #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 ) || \ #if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \ ( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \ defined( __IBM__TYPEOF__ ) ) || \
@ -365,13 +364,13 @@ FT_BEGIN_HEADER
#endif #endif
/* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */ /* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
/* a function that gets used only within the scope of a module. */ /* respectively, a function that gets used only within the scope of a */
/* Normally, both the header and source code files for such a */ /* module. Normally, both the header and source code files for such a */
/* function are within a single module directory. */ /* function are within a single module directory. */
/* */ /* */
/* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */ /* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
/* FT_LOCAL_ARRAY_DEF. */ /* `FT_LOCAL_ARRAY_DEF`. */
/* */ /* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
@ -394,11 +393,11 @@ FT_BEGIN_HEADER
#define FT_LOCAL_ARRAY_DEF( x ) const x #define FT_LOCAL_ARRAY_DEF( x ) const x
/* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */ /* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
/* functions that are used in more than a single module. In the */ /* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header */ /* current setup this implies that the declaration is in a header file */
/* file in the `include/freetype/internal' directory, and the */ /* in the `include/freetype/internal` directory, and the function body */
/* function body is in a file in `src/base'. */ /* is in a file in `src/base`. */
/* */ /* */
#ifndef FT_BASE #ifndef FT_BASE
@ -427,40 +426,45 @@ FT_BEGIN_HEADER
/* the return type of function declarations. */ /* the return type of function declarations. */
/* */ /* */
/* Two macros are used within the FreeType source code to define */ /* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ /* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
/* */ /* */
/* FT_EXPORT( return_type ) */ /* - `FT_EXPORT( return_type )` */
/* */ /* */
/* is used in a function declaration, as in */ /* is used in a function declaration, as in */
/* */ /* */
/* ``` */
/* FT_EXPORT( FT_Error ) */ /* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */ /* FT_Init_FreeType( FT_Library* alibrary ); */
/* ``` */
/* */ /* */
/* */ /* - `FT_EXPORT_DEF( return_type )` */
/* FT_EXPORT_DEF( return_type ) */
/* */ /* */
/* is used in a function definition, as in */ /* is used in a function definition, as in */
/* */ /* */
/* ``` */
/* FT_EXPORT_DEF( FT_Error ) */ /* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */ /* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */ /* { */
/* ... some code ... */ /* ... some code ... */
/* return FT_Err_Ok; */ /* return FT_Err_Ok; */
/* } */ /* } */
/* ``` */
/* */ /* */
/* You can provide your own implementation of FT_EXPORT and */ /* You can provide your own implementation of `FT_EXPORT` and */
/* FT_EXPORT_DEF here if you want. */ /* `FT_EXPORT_DEF` here if you want. */
/* */ /* */
/* To export a variable, use FT_EXPORT_VAR. */ /* To export a variable, use `FT_EXPORT_VAR`. */
/* */ /* */
#ifndef FT_EXPORT #ifndef FT_EXPORT
#ifdef FT2_BUILD_LIBRARY #ifdef FT2_BUILD_LIBRARY
#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) ) #if defined( _WIN32 ) && defined( DLL_EXPORT )
#define FT_EXPORT( x ) __declspec( dllexport ) x #define FT_EXPORT( x ) __declspec( dllexport ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4 #elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x #define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
#define FT_EXPORT( x ) __global x
#elif defined( __cplusplus ) #elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x #define FT_EXPORT( x ) extern "C" x
#else #else
@ -469,7 +473,7 @@ FT_BEGIN_HEADER
#else #else
#if defined( FT2_DLLIMPORT ) #if defined( _WIN32 ) && defined( DLL_IMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x #define FT_EXPORT( x ) __declspec( dllimport ) x
#elif defined( __cplusplus ) #elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x #define FT_EXPORT( x ) extern "C" x
@ -508,7 +512,7 @@ FT_BEGIN_HEADER
/* C++ compiler and with 16bit compilers. */ /* 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 */ /* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */ /* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */ /* assure C linkage -- it's not possible to have (local) anonymous */
@ -531,7 +535,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* */ /* */
/* Some 16bit compilers have to redefine these macros to insert */ /* 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 #ifndef FT_CALLBACK_DEF
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftheader.h */ * ftheader.h
/* */ *
/* Build macros of the FreeType 2 library. */ * Build macros of the FreeType 2 library.
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTHEADER_H_ #ifndef FTHEADER_H_
#define FTHEADER_H_ #define FTHEADER_H_
@ -27,7 +27,7 @@
/* <Description> */ /* <Description> */
/* This macro is used in association with @FT_END_HEADER in header */ /* This macro is used in association with @FT_END_HEADER in header */
/* files to ensure that the declarations within are properly */ /* 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. */ /* C++ compiler. */
/* */ /* */
#ifdef __cplusplus #ifdef __cplusplus
@ -45,7 +45,7 @@
/* <Description> */ /* <Description> */
/* This macro is used in association with @FT_BEGIN_HEADER in header */ /* This macro is used in association with @FT_BEGIN_HEADER in header */
/* files to ensure that the declarations within are properly */ /* 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. */ /* C++ compiler. */
/* */ /* */
#ifdef __cplusplus #ifdef __cplusplus
@ -55,54 +55,54 @@
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* Aliases for the FreeType 2 public and configuration files. */ * Aliases for the FreeType 2 public and configuration files.
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* header_file_macros */ * header_file_macros
/* */ *
/* <Title> */ * @title:
/* Header File Macros */ * Header File Macros
/* */ *
/* <Abstract> */ * @abstract:
/* Macro definitions used to #include specific header files. */ * Macro definitions used to `#include` specific header files.
/* */ *
/* <Description> */ * @description:
/* The following macros are defined to the name of specific */ * The following macros are defined to the name of specific FreeType~2
/* FreeType~2 header files. They can be used directly in #include */ * header files. They can be used directly in `#include` statements as
/* statements as in: */ * in:
/* */ *
/* { */ * ```
/* #include FT_FREETYPE_H */ * #include FT_FREETYPE_H
/* #include FT_MULTIPLE_MASTERS_H */ * #include FT_MULTIPLE_MASTERS_H
/* #include FT_GLYPH_H */ * #include FT_GLYPH_H
/* } */ * ```
/* */ *
/* There are several reasons why we are now using macros to name */ * There are several reasons why we are now using macros to name public
/* public header files. The first one is that such macros are not */ * header files. The first one is that such macros are not limited to
/* limited to the infamous 8.3~naming rule required by DOS (and */ * the infamous 8.3~naming rule required by DOS (and
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ * `FT_MULTIPLE_MASTERS_H` is a lot more meaningful than `ftmm.h`).
/* */ *
/* The second reason is that it allows for more flexibility in the */ * The second reason is that it allows for more flexibility in the way
/* way FreeType~2 is installed on a given system. */ * FreeType~2 is installed on a given system.
/* */ *
/*************************************************************************/ */
/* configuration files */ /* configuration files */
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_CONFIG_CONFIG_H * FT_CONFIG_CONFIG_H
* *
* @description: * @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. * FreeType~2 configuration data.
* *
*/ */
@ -111,13 +111,13 @@
#endif #endif
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_CONFIG_STANDARD_LIBRARY_H * FT_CONFIG_STANDARD_LIBRARY_H
* *
* @description: * @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 interface to the standard C library functions. * FreeType~2 interface to the standard C library functions.
* *
*/ */
@ -126,13 +126,13 @@
#endif #endif
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_CONFIG_OPTIONS_H * FT_CONFIG_OPTIONS_H
* *
* @description: * @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 project-specific configuration options. * FreeType~2 project-specific configuration options.
* *
*/ */
@ -141,13 +141,13 @@
#endif #endif
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_CONFIG_MODULES_H * FT_CONFIG_MODULES_H
* *
* @description: * @description:
* 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 * list of FreeType~2 modules that are statically linked to new library
* instances in @FT_Init_FreeType. * instances in @FT_Init_FreeType.
* *
@ -160,26 +160,26 @@
/* public headers */ /* public headers */
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_FREETYPE_H * FT_FREETYPE_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* base FreeType~2 API. * base FreeType~2 API.
* *
*/ */
#define FT_FREETYPE_H <freetype/freetype.h> #define FT_FREETYPE_H <freetype/freetype.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ERRORS_H * FT_ERRORS_H
* *
* @description: * @description:
* 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 error codes (and messages). * list of FreeType~2 error codes (and messages).
* *
* It is included by @FT_FREETYPE_H. * It is included by @FT_FREETYPE_H.
@ -188,26 +188,26 @@
#define FT_ERRORS_H <freetype/fterrors.h> #define FT_ERRORS_H <freetype/fterrors.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_MODULE_ERRORS_H * FT_MODULE_ERRORS_H
* *
* @description: * @description:
* 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 module error offsets (and messages). * list of FreeType~2 module error offsets (and messages).
* *
*/ */
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> #define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_SYSTEM_H * FT_SYSTEM_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 interface to low-level operations (i.e., memory management * FreeType~2 interface to low-level operations (i.e., memory management
* and stream i/o). * and stream i/o).
* *
@ -217,13 +217,13 @@
#define FT_SYSTEM_H <freetype/ftsystem.h> #define FT_SYSTEM_H <freetype/ftsystem.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_IMAGE_H * FT_IMAGE_H
* *
* @description: * @description:
* 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, * definitions related to glyph images (i.e., bitmaps, outlines,
* scan-converter parameters). * scan-converter parameters).
* *
@ -233,13 +233,13 @@
#define FT_IMAGE_H <freetype/ftimage.h> #define FT_IMAGE_H <freetype/ftimage.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_TYPES_H * FT_TYPES_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* basic data types defined by FreeType~2. * basic data types defined by FreeType~2.
* *
* It is included by @FT_FREETYPE_H. * It is included by @FT_FREETYPE_H.
@ -248,13 +248,13 @@
#define FT_TYPES_H <freetype/fttypes.h> #define FT_TYPES_H <freetype/fttypes.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_LIST_H * FT_LIST_H
* *
* @description: * @description:
* 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 management API of FreeType~2. * list management API of FreeType~2.
* *
* (Most applications will never need to include this file.) * (Most applications will never need to include this file.)
@ -263,151 +263,151 @@
#define FT_LIST_H <freetype/ftlist.h> #define FT_LIST_H <freetype/ftlist.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_OUTLINE_H * FT_OUTLINE_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* scalable outline management API of FreeType~2. * scalable outline management API of FreeType~2.
* *
*/ */
#define FT_OUTLINE_H <freetype/ftoutln.h> #define FT_OUTLINE_H <freetype/ftoutln.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_SIZES_H * FT_SIZES_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* API which manages multiple @FT_Size objects per face. * API which manages multiple @FT_Size objects per face.
* *
*/ */
#define FT_SIZES_H <freetype/ftsizes.h> #define FT_SIZES_H <freetype/ftsizes.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_MODULE_H * FT_MODULE_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* module management API of FreeType~2. * module management API of FreeType~2.
* *
*/ */
#define FT_MODULE_H <freetype/ftmodapi.h> #define FT_MODULE_H <freetype/ftmodapi.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_RENDER_H * FT_RENDER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* renderer module management API of FreeType~2. * renderer module management API of FreeType~2.
* *
*/ */
#define FT_RENDER_H <freetype/ftrender.h> #define FT_RENDER_H <freetype/ftrender.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_DRIVER_H * FT_DRIVER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing * A macro used in `#include` statements to name the file containing
* structures and macros related to the driver modules. * structures and macros related to the driver modules.
* *
*/ */
#define FT_DRIVER_H <freetype/ftdriver.h> #define FT_DRIVER_H <freetype/ftdriver.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_AUTOHINTER_H * FT_AUTOHINTER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing * A macro used in `#include` statements to name the file containing
* structures and macros related to the auto-hinting module. * 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 #define FT_AUTOHINTER_H FT_DRIVER_H
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_CFF_DRIVER_H * FT_CFF_DRIVER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing * A macro used in `#include` statements to name the file containing
* structures and macros related to the CFF driver module. * structures and macros related to the CFF driver module.
* *
* Deprecated since version 2.9; use @FT_DRIVER_H instead. * Deprecated since version~2.9; use @FT_DRIVER_H instead.
* *
*/ */
#define FT_CFF_DRIVER_H FT_DRIVER_H #define FT_CFF_DRIVER_H FT_DRIVER_H
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_TRUETYPE_DRIVER_H * FT_TRUETYPE_DRIVER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing * A macro used in `#include` statements to name the file containing
* structures and macros related to the TrueType driver module. * structures and macros related to the TrueType driver module.
* *
* Deprecated since version 2.9; use @FT_DRIVER_H instead. * Deprecated since version~2.9; use @FT_DRIVER_H instead.
* *
*/ */
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H #define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_PCF_DRIVER_H * FT_PCF_DRIVER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing * A macro used in `#include` statements to name the file containing
* structures and macros related to the PCF driver module. * structures and macros related to the PCF driver module.
* *
* Deprecated since version 2.9; use @FT_DRIVER_H instead. * Deprecated since version~2.9; use @FT_DRIVER_H instead.
* *
*/ */
#define FT_PCF_DRIVER_H FT_DRIVER_H #define FT_PCF_DRIVER_H FT_DRIVER_H
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_TYPE1_TABLES_H * FT_TYPE1_TABLES_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* types and API specific to the Type~1 format. * types and API specific to the Type~1 format.
* *
*/ */
#define FT_TYPE1_TABLES_H <freetype/t1tables.h> #define FT_TYPE1_TABLES_H <freetype/t1tables.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_TRUETYPE_IDS_H * FT_TRUETYPE_IDS_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* enumeration values which identify name strings, languages, encodings, * enumeration values which identify name strings, languages, encodings,
* etc. This file really contains a _large_ set of constant macro * etc. This file really contains a _large_ set of constant macro
* definitions, taken from the TrueType and OpenType specifications. * definitions, taken from the TrueType and OpenType specifications.
@ -416,174 +416,172 @@
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> #define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_TRUETYPE_TABLES_H * FT_TRUETYPE_TABLES_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* types and API specific to the TrueType (as well as OpenType) format. * types and API specific to the TrueType (as well as OpenType) format.
* *
*/ */
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h> #define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_TRUETYPE_TAGS_H * FT_TRUETYPE_TAGS_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* 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). * SFNT-based font formats (i.e., TrueType and OpenType).
* *
*/ */
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h> #define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_BDF_H * FT_BDF_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a * definitions of an API which accesses BDF-specific strings from a face.
* face.
* *
*/ */
#define FT_BDF_H <freetype/ftbdf.h> #define FT_BDF_H <freetype/ftbdf.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_CID_H * FT_CID_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* definitions of an API which access CID font information from a * definitions of an API which access CID font information from a face.
* face.
* *
*/ */
#define FT_CID_H <freetype/ftcid.h> #define FT_CID_H <freetype/ftcid.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_GZIP_H * FT_GZIP_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* definitions of an API which supports gzip-compressed files. * definitions of an API which supports gzip-compressed files.
* *
*/ */
#define FT_GZIP_H <freetype/ftgzip.h> #define FT_GZIP_H <freetype/ftgzip.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_LZW_H * FT_LZW_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* definitions of an API which supports LZW-compressed files. * definitions of an API which supports LZW-compressed files.
* *
*/ */
#define FT_LZW_H <freetype/ftlzw.h> #define FT_LZW_H <freetype/ftlzw.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_BZIP2_H * FT_BZIP2_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* definitions of an API which supports bzip2-compressed files. * definitions of an API which supports bzip2-compressed files.
* *
*/ */
#define FT_BZIP2_H <freetype/ftbzip2.h> #define FT_BZIP2_H <freetype/ftbzip2.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_WINFONTS_H * FT_WINFONTS_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* definitions of an API which supports Windows FNT files. * definitions of an API which supports Windows FNT files.
* *
*/ */
#define FT_WINFONTS_H <freetype/ftwinfnt.h> #define FT_WINFONTS_H <freetype/ftwinfnt.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_GLYPH_H * FT_GLYPH_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* API of the optional glyph management component. * API of the optional glyph management component.
* *
*/ */
#define FT_GLYPH_H <freetype/ftglyph.h> #define FT_GLYPH_H <freetype/ftglyph.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_BITMAP_H * FT_BITMAP_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* API of the optional bitmap conversion component. * API of the optional bitmap conversion component.
* *
*/ */
#define FT_BITMAP_H <freetype/ftbitmap.h> #define FT_BITMAP_H <freetype/ftbitmap.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_BBOX_H * FT_BBOX_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* API of the optional exact bounding box computation routines. * API of the optional exact bounding box computation routines.
* *
*/ */
#define FT_BBOX_H <freetype/ftbbox.h> #define FT_BBOX_H <freetype/ftbbox.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_CACHE_H * FT_CACHE_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* API of the optional FreeType~2 cache sub-system. * API of the optional FreeType~2 cache sub-system.
* *
*/ */
#define FT_CACHE_H <freetype/ftcache.h> #define FT_CACHE_H <freetype/ftcache.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_MAC_H * FT_MAC_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access * Macintosh-specific FreeType~2 API. The latter is used to access fonts
* fonts embedded in resource forks. * embedded in resource forks.
* *
* This header file must be explicitly included by client applications * This header file must be explicitly included by client applications
* compiled on the Mac (note that the base API still works though). * compiled on the Mac (note that the base API still works though).
@ -592,105 +590,105 @@
#define FT_MAC_H <freetype/ftmac.h> #define FT_MAC_H <freetype/ftmac.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_MULTIPLE_MASTERS_H * FT_MULTIPLE_MASTERS_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* optional multiple-masters management API of FreeType~2. * optional multiple-masters management API of FreeType~2.
* *
*/ */
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> #define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_SFNT_NAMES_H * FT_SFNT_NAMES_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which accesses embedded `name' strings in * optional FreeType~2 API which accesses embedded 'name' strings in
* SFNT-based font formats (i.e., TrueType and OpenType). * SFNT-based font formats (i.e., TrueType and OpenType).
* *
*/ */
#define FT_SFNT_NAMES_H <freetype/ftsnames.h> #define FT_SFNT_NAMES_H <freetype/ftsnames.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_OPENTYPE_VALIDATE_H * FT_OPENTYPE_VALIDATE_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables (BASE, GDEF, * optional FreeType~2 API which validates OpenType tables ('BASE',
* GPOS, GSUB, JSTF). * 'GDEF', 'GPOS', 'GSUB', 'JSTF').
* *
*/ */
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> #define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_GX_VALIDATE_H * FT_GX_VALIDATE_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat, * optional FreeType~2 API which validates TrueTypeGX/AAT tables ('feat',
* mort, morx, bsln, just, kern, opbd, trak, prop). * 'mort', 'morx', 'bsln', 'just', 'kern', 'opbd', 'trak', 'prop').
* *
*/ */
#define FT_GX_VALIDATE_H <freetype/ftgxval.h> #define FT_GX_VALIDATE_H <freetype/ftgxval.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_PFR_H * FT_PFR_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which accesses PFR-specific data. * FreeType~2 API which accesses PFR-specific data.
* *
*/ */
#define FT_PFR_H <freetype/ftpfr.h> #define FT_PFR_H <freetype/ftpfr.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_STROKER_H * FT_STROKER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which provides functions to stroke outline paths. * FreeType~2 API which provides functions to stroke outline paths.
*/ */
#define FT_STROKER_H <freetype/ftstroke.h> #define FT_STROKER_H <freetype/ftstroke.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_SYNTHESIS_H * FT_SYNTHESIS_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs artificial obliquing and emboldening. * FreeType~2 API which performs artificial obliquing and emboldening.
*/ */
#define FT_SYNTHESIS_H <freetype/ftsynth.h> #define FT_SYNTHESIS_H <freetype/ftsynth.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_FONT_FORMATS_H * FT_FONT_FORMATS_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which provides functions specific to font formats. * FreeType~2 API which provides functions specific to font formats.
*/ */
#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h> #define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
@ -699,67 +697,79 @@
#define FT_XFREE86_H FT_FONT_FORMATS_H #define FT_XFREE86_H FT_FONT_FORMATS_H
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_TRIGONOMETRY_H * FT_TRIGONOMETRY_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs trigonometric computations (e.g., * FreeType~2 API which performs trigonometric computations (e.g.,
* cosines and arc tangents). * cosines and arc tangents).
*/ */
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h> #define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_LCD_FILTER_H * FT_LCD_FILTER_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering. * FreeType~2 API which performs color filtering for subpixel rendering.
*/ */
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h> #define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_INCREMENTAL_H * FT_INCREMENTAL_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs incremental glyph loading. * FreeType~2 API which performs incremental glyph loading.
*/ */
#define FT_INCREMENTAL_H <freetype/ftincrem.h> #define FT_INCREMENTAL_H <freetype/ftincrem.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_GASP_H * FT_GASP_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which returns entries from the TrueType GASP table. * FreeType~2 API which returns entries from the TrueType GASP table.
*/ */
#define FT_GASP_H <freetype/ftgasp.h> #define FT_GASP_H <freetype/ftgasp.h>
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ADVANCES_H * FT_ADVANCES_H
* *
* @description: * @description:
* A macro used in #include statements to name the file containing the * A macro used in `#include` statements to name the file containing the
* FreeType~2 API which returns individual and ranged glyph advances. * FreeType~2 API which returns individual and ranged glyph advances.
*/ */
#define FT_ADVANCES_H <freetype/ftadvanc.h> #define FT_ADVANCES_H <freetype/ftadvanc.h>
/**************************************************************************
*
* @macro:
* FT_COLOR_H
*
* @description:
* A macro used in `#include` statements to name the file containing the
* 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. */ /* 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_UNPATENTED_HINTING_H <freetype/ftparams.h>
#define FT_TRUETYPE_UNPATENTED_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_IMAGE_H FT_CACHE_H
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H #define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
#define FT_CACHE_CHARMAP_H FT_CACHE_H #define FT_CACHE_CHARMAP_H FT_CACHE_H
/* The internals of the cache sub-system are no longer exposed. We */ /* 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 */ /* default to `FT_CACHE_H` at the moment just in case, but we know */
/* no rogue client that uses them. */ /* of no rogue client that uses them. */
/* */ /* */
#define FT_CACHE_MANAGER_H FT_CACHE_H #define FT_CACHE_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H #define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
@ -789,8 +799,8 @@
/* /*
* Include internal headers definitions from <internal/...> * Include internal headers definitions from `<internal/...>` only when
* only when building the library. * building the library.
*/ */
#ifdef FT2_BUILD_LIBRARY #ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> #define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>

View file

@ -2,10 +2,10 @@
* 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 * If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/') based on information * the objects directory (normally `<topdir>/objs/`) based on information
* from `<topdir>/modules.cfg'. * from `<topdir>/modules.cfg`.
* *
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile * Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile
* FreeType without GNU make. * FreeType without GNU make.
* *
*/ */

File diff suppressed because it is too large Load diff

View file

@ -1,31 +1,31 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftstdlib.h */ * ftstdlib.h
/* */ *
/* ANSI-specific library and header configuration file (specification */ * ANSI-specific library and header configuration file (specification
/* only). */ * only).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* This file is used to group all #includes to the ANSI C library that */ * This file is used to group all `#includes` to the ANSI~C library that
/* FreeType normally requires. It also defines macros to rename the */ * FreeType normally requires. It also defines macros to rename the
/* standard functions within the FreeType source code. */ * standard functions within the FreeType source code.
/* */ *
/* Load a file which defines FTSTDLIB_H_ before this one to override it. */ * Load a file which defines `FTSTDLIB_H_` before this one to override it.
/* */ *
/*************************************************************************/ */
#ifndef FTSTDLIB_H_ #ifndef FTSTDLIB_H_
@ -37,23 +37,23 @@
#define ft_ptrdiff_t ptrdiff_t #define ft_ptrdiff_t ptrdiff_t
/**********************************************************************/ /**************************************************************************
/* */ *
/* integer limits */ * integer limits
/* */ *
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */ * `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
/* of `int' and `long' in bytes at compile-time. So far, this works */ * `int` and `long` in bytes at compile-time. So far, this works for all
/* for all platforms the library has been tested on. */ * platforms the library has been tested on.
/* */ *
/* Note that on the extremely rare platforms that do not provide */ * Note that on the extremely rare platforms that do not provide integer
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */ * types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
/* old Crays where `int' is 36 bits), we do not make any guarantee */ * `int` is 36~bits), we do not make any guarantee about the correct
/* about the correct behaviour of FT2 with all fonts. */ * behaviour of FreeType~2 with all fonts.
/* */ *
/* In these case, `ftconfig.h' will refuse to compile anyway with a */ * In these cases, `ftconfig.h` will refuse to compile anyway with a
/* message like `couldn't find 32-bit type' or something similar. */ * message like 'couldn't find 32-bit type' or something similar.
/* */ *
/**********************************************************************/ */
#include <limits.h> #include <limits.h>
@ -68,11 +68,11 @@
#define FT_ULONG_MAX ULONG_MAX #define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/ /**************************************************************************
/* */ *
/* character and string processing */ * character and string processing
/* */ *
/**********************************************************************/ */
#include <string.h> #include <string.h>
@ -92,11 +92,11 @@
#define ft_strstr strstr #define ft_strstr strstr
/**********************************************************************/ /**************************************************************************
/* */ *
/* file handling */ * file handling
/* */ *
/**********************************************************************/ */
#include <stdio.h> #include <stdio.h>
@ -110,11 +110,11 @@
#define ft_sprintf sprintf #define ft_sprintf sprintf
/**********************************************************************/ /**************************************************************************
/* */ *
/* sorting */ * sorting
/* */ *
/**********************************************************************/ */
#include <stdlib.h> #include <stdlib.h>
@ -122,11 +122,11 @@
#define ft_qsort qsort #define ft_qsort qsort
/**********************************************************************/ /**************************************************************************
/* */ *
/* memory allocation */ * memory allocation
/* */ *
/**********************************************************************/ */
#define ft_scalloc calloc #define ft_scalloc calloc
@ -135,36 +135,36 @@
#define ft_srealloc realloc #define ft_srealloc realloc
/**********************************************************************/ /**************************************************************************
/* */ *
/* miscellaneous */ * miscellaneous
/* */ *
/**********************************************************************/ */
#define ft_strtol strtol #define ft_strtol strtol
#define ft_getenv getenv #define ft_getenv getenv
/**********************************************************************/ /**************************************************************************
/* */ *
/* execution control */ * execution control
/* */ *
/**********************************************************************/ */
#include <setjmp.h> #include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */ /* `jmp_buf` is defined as a macro */
/* on certain platforms */ /* on certain platforms */
#define ft_longjmp longjmp #define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */ #define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
/* the following is only used for debugging purposes, i.e., if */ /* The following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ /* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
#include <stdarg.h> #include <stdarg.h>

File diff suppressed because it is too large Load diff

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftadvanc.h */ * ftadvanc.h
/* */ *
/* Quick computation of advance widths (specification only). */ * Quick computation of advance widths (specification only).
/* */ *
/* Copyright 2008-2018 by */ * Copyright (C) 2008-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTADVANC_H_ #ifndef FTADVANC_H_
@ -56,68 +56,67 @@ FT_BEGIN_HEADER
*/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Const> */ * @enum:
/* FT_ADVANCE_FLAG_FAST_ONLY */ * FT_ADVANCE_FLAG_FAST_ONLY
/* */ *
/* <Description> */ * @description:
/* A bit-flag to be OR-ed with the `flags' parameter of the */ * A bit-flag to be OR-ed with the `flags` parameter of the
/* @FT_Get_Advance and @FT_Get_Advances functions. */ * @FT_Get_Advance and @FT_Get_Advances functions.
/* */ *
/* If set, it indicates that you want these functions to fail if the */ * If set, it indicates that you want these functions to fail if the
/* corresponding hinting mode or font driver doesn't allow for very */ * corresponding hinting mode or font driver doesn't allow for very quick
/* quick advance computation. */ * advance computation.
/* */ *
/* Typically, glyphs that are either unscaled, unhinted, bitmapped, */ * Typically, glyphs that are either unscaled, unhinted, bitmapped, or
/* or light-hinted can have their advance width computed very */ * light-hinted can have their advance width computed very quickly.
/* quickly. */ *
/* */ * Normal and bytecode hinted modes that require loading, scaling, and
/* Normal and bytecode hinted modes that require loading, scaling, */ * hinting of the glyph outline, are extremely slow by comparison.
/* and hinting of the glyph outline, are extremely slow by */ */
/* comparison. */
/* */
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L #define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Get_Advance */ * FT_Get_Advance
/* */ *
/* <Description> */ * @description:
/* Retrieve the advance value of a given glyph outline in an */ * Retrieve the advance value of a given glyph outline in an @FT_Face.
/* @FT_Face. */ *
/* */ * @input:
/* <Input> */ * face ::
/* face :: The source @FT_Face handle. */ * The source @FT_Face handle.
/* */ *
/* gindex :: The glyph index. */ * 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 */ * load_flags ::
/* of advances you need. */ * A set of bit flags similar to those used when calling
/* <Output> */ * @FT_Load_Glyph, used to determine what kind of advances you need.
/* padvance :: The advance value. If scaling is performed (based on */ * @output:
/* the value of `load_flags'), the advance value is in */ * padvance ::
/* 16.16 format. Otherwise, it is in font units. */ * The advance value. If scaling is performed (based on the value of
/* */ * `load_flags`), the advance value is in 16.16 format. Otherwise, it
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ * is in font units.
/* vertical advance corresponding to a vertical layout. */ *
/* Otherwise, it is the horizontal advance in a */ * If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance
/* horizontal layout. */ * corresponding to a vertical layout. Otherwise, it is the horizontal
/* */ * advance in a horizontal layout.
/* <Return> */ *
/* FreeType error code. 0 means success. */ * @return:
/* */ * FreeType error code. 0 means success.
/* <Note> */ *
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ * @note:
/* if the corresponding font backend doesn't have a quick way to */ * This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
/* retrieve the advances. */ * 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. */ * 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_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face, FT_Get_Advance( FT_Face face,
FT_UInt gindex, FT_UInt gindex,
@ -125,50 +124,52 @@ FT_BEGIN_HEADER
FT_Fixed *padvance ); FT_Fixed *padvance );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Get_Advances */ * FT_Get_Advances
/* */ *
/* <Description> */ * @description:
/* Retrieve the advance values of several glyph outlines in an */ * Retrieve the advance values of several glyph outlines in an @FT_Face.
/* @FT_Face. */ *
/* */ * @input:
/* <Input> */ * face ::
/* face :: The source @FT_Face handle. */ * The source @FT_Face handle.
/* */ *
/* start :: The first glyph index. */ * start ::
/* */ * The first glyph index.
/* count :: The number of advance values you want to retrieve. */ *
/* */ * count ::
/* load_flags :: A set of bit flags similar to those used when */ * The number of advance values you want to retrieve.
/* calling @FT_Load_Glyph. */ *
/* */ * load_flags ::
/* <Output> */ * A set of bit flags similar to those used when calling
/* padvance :: The advance values. This array, to be provided by the */ * @FT_Load_Glyph.
/* caller, must contain at least `count' elements. */ *
/* */ * @output:
/* If scaling is performed (based on the value of */ * padvance ::
/* `load_flags'), the advance values are in 16.16 format. */ * The advance values. This array, to be provided by the caller, must
/* Otherwise, they are in font units. */ * contain at least `count` elements.
/* */ *
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ * If scaling is performed (based on the value of `load_flags`), the
/* vertical advances corresponding to a vertical layout. */ * advance values are in 16.16 format. Otherwise, they are in font
/* Otherwise, they are the horizontal advances in a */ * units.
/* horizontal layout. */ *
/* */ * If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances
/* <Return> */ * corresponding to a vertical layout. Otherwise, they are the
/* FreeType error code. 0 means success. */ * horizontal advances in a horizontal layout.
/* */ *
/* <Note> */ * @return:
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ * FreeType error code. 0 means success.
/* if the corresponding font backend doesn't have a quick way to */ *
/* retrieve the advances. */ * @note:
/* */ * This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
/* Scaled advances are returned in 16.16 format but aren't */ * the corresponding font backend doesn't have a quick way to retrieve
/* transformed by the affine transformation specified by */ * the advances.
/* @FT_Set_Transform. */ *
/* */ * Scaled advances are returned in 16.16 format but aren't transformed by
* the affine transformation specified by @FT_Set_Transform.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Advances( FT_Face face, FT_Get_Advances( FT_Face face,
FT_UInt start, FT_UInt start,

View file

@ -1,533 +0,0 @@
/***************************************************************************/
/* */
/* ftautoh.h */
/* */
/* FreeType API for controlling the auto-hinter (specification only). */
/* */
/* Copyright 2012-2017 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. */
/* */
/***************************************************************************/
#ifndef FTAUTOH_H_
#define FTAUTOH_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
/**************************************************************************
*
* @section:
* auto_hinter
*
* @title:
* The auto-hinter
*
* @abstract:
* Controlling the auto-hinting module.
*
* @description:
* While FreeType's auto-hinter doesn't expose API functions by itself,
* it is possible to control its behaviour with @FT_Property_Set and
* @FT_Property_Get. The following lists the available properties
* together with the necessary macros and structures.
*
* Note that the auto-hinter's module name is `autofitter' for
* historical reasons.
*
*/
/**************************************************************************
*
* @property:
* glyph-to-script-map
*
* @description:
* *Experimental* *only*
*
* The auto-hinter provides various script modules to hint glyphs.
* Examples of supported scripts are Latin or CJK. Before a glyph is
* auto-hinted, the Unicode character map of the font gets examined, and
* the script is then determined based on Unicode character ranges, see
* below.
*
* OpenType fonts, however, often provide much more glyphs than
* character codes (small caps, superscripts, ligatures, swashes, etc.),
* to be controlled by so-called `features'. Handling OpenType features
* can be quite complicated and thus needs a separate library on top of
* FreeType.
*
* The mapping between glyph indices and scripts (in the auto-hinter
* sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
* array with `num_glyphs' elements, as found in the font's @FT_Face
* structure. The `glyph-to-script-map' property returns a pointer to
* this array, which can be modified as needed. Note that the
* modification should happen before the first glyph gets processed by
* the auto-hinter so that the global analysis of the font shapes
* actually uses the modified mapping.
*
* The following example code demonstrates how to access it (omitting
* the error handling).
*
* {
* FT_Library library;
* FT_Face face;
* FT_Prop_GlyphToScriptMap prop;
*
*
* FT_Init_FreeType( &library );
* FT_New_Face( library, "foo.ttf", 0, &face );
*
* prop.face = face;
*
* FT_Property_Get( library, "autofitter",
* "glyph-to-script-map", &prop );
*
* // adjust `prop.map' as needed right here
*
* FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
* }
*
*/
/**************************************************************************
*
* @enum:
* FT_AUTOHINTER_SCRIPT_XXX
*
* @description:
* *Experimental* *only*
*
* A list of constants used for the @glyph-to-script-map property to
* specify the script submodule the auto-hinter should use for hinting a
* particular glyph.
*
* @values:
* FT_AUTOHINTER_SCRIPT_NONE ::
* Don't auto-hint this glyph.
*
* FT_AUTOHINTER_SCRIPT_LATIN ::
* Apply the latin auto-hinter. For the auto-hinter, `latin' is a
* very broad term, including Cyrillic and Greek also since characters
* from those scripts share the same design constraints.
*
* By default, characters from the following Unicode ranges are
* assigned to this submodule.
*
* {
* U+0020 - U+007F // Basic Latin (no control characters)
* U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
* U+0100 - U+017F // Latin Extended-A
* U+0180 - U+024F // Latin Extended-B
* U+0250 - U+02AF // IPA Extensions
* U+02B0 - U+02FF // Spacing Modifier Letters
* U+0300 - U+036F // Combining Diacritical Marks
* U+0370 - U+03FF // Greek and Coptic
* U+0400 - U+04FF // Cyrillic
* U+0500 - U+052F // Cyrillic Supplement
* U+1D00 - U+1D7F // Phonetic Extensions
* U+1D80 - U+1DBF // Phonetic Extensions Supplement
* U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
* U+1E00 - U+1EFF // Latin Extended Additional
* U+1F00 - U+1FFF // Greek Extended
* U+2000 - U+206F // General Punctuation
* U+2070 - U+209F // Superscripts and Subscripts
* U+20A0 - U+20CF // Currency Symbols
* U+2150 - U+218F // Number Forms
* U+2460 - U+24FF // Enclosed Alphanumerics
* U+2C60 - U+2C7F // Latin Extended-C
* U+2DE0 - U+2DFF // Cyrillic Extended-A
* U+2E00 - U+2E7F // Supplemental Punctuation
* U+A640 - U+A69F // Cyrillic Extended-B
* U+A720 - U+A7FF // Latin Extended-D
* U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
* U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
* U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
* }
*
* FT_AUTOHINTER_SCRIPT_CJK ::
* Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
* Vietnamese, and some other scripts.
*
* By default, characters from the following Unicode ranges are
* assigned to this submodule.
*
* {
* U+1100 - U+11FF // Hangul Jamo
* U+2E80 - U+2EFF // CJK Radicals Supplement
* U+2F00 - U+2FDF // Kangxi Radicals
* U+2FF0 - U+2FFF // Ideographic Description Characters
* U+3000 - U+303F // CJK Symbols and Punctuation
* U+3040 - U+309F // Hiragana
* U+30A0 - U+30FF // Katakana
* U+3100 - U+312F // Bopomofo
* U+3130 - U+318F // Hangul Compatibility Jamo
* U+3190 - U+319F // Kanbun
* U+31A0 - U+31BF // Bopomofo Extended
* U+31C0 - U+31EF // CJK Strokes
* U+31F0 - U+31FF // Katakana Phonetic Extensions
* U+3200 - U+32FF // Enclosed CJK Letters and Months
* U+3300 - U+33FF // CJK Compatibility
* U+3400 - U+4DBF // CJK Unified Ideographs Extension A
* U+4DC0 - U+4DFF // Yijing Hexagram Symbols
* U+4E00 - U+9FFF // CJK Unified Ideographs
* U+A960 - U+A97F // Hangul Jamo Extended-A
* U+AC00 - U+D7AF // Hangul Syllables
* U+D7B0 - U+D7FF // Hangul Jamo Extended-B
* U+F900 - U+FAFF // CJK Compatibility Ideographs
* U+FE10 - U+FE1F // Vertical forms
* U+FE30 - U+FE4F // CJK Compatibility Forms
* U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
* U+1B000 - U+1B0FF // Kana Supplement
* U+1D300 - U+1D35F // Tai Xuan Hing Symbols
* U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
* U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
* U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
* U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
* U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
* }
*
* FT_AUTOHINTER_SCRIPT_INDIC ::
* Apply the indic auto-hinter, covering all major scripts from the
* Indian sub-continent and some other related scripts like Thai, Lao,
* or Tibetan.
*
* By default, characters from the following Unicode ranges are
* assigned to this submodule.
*
* {
* U+0900 - U+0DFF // Indic Range
* U+0F00 - U+0FFF // Tibetan
* U+1900 - U+194F // Limbu
* U+1B80 - U+1BBF // Sundanese
* U+A800 - U+A82F // Syloti Nagri
* U+ABC0 - U+ABFF // Meetei Mayek
* U+11800 - U+118DF // Sharada
* }
*
* Note that currently Indic support is rudimentary only, missing blue
* zone support.
*
*/
#define FT_AUTOHINTER_SCRIPT_NONE 0
#define FT_AUTOHINTER_SCRIPT_LATIN 1
#define FT_AUTOHINTER_SCRIPT_CJK 2
#define FT_AUTOHINTER_SCRIPT_INDIC 3
/**************************************************************************
*
* @struct:
* FT_Prop_GlyphToScriptMap
*
* @description:
* *Experimental* *only*
*
* The data exchange structure for the @glyph-to-script-map property.
*
*/
typedef struct FT_Prop_GlyphToScriptMap_
{
FT_Face face;
FT_UShort* map;
} FT_Prop_GlyphToScriptMap;
/**************************************************************************
*
* @property:
* fallback-script
*
* @description:
* *Experimental* *only*
*
* If no auto-hinter script module can be assigned to a glyph, a
* fallback script gets assigned to it (see also the
* @glyph-to-script-map property). By default, this is
* @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property,
* this fallback value can be changed.
*
* {
* FT_Library library;
* FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "autofitter",
* "fallback-script", &fallback_script );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* It's important to use the right timing for changing this value: The
* creation of the glyph-to-script map that eventually uses the
* fallback script value gets triggered either by setting or reading a
* face-specific property like @glyph-to-script-map, or by auto-hinting
* any glyph from that face. In particular, if you have already created
* an @FT_Face structure but not loaded any glyph (using the
* auto-hinter), a change of the fallback script will affect this face.
*
*/
/**************************************************************************
*
* @property:
* default-script
*
* @description:
* *Experimental* *only*
*
* If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
* the HarfBuzz library access OpenType features for getting better
* glyph coverages, this property sets the (auto-fitter) script to be
* used for the default (OpenType) script data of a font's GSUB table.
* Features for the default script are intended for all scripts not
* explicitly handled in GSUB; an example is a `dlig' feature,
* containing the combination of the characters `T', `E', and `L' to
* form a `TEL' ligature.
*
* By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the
* `default-script' property, this default value can be changed.
*
* {
* FT_Library library;
* FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "autofitter",
* "default-script", &default_script );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* It's important to use the right timing for changing this value: The
* creation of the glyph-to-script map that eventually uses the
* default script value gets triggered either by setting or reading a
* face-specific property like @glyph-to-script-map, or by auto-hinting
* any glyph from that face. In particular, if you have already created
* an @FT_Face structure but not loaded any glyph (using the
* auto-hinter), a change of the default script will affect this face.
*
*/
/**************************************************************************
*
* @property:
* increase-x-height
*
* @description:
* For ppem values in the range 6~<= ppem <= `increase-x-height', round
* up the font's x~height much more often than normally. If the value
* is set to~0, which is the default, this feature is switched off. Use
* this property to improve the legibility of small font sizes if
* necessary.
*
* {
* FT_Library library;
* FT_Face face;
* FT_Prop_IncreaseXHeight prop;
*
*
* FT_Init_FreeType( &library );
* FT_New_Face( library, "foo.ttf", 0, &face );
* FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
*
* prop.face = face;
* prop.limit = 14;
*
* FT_Property_Set( library, "autofitter",
* "increase-x-height", &prop );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* Set this value right after calling @FT_Set_Char_Size, but before
* loading any glyph (using the auto-hinter).
*
*/
/**************************************************************************
*
* @struct:
* FT_Prop_IncreaseXHeight
*
* @description:
* The data exchange structure for the @increase-x-height property.
*
*/
typedef struct FT_Prop_IncreaseXHeight_
{
FT_Face face;
FT_UInt limit;
} FT_Prop_IncreaseXHeight;
/**************************************************************************
*
* @property:
* warping
*
* @description:
* *Experimental* *only*
*
* If FreeType gets compiled with option AF_CONFIG_OPTION_USE_WARPER to
* activate the warp hinting code in the auto-hinter, this property
* switches warping on and off.
*
* Warping only works in `normal' auto-hinting mode replacing it.
* The idea of the code is to slightly scale and shift a glyph along
* the non-hinted dimension (which is usually the horizontal axis) so
* that as much of its segments are aligned (more or less) to the grid.
* To find out a glyph's optimal scaling and shifting value, various
* parameter combinations are tried and scored.
*
* By default, warping is off. The example below shows how to switch on
* warping (omitting the error handling).
*
* {
* FT_Library library;
* FT_Bool warping = 1;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "autofitter",
* "warping", &warping );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable (using values 1 and 0 for `on' and `off', respectively).
*
* The warping code can also change advance widths. Have a look at the
* `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure
* for details on improving inter-glyph distances while rendering.
*
* Since warping is a global property of the auto-hinter it is best to
* change its value before rendering any face. Otherwise, you should
* reload all faces that get auto-hinted in `normal' hinting mode.
*
*/
/**************************************************************************
*
* @property:
* no-stem-darkening[autofit]
*
* @description:
* *Experimental* *only*, *requires* *linear* *alpha* *blending* *and*
* *gamma* *correction*
*
* Stem darkening emboldens glyphs at smaller sizes to make them more
* readable on common low-DPI screens when using linear alpha blending
* and gamma correction, see @FT_Render_Glyph. When not using linear
* alpha blending and gamma correction, glyphs will appear heavy and
* fuzzy!
*
* Gamma correction essentially lightens fonts since shades of grey are
* shifted to higher pixel values (=~higher brightness) to match the
* original intention to the reality of our screens. The side-effect is
* that glyphs `thin out'. Mac OS~X and Adobe's proprietary font
* rendering library implement a counter-measure: stem darkening at
* smaller sizes where shades of gray dominate. By emboldening a glyph
* slightly in relation to its pixel size, individual pixels get higher
* coverage of filled-in outlines and are therefore `blacker'. This
* counteracts the `thinning out' of glyphs, making text remain readable
* at smaller sizes. All glyphs that pass through the auto-hinter will
* be emboldened unless this property is set to TRUE.
*
* See the description of the CFF driver for algorithmic details. Total
* consistency with the CFF driver is currently not achieved because the
* emboldening method differs and glyphs must be scaled down on the
* Y-axis to keep outline points inside their precomputed blue zones.
* The smaller the size (especially 9ppem and down), the higher the loss
* of emboldening versus the CFF driver.
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable similar to the CFF driver. It can also be set per face
* using @FT_Face_Properties with @FT_PARAM_TAG_STEM_DARKENING.
*
*/
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_STEM_DARKENING
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding Boolean argument specifies whether to apply stem
* darkening, overriding the global default values or the values set up
* with @FT_Property_Set (see @no-stem-darkening[autofit] and
* @no-stem-darkening[cff]).
*
* This is a passive setting that only takes effect if the font driver
* or autohinter honors it, which the CFF driver always does, but the
* autohinter only in `light' hinting mode (as of version 2.7.0).
*
*/
#define FT_PARAM_TAG_STEM_DARKENING \
FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/**************************************************************************
*
* @property:
* darkening-parameters[autofit]
*
* @description:
* *Experimental* *only*
*
* See the description of the CFF driver for details. This
* implementation appropriates the
* CFF_CONFIG_OPTION_DARKENING_PARAMETER_* #defines for consistency.
* Note the differences described in @no-stem-darkening[autofit].
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable similar to the CFF driver.
*/
/* */
FT_END_HEADER
#endif /* FTAUTOH_H_ */
/* END */

View file

@ -1,30 +1,30 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbbox.h */ * ftbbox.h
/* */ *
/* FreeType exact bbox computation (specification). */ * FreeType exact bbox computation (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* This component has a _single_ role: to compute exact outline bounding */ * This component has a _single_ role: to compute exact outline bounding
/* boxes. */ * boxes.
/* */ *
/* It is separated from the rest of the engine for various technical */ * It is separated from the rest of the engine for various technical
/* reasons. It may well be integrated in `ftoutln' later. */ * reasons. It may well be integrated in 'ftoutln' later.
/* */ *
/*************************************************************************/ */
#ifndef FTBBOX_H_ #ifndef FTBBOX_H_
@ -44,43 +44,44 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* outline_processing */ * outline_processing
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Get_BBox */ * FT_Outline_Get_BBox
/* */ *
/* <Description> */ * @description:
/* Compute the exact bounding box of an outline. This is slower */ * Compute the exact bounding box of an outline. This is slower than
/* than computing the control box. However, it uses an advanced */ * computing the control box. However, it uses an advanced algorithm
/* algorithm that returns _very_ quickly when the two boxes */ * that returns _very_ quickly when the two boxes coincide. Otherwise,
/* coincide. Otherwise, the outline Bezier arcs are traversed to */ * the outline Bezier arcs are traversed to extract their extrema.
/* extract their extrema. */ *
/* */ * @input:
/* <Input> */ * outline ::
/* outline :: A pointer to the source outline. */ * A pointer to the source outline.
/* */ *
/* <Output> */ * @output:
/* abbox :: The outline's exact bounding box. */ * abbox ::
/* */ * The outline's exact bounding box.
/* <Return> */ *
/* FreeType error code. 0~means success. */ * @return:
/* */ * FreeType error code. 0~means success.
/* <Note> */ *
/* If the font is tricky and the glyph has been loaded with */ * @note:
/* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */ * If the font is tricky and the glyph has been loaded with
/* reasonable values for the BBox it is necessary to load the glyph */ * @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get
/* at a large ppem value (so that the hinting instructions can */ * reasonable values for the BBox it is necessary to load the glyph at a
/* properly shift and scale the subglyphs), then extracting the BBox, */ * large ppem value (so that the hinting instructions can properly shift
/* which can be eventually converted back to font units. */ * and scale the subglyphs), then extracting the BBox, which can be
/* */ * eventually converted back to font units.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline, FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox ); FT_BBox *abbox );

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbdf.h */ * ftbdf.h
/* */ *
/* FreeType API for accessing BDF-specific strings (specification). */ * FreeType API for accessing BDF-specific strings (specification).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTBDF_H_ #ifndef FTBDF_H_
@ -32,25 +32,25 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* bdf_fonts */ * bdf_fonts
/* */ *
/* <Title> */ * @title:
/* BDF and PCF Files */ * BDF and PCF Files
/* */ *
/* <Abstract> */ * @abstract:
/* BDF and PCF specific API. */ * BDF and PCF specific API.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of functions specific to BDF */ * This section contains the declaration of functions specific to BDF and
/* and PCF fonts. */ * PCF fonts.
/* */ *
/*************************************************************************/ */
/********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* BDF_PropertyType * BDF_PropertyType
@ -81,19 +81,19 @@ FT_BEGIN_HEADER
} BDF_PropertyType; } BDF_PropertyType;
/********************************************************************** /**************************************************************************
* *
* @type: * @type:
* BDF_Property * BDF_Property
* *
* @description: * @description:
* A handle to a @BDF_PropertyRec structure to model a given * A handle to a @BDF_PropertyRec structure to model a given BDF/PCF
* BDF/PCF property. * property.
*/ */
typedef struct BDF_PropertyRec_* BDF_Property; typedef struct BDF_PropertyRec_* BDF_Property;
/********************************************************************** /**************************************************************************
* *
* @struct: * @struct:
* BDF_PropertyRec * BDF_PropertyRec
@ -107,7 +107,7 @@ FT_BEGIN_HEADER
* *
* u.atom :: * u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
* NULL, indicating an empty string. * `NULL`, indicating an empty string.
* *
* u.integer :: * u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
@ -128,14 +128,14 @@ FT_BEGIN_HEADER
} BDF_PropertyRec; } BDF_PropertyRec;
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_BDF_Charset_ID * FT_Get_BDF_Charset_ID
* *
* @description: * @description:
* Retrieve a BDF font character set identity, according to * Retrieve a BDF font character set identity, according to the BDF
* the BDF specification. * specification.
* *
* @input: * @input:
* face :: * face ::
@ -160,7 +160,7 @@ FT_BEGIN_HEADER
const char* *acharset_registry ); const char* *acharset_registry );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_BDF_Property * FT_Get_BDF_Property
@ -169,12 +169,15 @@ FT_BEGIN_HEADER
* Retrieve a BDF property from a BDF or PCF font file. * Retrieve a BDF property from a BDF or PCF font file.
* *
* @input: * @input:
* face :: A handle to the input face. * face ::
* A handle to the input face.
* *
* name :: The property name. * name ::
* The property name.
* *
* @output: * @output:
* aproperty :: The property. * aproperty ::
* The property.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -184,15 +187,15 @@ FT_BEGIN_HEADER
* otherwise. It also returns an error if the property is not in the * otherwise. It also returns an error if the property is not in the
* font. * font.
* *
* A `property' is a either key-value pair within the STARTPROPERTIES * A 'property' is a either key-value pair within the STARTPROPERTIES
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* `info->props' array within a `FontRec' structure of a PCF font. * `info->props` array within a `FontRec` structure of a PCF font.
* *
* Integer properties are always stored as `signed' within PCF fonts; * Integer properties are always stored as 'signed' within PCF fonts;
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* for BDF fonts only. * for BDF fonts only.
* *
* In case of error, `aproperty->type' is always set to * In case of error, `aproperty->type` is always set to
* @BDF_PROPERTY_TYPE_NONE. * @BDF_PROPERTY_TYPE_NONE.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbitmap.h */ * ftbitmap.h
/* */ *
/* FreeType utility functions for bitmaps (specification). */ * FreeType utility functions for bitmaps (specification).
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTBITMAP_H_ #ifndef FTBITMAP_H_
@ -22,6 +22,7 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include FT_COLOR_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
@ -33,39 +34,46 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* bitmap_handling */ * bitmap_handling
/* */ *
/* <Title> */ * @title:
/* Bitmap Handling */ * Bitmap Handling
/* */ *
/* <Abstract> */ * @abstract:
/* Handling FT_Bitmap objects. */ * Handling FT_Bitmap objects.
/* */ *
/* <Description> */ * @description:
/* This section contains functions for 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 */ * automatically adjusting the target's bitmap buffer size as needed.
/* indicated by the sign of the `pitch' field in `FT_Bitmap'). */ *
/* */ * 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.
*/
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Bitmap_Init */ * FT_Bitmap_Init
/* */ *
/* <Description> */ * @description:
/* Initialize a pointer to an @FT_Bitmap structure. */ * Initialize a pointer to an @FT_Bitmap structure.
/* */ *
/* <InOut> */ * @inout:
/* abitmap :: A pointer to the bitmap structure. */ * abitmap ::
/* */ * A pointer to the bitmap structure.
/* <Note> */ *
/* A deprecated name for the same function is `FT_Bitmap_New'. */ * @note:
/* */ * A deprecated name for the same function is `FT_Bitmap_New`.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_Bitmap_Init( FT_Bitmap *abitmap ); FT_Bitmap_Init( FT_Bitmap *abitmap );
@ -75,66 +83,77 @@ FT_BEGIN_HEADER
FT_Bitmap_New( FT_Bitmap *abitmap ); FT_Bitmap_New( FT_Bitmap *abitmap );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Bitmap_Copy */ * FT_Bitmap_Copy
/* */ *
/* <Description> */ * @description:
/* Copy a bitmap into another one. */ * Copy a bitmap into another one.
/* */ *
/* <Input> */ * @input:
/* library :: A handle to a library object. */ * library ::
/* */ * A handle to a library object.
/* source :: A handle to the source bitmap. */ *
/* */ * source ::
/* <Output> */ * A handle to the source bitmap.
/* target :: A handle to the target bitmap. */ *
/* */ * @output:
/* <Return> */ * target ::
/* FreeType error code. 0~means success. */ * A handle to the target bitmap.
/* */ *
* @return:
* FreeType error code. 0~means success.
*
* @note:
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library, FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source, const FT_Bitmap *source,
FT_Bitmap *target ); FT_Bitmap *target );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Bitmap_Embolden */ * FT_Bitmap_Embolden
/* */ *
/* <Description> */ * @description:
/* Embolden a bitmap. The new bitmap will be about `xStrength' */ * Embolden a bitmap. The new bitmap will be about `xStrength` pixels
/* pixels wider and `yStrength' pixels higher. The left and bottom */ * wider and `yStrength` pixels higher. The left and bottom borders are
/* borders are kept unchanged. */ * kept unchanged.
/* */ *
/* <Input> */ * @input:
/* library :: A handle to a library object. */ * library ::
/* */ * A handle to a library object.
/* xStrength :: How strong the glyph is emboldened horizontally. */ *
/* Expressed in 26.6 pixel format. */ * xStrength ::
/* */ * How strong the glyph is emboldened horizontally. Expressed in 26.6
/* yStrength :: How strong the glyph is emboldened vertically. */ * pixel format.
/* Expressed in 26.6 pixel format. */ *
/* */ * yStrength ::
/* <InOut> */ * How strong the glyph is emboldened vertically. Expressed in 26.6
/* bitmap :: A handle to the target bitmap. */ * pixel format.
/* */ *
/* <Return> */ * @inout:
/* FreeType error code. 0~means success. */ * bitmap ::
/* */ * A handle to the target bitmap.
/* <Note> */ *
/* The current implementation restricts `xStrength' to be less than */ * @return:
/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ * FreeType error code. 0~means success.
/* */ *
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ * @note:
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ * The current implementation restricts `xStrength` to be less than or
/* */ * equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.
/* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */ *
/* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */ * 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_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library, FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap, FT_Bitmap* bitmap,
@ -142,39 +161,46 @@ FT_BEGIN_HEADER
FT_Pos yStrength ); FT_Pos yStrength );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Bitmap_Convert */ * FT_Bitmap_Convert
/* */ *
/* <Description> */ * @description:
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */ * Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to
/* to a bitmap object with depth 8bpp, making the number of used */ * a bitmap object with depth 8bpp, making the number of used bytes per
/* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */ * line (a.k.a. the 'pitch') a multiple of `alignment`.
/* */ *
/* <Input> */ * @input:
/* library :: A handle to a library object. */ * library ::
/* */ * A handle to a library object.
/* source :: The source bitmap. */ *
/* */ * source ::
/* alignment :: The pitch of the bitmap is a multiple of this */ * The source bitmap.
/* parameter. Common values are 1, 2, or 4. */ *
/* */ * alignment ::
/* <Output> */ * The pitch of the bitmap is a multiple of this argument. Common
/* target :: The target bitmap. */ * values are 1, 2, or 4.
/* */ *
/* <Return> */ * @output:
/* FreeType error code. 0~means success. */ * target ::
/* */ * The target bitmap.
/* <Note> */ *
/* It is possible to call @FT_Bitmap_Convert multiple times without */ * @return:
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */ * FreeType error code. 0~means success.
/* */ *
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */ * @note:
/* */ * It is possible to call @FT_Bitmap_Convert multiple times without
/* The `library' argument is taken to have access to FreeType's */ * calling @FT_Bitmap_Done (the memory is simply reallocated).
/* memory handling functions. */ *
/* */ * Use @FT_Bitmap_Done to finally remove the bitmap object.
*
* The `library` argument is taken to have access to FreeType's memory
* handling functions.
*
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library, FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source, const FT_Bitmap *source,
@ -182,48 +208,112 @@ FT_BEGIN_HEADER
FT_Int alignment ); FT_Int alignment );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_GlyphSlot_Own_Bitmap */ * FT_Bitmap_Blend
/* */ *
/* <Description> */ * @description:
/* Make sure that a glyph slot owns `slot->bitmap'. */ * Blend a bitmap onto another bitmap, using a given color.
/* */ *
/* <Input> */ * @input:
/* slot :: The glyph slot. */ * library ::
/* */ * A handle to a library object.
/* <Return> */ *
/* FreeType error code. 0~means success. */ * source ::
/* */ * The source bitmap, which can have any @FT_Pixel_Mode format.
/* <Note> */ *
/* This function is to be used in combination with */ * source_offset ::
/* @FT_Bitmap_Embolden. */ * The offset vector to the upper left corner of the source 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.
*
* color ::
* The color used to draw `source` onto `target`.
*
* @inout:
* 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.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* 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).
*
* `source->buffer` and `target->buffer` must neither be equal nor
* overlap.
*
* @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 );
/**************************************************************************
*
* @function:
* FT_GlyphSlot_Own_Bitmap
*
* @description:
* Make sure that a glyph slot owns `slot->bitmap`.
*
* @input:
* slot ::
* The glyph slot.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function is to be used in combination with @FT_Bitmap_Embolden.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Bitmap_Done */ * FT_Bitmap_Done
/* */ *
/* <Description> */ * @description:
/* Destroy a bitmap object initialized with @FT_Bitmap_Init. */ * Destroy a bitmap object initialized with @FT_Bitmap_Init.
/* */ *
/* <Input> */ * @input:
/* library :: A handle to a library object. */ * library ::
/* */ * A handle to a library object.
/* bitmap :: The bitmap object to be freed. */ *
/* */ * bitmap ::
/* <Return> */ * The bitmap object to be freed.
/* FreeType error code. 0~means success. */ *
/* */ * @return:
/* <Note> */ * FreeType error code. 0~means success.
/* The `library' argument is taken to have access to FreeType's */ *
/* memory handling functions. */ * @note:
/* */ * The `library` argument is taken to have access to FreeType's memory
* handling functions.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library, FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap ); FT_Bitmap *bitmap );

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbzip2.h */ * ftbzip2.h
/* */ *
/* Bzip2-compressed stream support. */ * Bzip2-compressed stream support.
/* */ *
/* Copyright 2010-2018 by */ * Copyright (C) 2010-2019 by
/* Joel Klinghed. */ * Joel Klinghed.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTBZIP2_H_ #ifndef FTBZIP2_H_
@ -31,32 +31,32 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* bzip2 */ * bzip2
/* */ *
/* <Title> */ * @title:
/* BZIP2 Streams */ * BZIP2 Streams
/* */ *
/* <Abstract> */ * @abstract:
/* Using bzip2-compressed font files. */ * Using bzip2-compressed font files.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of Bzip2-specific functions. */ * This section contains the declaration of Bzip2-specific functions.
/* */ *
/*************************************************************************/ */
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Stream_OpenBzip2 * FT_Stream_OpenBzip2
* *
* @description: * @description:
* Open a new stream to parse bzip2-compressed font files. This is * Open a new stream to parse bzip2-compressed font files. This is
* mainly used to support the compressed `*.pcf.bz2' fonts that come * mainly used to support the compressed `*.pcf.bz2` fonts that come with
* with XFree86. * XFree86.
* *
* @input: * @input:
* stream :: * stream ::
@ -71,9 +71,9 @@ FT_BEGIN_HEADER
* @note: * @note:
* The source stream must be opened _before_ calling this function. * The source stream must be opened _before_ calling this function.
* *
* Calling the internal function `FT_Stream_Close' on the new stream will * 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 * **not** call `FT_Stream_Close` on the source stream. None of the
* objects will be released to the heap. * stream objects will be released to the heap.
* *
* The stream implementation is very basic and resets the decompression * The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream. * process each time seeking backwards is needed within the stream.
@ -81,10 +81,10 @@ FT_BEGIN_HEADER
* In certain builds of the library, bzip2 compression recognition is * In certain builds of the library, bzip2 compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face. * automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw * 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 * compressed file, the library will try to open a bzip2 compressed
* from it and re-open the face with it. * stream from it and re-open the face with it.
* *
* This function may return `FT_Err_Unimplemented_Feature' if your build * This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with bzip2 support. * of FreeType was not compiled with bzip2 support.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )

File diff suppressed because it is too large Load diff

View file

@ -1,321 +0,0 @@
/***************************************************************************/
/* */
/* ftcffdrv.h */
/* */
/* FreeType API for controlling the CFF driver (specification only). */
/* */
/* Copyright 2013-2017 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. */
/* */
/***************************************************************************/
#ifndef FTCFFDRV_H_
#define FTCFFDRV_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
/**************************************************************************
*
* @section:
* cff_driver
*
* @title:
* The CFF driver
*
* @abstract:
* Controlling the CFF driver module.
*
* @description:
* While FreeType's CFF driver doesn't expose API functions by itself,
* it is possible to control its behaviour with @FT_Property_Set and
* @FT_Property_Get. The list below gives the available properties
* together with the necessary macros and structures.
*
* The CFF driver's module name is `cff'.
*
* *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*
*
* The rasterizer is positioning horizontal features (e.g., ascender
* height & x-height, or crossbars) on the pixel grid and minimizing the
* amount of antialiasing applied to them, while placing vertical
* features (vertical stems) on the pixel grid without hinting, thus
* representing the stem position and weight accurately. Sometimes the
* vertical stems may be only partially black. In this context,
* `antialiasing' means that stems are not positioned exactly on pixel
* borders, causing a fuzzy appearance.
*
* There are two principles behind this approach.
*
* 1) No hinting in the horizontal direction: Unlike `superhinted'
* TrueType, which changes glyph widths to accommodate regular
* inter-glyph spacing, Adobe's approach is `faithful to the design' in
* representing both the glyph width and the inter-glyph spacing
* designed for the font. This makes the screen display as close as it
* can be to the result one would get with infinite resolution, while
* preserving what is considered the key characteristics of each glyph.
* Note that the distances between unhinted and grid-fitted positions at
* small sizes are comparable to kerning values and thus would be
* noticeable (and distracting) while reading if hinting were applied.
*
* One of the reasons to not hint horizontally is antialiasing for LCD
* screens: The pixel geometry of modern displays supplies three
* vertical sub-pixels as the eye moves horizontally across each visible
* pixel. On devices where we can be certain this characteristic is
* present a rasterizer can take advantage of the sub-pixels to add
* increments of weight. In Western writing systems this turns out to
* be the more critical direction anyway; the weights and spacing of
* vertical stems (see above) are central to Armenian, Cyrillic, Greek,
* and Latin type designs. Even when the rasterizer uses greyscale
* antialiasing instead of color (a necessary compromise when one
* doesn't know the screen characteristics), the unhinted vertical
* features preserve the design's weight and spacing much better than
* aliased type would.
*
* 2) Alignment in the vertical direction: Weights and spacing along the
* y~axis are less critical; what is much more important is the visual
* alignment of related features (like cap-height and x-height). The
* sense of alignment for these is enhanced by the sharpness of grid-fit
* edges, while the cruder vertical resolution (full pixels instead of
* 1/3 pixels) is less of a problem.
*
* On the technical side, horizontal alignment zones for ascender,
* x-height, and other important height values (traditionally called
* `blue zones') as defined in the font are positioned independently,
* each being rounded to the nearest pixel edge, taking care of
* overshoot suppression at small sizes, stem darkening, and scaling.
*
* Hstems (this is, hint values defined in the font to help align
* horizontal features) that fall within a blue zone are said to be
* `captured' and are aligned to that zone. Uncaptured stems are moved
* in one of four ways, top edge up or down, bottom edge up or down.
* Unless there are conflicting hstems, the smallest movement is taken
* to minimize distortion.
*
* @order:
* hinting-engine[cff]
* no-stem-darkening[cff]
* darkening-parameters[cff]
* random-seed
*
*/
/**************************************************************************
*
* @property:
* hinting-engine[cff]
*
* @description:
* Thanks to Adobe, which contributed a new hinting (and parsing)
* engine, an application can select between `freetype' and `adobe' if
* compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
* macro isn't defined, `hinting-engine' does nothing.
*
* The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
* defined, and `adobe' otherwise.
*
* The following example code demonstrates how to select Adobe's hinting
* engine (omitting the error handling).
*
* {
* FT_Library library;
* FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "cff",
* "hinting-engine", &hinting_engine );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable (using values `adobe' or `freetype').
*/
/**************************************************************************
*
* @enum:
* FT_CFF_HINTING_XXX
*
* @description:
* A list of constants used for the @hinting-engine[cff] property to
* select the hinting engine for CFF fonts.
*
* @values:
* FT_CFF_HINTING_FREETYPE ::
* Use the old FreeType hinting engine.
*
* FT_CFF_HINTING_ADOBE ::
* Use the hinting engine contributed by Adobe.
*
*/
#define FT_CFF_HINTING_FREETYPE 0
#define FT_CFF_HINTING_ADOBE 1
/**************************************************************************
*
* @property:
* no-stem-darkening[cff]
*
* @description:
* By default, the Adobe CFF engine darkens stems at smaller sizes,
* regardless of hinting, to enhance contrast. This feature requires
* a rendering system with proper gamma correction. Setting this
* property, stem darkening gets switched off.
*
* Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
*
* {
* FT_Library library;
* FT_Bool no_stem_darkening = TRUE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "cff",
* "no-stem-darkening", &no_stem_darkening );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable (using values 1 and 0 for `on' and `off', respectively).
* It can also be set per face using @FT_Face_Properties with
* @FT_PARAM_TAG_STEM_DARKENING.
*
*/
/**************************************************************************
*
* @property:
* darkening-parameters[cff]
*
* @description:
* By default, the Adobe CFF engine darkens stems as follows (if the
* `no-stem-darkening' property isn't set):
*
* {
* stem width <= 0.5px: darkening amount = 0.4px
* stem width = 1px: darkening amount = 0.275px
* stem width = 1.667px: darkening amount = 0.275px
* stem width >= 2.333px: darkening amount = 0px
* }
*
* and piecewise linear in-between. At configuration time, these four
* control points can be set with the macro
* `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'. At runtime, the control
* points can be changed using the `darkening-parameters' property, as
* the following example demonstrates.
*
* {
* FT_Library library;
* FT_Int darken_params[8] = { 500, 300, // x1, y1
* 1000, 200, // x2, y2
* 1500, 100, // x3, y3
* 2000, 0 }; // x4, y4
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "cff",
* "darkening-parameters", darken_params );
* }
*
* The x~values give the stem width, and the y~values the darkening
* amount. The unit is 1000th of pixels. All coordinate values must be
* positive; the x~values must be monotonically increasing; the
* y~values must be monotonically decreasing and smaller than or
* equal to 500 (corresponding to half a pixel); the slope of each
* linear piece must be shallower than -1 (e.g., -.4).
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable, using eight comma-separated integers without spaces. Here
* the above example, using `\' to break the line for readability.
*
* {
* FREETYPE_PROPERTIES=\
* cff:darkening-parameters=500,300,1000,200,1500,100,2000,0
* }
*/
/**************************************************************************
*
* @property:
* random-seed
*
* @description:
* By default, the seed value for the CFF `random' operator is set to a
* random value. However, mainly for debugging purposes, it is often
* necessary to use a known value as a seed so that the pseudo-random
* number sequences generated by `random' are repeatable.
*
* The `random-seed' property does that. Its argument is a signed 32bit
* integer; if the value is zero or negative, the seed given by the
* `intitialRandomSeed' private DICT operator in a CFF file gets used
* (or a default value if there is no such operator). If the value is
* positive, use it instead of `initialRandomSeed', which is
* consequently ignored.
*
* @note:
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable. It can also be set per face using @FT_Face_Properties with
* @FT_PARAM_TAG_RANDOM_SEED.
*
*/
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_RANDOM_SEED
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding 32bit signed integer argument overrides the CFF
* module's random seed value with a face-specific one; see
* @random-seed.
*
*/
#define FT_PARAM_TAG_RANDOM_SEED \
FT_MAKE_TAG( 's', 'e', 'e', 'd' )
/* */
FT_END_HEADER
#endif /* FTCFFDRV_H_ */
/* END */

View file

@ -1,139 +1,145 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* This file defines the structure of the FreeType reference. */ * This file defines the structure of the FreeType reference.
/* It is used by the python script that generates the HTML files. */ * It is used by the python script that generates the HTML files.
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /**************************************************************************
/* */ *
/* <Chapter> */ * @chapter:
/* general_remarks */ * general_remarks
/* */ *
/* <Title> */ * @title:
/* General Remarks */ * General Remarks
/* */ *
/* <Sections> */ * @sections:
/* header_inclusion */ * header_inclusion
/* user_allocation */ * user_allocation
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /**************************************************************************
/* */ *
/* <Chapter> */ * @chapter:
/* core_api */ * core_api
/* */ *
/* <Title> */ * @title:
/* Core API */ * Core API
/* */ *
/* <Sections> */ * @sections:
/* version */ * version
/* basic_types */ * basic_types
/* base_interface */ * base_interface
/* glyph_variants */ * glyph_variants
/* glyph_management */ * color_management
/* mac_specific */ * layer_management
/* sizes_management */ * glyph_management
/* header_file_macros */ * mac_specific
/* */ * sizes_management
/***************************************************************************/ * header_file_macros
*
*/
/***************************************************************************/ /**************************************************************************
/* */ *
/* <Chapter> */ * @chapter:
/* format_specific */ * format_specific
/* */ *
/* <Title> */ * @title:
/* Format-Specific API */ * Format-Specific API
/* */ *
/* <Sections> */ * @sections:
/* multiple_masters */ * multiple_masters
/* truetype_tables */ * truetype_tables
/* type1_tables */ * type1_tables
/* sfnt_names */ * sfnt_names
/* bdf_fonts */ * bdf_fonts
/* cid_fonts */ * cid_fonts
/* pfr_fonts */ * pfr_fonts
/* winfnt_fonts */ * winfnt_fonts
/* font_formats */ * font_formats
/* gasp_table */ * gasp_table
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /**************************************************************************
/* */ *
/* <Chapter> */ * @chapter:
/* module_specific */ * module_specific
/* */ *
/* <Title> */ * @title:
/* Controlling FreeType Modules */ * Controlling FreeType Modules
/* */ *
/* <Sections> */ * @sections:
/* auto_hinter */ * auto_hinter
/* cff_driver */ * cff_driver
/* t1_cid_driver */ * t1_cid_driver
/* tt_driver */ * tt_driver
/* pcf_driver */ * pcf_driver
/* properties */ * properties
/* parameter_tags */ * parameter_tags
/* */ * lcd_rendering
/***************************************************************************/ *
*/
/***************************************************************************/ /**************************************************************************
/* */ *
/* <Chapter> */ * @chapter:
/* cache_subsystem */ * cache_subsystem
/* */ *
/* <Title> */ * @title:
/* Cache Sub-System */ * Cache Sub-System
/* */ *
/* <Sections> */ * @sections:
/* cache_subsystem */ * cache_subsystem
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /**************************************************************************
/* */ *
/* <Chapter> */ * @chapter:
/* support_api */ * support_api
/* */ *
/* <Title> */ * @title:
/* Support API */ * Support API
/* */ *
/* <Sections> */ * @sections:
/* computations */ * computations
/* list_processing */ * list_processing
/* outline_processing */ * outline_processing
/* quick_advance */ * quick_advance
/* bitmap_handling */ * bitmap_handling
/* raster */ * raster
/* glyph_stroker */ * glyph_stroker
/* system_interface */ * system_interface
/* module_management */ * module_management
/* gzip */ * gzip
/* lzw */ * lzw
/* bzip2 */ * bzip2
/* lcd_filtering */ *
/* */ */
/***************************************************************************/
/***************************************************************************/
/* */ /**************************************************************************
/* <Chapter> */ *
/* error_codes */ * @chapter:
/* */ * error_codes
/* <Title> */ *
/* Error Codes */ * @title:
/* */ * Error Codes
/* <Sections> */ *
/* error_enumerations */ * @sections:
/* error_code_values */ * error_enumerations
/* */ * error_code_values
/***************************************************************************/ *
*/
/* END */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftcid.h */ * ftcid.h
/* */ *
/* FreeType API for accessing CID font information (specification). */ * FreeType API for accessing CID font information (specification).
/* */ *
/* Copyright 2007-2018 by */ * Copyright (C) 2007-2019 by
/* Dereg Clegg and Michael Toftdal. */ * Dereg Clegg and Michael Toftdal.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTCID_H_ #ifndef FTCID_H_
@ -32,25 +32,25 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* cid_fonts */ * cid_fonts
/* */ *
/* <Title> */ * @title:
/* CID Fonts */ * CID Fonts
/* */ *
/* <Abstract> */ * @abstract:
/* CID-keyed font specific API. */ * CID-keyed font-specific API.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of CID-keyed font specific */ * This section contains the declaration of CID-keyed font-specific
/* functions. */ * functions.
/* */ *
/*************************************************************************/ */
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_CID_Registry_Ordering_Supplement * FT_Get_CID_Registry_Ordering_Supplement
@ -90,15 +90,15 @@ FT_BEGIN_HEADER
FT_Int *supplement ); FT_Int *supplement );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_CID_Is_Internally_CID_Keyed * FT_Get_CID_Is_Internally_CID_Keyed
* *
* @description: * @description:
* Retrieve the type of the input face, CID keyed or not. In * Retrieve the type of the input face, CID keyed or not. In contrast
* contrast to the @FT_IS_CID_KEYED macro this function returns * to the @FT_IS_CID_KEYED macro this function returns successfully also
* successfully also for CID-keyed fonts in an SFNT wrapper. * for CID-keyed fonts in an SFNT wrapper.
* *
* @input: * @input:
* face :: * face ::
@ -112,8 +112,8 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with CID faces and OpenType fonts, * This function only works with CID faces and OpenType fonts, returning
* returning an error otherwise. * an error otherwise.
* *
* @since: * @since:
* 2.3.9 * 2.3.9
@ -123,7 +123,7 @@ FT_BEGIN_HEADER
FT_Bool *is_cid ); FT_Bool *is_cid );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_CID_From_Glyph_Index * FT_Get_CID_From_Glyph_Index
@ -146,8 +146,8 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with CID faces and OpenType fonts, * This function only works with CID faces and OpenType fonts, returning
* returning an error otherwise. * an error otherwise.
* *
* @since: * @since:
* 2.3.9 * 2.3.9

View file

@ -0,0 +1,311 @@
/****************************************************************************
*
* ftcolor.h
*
* FreeType's glyph color management (specification).
*
* Copyright (C) 2018-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.
*
*/
#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
/**************************************************************************
*
* @section:
* color_management
*
* @title:
* Glyph Color Management
*
* @abstract:
* Retrieving and manipulating OpenType's 'CPAL' table data.
*
* @description:
* The functions described here allow access and manipulation of color
* palette entries in OpenType's 'CPAL' tables.
*/
/**************************************************************************
*
* @struct:
* FT_Color
*
* @description:
* 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.
*
* @fields:
* blue ::
* Blue value.
*
* green ::
* Green value.
*
* red ::
* Red value.
*
* alpha ::
* Alpha value, giving the red, green, and blue color's opacity.
*
* @since:
* 2.10
*/
typedef struct FT_Color_
{
FT_Byte blue;
FT_Byte green;
FT_Byte red;
FT_Byte alpha;
} FT_Color;
/**************************************************************************
*
* @enum:
* FT_PALETTE_XXX
*
* @description:
* 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.
*
* @since:
* 2.10
*/
#define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01
#define FT_PALETTE_FOR_DARK_BACKGROUND 0x02
/**************************************************************************
*
* @struct:
* FT_Palette_Data
*
* @description:
* This structure holds the data of the 'CPAL' table.
*
* @fields:
* 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.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* 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
* 0xFFFF.
*
* `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
*
* @note:
* Use function @FT_Get_Sfnt_Name to map name IDs and entry name IDs to
* name strings.
*
* @since:
* 2.10
*/
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;
/**************************************************************************
*
* @function:
* FT_Palette_Data_Get
*
* @description:
* Retrieve the face's color palette data.
*
* @input:
* face ::
* The source face handle.
*
* @output:
* apalette ::
* A pointer to an @FT_Palette_Data structure.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* 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`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Data_Get( FT_Face face,
FT_Palette_Data *apalette );
/**************************************************************************
*
* @function:
* FT_Palette_Select
*
* @description:
* 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.
*
* @input:
* face ::
* The source face handle.
*
* palette_index ::
* The palette index.
*
* @output:
* apalette ::
* An array of color entries for a palette with index `palette_index`,
* having `num_palette_entries` elements (as found in the
* `FT_Palette_Data` structure). 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.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The array pointed to by `apalette_entries` is owned and managed by
* FreeType.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Select( FT_Face face,
FT_UShort palette_index,
FT_Color* *apalette );
/**************************************************************************
*
* @function:
* FT_Palette_Set_Foreground_Color
*
* @description:
* 'COLR' uses palette index 0xFFFF to indicate a 'text foreground
* color'. This function sets this value.
*
* @input:
* face ::
* The source face handle.
*
* foreground_color ::
* An `FT_Color` structure to define the text foreground color.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* 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.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
*
* @since:
* 2.10
*/
FT_EXPORT( FT_Error )
FT_Palette_Set_Foreground_Color( FT_Face face,
FT_Color foreground_color );
/* */
FT_END_HEADER
#endif /* FTCOLOR_H_ */
/* END */

File diff suppressed because it is too large Load diff

View file

@ -1,58 +1,57 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fterrdef.h */ * fterrdef.h
/* */ *
/* FreeType error codes (specification). */ * FreeType error codes (specification).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* error_code_values */ * error_code_values
/* */ *
/* <Title> */ * @title:
/* Error Code Values */ * Error Code Values
/* */ *
/* <Abstract> */ * @abstract:
/* All possible error codes returned by FreeType functions. */ * All possible error codes returned by FreeType functions.
/* */ *
/* <Description> */ * @description:
/* The list below is taken verbatim from the file `fterrdef.h' */ * The list below is taken verbatim from the file `fterrdef.h` (loaded
/* (loaded automatically by including `FT_FREETYPE_H'). The first */ * automatically by including `FT_FREETYPE_H`). The first argument of the
/* argument of the `FT_ERROR_DEF_' macro is the error label; by */ * `FT_ERROR_DEF_` macro is the error label; by default, the prefix
/* default, the prefix `FT_Err_' gets added so that you get error */ * `FT_Err_` gets added so that you get error names like
/* names like `FT_Err_Cannot_Open_Resource'. The second argument is */ * `FT_Err_Cannot_Open_Resource`. The second argument is the error code,
/* the error code, and the last argument an error string, which is not */ * and the last argument an error string, which is not used by FreeType.
/* used by FreeType. */ *
/* */ * Within your application you should **only** use error names and
/* Within your application you should *only* use error names and */ * **never** its numeric values! The latter might (and actually do)
/* *never* its numeric values! The latter might (and actually do) */ * change in forthcoming FreeType versions.
/* change in forthcoming FreeType versions. */ *
/* */ * Macro `FT_NOERRORDEF_` defines `FT_Err_Ok`, which is always zero. See
/* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */ * the 'Error Enumerations' subsection how to automatically generate a
/* See the `Error Enumerations' subsection how to automatically */ * list of error strings.
/* generate a list of error strings. */ *
/* */ */
/*************************************************************************/
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Enum> */ * @enum:
/* FT_Err_XXX */ * FT_Err_XXX
/* */ *
/*************************************************************************/ */
/* generic errors */ /* generic errors */

View file

@ -1,110 +1,120 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fterrors.h */ * fterrors.h
/* */ *
/* FreeType error code handling (specification). */ * FreeType error code handling (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* error_enumerations */ * error_enumerations
/* */ *
/* <Title> */ * @title:
/* Error Enumerations */ * Error Enumerations
/* */ *
/* <Abstract> */ * @abstract:
/* How to handle errors and error strings. */ * How to handle errors and error strings.
/* */ *
/* <Description> */ * @description:
/* The header file `fterrors.h' (which is automatically included by */ * The header file `fterrors.h` (which is automatically included by
/* `freetype.h' defines the handling of FreeType's enumeration */ * `freetype.h` defines the handling of FreeType's enumeration
/* constants. It can also be used to generate error message strings */ * constants. It can also be used to generate error message strings
/* with a small macro trick explained below. */ * with a small macro trick explained below.
/* */ *
/* *Error* *Formats* */ * **Error Formats**
/* */ *
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ * The configuration macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` can be
/* defined in `ftoption.h' in order to make the higher byte indicate */ * defined in `ftoption.h` in order to make the higher byte indicate the
/* the module where the error has happened (this is not compatible */ * module where the error has happened (this is not compatible with
/* with standard builds of FreeType~2, however). See the file */ * standard builds of FreeType~2, however). See the file `ftmoderr.h`
/* `ftmoderr.h' for more details. */ * for more details.
/* */ *
/* *Error* *Message* *Strings* */ * **Error Message Strings**
/* */ *
/* Error definitions are set up with special macros that allow client */ * Error definitions are set up with special macros that allow client
/* applications to build a table of error message strings. The */ * applications to build a table of error message strings. The strings
/* strings are not included in a normal build of FreeType~2 to save */ * are not included in a normal build of FreeType~2 to save space (most
/* space (most client applications do not use them). */ * client applications do not use them).
/* */ *
/* To do so, you have to define the following macros before including */ * To do so, you have to define the following macros before including
/* this file. */ * this file.
/* */ *
/* { */ * ```
/* FT_ERROR_START_LIST */ * FT_ERROR_START_LIST
/* } */ * ```
/* */ *
/* This macro is called before anything else to define the start of */ * This macro is called before anything else to define the start of the
/* the error list. It is followed by several FT_ERROR_DEF calls. */ * error list. It is followed by several `FT_ERROR_DEF` calls.
/* */ *
/* { */ * ```
/* FT_ERROR_DEF( e, v, s ) */ * FT_ERROR_DEF( e, v, s )
/* } */ * ```
/* */ *
/* This macro is called to define one single error. `e' is the error */ * This macro is called to define one single error. 'e' is the error
/* code identifier (e.g., `Invalid_Argument'), `v' is the error's */ * code identifier (e.g., `Invalid_Argument`), 'v' is the error's
/* numerical value, and `s' is the corresponding error string. */ * numerical value, and 's' is the corresponding error string.
/* */ *
/* { */ * ```
/* FT_ERROR_END_LIST */ * FT_ERROR_END_LIST
/* } */ * ```
/* */ *
/* This macro ends the list. */ * This macro ends the list.
/* */ *
/* Additionally, you have to undefine `FTERRORS_H_' before #including */ * Additionally, you have to undefine `FTERRORS_H_` before #including
/* this file. */ * this file.
/* */ *
/* Here is a simple example. */ * Here is a simple example.
/* */ *
/* { */ * ```
/* #undef FTERRORS_H_ */ * #undef FTERRORS_H_
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */ * #define FT_ERRORDEF( e, v, s ) { e, s },
/* #define FT_ERROR_START_LIST { */ * #define FT_ERROR_START_LIST {
/* #define FT_ERROR_END_LIST { 0, NULL } }; */ * #define FT_ERROR_END_LIST { 0, NULL } };
/* */ *
/* const struct */ * const struct
/* { */ * {
/* int err_code; */ * int err_code;
/* const char* err_msg; */ * const char* err_msg;
/* } ft_errors[] = */ * } ft_errors[] =
/* */ *
/* #include FT_ERRORS_H */ * #include FT_ERRORS_H
/* } */ * ```
/* */ *
/* Note that `FT_Err_Ok' is _not_ defined with `FT_ERRORDEF' but with */ * An alternative to using an array is a switch statement.
/* `FT_NOERRORDEF'; it is always zero. */ *
/* */ * ```
/*************************************************************************/ * #undef FTERRORS_H_
* #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 */ /* using two successive underscores in a non-system symbol name */
/* violates the C (and C++) standard, so it was changed to the */ /* violates the C (and C++) standard, so it was changed to the */
/* current form. In spite of this, we have to make */ /* current form. In spite of this, we have to make */
/* */ /* */
/* ``` */
/* #undefine __FTERRORS_H__ */ /* #undefine __FTERRORS_H__ */
/* ``` */
/* */ /* */
/* work for backward compatibility. */ /* work for backward compatibility. */
/* */ /* */
@ -130,7 +140,7 @@
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */ /* 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 #ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIX FT_Err_ #define FT_ERR_PREFIX FT_Err_
@ -158,6 +168,8 @@
/* */ /* */
#ifndef FT_ERRORDEF #ifndef FT_ERRORDEF
#define FT_INCLUDE_ERR_PROTOS
#define FT_ERRORDEF( e, v, s ) e = v, #define FT_ERRORDEF( e, v, s ) e = v,
#define FT_ERROR_START_LIST enum { #define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) }; #define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
@ -220,6 +232,53 @@
#undef FT_ERR_PREFIX #undef FT_ERR_PREFIX
#endif #endif
/* 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
/**************************************************************************
*
* @function:
* FT_Error_String
*
* @description:
* Retrieve the description of a valid FreeType error code.
*
* @input:
* error_code ::
* A valid FreeType error code.
*
* @return:
* A C~string or `NULL`, if any error occurred.
*
* @note:
* 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__) */ #endif /* !(FTERRORS_H_ && __FTERRORS_H__) */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftfntfmt.h */ * ftfntfmt.h
/* */ *
/* Support functions for font formats. */ * Support functions for font formats.
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTFNTFMT_H_ #ifndef FTFNTFMT_H_
@ -32,49 +32,48 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* font_formats */ * font_formats
/* */ *
/* <Title> */ * @title:
/* Font Formats */ * Font Formats
/* */ *
/* <Abstract> */ * @abstract:
/* Getting the font format. */ * Getting the font format.
/* */ *
/* <Description> */ * @description:
/* The single function in this section can be used to get the font */ * The single function in this section can be used to get the font format.
/* format. Note that this information is not needed normally; */ * Note that this information is not needed normally; however, there are
/* however, there are special cases (like in PDF devices) where it is */ * special cases (like in PDF devices) where it is important to
/* important to differentiate, in spite of FreeType's uniform API. */ * differentiate, in spite of FreeType's uniform API.
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Get_Font_Format */ * FT_Get_Font_Format
/* */ *
/* <Description> */ * @description:
/* Return a string describing the format of a given face. Possible */ * Return a string describing the format of a given face. Possible values
/* values are `TrueType', `Type~1', `BDF', `PCF', `Type~42', */ * are 'TrueType', 'Type~1', 'BDF', 'PCF', 'Type~42', 'CID~Type~1', 'CFF',
/* `CID~Type~1', `CFF', `PFR', and `Windows~FNT'. */ * 'PFR', and 'Windows~FNT'.
/* */ *
/* The return value is suitable to be used as an X11 FONT_PROPERTY. */ * The return value is suitable to be used as an X11 FONT_PROPERTY.
/* */ *
/* <Input> */ * @input:
/* face :: */ * face ::
/* Input face handle. */ * Input face handle.
/* */ *
/* <Return> */ * @return:
/* Font format string. NULL in case of error. */ * Font format string. `NULL` in case of error.
/* */ *
/* <Note> */ * @note:
/* A deprecated name for the same function is */ * A deprecated name for the same function is `FT_Get_X11_Font_Format`.
/* `FT_Get_X11_Font_Format'. */ */
/* */
FT_EXPORT( const char* ) FT_EXPORT( const char* )
FT_Get_Font_Format( FT_Face face ); FT_Get_Font_Format( FT_Face face );

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftgasp.h */ * ftgasp.h
/* */ *
/* Access of TrueType's `gasp' table (specification). */ * Access of TrueType's 'gasp' table (specification).
/* */ *
/* Copyright 2007-2018 by */ * Copyright (C) 2007-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTGASP_H_ #ifndef FTGASP_H_
@ -32,7 +32,7 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************** /**************************************************************************
* *
* @section: * @section:
* gasp_table * gasp_table
@ -41,16 +41,16 @@ FT_BEGIN_HEADER
* Gasp Table * Gasp Table
* *
* @abstract: * @abstract:
* Retrieving TrueType `gasp' table entries. * Retrieving TrueType 'gasp' table entries.
* *
* @description: * @description:
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType * 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 * font for specific entries in its 'gasp' table, if any. This is mainly
* mainly useful when implementing native TrueType hinting with the * useful when implementing native TrueType hinting with the bytecode
* bytecode interpreter to duplicate the Windows text rendering results. * interpreter to duplicate the Windows text rendering results.
*/ */
/************************************************************************* /**************************************************************************
* *
* @enum: * @enum:
* FT_GASP_XXX * FT_GASP_XXX
@ -66,7 +66,7 @@ FT_BEGIN_HEADER
* *
* FT_GASP_DO_GRIDFIT :: * FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem. * 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. * is not set, no hinting gets applied.
* *
* FT_GASP_DO_GRAY :: * FT_GASP_DO_GRAY ::
@ -80,13 +80,13 @@ FT_BEGIN_HEADER
* Grid-fitting must be used with ClearType's symmetric smoothing. * Grid-fitting must be used with ClearType's symmetric smoothing.
* *
* @note: * @note:
* 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, * used for standard font rasterization only. Independently of that,
* `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to * `FT_GASP_SYMMETRIC_SMOOTHING` and `FT_GASP_SYMMETRIC_GRIDFIT` are to
* be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT` and
* `FT_GASP_DO_GRAY' are consequently ignored). * `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. * protected by patents.
* *
* @since: * @since:
@ -99,29 +99,31 @@ FT_BEGIN_HEADER
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08 #define FT_GASP_SYMMETRIC_SMOOTHING 0x08
/************************************************************************* /**************************************************************************
* *
* @func: * @function:
* FT_Get_Gasp * FT_Get_Gasp
* *
* @description: * @description:
* For a TrueType or OpenType font file, return the rasterizer behaviour * For a TrueType or OpenType font file, return the rasterizer behaviour
* flags from the font's `gasp' table corresponding to a given * flags from the font's 'gasp' table corresponding to a given character
* character pixel size. * pixel size.
* *
* @input: * @input:
* face :: The source face handle. * face ::
* The source face handle.
* *
* ppem :: The vertical character pixel size. * ppem ::
* The vertical character pixel size.
* *
* @return: * @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no * 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.
* *
* @note: * @note:
* If you want to use the MM functionality of OpenType variation fonts * If you want to use the MM functionality of OpenType variation fonts
* (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this * (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. * change.
* *
* @since: * @since:

File diff suppressed because it is too large Load diff

View file

@ -1,28 +1,28 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftgxval.h */ * ftgxval.h
/* */ *
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ * FreeType API for validating TrueTypeGX/AAT tables (specification).
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* Masatake YAMATO, Redhat K.K, */ * Masatake YAMATO, Redhat K.K,
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /****************************************************************************
/* */ *
/* gxvalid is derived from both gxlayout module and otvalid module. */ * gxvalid is derived from both gxlayout module and otvalid module.
/* Development of gxlayout is supported by the Information-technology */ * Development of gxlayout is supported by the Information-technology
/* Promotion Agency(IPA), Japan. */ * Promotion Agency(IPA), Japan.
/* */ *
/***************************************************************************/ */
#ifndef FTGXVAL_H_ #ifndef FTGXVAL_H_
@ -41,43 +41,43 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* gx_validation */ * gx_validation
/* */ *
/* <Title> */ * @title:
/* TrueTypeGX/AAT Validation */ * TrueTypeGX/AAT Validation
/* */ *
/* <Abstract> */ * @abstract:
/* An API to validate TrueTypeGX/AAT tables. */ * An API to validate TrueTypeGX/AAT tables.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of functions to validate */ * This section contains the declaration of functions to validate some
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ * TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak,
/* trak, prop, lcar). */ * prop, lcar).
/* */ *
/* <Order> */ * @order:
/* FT_TrueTypeGX_Validate */ * FT_TrueTypeGX_Validate
/* FT_TrueTypeGX_Free */ * FT_TrueTypeGX_Free
/* */ *
/* FT_ClassicKern_Validate */ * FT_ClassicKern_Validate
/* FT_ClassicKern_Free */ * FT_ClassicKern_Free
/* */ *
/* FT_VALIDATE_GX_LENGTH */ * FT_VALIDATE_GX_LENGTH
/* FT_VALIDATE_GXXXX */ * FT_VALIDATE_GXXXX
/* FT_VALIDATE_CKERNXXX */ * FT_VALIDATE_CKERNXXX
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* */ *
/* Warning: Use FT_VALIDATE_XXX to validate a table. */ * Warning: Use `FT_VALIDATE_XXX` to validate a table.
/* Following definitions are for gxvalid developers. */ * Following definitions are for gxvalid developers.
/* */ *
/* */ *
/*************************************************************************/ */
#define FT_VALIDATE_feat_INDEX 0 #define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1 #define FT_VALIDATE_mort_INDEX 1
@ -92,14 +92,14 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX #define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_VALIDATE_GX_LENGTH * FT_VALIDATE_GX_LENGTH
* *
* @description: * @description:
* The number of tables checked in this module. Use it as a parameter * 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 ) #define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
@ -112,7 +112,7 @@ FT_BEGIN_HEADER
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX ) ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_VALIDATE_GXXXX * FT_VALIDATE_GXXXX
@ -123,34 +123,34 @@ FT_BEGIN_HEADER
* *
* @values: * @values:
* FT_VALIDATE_feat :: * FT_VALIDATE_feat ::
* Validate `feat' table. * Validate 'feat' table.
* *
* FT_VALIDATE_mort :: * FT_VALIDATE_mort ::
* Validate `mort' table. * Validate 'mort' table.
* *
* FT_VALIDATE_morx :: * FT_VALIDATE_morx ::
* Validate `morx' table. * Validate 'morx' table.
* *
* FT_VALIDATE_bsln :: * FT_VALIDATE_bsln ::
* Validate `bsln' table. * Validate 'bsln' table.
* *
* FT_VALIDATE_just :: * FT_VALIDATE_just ::
* Validate `just' table. * Validate 'just' table.
* *
* FT_VALIDATE_kern :: * FT_VALIDATE_kern ::
* Validate `kern' table. * Validate 'kern' table.
* *
* FT_VALIDATE_opbd :: * FT_VALIDATE_opbd ::
* Validate `opbd' table. * Validate 'opbd' table.
* *
* FT_VALIDATE_trak :: * FT_VALIDATE_trak ::
* Validate `trak' table. * Validate 'trak' table.
* *
* FT_VALIDATE_prop :: * FT_VALIDATE_prop ::
* Validate `prop' table. * Validate 'prop' table.
* *
* FT_VALIDATE_lcar :: * FT_VALIDATE_lcar ::
* Validate `lcar' table. * Validate 'lcar' table.
* *
* FT_VALIDATE_GX :: * FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
@ -181,7 +181,7 @@ FT_BEGIN_HEADER
FT_VALIDATE_lcar ) FT_VALIDATE_lcar )
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_TrueTypeGX_Validate * FT_TrueTypeGX_Validate
@ -189,8 +189,8 @@ FT_BEGIN_HEADER
* @description: * @description:
* Validate various TrueTypeGX tables to assure that all offsets and * Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that * indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without * actually does the text layout can access those tables without error
* error checking (which can be quite time consuming). * checking (which can be quite time consuming).
* *
* @input: * @input:
* face :: * face ::
@ -201,13 +201,13 @@ FT_BEGIN_HEADER
* @FT_VALIDATE_GXXXX for possible values. * @FT_VALIDATE_GXXXX for possible values.
* *
* table_length :: * table_length ::
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH * The size of the `tables` array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed. * should be passed.
* *
* @output: * @output:
* tables :: * tables ::
* The array where all validated sfnt tables are stored. * The array where all validated sfnt tables are stored. The array
* The array itself must be allocated by a client. * itself must be allocated by a client.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -217,7 +217,7 @@ FT_BEGIN_HEADER
* otherwise. * otherwise.
* *
* After use, the application should deallocate the buffers pointed to by * After use, the application should deallocate the buffers pointed to by
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value * each `tables` element, by calling @FT_TrueTypeGX_Free. A `NULL` value
* indicates that the table either doesn't exist in the font, the * indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have * application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table. * the ability to validate the sfnt table.
@ -229,7 +229,7 @@ FT_BEGIN_HEADER
FT_UInt table_length ); FT_UInt table_length );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_TrueTypeGX_Free * FT_TrueTypeGX_Free
@ -242,8 +242,7 @@ FT_BEGIN_HEADER
* A handle to the input face. * A handle to the input face.
* *
* table :: * table ::
* The pointer to the buffer allocated by * The pointer to the buffer allocated by @FT_TrueTypeGX_Validate.
* @FT_TrueTypeGX_Validate.
* *
* @note: * @note:
* This function must be used to free the buffer allocated by * This function must be used to free the buffer allocated by
@ -254,26 +253,25 @@ FT_BEGIN_HEADER
FT_Bytes table ); FT_Bytes table );
/********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_VALIDATE_CKERNXXX * FT_VALIDATE_CKERNXXX
* *
* @description: * @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate * A list of bit-field constants used with @FT_ClassicKern_Validate to
* to indicate the classic kern dialect or dialects. If the selected * indicate the classic kern dialect or dialects. If the selected type
* type doesn't fit, @FT_ClassicKern_Validate regards the table as * doesn't fit, @FT_ClassicKern_Validate regards the table as invalid.
* invalid.
* *
* @values: * @values:
* FT_VALIDATE_MS :: * FT_VALIDATE_MS ::
* Handle the `kern' table as a classic Microsoft kern table. * Handle the 'kern' table as a classic Microsoft kern table.
* *
* FT_VALIDATE_APPLE :: * FT_VALIDATE_APPLE ::
* Handle the `kern' table as a classic Apple kern table. * Handle the 'kern' table as a classic Apple kern table.
* *
* FT_VALIDATE_CKERN :: * FT_VALIDATE_CKERN ::
* Handle the `kern' as either classic Apple or Microsoft kern table. * Handle the 'kern' as either classic Apple or Microsoft kern table.
*/ */
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) #define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) #define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
@ -281,18 +279,18 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) #define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_ClassicKern_Validate * FT_ClassicKern_Validate
* *
* @description: * @description:
* Validate classic (16-bit format) kern table to assure that the offsets * Validate classic (16-bit format) kern table to assure that the
* and indices are valid. The idea is that a higher-level library that * offsets and indices are valid. The idea is that a higher-level
* actually does the text layout can access those tables without error * library that actually does the text layout can access those tables
* checking (which can be quite time consuming). * without error checking (which can be quite time consuming).
* *
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both * The 'kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32-bit format and the classic 16-bit format, while * the new 32-bit format and the classic 16-bit format, while
* FT_ClassicKern_Validate only supports the classic 16-bit format. * FT_ClassicKern_Validate only supports the classic 16-bit format.
* *
@ -313,7 +311,7 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* After use, the application should deallocate the buffers pointed to by * After use, the application should deallocate the buffers pointed to by
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value * `ckern_table`, by calling @FT_ClassicKern_Free. A `NULL` value
* indicates that the table doesn't exist in the font. * indicates that the table doesn't exist in the font.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
@ -322,7 +320,7 @@ FT_BEGIN_HEADER
FT_Bytes *ckern_table ); FT_Bytes *ckern_table );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_ClassicKern_Free * FT_ClassicKern_Free

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftgzip.h */ * ftgzip.h
/* */ *
/* Gzip-compressed stream support. */ * Gzip-compressed stream support.
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTGZIP_H_ #ifndef FTGZIP_H_
@ -31,32 +31,32 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* gzip */ * gzip
/* */ *
/* <Title> */ * @title:
/* GZIP Streams */ * GZIP Streams
/* */ *
/* <Abstract> */ * @abstract:
/* Using gzip-compressed font files. */ * Using gzip-compressed font files.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of Gzip-specific functions. */ * This section contains the declaration of Gzip-specific functions.
/* */ *
/*************************************************************************/ */
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Stream_OpenGzip * FT_Stream_OpenGzip
* *
* @description: * @description:
* Open a new stream to parse gzip-compressed font files. This is * Open a new stream to parse gzip-compressed font files. This is mainly
* mainly used to support the compressed `*.pcf.gz' fonts that come * used to support the compressed `*.pcf.gz` fonts that come with
* with XFree86. * XFree86.
* *
* @input: * @input:
* stream :: * stream ::
@ -71,9 +71,9 @@ FT_BEGIN_HEADER
* @note: * @note:
* The source stream must be opened _before_ calling this function. * The source stream must be opened _before_ calling this function.
* *
* Calling the internal function `FT_Stream_Close' on the new stream will * 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 * **not** call `FT_Stream_Close` on the source stream. None of the
* objects will be released to the heap. * stream objects will be released to the heap.
* *
* The stream implementation is very basic and resets the decompression * The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream. * process each time seeking backwards is needed within the stream.
@ -81,10 +81,10 @@ FT_BEGIN_HEADER
* In certain builds of the library, gzip compression recognition is * In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face. * automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw * This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from * compressed file, the library will try to open a gzipped stream from it
* it and re-open the face with it. * and re-open the face with it.
* *
* This function may return `FT_Err_Unimplemented_Feature' if your build * This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with zlib support. * of FreeType was not compiled with zlib support.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
@ -92,14 +92,14 @@ FT_BEGIN_HEADER
FT_Stream source ); FT_Stream source );
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Gzip_Uncompress * FT_Gzip_Uncompress
* *
* @description: * @description:
* Decompress a zipped input buffer into an output buffer. This function * Decompress a zipped input buffer into an output buffer. This function
* is modeled after zlib's `uncompress' function. * is modeled after zlib's `uncompress` function.
* *
* @input: * @input:
* memory :: * memory ::
@ -112,7 +112,7 @@ FT_BEGIN_HEADER
* The length of the input buffer. * The length of the input buffer.
* *
* @output: * @output:
* output:: * output ::
* The output buffer. * The output buffer.
* *
* @inout: * @inout:
@ -120,14 +120,14 @@ FT_BEGIN_HEADER
* Before calling the function, this is the total size of the output * Before calling the function, this is the total size of the output
* buffer, which must be large enough to hold the entire uncompressed * buffer, which must be large enough to hold the entire uncompressed
* data (so the size of the uncompressed data must be known in * data (so the size of the uncompressed data must be known in
* advance). After calling the function, `output_len' is the size of * advance). After calling the function, `output_len` is the size of
* the used data in `output'. * the used data in `output`.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function may return `FT_Err_Unimplemented_Feature' if your build * This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with zlib support. * of FreeType was not compiled with zlib support.
* *
* @since: * @since:

File diff suppressed because it is too large Load diff

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftincrem.h */ * ftincrem.h
/* */ *
/* FreeType incremental loading (specification). */ * FreeType incremental loading (specification).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTINCREM_H_ #ifndef FTINCREM_H_
@ -32,7 +32,7 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************** /**************************************************************************
* *
* @section: * @section:
* incremental * incremental
@ -45,7 +45,7 @@ FT_BEGIN_HEADER
* *
* @description: * @description:
* This section contains various functions used to perform so-called * 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. * from a given @FT_Face are provided by the client application.
* *
* Apart from that, all other tables are loaded normally from the font * Apart from that, all other tables are loaded normally from the font
@ -60,23 +60,24 @@ FT_BEGIN_HEADER
*/ */
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental * FT_Incremental
* *
* @description: * @description:
* An opaque type describing a user-provided object used to implement * An opaque type describing a user-provided object used to implement
* `incremental' glyph loading within FreeType. This is used to support * 'incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., PostScript interpreters), * embedded fonts in certain environments (e.g., PostScript
* where the glyph data isn't in the font file, or must be overridden by * interpreters), where the glyph data isn't in the font file, or must be
* different values. * overridden by different values.
* *
* @note: * @note:
* It is up to client applications to create and implement @FT_Incremental * It is up to client applications to create and implement
* objects, as long as they provide implementations for the methods * @FT_Incremental objects, as long as they provide implementations for
* @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc * the methods @FT_Incremental_GetGlyphDataFunc,
* and @FT_Incremental_GetGlyphMetricsFunc. * @FT_Incremental_FreeGlyphDataFunc and
* @FT_Incremental_GetGlyphMetricsFunc.
* *
* See the description of @FT_Incremental_InterfaceRec to understand how * See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType. * to use incremental objects with FreeType.
@ -85,14 +86,14 @@ FT_BEGIN_HEADER
typedef struct FT_IncrementalRec_* FT_Incremental; typedef struct FT_IncrementalRec_* FT_Incremental;
/*************************************************************************** /**************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_MetricsRec * FT_Incremental_MetricsRec
* *
* @description: * @description:
* A small structure used to contain the basic glyph metrics returned * A small structure used to contain the basic glyph metrics returned by
* by the @FT_Incremental_GetGlyphMetricsFunc method. * the @FT_Incremental_GetGlyphMetricsFunc method.
* *
* @fields: * @fields:
* bearing_x :: * bearing_x ::
@ -109,7 +110,7 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* These correspond to horizontal or vertical metrics depending on the * 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. * @FT_Incremental_GetGlyphMetricsFunc.
* *
*/ */
@ -123,7 +124,7 @@ FT_BEGIN_HEADER
} FT_Incremental_MetricsRec; } FT_Incremental_MetricsRec;
/*************************************************************************** /**************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_Metrics * FT_Incremental_Metrics
@ -135,7 +136,7 @@ FT_BEGIN_HEADER
typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics; typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental_GetGlyphDataFunc * FT_Incremental_GetGlyphDataFunc
@ -147,8 +148,8 @@ FT_BEGIN_HEADER
* *
* Note that the format of the glyph's data bytes depends on the font * 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 * file format. For TrueType, it must correspond to the raw bytes within
* the `glyf' table. For PostScript formats, it must correspond to the * the 'glyf' table. For PostScript formats, it must correspond to the
* *unencrypted* charstring bytes, without any `lenIV' header. It is * **unencrypted** charstring bytes, without any `lenIV` header. It is
* undefined for any other format. * undefined for any other format.
* *
* @input: * @input:
@ -169,8 +170,8 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* If this function returns successfully the method * If this function returns successfully the method
* @FT_Incremental_FreeGlyphDataFunc will be called later to release * @FT_Incremental_FreeGlyphDataFunc will be called later to release the
* the data bytes. * data bytes.
* *
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
* compound glyphs. * compound glyphs.
@ -182,7 +183,7 @@ FT_BEGIN_HEADER
FT_Data* adata ); FT_Data* adata );
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental_FreeGlyphDataFunc * FT_Incremental_FreeGlyphDataFunc
@ -206,7 +207,7 @@ FT_BEGIN_HEADER
FT_Data* data ); FT_Data* data );
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental_GetGlyphMetricsFunc * FT_Incremental_GetGlyphMetricsFunc
@ -214,8 +215,8 @@ FT_BEGIN_HEADER
* @description: * @description:
* A function used to retrieve the basic metrics of a given glyph index * A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain * before accessing its data. This is necessary because, in certain
* formats like TrueType, the metrics are stored in a different place from * formats like TrueType, the metrics are stored in a different place
* the glyph images proper. * from the glyph images proper.
* *
* @input: * @input:
* incremental :: * incremental ::
@ -229,9 +230,9 @@ FT_BEGIN_HEADER
* If true, return vertical metrics. * If true, return vertical metrics.
* *
* ametrics :: * ametrics ::
* This parameter is used for both input and output. * This parameter is used for both input and output. The original
* The original glyph metrics, if any, in font units. If metrics are * glyph metrics, if any, in font units. If metrics are not available
* not available all the values must be set to zero. * all the values must be set to zero.
* *
* @output: * @output:
* ametrics :: * ametrics ::
@ -252,8 +253,8 @@ FT_BEGIN_HEADER
* FT_Incremental_FuncsRec * FT_Incremental_FuncsRec
* *
* @description: * @description:
* A table of functions for accessing fonts that load data * A table of functions for accessing fonts that load data incrementally.
* incrementally. Used in @FT_Incremental_InterfaceRec. * Used in @FT_Incremental_InterfaceRec.
* *
* @fields: * @fields:
* get_glyph_data :: * get_glyph_data ::
@ -263,8 +264,8 @@ FT_BEGIN_HEADER
* The function to release glyph data. Must not be null. * The function to release glyph data. Must not be null.
* *
* get_glyph_metrics :: * get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does * The function to get glyph metrics. May be null if the font does not
* not provide overriding glyph metrics. * provide overriding glyph metrics.
* *
*/ */
typedef struct FT_Incremental_FuncsRec_ typedef struct FT_Incremental_FuncsRec_
@ -276,7 +277,7 @@ FT_BEGIN_HEADER
} FT_Incremental_FuncsRec; } FT_Incremental_FuncsRec;
/*************************************************************************** /**************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_InterfaceRec * FT_Incremental_InterfaceRec
@ -286,7 +287,7 @@ FT_BEGIN_HEADER
* wants to support incremental glyph loading. You should use it with * wants to support incremental glyph loading. You should use it with
* @FT_PARAM_TAG_INCREMENTAL as in the following example: * @FT_PARAM_TAG_INCREMENTAL as in the following example:
* *
* { * ```
* FT_Incremental_InterfaceRec inc_int; * FT_Incremental_InterfaceRec inc_int;
* FT_Parameter parameter; * FT_Parameter parameter;
* FT_Open_Args open_args; * FT_Open_Args open_args;
@ -309,7 +310,7 @@ FT_BEGIN_HEADER
* // open the font * // open the font
* error = FT_Open_Face( library, &open_args, index, &face ); * error = FT_Open_Face( library, &open_args, index, &face );
* ... * ...
* } * ```
* *
*/ */
typedef struct FT_Incremental_InterfaceRec_ typedef struct FT_Incremental_InterfaceRec_
@ -320,7 +321,7 @@ FT_BEGIN_HEADER
} FT_Incremental_InterfaceRec; } FT_Incremental_InterfaceRec;
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental_Interface * FT_Incremental_Interface

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftlcdfil.h */ * ftlcdfil.h
/* */ *
/* FreeType API for color filtering of subpixel bitmap glyphs */ * FreeType API for color filtering of subpixel bitmap glyphs
/* (specification). */ * (specification).
/* */ *
/* Copyright 2006-2018 by */ * Copyright (C) 2006-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTLCDFIL_H_ #ifndef FTLCDFIL_H_
@ -33,105 +33,98 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************** /**************************************************************************
* *
* @section: * @section:
* lcd_filtering * lcd_rendering
* *
* @title: * @title:
* LCD Filtering * Subpixel Rendering
* *
* @abstract: * @abstract:
* Reduce color fringes of subpixel-rendered bitmaps. * API to control subpixel rendering.
* *
* @description: * @description:
* Should you #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your * FreeType provides two alternative subpixel rendering technologies.
* `ftoption.h', which enables patented ClearType-style rendering, * Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
* the LCD-optimized glyph bitmaps should be filtered to reduce color * `ftoption.h` file, this enables patented ClearType-style rendering.
* fringes inherent to this technology. The default FreeType LCD * Otherwise, Harmony LCD rendering is enabled. These technologies are
* rendering uses different technology, and API described below, * controlled differently and API described below, although always
* although available, does nothing. * available, performs its function when appropriate method is enabled
* and does nothing otherwise.
* *
* ClearType-style LCD rendering exploits the color-striped structure of * ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of * LCD pixels, increasing the available resolution in the direction of
* the stripe (usually horizontal RGB) by a factor of~3. Since these * the stripe (usually horizontal RGB) by a factor of~3. Using the
* subpixels are color pixels, using them unfiltered creates severe * subpixels coverages unfiltered can create severe color fringes
* color fringes. Use the @FT_Library_SetLcdFilter API to specify a * especially when rendering thin features. Indeed, to produce
* low-pass filter, which is then applied to subpixel-rendered bitmaps * black-on-white text, the nearby color subpixels must be dimmed
* generated through @FT_Render_Glyph. The filter sacrifices some of * equally.
* the higher resolution to reduce color fringes, making the glyph image
* slightly blurrier. Positional improvements will remain.
* *
* A filter should have two properties: * 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 normalized, meaning the sum of the 5~components * 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
* should be 256 (0x100). It is possible to go above or under this * any shifts in appearance.
* 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~}' * 2. It should be color-balanced, meaning a~+ b~=~c, to reduce color
* where a~+ b~=~c. It distributes the computed coverage for one * fringes by distributing the computed coverage for one subpixel to
* subpixel to all subpixels equally, sacrificing some won resolution * all subpixels equally.
* 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' * 3. It should be normalized, meaning 2a~+ 2b~+ c~=~1.0 to maintain
* filter. Boxy filters are sharper but are less forgiving of non-ideal * overall brightness.
* gamma curves of a screen (viewing angles!), beveled filters are
* fuzzier but more tolerant.
* *
* Examples: * 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.
* *
* - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor * Use the @FT_Library_SetLcdFilter or @FT_Library_SetLcdFilterWeights
* normalized. * API to specify a low-pass filter, which is then applied to
* subpixel-rendered bitmaps generated through @FT_Render_Glyph.
* *
* - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not * Harmony LCD rendering is suitable to panels with any regular subpixel
* normalized. * 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.
* *
* - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not * The subpixel geometry must be specified by xy-coordinates for each
* balanced. * 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.
* *
* - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not * Use the @FT_Library_SetLcdGeometry API to specify subpixel positions.
* balanced. * 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.
* *
* - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost * As a result of ClearType filtering or Harmony rendering, the
* balanced. * 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.
* *
* - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost * The ClearType and Harmony rendering is applicable to glyph bitmaps
* balanced. * 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 filter affects glyph bitmaps rendered through @FT_Render_Glyph, * The described algorithms can completely remove color artefacts when
* @FT_Load_Glyph, and @FT_Load_Char. It does _not_ affect the output * combined with gamma-corrected alpha blending in linear space. Each of
* of @FT_Outline_Render and @FT_Outline_Get_Bitmap. * 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
* If this feature is activated, the dimensions of LCD glyph bitmaps are * color with the red channel of the background pixel.
* 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.
*/ */
/**************************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_LcdFilter * FT_LcdFilter
@ -145,47 +138,25 @@ FT_BEGIN_HEADER
* results in sometimes severe color fringes. * results in sometimes severe color fringes.
* *
* FT_LCD_FILTER_DEFAULT :: * FT_LCD_FILTER_DEFAULT ::
* The default filter reduces color fringes considerably, at the cost * This is a beveled, normalized, and color-balanced five-tap filter
* of a slight blurriness in the output. * with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units.
*
* 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].
* *
* FT_LCD_FILTER_LIGHT :: * FT_LCD_FILTER_LIGHT ::
* The light filter is a variant that is sharper at the cost of * this is a boxy, normalized, and color-balanced three-tap filter with
* slightly more color fringes than the default one. * weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units.
*
* 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].
* *
* FT_LCD_FILTER_LEGACY :: * FT_LCD_FILTER_LEGACY ::
* FT_LCD_FILTER_LEGACY1 ::
* This filter corresponds to the original libXft color filter. It * This filter corresponds to the original libXft color filter. It
* provides high contrast output but can exhibit really bad color * provides high contrast output but can exhibit really bad color
* fringes if glyphs are not extremely well hinted to the pixel grid. * 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 * This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future. * disabled or stay unsupported in the future. The second value is
* * provided for compatibility with FontConfig, which historically used
* FT_LCD_FILTER_LEGACY1 :: * different enumeration, sometimes incorrectly forwarded to FreeType.
* 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'.
* *
* @since: * @since:
* 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_ typedef enum FT_LcdFilter_
{ {
@ -202,7 +173,7 @@ FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @func: * @function:
* FT_Library_SetLcdFilter * FT_Library_SetLcdFilter
* *
* @description: * @description:
@ -218,20 +189,20 @@ FT_BEGIN_HEADER
* The filter type. * The filter type.
* *
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or * 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 * @FT_LCD_FILTER_DEFAULT to use a default filter that should work well
* well on most LCD screens. * on most LCD screens.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This feature is always disabled by default. Clients must make an * 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. * @FT_LCD_FILTER_NONE in order to enable it.
* *
* Due to *PATENTS* covering subpixel rendering, this function doesn't * Due to **PATENTS** covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the * do anything except returning `FT_Err_Unimplemented_Feature` if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not * configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
* defined in your build of the library, which should correspond to all * defined in your build of the library, which should correspond to all
* default builds of FreeType. * default builds of FreeType.
* *
@ -245,7 +216,7 @@ FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @func: * @function:
* FT_Library_SetLcdFilterWeights * FT_Library_SetLcdFilterWeights
* *
* @description: * @description:
@ -258,15 +229,15 @@ FT_BEGIN_HEADER
* *
* weights :: * weights ::
* A pointer to an array; the function copies the first five bytes and * 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.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* Due to *PATENTS* covering subpixel rendering, this function doesn't * Due to **PATENTS** covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the * do anything except returning `FT_Err_Unimplemented_Feature` if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not * configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
* defined in your build of the library, which should correspond to all * defined in your build of the library, which should correspond to all
* default builds of FreeType. * default builds of FreeType.
* *
@ -281,7 +252,8 @@ FT_BEGIN_HEADER
unsigned char *weights ); unsigned char *weights );
/* /**************************************************************************
*
* @type: * @type:
* FT_LcdFiveTapFilter * FT_LcdFiveTapFilter
* *
@ -298,6 +270,53 @@ FT_BEGIN_HEADER
typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS]; typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];
/**************************************************************************
*
* @function:
* FT_Library_SetLcdGeometry
*
* @description:
* This function can be used to modify default positions of color
* subpixels, which controls Harmony LCD rendering.
*
* @input:
* library ::
* 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.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* 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
* library.
*
* @since:
* 2.10.0
*/
FT_EXPORT( FT_Error )
FT_Library_SetLcdGeometry( FT_Library library,
FT_Vector sub[3] );
/* */ /* */

View file

@ -1,27 +1,27 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftlist.h */ * ftlist.h
/* */ *
/* Generic list support for FreeType (specification). */ * Generic list support for FreeType (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* This file implements functions relative to list processing. Its */ * This file implements functions relative to list processing. Its data
/* data structures are defined in `freetype.h'. */ * structures are defined in `freetype.h`.
/* */ *
/*************************************************************************/ */
#ifndef FTLIST_H_ #ifndef FTLIST_H_
@ -41,224 +41,245 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* list_processing */ * list_processing
/* */ *
/* <Title> */ * @title:
/* List Processing */ * List Processing
/* */ *
/* <Abstract> */ * @abstract:
/* Simple management of lists. */ * Simple management of lists.
/* */ *
/* <Description> */ * @description:
/* This section contains various definitions related to list */ * This section contains various definitions related to list processing
/* processing using doubly-linked nodes. */ * using doubly-linked nodes.
/* */ *
/* <Order> */ * @order:
/* FT_List */ * FT_List
/* FT_ListNode */ * FT_ListNode
/* FT_ListRec */ * FT_ListRec
/* FT_ListNodeRec */ * FT_ListNodeRec
/* */ *
/* FT_List_Add */ * FT_List_Add
/* FT_List_Insert */ * FT_List_Insert
/* FT_List_Find */ * FT_List_Find
/* FT_List_Remove */ * FT_List_Remove
/* FT_List_Up */ * FT_List_Up
/* FT_List_Iterate */ * FT_List_Iterate
/* FT_List_Iterator */ * FT_List_Iterator
/* FT_List_Finalize */ * FT_List_Finalize
/* FT_List_Destructor */ * FT_List_Destructor
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_List_Find */ * FT_List_Find
/* */ *
/* <Description> */ * @description:
/* Find the list node for a given listed object. */ * Find the list node for a given listed object.
/* */ *
/* <Input> */ * @input:
/* list :: A pointer to the parent list. */ * list ::
/* data :: The address of the listed object. */ * A pointer to the parent list.
/* */ * data ::
/* <Return> */ * The address of the listed object.
/* List node. NULL if it wasn't found. */ *
/* */ * @return:
* List node. `NULL` if it wasn't found.
*/
FT_EXPORT( FT_ListNode ) FT_EXPORT( FT_ListNode )
FT_List_Find( FT_List list, FT_List_Find( FT_List list,
void* data ); void* data );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_List_Add */ * FT_List_Add
/* */ *
/* <Description> */ * @description:
/* Append an element to the end of a list. */ * Append an element to the end of a list.
/* */ *
/* <InOut> */ * @inout:
/* list :: A pointer to the parent list. */ * list ::
/* node :: The node to append. */ * A pointer to the parent list.
/* */ * node ::
* The node to append.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Add( FT_List list, FT_List_Add( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_List_Insert */ * FT_List_Insert
/* */ *
/* <Description> */ * @description:
/* Insert an element at the head of a list. */ * Insert an element at the head of a list.
/* */ *
/* <InOut> */ * @inout:
/* list :: A pointer to parent list. */ * list ::
/* node :: The node to insert. */ * A pointer to parent list.
/* */ * node ::
* The node to insert.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Insert( FT_List list, FT_List_Insert( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_List_Remove */ * FT_List_Remove
/* */ *
/* <Description> */ * @description:
/* Remove a node from a list. This function doesn't check whether */ * Remove a node from a list. This function doesn't check whether the
/* the node is in the list! */ * node is in the list!
/* */ *
/* <Input> */ * @input:
/* node :: The node to remove. */ * node ::
/* */ * The node to remove.
/* <InOut> */ *
/* list :: A pointer to the parent list. */ * @inout:
/* */ * list ::
* A pointer to the parent list.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Remove( FT_List list, FT_List_Remove( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_List_Up */ * FT_List_Up
/* */ *
/* <Description> */ * @description:
/* Move a node to the head/top of a list. Used to maintain LRU */ * Move a node to the head/top of a list. Used to maintain LRU lists.
/* lists. */ *
/* */ * @inout:
/* <InOut> */ * list ::
/* list :: A pointer to the parent list. */ * A pointer to the parent list.
/* node :: The node to move. */ * node ::
/* */ * The node to move.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Up( FT_List list, FT_List_Up( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <FuncType> */ * @functype:
/* FT_List_Iterator */ * FT_List_Iterator
/* */ *
/* <Description> */ * @description:
/* An FT_List iterator function that is called during a list parse */ * An FT_List iterator function that is called during a list parse by
/* by @FT_List_Iterate. */ * @FT_List_Iterate.
/* */ *
/* <Input> */ * @input:
/* node :: The current iteration list node. */ * 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. */ * user ::
/* */ * A typeless pointer passed to @FT_List_Iterate. Can be used to point
* to the iteration's state.
*/
typedef FT_Error typedef FT_Error
(*FT_List_Iterator)( FT_ListNode node, (*FT_List_Iterator)( FT_ListNode node,
void* user ); void* user );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_List_Iterate */ * FT_List_Iterate
/* */ *
/* <Description> */ * @description:
/* Parse a list and calls a given iterator function on each element. */ * 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 */ * Note that parsing is stopped as soon as one of the iterator calls
/* returns a non-zero value. */ * returns a non-zero value.
/* */ *
/* <Input> */ * @input:
/* list :: A handle to the list. */ * list ::
/* iterator :: An iterator function, called on each node of the list. */ * A handle to the list.
/* user :: A user-supplied field that is passed as the second */ * iterator ::
/* argument to the iterator. */ * An iterator function, called on each node of the list.
/* */ * user ::
/* <Return> */ * A user-supplied field that is passed as the second argument to the
/* The result (a FreeType error code) of the last iterator call. */ * iterator.
/* */ *
* @return:
* The result (a FreeType error code) of the last iterator call.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_List_Iterate( FT_List list, FT_List_Iterate( FT_List list,
FT_List_Iterator iterator, FT_List_Iterator iterator,
void* user ); void* user );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <FuncType> */ * @functype:
/* FT_List_Destructor */ * FT_List_Destructor
/* */ *
/* <Description> */ * @description:
/* An @FT_List iterator function that is called during a list */ * An @FT_List iterator function that is called during a list
/* finalization by @FT_List_Finalize to destroy all elements in a */ * finalization by @FT_List_Finalize to destroy all elements in a given
/* given list. */ * list.
/* */ *
/* <Input> */ * @input:
/* system :: The current system object. */ * system ::
/* */ * The current system object.
/* data :: The current object to destroy. */ *
/* */ * data ::
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */ * The current object to destroy.
/* be used to point to the iteration's state. */ *
/* */ * user ::
* A typeless pointer passed to @FT_List_Iterate. It can be used to
* point to the iteration's state.
*/
typedef void typedef void
(*FT_List_Destructor)( FT_Memory memory, (*FT_List_Destructor)( FT_Memory memory,
void* data, void* data,
void* user ); void* user );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_List_Finalize */ * FT_List_Finalize
/* */ *
/* <Description> */ * @description:
/* Destroy all elements in the list as well as the list itself. */ * Destroy all elements in the list as well as the list itself.
/* */ *
/* <Input> */ * @input:
/* list :: A handle to the list. */ * list ::
/* */ * A handle to the list.
/* destroy :: A list destructor that will be applied to each element */ *
/* of the list. Set this to NULL if not needed. */ * destroy ::
/* */ * A list destructor that will be applied to each element of the list.
/* memory :: The current memory object that handles deallocation. */ * Set this to `NULL` if not needed.
/* */ *
/* user :: A user-supplied field that is passed as the last */ * memory ::
/* argument to the destructor. */ * The current memory object that handles deallocation.
/* */ *
/* <Note> */ * user ::
/* This function expects that all nodes added by @FT_List_Add or */ * A user-supplied field that is passed as the last argument to the
/* @FT_List_Insert have been dynamically allocated. */ * destructor.
/* */ *
* @note:
* This function expects that all nodes added by @FT_List_Add or
* @FT_List_Insert have been dynamically allocated.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Finalize( FT_List list, FT_List_Finalize( FT_List list,
FT_List_Destructor destroy, FT_List_Destructor destroy,

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftlzw.h */ * ftlzw.h
/* */ *
/* LZW-compressed stream support. */ * LZW-compressed stream support.
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTLZW_H_ #ifndef FTLZW_H_
@ -31,36 +31,37 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* lzw */ * lzw
/* */ *
/* <Title> */ * @title:
/* LZW Streams */ * LZW Streams
/* */ *
/* <Abstract> */ * @abstract:
/* Using LZW-compressed font files. */ * Using LZW-compressed font files.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of LZW-specific functions. */ * This section contains the declaration of LZW-specific functions.
/* */ *
/*************************************************************************/ */
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Stream_OpenLZW * FT_Stream_OpenLZW
* *
* @description: * @description:
* Open a new stream to parse LZW-compressed font files. This is * Open a new stream to parse LZW-compressed font files. This is mainly
* mainly used to support the compressed `*.pcf.Z' fonts that come * used to support the compressed `*.pcf.Z` fonts that come with XFree86.
* with XFree86.
* *
* @input: * @input:
* stream :: The target embedding stream. * stream ::
* The target embedding stream.
* *
* source :: The source stream. * source ::
* The source stream.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -68,9 +69,9 @@ FT_BEGIN_HEADER
* @note: * @note:
* The source stream must be opened _before_ calling this function. * The source stream must be opened _before_ calling this function.
* *
* Calling the internal function `FT_Stream_Close' on the new stream will * 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 * **not** call `FT_Stream_Close` on the source stream. None of the
* objects will be released to the heap. * stream objects will be released to the heap.
* *
* The stream implementation is very basic and resets the decompression * The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream * process each time seeking backwards is needed within the stream
@ -78,10 +79,10 @@ FT_BEGIN_HEADER
* In certain builds of the library, LZW compression recognition is * In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face. * automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw * This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it * compressed file, the library will try to open a LZW stream from it and
* and re-open the face with it. * re-open the face with it.
* *
* This function may return `FT_Err_Unimplemented_Feature' if your build * This function may return `FT_Err_Unimplemented_Feature` if your build
* of FreeType was not compiled with LZW support. * of FreeType was not compiled with LZW support.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )

View file

@ -1,28 +1,28 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftmac.h */ * ftmac.h
/* */ *
/* Additional Mac-specific API. */ * Additional Mac-specific API.
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /****************************************************************************
/* */ *
/* NOTE: Include this file after FT_FREETYPE_H and after any */ * NOTE: Include this file after `FT_FREETYPE_H` and after any
/* Mac-specific headers (because this header uses Mac types such as */ * Mac-specific headers (because this header uses Mac types such as
/* Handle, FSSpec, FSRef, etc.) */ * 'Handle', 'FSSpec', 'FSRef', etc.)
/* */ *
/***************************************************************************/ */
#ifndef FTMAC_H_ #ifndef FTMAC_H_
@ -47,56 +47,59 @@ FT_BEGIN_HEADER
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* mac_specific */ * mac_specific
/* */ *
/* <Title> */ * @title:
/* Mac Specific Interface */ * Mac Specific Interface
/* */ *
/* <Abstract> */ * @abstract:
/* Only available on the Macintosh. */ * Only available on the Macintosh.
/* */ *
/* <Description> */ * @description:
/* The following definitions are only available if FreeType is */ * The following definitions are only available if FreeType is compiled
/* compiled on a Macintosh. */ * on a Macintosh.
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_New_Face_From_FOND */ * FT_New_Face_From_FOND
/* */ *
/* <Description> */ * @description:
/* Create a new face object from a FOND resource. */ * Create a new face object from a FOND resource.
/* */ *
/* <InOut> */ * @inout:
/* library :: A handle to the library resource. */ * library ::
/* */ * A handle to the library resource.
/* <Input> */ *
/* fond :: A FOND resource. */ * @input:
/* */ * fond ::
/* face_index :: Only supported for the -1 `sanity check' special */ * A FOND resource.
/* case. */ *
/* */ * face_index ::
/* <Output> */ * Only supported for the -1 'sanity check' special case.
/* aface :: A handle to a new face object. */ *
/* */ * @output:
/* <Return> */ * aface ::
/* FreeType error code. 0~means success. */ * A handle to a new face object.
/* */ *
/* <Notes> */ * @return:
/* This function can be used to create @FT_Face objects from fonts */ * FreeType error code. 0~means success.
/* that are installed in the system as follows. */ *
/* */ * @example:
/* { */ * This function can be used to create @FT_Face objects from fonts that
/* fond = GetResource( 'FOND', fontName ); */ * are installed in the system as follows.
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ *
/* } */ * ```
/* */ * fond = GetResource( 'FOND', fontName );
* error = FT_New_Face_From_FOND( library, fond, 0, &face );
* ```
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Face_From_FOND( FT_Library library, FT_New_Face_From_FOND( FT_Library library,
Handle fond, Handle fond,
@ -105,28 +108,28 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_GetFile_From_Mac_Name */ * FT_GetFile_From_Mac_Name
/* */ *
/* <Description> */ * @description:
/* Return an FSSpec for the disk file containing the named font. */ * Return an FSSpec for the disk file containing the named font.
/* */ *
/* <Input> */ * @input:
/* fontName :: Mac OS name of the font (e.g., Times New Roman */ * fontName ::
/* Bold). */ * Mac OS name of the font (e.g., Times New Roman Bold).
/* */ *
/* <Output> */ * @output:
/* pathSpec :: FSSpec to the file. For passing to */ * pathSpec ::
/* @FT_New_Face_From_FSSpec. */ * FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
/* */ *
/* face_index :: Index of the face. For passing to */ * face_index ::
/* @FT_New_Face_From_FSSpec. */ * Index of the face. For passing to @FT_New_Face_From_FSSpec.
/* */ *
/* <Return> */ * @return:
/* FreeType error code. 0~means success. */ * FreeType error code. 0~means success.
/* */ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName, FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec, FSSpec* pathSpec,
@ -134,27 +137,28 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_GetFile_From_Mac_ATS_Name */ * FT_GetFile_From_Mac_ATS_Name
/* */ *
/* <Description> */ * @description:
/* Return an FSSpec for the disk file containing the named font. */ * Return an FSSpec for the disk file containing the named font.
/* */ *
/* <Input> */ * @input:
/* fontName :: Mac OS name of the font in ATS framework. */ * fontName ::
/* */ * Mac OS name of the font in ATS framework.
/* <Output> */ *
/* pathSpec :: FSSpec to the file. For passing to */ * @output:
/* @FT_New_Face_From_FSSpec. */ * pathSpec ::
/* */ * FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
/* face_index :: Index of the face. For passing to */ *
/* @FT_New_Face_From_FSSpec. */ * face_index ::
/* */ * Index of the face. For passing to @FT_New_Face_From_FSSpec.
/* <Return> */ *
/* FreeType error code. 0~means success. */ * @return:
/* */ * FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_ATS_Name( const char* fontName, FT_GetFile_From_Mac_ATS_Name( const char* fontName,
FSSpec* pathSpec, FSSpec* pathSpec,
@ -162,30 +166,33 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_GetFilePath_From_Mac_ATS_Name */ * FT_GetFilePath_From_Mac_ATS_Name
/* */ *
/* <Description> */ * @description:
/* Return a pathname of the disk file and face index for given font */ * Return a pathname of the disk file and face index for given font name
/* name that is handled by ATS framework. */ * that is handled by ATS framework.
/* */ *
/* <Input> */ * @input:
/* fontName :: Mac OS name of the font in ATS framework. */ * fontName ::
/* */ * Mac OS name of the font in ATS framework.
/* <Output> */ *
/* path :: Buffer to store pathname of the file. For passing */ * @output:
/* to @FT_New_Face. The client must allocate this */ * path ::
/* buffer before calling this function. */ * 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. */ *
/* */ * maxPathSize ::
/* face_index :: Index of the face. For passing to @FT_New_Face. */ * Lengths of the buffer `path` that client allocated.
/* */ *
/* <Return> */ * face_index ::
/* FreeType error code. 0~means success. */ * Index of the face. For passing to @FT_New_Face.
/* */ *
* @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
UInt8* path, UInt8* path,
@ -194,33 +201,37 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_New_Face_From_FSSpec */ * FT_New_Face_From_FSSpec
/* */ *
/* <Description> */ * @description:
/* Create a new face object from a given resource and typeface index */ * Create a new face object from a given resource and typeface index
/* using an FSSpec to the font file. */ * using an FSSpec to the font file.
/* */ *
/* <InOut> */ * @inout:
/* library :: A handle to the library resource. */ * library ::
/* */ * A handle to the library resource.
/* <Input> */ *
/* spec :: FSSpec to the font file. */ * @input:
/* */ * spec ::
/* face_index :: The index of the face within the resource. The */ * FSSpec to the font file.
/* first face has index~0. */ *
/* <Output> */ * face_index ::
/* aface :: A handle to a new face object. */ * The index of the face within the resource. The first face has
/* */ * index~0.
/* <Return> */ * @output:
/* FreeType error code. 0~means success. */ * aface ::
/* */ * A handle to a new face object.
/* <Note> */ *
/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ * @return:
/* it accepts an FSSpec instead of a path. */ * FreeType error code. 0~means success.
/* */ *
* @note:
* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except it
* accepts an FSSpec instead of a path.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Face_From_FSSpec( FT_Library library, FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec, const FSSpec *spec,
@ -229,33 +240,37 @@ FT_BEGIN_HEADER
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_New_Face_From_FSRef */ * FT_New_Face_From_FSRef
/* */ *
/* <Description> */ * @description:
/* Create a new face object from a given resource and typeface index */ * Create a new face object from a given resource and typeface index
/* using an FSRef to the font file. */ * using an FSRef to the font file.
/* */ *
/* <InOut> */ * @inout:
/* library :: A handle to the library resource. */ * library ::
/* */ * A handle to the library resource.
/* <Input> */ *
/* spec :: FSRef to the font file. */ * @input:
/* */ * spec ::
/* face_index :: The index of the face within the resource. The */ * FSRef to the font file.
/* first face has index~0. */ *
/* <Output> */ * face_index ::
/* aface :: A handle to a new face object. */ * The index of the face within the resource. The first face has
/* */ * index~0.
/* <Return> */ * @output:
/* FreeType error code. 0~means success. */ * aface ::
/* */ * A handle to a new face object.
/* <Note> */ *
/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ * @return:
/* it accepts an FSRef instead of a path. */ * FreeType error code. 0~means success.
/* */ *
* @note:
* @FT_New_Face_From_FSRef is identical to @FT_New_Face except it accepts
* an FSRef instead of a path.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Face_From_FSRef( FT_Library library, FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref, const FSRef *ref,

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,94 +1,103 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftmoderr.h */ * ftmoderr.h
/* */ *
/* FreeType module error offsets (specification). */ * FreeType module error offsets (specification).
/* */ *
/* Copyright 2001-2018 by */ * Copyright (C) 2001-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* This file is used to define the FreeType module error codes. */ * This file is used to define the FreeType module error codes.
/* */ *
/* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */ * 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 */ * set, the lower byte of an error value identifies the error code as
/* usual. In addition, the higher byte identifies the module. For */ * usual. In addition, the higher byte identifies the module. For
/* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */ * example, the error `FT_Err_Invalid_File_Format` has value 0x0003, the
/* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */ * error `TT_Err_Invalid_File_Format` has value 0x1303, the error
/* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */ * `T1_Err_Invalid_File_Format` has value 0x1403, etc.
/* */ *
/* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */ * Note that `FT_Err_Ok`, `TT_Err_Ok`, etc. are always equal to zero,
/* including the high byte. */ * including the high byte.
/* */ *
/* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */ * If `FT_CONFIG_OPTION_USE_MODULE_ERRORS` isn't set, the higher byte of an
/* an error value is set to zero. */ * error value is set to zero.
/* */ *
/* To hide the various `XXX_Err_' prefixes in the source code, FreeType */ * To hide the various `XXX_Err_` prefixes in the source code, FreeType
/* provides some macros in `fttypes.h'. */ * provides some macros in `fttypes.h`.
/* */ *
/* FT_ERR( err ) */ * FT_ERR( err )
/* Add current error module prefix (as defined with the */ *
/* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */ * Add current error module prefix (as defined with the `FT_ERR_PREFIX`
/* the line */ * macro) to `err`. For example, in the BDF module the line
/* */ *
/* error = FT_ERR( Invalid_Outline ); */ * ```
/* */ * error = FT_ERR( Invalid_Outline );
/* expands to */ * ```
/* */ *
/* error = BDF_Err_Invalid_Outline; */ * expands to
/* */ *
/* For simplicity, you can always use `FT_Err_Ok' directly instead */ * ```
/* of `FT_ERR( Ok )'. */ * error = BDF_Err_Invalid_Outline;
/* */ * ```
/* FT_ERR_EQ( errcode, err ) */ *
/* FT_ERR_NEQ( errcode, err ) */ * For simplicity, you can always use `FT_Err_Ok` directly instead of
/* Compare error code `errcode' with the error `err' for equality */ * `FT_ERR( Ok )`.
/* and inequality, respectively. Example: */ *
/* */ * FT_ERR_EQ( errcode, err )
/* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */ * FT_ERR_NEQ( errcode, err )
/* ... */ *
/* */ * Compare error code `errcode` with the error `err` for equality and
/* Using this macro you don't have to think about error prefixes. */ * inequality, respectively. Example:
/* Of course, if module errors are not active, the above example is */ *
/* the same as */ * ```
/* */ * if ( FT_ERR_EQ( error, Invalid_Outline ) )
/* if ( error == FT_Err_Invalid_Outline ) */ * ...
/* ... */ * ```
/* */ *
/* FT_ERROR_BASE( errcode ) */ * Using this macro you don't have to think about error prefixes. Of
/* FT_ERROR_MODULE( errcode ) */ * course, if module errors are not active, the above example is the
/* Get base error and module error code, respectively. */ * same as
/* */ *
/* */ * ```
/* It can also be used to create a module error message table easily */ * if ( error == FT_Err_Invalid_Outline )
/* with something like */ * ...
/* */ * ```
/* { */ *
/* #undef FTMODERR_H_ */ * FT_ERROR_BASE( errcode )
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */ * FT_ERROR_MODULE( errcode )
/* #define FT_MODERR_START_LIST { */ *
/* #define FT_MODERR_END_LIST { 0, 0 } }; */ * Get base error and module error code, respectively.
/* */ *
/* const struct */ * It can also be used to create a module error message table easily with
/* { */ * something like
/* int mod_err_offset; */ *
/* const char* mod_err_msg */ * ```
/* } ft_mod_errors[] = */ * #undef FTMODERR_H_
/* */ * #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s },
/* #include FT_MODULE_ERRORS_H */ * #define FT_MODERR_START_LIST {
/* } */ * #define FT_MODERR_END_LIST { 0, 0 } };
/* */ *
/*************************************************************************/ * const struct
* {
* int mod_err_offset;
* const char* mod_err_msg
* } ft_mod_errors[] =
*
* #include FT_MODULE_ERRORS_H
* ```
*
*/
#ifndef FTMODERR_H_ #ifndef FTMODERR_H_

View file

@ -1,30 +1,30 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftotval.h */ * ftotval.h
/* */ *
/* FreeType API for validating OpenType tables (specification). */ * FreeType API for validating OpenType tables (specification).
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /****************************************************************************
/* */ *
/* */ *
/* Warning: This module might be moved to a different library in the */ * Warning: This module might be moved to a different library in the
/* future to avoid a tight dependency between FreeType and the */ * future to avoid a tight dependency between FreeType and the
/* OpenType specification. */ * OpenType specification.
/* */ *
/* */ *
/***************************************************************************/ */
#ifndef FTOTVAL_H_ #ifndef FTOTVAL_H_
@ -43,31 +43,31 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* ot_validation */ * ot_validation
/* */ *
/* <Title> */ * @title:
/* OpenType Validation */ * OpenType Validation
/* */ *
/* <Abstract> */ * @abstract:
/* An API to validate OpenType tables. */ * An API to validate OpenType tables.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of functions to validate */ * This section contains the declaration of functions to validate some
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ * OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
/* */ *
/* <Order> */ * @order:
/* FT_OpenType_Validate */ * FT_OpenType_Validate
/* FT_OpenType_Free */ * FT_OpenType_Free
/* */ *
/* FT_VALIDATE_OTXXX */ * FT_VALIDATE_OTXXX
/* */ *
/*************************************************************************/ */
/********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_VALIDATE_OTXXX * FT_VALIDATE_OTXXX
@ -113,7 +113,8 @@ FT_BEGIN_HEADER
FT_VALIDATE_JSTF | \ FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH ) FT_VALIDATE_MATH )
/**********************************************************************
/**************************************************************************
* *
* @function: * @function:
* FT_OpenType_Validate * FT_OpenType_Validate
@ -121,8 +122,8 @@ FT_BEGIN_HEADER
* @description: * @description:
* Validate various OpenType tables to assure that all offsets and * Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that * indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without * actually does the text layout can access those tables without error
* error checking (which can be quite time consuming). * checking (which can be quite time consuming).
* *
* @input: * @input:
* face :: * face ::
@ -156,7 +157,7 @@ FT_BEGIN_HEADER
* otherwise. * otherwise.
* *
* After use, the application should deallocate the five tables with * After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A NULL value indicates that the table either * @FT_OpenType_Free. A `NULL` value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for * doesn't exist in the font, or the application hasn't asked for
* validation. * validation.
*/ */
@ -169,7 +170,8 @@ FT_BEGIN_HEADER
FT_Bytes *GSUB_table, FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table ); FT_Bytes *JSTF_table );
/**********************************************************************
/**************************************************************************
* *
* @function: * @function:
* FT_OpenType_Free * FT_OpenType_Free
@ -193,6 +195,7 @@ FT_BEGIN_HEADER
FT_OpenType_Free( FT_Face face, FT_OpenType_Free( FT_Face face,
FT_Bytes table ); FT_Bytes table );
/* */ /* */

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftoutln.h */ * ftoutln.h
/* */ *
/* Support for the FT_Outline type used to store glyph shapes of */ * Support for the FT_Outline type used to store glyph shapes of
/* most scalable font formats (specification). */ * most scalable font formats (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTOUTLN_H_ #ifndef FTOUTLN_H_
@ -34,127 +34,131 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* outline_processing */ * outline_processing
/* */ *
/* <Title> */ * @title:
/* Outline Processing */ * Outline Processing
/* */ *
/* <Abstract> */ * @abstract:
/* Functions to create, transform, and render vectorial glyph images. */ * Functions to create, transform, and render vectorial glyph images.
/* */ *
/* <Description> */ * @description:
/* This section contains routines used to create and destroy scalable */ * This section contains routines used to create and destroy scalable
/* glyph images known as `outlines'. These can also be measured, */ * glyph images known as 'outlines'. These can also be measured,
/* transformed, and converted into bitmaps and pixmaps. */ * transformed, and converted into bitmaps and pixmaps.
/* */ *
/* <Order> */ * @order:
/* FT_Outline */ * FT_Outline
/* FT_Outline_New */ * FT_Outline_New
/* FT_Outline_Done */ * FT_Outline_Done
/* FT_Outline_Copy */ * FT_Outline_Copy
/* FT_Outline_Translate */ * FT_Outline_Translate
/* FT_Outline_Transform */ * FT_Outline_Transform
/* FT_Outline_Embolden */ * FT_Outline_Embolden
/* FT_Outline_EmboldenXY */ * FT_Outline_EmboldenXY
/* FT_Outline_Reverse */ * FT_Outline_Reverse
/* FT_Outline_Check */ * FT_Outline_Check
/* */ *
/* FT_Outline_Get_CBox */ * FT_Outline_Get_CBox
/* FT_Outline_Get_BBox */ * FT_Outline_Get_BBox
/* */ *
/* FT_Outline_Get_Bitmap */ * FT_Outline_Get_Bitmap
/* FT_Outline_Render */ * FT_Outline_Render
/* FT_Outline_Decompose */ * FT_Outline_Decompose
/* FT_Outline_Funcs */ * FT_Outline_Funcs
/* FT_Outline_MoveToFunc */ * FT_Outline_MoveToFunc
/* FT_Outline_LineToFunc */ * FT_Outline_LineToFunc
/* FT_Outline_ConicToFunc */ * FT_Outline_ConicToFunc
/* FT_Outline_CubicToFunc */ * FT_Outline_CubicToFunc
/* */ *
/* FT_Orientation */ * FT_Orientation
/* FT_Outline_Get_Orientation */ * FT_Outline_Get_Orientation
/* */ *
/* FT_OUTLINE_XXX */ * FT_OUTLINE_XXX
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Decompose */ * FT_Outline_Decompose
/* */ *
/* <Description> */ * @description:
/* Walk over an outline's structure to decompose it into individual */ * Walk over an outline's structure to decompose it into individual
/* segments and Bezier arcs. This function also emits `move to' */ * segments and Bezier arcs. This function also emits 'move to'
/* operations to indicate the start of new contours in the outline. */ * operations to indicate the start of new contours in the outline.
/* */ *
/* <Input> */ * @input:
/* outline :: A pointer to the source target. */ * outline ::
/* */ * A pointer to the source target.
/* func_interface :: A table of `emitters', i.e., function pointers */ *
/* called during decomposition to indicate path */ * func_interface ::
/* operations. */ * A table of 'emitters', i.e., function pointers called during
/* */ * decomposition to indicate path operations.
/* <InOut> */ *
/* user :: A typeless pointer that is passed to each */ * @inout:
/* emitter during the decomposition. It can be */ * user ::
/* used to store the state during the */ * A typeless pointer that is passed to each emitter during the
/* decomposition. */ * decomposition. It can be used to store the state during the
/* */ * decomposition.
/* <Return> */ *
/* FreeType error code. 0~means success. */ * @return:
/* */ * FreeType error code. 0~means success.
/* <Note> */ *
/* A contour that contains a single point only is represented by a */ * @note:
/* `move to' operation followed by `line to' to the same point. In */ * A contour that contains a single point only is represented by a 'move
/* most cases, it is best to filter this out before using the */ * to' operation followed by 'line to' to the same point. In most cases,
/* outline for stroking purposes (otherwise it would result in a */ * it is best to filter this out before using the outline for stroking
/* visible dot when round caps are used). */ * 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, */ * Similarly, the function returns success for an empty outline also
/* you should filter this out, too. */ * (doing nothing, this is, not calling any emitter); if necessary, you
/* */ * should filter this out, too.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Decompose( FT_Outline* outline, FT_Outline_Decompose( FT_Outline* outline,
const FT_Outline_Funcs* func_interface, const FT_Outline_Funcs* func_interface,
void* user ); void* user );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_New */ * FT_Outline_New
/* */ *
/* <Description> */ * @description:
/* Create a new outline of a given size. */ * Create a new outline of a given size.
/* */ *
/* <Input> */ * @input:
/* library :: A handle to the library object from where the */ * library ::
/* outline is allocated. Note however that the new */ * A handle to the library object from where the outline is allocated.
/* outline will *not* necessarily be *freed*, when */ * Note however that the new outline will **not** necessarily be
/* destroying the library, by @FT_Done_FreeType. */ * **freed**, when destroying the library, by @FT_Done_FreeType.
/* */ *
/* numPoints :: The maximum number of points within the outline. */ * numPoints ::
/* Must be smaller than or equal to 0xFFFF (65535). */ * 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'. */ * numContours ::
/* */ * The maximum number of contours within the outline. This value must
/* <Output> */ * be in the range 0 to `numPoints`.
/* anoutline :: A handle to the new outline. */ *
/* */ * @output:
/* <Return> */ * anoutline ::
/* FreeType error code. 0~means success. */ * A handle to the new outline.
/* */ *
/* <Note> */ * @return:
/* The reason why this function takes a `library' parameter is simply */ * FreeType error code. 0~means success.
/* to use the library's memory allocator. */ *
/* */ * @note:
* The reason why this function takes a `library` parameter is simply to
* use the library's memory allocator.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_New( FT_Library library, FT_Outline_New( FT_Library library,
FT_UInt numPoints, FT_UInt numPoints,
@ -162,331 +166,337 @@ FT_BEGIN_HEADER
FT_Outline *anoutline ); FT_Outline *anoutline );
FT_EXPORT( FT_Error ) /**************************************************************************
FT_Outline_New_Internal( FT_Memory memory, *
FT_UInt numPoints, * @function:
FT_Int numContours, * FT_Outline_Done
FT_Outline *anoutline ); *
* @description:
* Destroy an outline created with @FT_Outline_New.
/*************************************************************************/ *
/* */ * @input:
/* <Function> */ * library ::
/* FT_Outline_Done */ * A handle of the library object used to allocate the outline.
/* */ *
/* <Description> */ * outline ::
/* Destroy an outline created with @FT_Outline_New. */ * A pointer to the outline object to be discarded.
/* */ *
/* <Input> */ * @return:
/* library :: A handle of the library object used to allocate the */ * FreeType error code. 0~means success.
/* outline. */ *
/* */ * @note:
/* 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.
/* <Return> */ */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If the outline's `owner' field is not set, only the outline */
/* descriptor will be released. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Done( FT_Library library, FT_Outline_Done( FT_Library library,
FT_Outline* outline ); FT_Outline* outline );
FT_EXPORT( FT_Error ) /**************************************************************************
FT_Outline_Done_Internal( FT_Memory memory, *
FT_Outline* outline ); * @function:
* FT_Outline_Check
*
/*************************************************************************/ * @description:
/* */ * Check the contents of an outline descriptor.
/* <Function> */ *
/* FT_Outline_Check */ * @input:
/* */ * outline ::
/* <Description> */ * A handle to a source outline.
/* Check the contents of an outline descriptor. */ *
/* */ * @return:
/* <Input> */ * FreeType error code. 0~means success.
/* outline :: A handle to a source outline. */ *
/* */ * @note:
/* <Return> */ * An empty outline, or an outline with a single point only is also
/* FreeType error code. 0~means success. */ * valid.
/* */ */
/* <Note> */
/* An empty outline, or an outline with a single point only is also */
/* valid. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Check( FT_Outline* outline ); FT_Outline_Check( FT_Outline* outline );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Get_CBox */ * FT_Outline_Get_CBox
/* */ *
/* <Description> */ * @description:
/* Return an outline's `control box'. The control box encloses all */ * Return an outline's 'control box'. The control box encloses all the
/* the outline's points, including Bezier control points. Though it */ * outline's points, including Bezier control points. Though it
/* coincides with the exact bounding box for most glyphs, it can be */ * coincides with the exact bounding box for most glyphs, it can be
/* slightly larger in some situations (like when rotating an outline */ * slightly larger in some situations (like when rotating an outline that
/* that contains Bezier outside arcs). */ * contains Bezier outside arcs).
/* */ *
/* Computing the control box is very fast, while getting the bounding */ * Computing the control box is very fast, while getting the bounding box
/* box can take much more time as it needs to walk over all segments */ * can take much more time as it needs to walk over all segments and arcs
/* and arcs in the outline. To get the latter, you can use the */ * in the outline. To get the latter, you can use the 'ftbbox'
/* `ftbbox' component, which is dedicated to this single task. */ * component, which is dedicated to this single task.
/* */ *
/* <Input> */ * @input:
/* outline :: A pointer to the source outline descriptor. */ * outline ::
/* */ * A pointer to the source outline descriptor.
/* <Output> */ *
/* acbox :: The outline's control box. */ * @output:
/* */ * acbox ::
/* <Note> */ * The outline's control box.
/* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */ *
/* */ * @note:
* See @FT_Glyph_Get_CBox for a discussion of tricky fonts.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_Outline_Get_CBox( const FT_Outline* outline, FT_Outline_Get_CBox( const FT_Outline* outline,
FT_BBox *acbox ); FT_BBox *acbox );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Translate */ * FT_Outline_Translate
/* */ *
/* <Description> */ * @description:
/* Apply a simple translation to the points of an outline. */ * Apply a simple translation to the points of an outline.
/* */ *
/* <InOut> */ * @inout:
/* outline :: A pointer to the target outline descriptor. */ * outline ::
/* */ * A pointer to the target outline descriptor.
/* <Input> */ *
/* xOffset :: The horizontal offset. */ * @input:
/* */ * xOffset ::
/* yOffset :: The vertical offset. */ * The horizontal offset.
/* */ *
* yOffset ::
* The vertical offset.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_Outline_Translate( const FT_Outline* outline, FT_Outline_Translate( const FT_Outline* outline,
FT_Pos xOffset, FT_Pos xOffset,
FT_Pos yOffset ); FT_Pos yOffset );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Copy */ * FT_Outline_Copy
/* */ *
/* <Description> */ * @description:
/* Copy an outline into another one. Both objects must have the */ * Copy an outline into another one. Both objects must have the same
/* same sizes (number of points & number of contours) when this */ * sizes (number of points & number of contours) when this function is
/* function is called. */ * called.
/* */ *
/* <Input> */ * @input:
/* source :: A handle to the source outline. */ * source ::
/* */ * A handle to the source outline.
/* <Output> */ *
/* target :: A handle to the target outline. */ * @output:
/* */ * target ::
/* <Return> */ * A handle to the target outline.
/* FreeType error code. 0~means success. */ *
/* */ * @return:
* FreeType error code. 0~means success.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Copy( const FT_Outline* source, FT_Outline_Copy( const FT_Outline* source,
FT_Outline *target ); FT_Outline *target );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Transform */ * FT_Outline_Transform
/* */ *
/* <Description> */ * @description:
/* Apply a simple 2x2 matrix to all of an outline's points. Useful */ * Apply a simple 2x2 matrix to all of an outline's points. Useful for
/* for applying rotations, slanting, flipping, etc. */ * applying rotations, slanting, flipping, etc.
/* */ *
/* <InOut> */ * @inout:
/* outline :: A pointer to the target outline descriptor. */ * outline ::
/* */ * A pointer to the target outline descriptor.
/* <Input> */ *
/* matrix :: A pointer to the transformation matrix. */ * @input:
/* */ * matrix ::
/* <Note> */ * A pointer to the transformation matrix.
/* You can use @FT_Outline_Translate if you need to translate the */ *
/* outline's points. */ * @note:
/* */ * You can use @FT_Outline_Translate if you need to translate the
* outline's points.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_Outline_Transform( const FT_Outline* outline, FT_Outline_Transform( const FT_Outline* outline,
const FT_Matrix* matrix ); const FT_Matrix* matrix );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Embolden */ * FT_Outline_Embolden
/* */ *
/* <Description> */ * @description:
/* Embolden an outline. The new outline will be at most 4~times */ * Embolden an outline. The new outline will be at most 4~times
/* `strength' pixels wider and higher. You may think of the left and */ * `strength` pixels wider and higher. You may think of the left and
/* bottom borders as unchanged. */ * bottom borders as unchanged.
/* */ *
/* Negative `strength' values to reduce the outline thickness are */ * Negative `strength` values to reduce the outline thickness are
/* possible also. */ * possible also.
/* */ *
/* <InOut> */ * @inout:
/* outline :: A handle to the target outline. */ * outline ::
/* */ * A handle to the target outline.
/* <Input> */ *
/* strength :: How strong the glyph is emboldened. Expressed in */ * @input:
/* 26.6 pixel format. */ * strength ::
/* */ * How strong the glyph is emboldened. Expressed in 26.6 pixel format.
/* <Return> */ *
/* FreeType error code. 0~means success. */ * @return:
/* */ * FreeType error code. 0~means success.
/* <Note> */ *
/* The used algorithm to increase or decrease the thickness of the */ * @note:
/* glyph doesn't change the number of points; this means that certain */ * The used algorithm to increase or decrease the thickness of the glyph
/* situations like acute angles or intersections are sometimes */ * doesn't change the number of points; this means that certain
/* handled incorrectly. */ * 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. */ * If you need 'better' metrics values you should call
/* */ * @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.
/* Example call: */ *
/* */ * 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 ) */ * @example:
/* FT_Outline_Embolden( &face->glyph->outline, strength ); */ * ```
/* } */ * FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );
/* */ *
/* To get meaningful results, font scaling values must be set with */ * if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE )
/* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */ * FT_Outline_Embolden( &face->glyph->outline, strength );
/* */ * ```
*
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Embolden( FT_Outline* outline, FT_Outline_Embolden( FT_Outline* outline,
FT_Pos strength ); FT_Pos strength );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_EmboldenXY */ * FT_Outline_EmboldenXY
/* */ *
/* <Description> */ * @description:
/* Embolden an outline. The new outline will be `xstrength' pixels */ * Embolden an outline. The new outline will be `xstrength` pixels wider
/* wider and `ystrength' pixels higher. Otherwise, it is similar to */ * and `ystrength` pixels higher. Otherwise, it is similar to
/* @FT_Outline_Embolden, which uses the same strength in both */ * @FT_Outline_Embolden, which uses the same strength in both directions.
/* directions. */ *
/* */ * @since:
/* <Since> */ * 2.4.10
/* 2.4.10 */ */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_EmboldenXY( FT_Outline* outline, FT_Outline_EmboldenXY( FT_Outline* outline,
FT_Pos xstrength, FT_Pos xstrength,
FT_Pos ystrength ); FT_Pos ystrength );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Reverse */ * FT_Outline_Reverse
/* */ *
/* <Description> */ * @description:
/* Reverse the drawing direction of an outline. This is used to */ * Reverse the drawing direction of an outline. This is used to ensure
/* ensure consistent fill conventions for mirrored glyphs. */ * consistent fill conventions for mirrored glyphs.
/* */ *
/* <InOut> */ * @inout:
/* outline :: A pointer to the target outline descriptor. */ * outline ::
/* */ * A pointer to the target outline descriptor.
/* <Note> */ *
/* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ * @note:
/* the outline's `flags' field. */ * 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. */ * It shouldn't be used by a normal client application, unless it knows
/* */ * what it is doing.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_Outline_Reverse( FT_Outline* outline ); FT_Outline_Reverse( FT_Outline* outline );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Get_Bitmap */ * FT_Outline_Get_Bitmap
/* */ *
/* <Description> */ * @description:
/* Render an outline within a bitmap. The outline's image is simply */ * Render an outline within a bitmap. The outline's image is simply
/* OR-ed to the target bitmap. */ * OR-ed to the target bitmap.
/* */ *
/* <Input> */ * @input:
/* library :: A handle to a FreeType library object. */ * library ::
/* */ * A handle to a FreeType library object.
/* outline :: A pointer to the source outline descriptor. */ *
/* */ * outline ::
/* <InOut> */ * A pointer to the source outline descriptor.
/* abitmap :: A pointer to the target bitmap descriptor. */ *
/* */ * @inout:
/* <Return> */ * abitmap ::
/* FreeType error code. 0~means success. */ * A pointer to the target bitmap descriptor.
/* */ *
/* <Note> */ * @return:
/* This function does NOT CREATE the bitmap, it only renders an */ * FreeType error code. 0~means success.
/* outline image within the one you pass to it! Consequently, the */ *
/* various fields in `abitmap' should be set accordingly. */ * @note:
/* */ * This function does **not create** the bitmap, it only renders an
/* It will use the raster corresponding to the default glyph format. */ * outline image within the one you pass to it! Consequently, the
/* */ * various fields in `abitmap` should be set accordingly.
/* The value of the `num_grays' field in `abitmap' is ignored. If */ *
/* you select the gray-level rasterizer, and you want less than 256 */ * It will use the raster corresponding to the default glyph format.
/* gray levels, you have to use @FT_Outline_Render directly. */ *
/* */ * 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_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Get_Bitmap( FT_Library library, FT_Outline_Get_Bitmap( FT_Library library,
FT_Outline* outline, FT_Outline* outline,
const FT_Bitmap *abitmap ); const FT_Bitmap *abitmap );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Outline_Render */ * FT_Outline_Render
/* */ *
/* <Description> */ * @description:
/* Render an outline within a bitmap using the current scan-convert. */ * Render an outline within a bitmap using the current scan-convert.
/* This function uses an @FT_Raster_Params structure as an argument, */ * This function uses an @FT_Raster_Params structure as an argument,
/* allowing advanced features like direct composition, translucency, */ * allowing advanced features like direct composition, translucency, etc.
/* etc. */ *
/* */ * @input:
/* <Input> */ * library ::
/* library :: A handle to a FreeType library object. */ * A handle to a FreeType library object.
/* */ *
/* outline :: A pointer to the source outline descriptor. */ * outline ::
/* */ * A pointer to the source outline descriptor.
/* <InOut> */ *
/* params :: A pointer to an @FT_Raster_Params structure used to */ * @inout:
/* describe the rendering operation. */ * params ::
/* */ * A pointer to an @FT_Raster_Params structure used to describe the
/* <Return> */ * rendering operation.
/* FreeType error code. 0~means success. */ *
/* */ * @return:
/* <Note> */ * FreeType error code. 0~means success.
/* You should know what you are doing and how @FT_Raster_Params works */ *
/* to use this function. */ * @note:
/* */ * You should know what you are doing and how @FT_Raster_Params works to
/* The field `params.source' will be set to `outline' before the scan */ * use this function.
/* converter is called, which means that the value you give to it is */ *
/* actually ignored. */ * 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
/* The gray-level rasterizer always uses 256 gray levels. If you */ * actually ignored.
/* 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 */ * The gray-level rasterizer always uses 256 gray levels. If you want
/* @FT_Raster_Params structure for more details. */ * 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_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Outline_Render( FT_Library library, FT_Outline_Render( FT_Library library,
FT_Outline* outline, FT_Outline* outline,
@ -506,22 +516,22 @@ FT_BEGIN_HEADER
* *
* @values: * @values:
* FT_ORIENTATION_TRUETYPE :: * FT_ORIENTATION_TRUETYPE ::
* According to the TrueType specification, clockwise contours must * According to the TrueType specification, clockwise contours must be
* be filled, and counter-clockwise ones must be unfilled. * filled, and counter-clockwise ones must be unfilled.
* *
* FT_ORIENTATION_POSTSCRIPT :: * FT_ORIENTATION_POSTSCRIPT ::
* According to the PostScript specification, counter-clockwise contours * According to the PostScript specification, counter-clockwise
* must be filled, and clockwise ones must be unfilled. * contours must be filled, and clockwise ones must be unfilled.
* *
* FT_ORIENTATION_FILL_RIGHT :: * FT_ORIENTATION_FILL_RIGHT ::
* This is identical to @FT_ORIENTATION_TRUETYPE, but is used to * This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
* remember that in TrueType, everything that is to the right of * remember that in TrueType, everything that is to the right of the
* the drawing direction of a contour must be filled. * drawing direction of a contour must be filled.
* *
* FT_ORIENTATION_FILL_LEFT :: * FT_ORIENTATION_FILL_LEFT ::
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to * This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
* remember that in PostScript, everything that is to the left of * remember that in PostScript, everything that is to the left of the
* the drawing direction of a contour must be filled. * drawing direction of a contour must be filled.
* *
* FT_ORIENTATION_NONE :: * FT_ORIENTATION_NONE ::
* The orientation cannot be determined. That is, different parts of * The orientation cannot be determined. That is, different parts of
@ -545,11 +555,11 @@ FT_BEGIN_HEADER
* FT_Outline_Get_Orientation * FT_Outline_Get_Orientation
* *
* @description: * @description:
* This function analyzes a glyph outline and tries to compute its * This function analyzes a glyph outline and tries to compute its fill
* fill orientation (see @FT_Orientation). This is done by integrating * orientation (see @FT_Orientation). This is done by integrating the
* the total area covered by the outline. The positive integral * total area covered by the outline. The positive integral corresponds
* corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT * to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT is
* is returned. The negative integral corresponds to the counter-clockwise * returned. The negative integral corresponds to the counter-clockwise
* orientation and @FT_ORIENTATION_TRUETYPE is returned. * orientation and @FT_ORIENTATION_TRUETYPE is returned.
* *
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty * Note that this will return @FT_ORIENTATION_TRUETYPE for empty
@ -566,6 +576,7 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Orientation ) FT_EXPORT( FT_Orientation )
FT_Outline_Get_Orientation( FT_Outline* outline ); FT_Outline_Get_Orientation( FT_Outline* outline );
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftparams.h */ * ftparams.h
/* */ *
/* FreeType API for possible FT_Parameter tags (specification only). */ * FreeType API for possible FT_Parameter tags (specification only).
/* */ *
/* Copyright 2017-2018 by */ * Copyright (C) 2017-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTPARAMS_H_ #ifndef FTPARAMS_H_
@ -51,16 +51,16 @@ FT_BEGIN_HEADER
*/ */
/*************************************************************************** /**************************************************************************
* *
* @constant: * @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
* *
* @description: * @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* family names in the `name' table (introduced in OpenType version * family names in the 'name' table (introduced in OpenType version 1.4).
* 1.4). Use this for backward compatibility with legacy systems that * Use this for backward compatibility with legacy systems that have a
* have a four-faces-per-family restriction. * four-faces-per-family restriction.
* *
* @since: * @since:
* 2.8 * 2.8
@ -75,14 +75,14 @@ FT_BEGIN_HEADER
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
/*************************************************************************** /**************************************************************************
* *
* @constant: * @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
* *
* @description: * @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* 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 * 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction. * have a four-faces-per-family restriction.
* *
@ -99,9 +99,9 @@ FT_BEGIN_HEADER
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
/*************************************************************************** /**************************************************************************
* *
* @constant: * @enum:
* FT_PARAM_TAG_INCREMENTAL * FT_PARAM_TAG_INCREMENTAL
* *
* @description: * @description:
@ -115,14 +115,14 @@ FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @constant: * @enum:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS * FT_PARAM_TAG_LCD_FILTER_WEIGHTS
* *
* @description: * @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The * An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding argument specifies the five LCD filter weights for a * corresponding argument specifies the five LCD filter weights for a
* given face (if using @FT_LOAD_TARGET_LCD, for example), overriding * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding the
* the global default values or the values set up with * global default values or the values set up with
* @FT_Library_SetLcdFilterWeights. * @FT_Library_SetLcdFilterWeights.
* *
* @since: * @since:
@ -135,14 +135,13 @@ FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @constant: * @enum:
* FT_PARAM_TAG_RANDOM_SEED * FT_PARAM_TAG_RANDOM_SEED
* *
* @description: * @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The * An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding 32bit signed integer argument overrides the font * corresponding 32bit signed integer argument overrides the font
* driver's random seed value with a face-specific one; see * driver's random seed value with a face-specific one; see @random-seed.
* @random-seed.
* *
* @since: * @since:
* 2.8 * 2.8
@ -154,7 +153,7 @@ FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @constant: * @enum:
* FT_PARAM_TAG_STEM_DARKENING * FT_PARAM_TAG_STEM_DARKENING
* *
* @description: * @description:
@ -163,10 +162,10 @@ FT_BEGIN_HEADER
* darkening, overriding the global default values or the values set up * darkening, overriding the global default values or the values set up
* with @FT_Property_Set (see @no-stem-darkening). * with @FT_Property_Set (see @no-stem-darkening).
* *
* This is a passive setting that only takes effect if the font driver * This is a passive setting that only takes effect if the font driver or
* or autohinter honors it, which the CFF, Type~1, and CID drivers * autohinter honors it, which the CFF, Type~1, and CID drivers always
* always do, but the autohinter only in `light' hinting mode (as of * do, but the autohinter only in 'light' hinting mode (as of version
* version 2.9). * 2.9).
* *
* @since: * @since:
* 2.8 * 2.8
@ -176,17 +175,17 @@ FT_BEGIN_HEADER
FT_MAKE_TAG( 'd', 'a', 'r', 'k' ) FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/*************************************************************************** /**************************************************************************
* *
* @constant: * @enum:
* FT_PARAM_TAG_UNPATENTED_HINTING * FT_PARAM_TAG_UNPATENTED_HINTING
* *
* @description: * @description:
* Deprecated, no effect. * Deprecated, no effect.
* *
* Previously: A constant used as the tag of an @FT_Parameter structure to * Previously: A constant used as the tag of an @FT_Parameter structure
* indicate that unpatented methods only should be used by the TrueType * to indicate that unpatented methods only should be used by the
* bytecode interpreter for a typeface opened by @FT_Open_Face. * TrueType bytecode interpreter for a typeface opened by @FT_Open_Face.
* *
*/ */
#define FT_PARAM_TAG_UNPATENTED_HINTING \ #define FT_PARAM_TAG_UNPATENTED_HINTING \

View file

@ -1,105 +0,0 @@
/***************************************************************************/
/* */
/* ftpcfdrv.h */
/* */
/* FreeType API for controlling the PCF driver (specification only). */
/* */
/* Copyright 2017 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. */
/* */
/***************************************************************************/
#ifndef FTPCFDRV_H_
#define FTPCFDRV_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
/**************************************************************************
*
* @section:
* pcf_driver
*
* @title:
* The PCF driver
*
* @abstract:
* Controlling the PCF driver module.
*
* @description:
* While FreeType's PCF driver doesn't expose API functions by itself,
* it is possible to control its behaviour with @FT_Property_Set and
* @FT_Property_Get. Right now, there is a single property
* `no-long-family-names' available if FreeType is compiled with
* PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
*
* The PCF driver's module name is `pcf'.
*
*/
/**************************************************************************
*
* @property:
* no-long-family-names
*
* @description:
* If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling
* FreeType, the PCF driver constructs long family names.
*
* There are many PCF fonts just called `Fixed' which look completely
* different, and which have nothing to do with each other. When
* selecting `Fixed' in KDE or Gnome one gets results that appear rather
* random, the style changes often if one changes the size and one
* cannot select some fonts at all. The improve this situation, the PCF
* module prepends the foundry name (plus a space) to the family name.
* It also checks whether there are `wide' characters; all put together,
* family names like `Sony Fixed' or `Misc Fixed Wide' are constructed.
*
* If `no-long-family-names' is set, this feature gets switched off.
*
* {
* FT_Library library;
* FT_Bool no_long_family_names = TRUE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "pcf",
* "no-long-family-names",
* &no_long_family_names );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable (using values 1 and 0 for `on' and `off', respectively).
*
*/
FT_END_HEADER
#endif /* FTPCFDRV_H_ */
/* END */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftpfr.h */ * ftpfr.h
/* */ *
/* FreeType API for accessing PFR-specific data (specification only). */ * FreeType API for accessing PFR-specific data (specification only).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTPFR_H_ #ifndef FTPFR_H_
@ -32,24 +32,24 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* pfr_fonts */ * pfr_fonts
/* */ *
/* <Title> */ * @title:
/* PFR Fonts */ * PFR Fonts
/* */ *
/* <Abstract> */ * @abstract:
/* PFR/TrueDoc specific API. */ * PFR/TrueDoc-specific API.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of PFR-specific functions. */ * This section contains the declaration of PFR-specific functions.
/* */ *
/*************************************************************************/ */
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Metrics * FT_Get_PFR_Metrics
@ -58,26 +58,27 @@ FT_BEGIN_HEADER
* Return the outline and metrics resolutions of a given PFR face. * Return the outline and metrics resolutions of a given PFR face.
* *
* @input: * @input:
* face :: Handle to the input face. It can be a non-PFR face. * face ::
* Handle to the input face. It can be a non-PFR face.
* *
* @output: * @output:
* aoutline_resolution :: * aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM' * Outline resolution. This is equivalent to `face->units_per_EM` for
* for non-PFR fonts. Optional (parameter can be NULL). * non-PFR fonts. Optional (parameter can be `NULL`).
* *
* ametrics_resolution :: * ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution' * Metrics resolution. This is equivalent to `outline_resolution` for
* for non-PFR fonts. Optional (parameter can be NULL). * non-PFR fonts. Optional (parameter can be `NULL`).
* *
* ametrics_x_scale :: * ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed * A 16.16 fixed-point number used to scale distance expressed in
* in metrics units to device subpixels. This is equivalent to * metrics units to device subpixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter * `face->size->x_scale`, but for metrics only. Optional (parameter
* can be NULL). * can be `NULL`).
* *
* ametrics_y_scale :: * ametrics_y_scale ::
* Same as `ametrics_x_scale' but for the vertical direction. * Same as `ametrics_x_scale` but for the vertical direction.
* optional (parameter can be NULL). * optional (parameter can be `NULL`).
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -94,7 +95,7 @@ FT_BEGIN_HEADER
FT_Fixed *ametrics_y_scale ); FT_Fixed *ametrics_y_scale );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Kerning * FT_Get_PFR_Kerning
@ -105,24 +106,28 @@ FT_BEGIN_HEADER
* @FT_Get_Kerning. * @FT_Get_Kerning.
* *
* @input: * @input:
* face :: A handle to the input face. * face ::
* A handle to the input face.
* *
* left :: Index of the left glyph. * left ::
* Index of the left glyph.
* *
* right :: Index of the right glyph. * right ::
* Index of the right glyph.
* *
* @output: * @output:
* avector :: A kerning vector. * avector ::
* A kerning vector.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function always return distances in original PFR metrics * This function always return distances in original PFR metrics units.
* units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED * This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED mode,
* mode, which always returns distances converted to outline units. * which always returns distances converted to outline units.
* *
* You can use the value of the `x_scale' and `y_scale' parameters * 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. * returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
@ -132,7 +137,7 @@ FT_BEGIN_HEADER
FT_Vector *avector ); FT_Vector *avector );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Advance * FT_Get_PFR_Advance
@ -142,18 +147,21 @@ FT_BEGIN_HEADER
* from a PFR font. * from a PFR font.
* *
* @input: * @input:
* face :: A handle to the input face. * face ::
* A handle to the input face.
* *
* gindex :: The glyph index. * gindex ::
* The glyph index.
* *
* @output: * @output:
* aadvance :: The glyph advance in metrics units. * aadvance ::
* The glyph advance in metrics units.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics * 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). * to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftrender.h */ * ftrender.h
/* */ *
/* FreeType renderer modules public interface (specification). */ * FreeType renderer modules public interface (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTRENDER_H_ #ifndef FTRENDER_H_
@ -28,12 +28,12 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* module_management */ * module_management
/* */ *
/*************************************************************************/ */
/* create a new glyph object */ /* create a new glyph object */
@ -116,32 +116,38 @@ FT_BEGIN_HEADER
#define FTRenderer_setMode FT_Renderer_SetModeFunc #define FTRenderer_setMode FT_Renderer_SetModeFunc
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_Renderer_Class */ * FT_Renderer_Class
/* */ *
/* <Description> */ * @description:
/* The renderer module class descriptor. */ * The renderer module class descriptor.
/* */ *
/* <Fields> */ * @fields:
/* root :: The root @FT_Module_Class fields. */ * root ::
/* */ * The root @FT_Module_Class fields.
/* glyph_format :: The glyph image format this renderer handles. */ *
/* */ * glyph_format ::
/* render_glyph :: A method used to render the image that is in a */ * The glyph image format this renderer handles.
/* given glyph slot into a bitmap. */ *
/* */ * render_glyph ::
/* transform_glyph :: A method used to transform the image that is in */ * A method used to render the image that is in a given glyph slot into
/* a given glyph slot. */ * a bitmap.
/* */ *
/* get_glyph_cbox :: A method used to access the glyph's cbox. */ * transform_glyph ::
/* */ * A method used to transform the image that is in a given glyph slot.
/* set_mode :: A method used to pass additional parameters. */ *
/* */ * get_glyph_cbox ::
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ * A method used to access the glyph's cbox.
/* This is a pointer to its raster's class. */ *
/* */ * 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_ typedef struct FT_Renderer_Class_
{ {
FT_Module_Class root; FT_Module_Class root;
@ -158,64 +164,70 @@ FT_BEGIN_HEADER
} FT_Renderer_Class; } FT_Renderer_Class;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Get_Renderer */ * FT_Get_Renderer
/* */ *
/* <Description> */ * @description:
/* Retrieve the current renderer for a given glyph format. */ * Retrieve the current renderer for a given glyph format.
/* */ *
/* <Input> */ * @input:
/* library :: A handle to the library object. */ * library ::
/* */ * A handle to the library object.
/* format :: The glyph format. */ *
/* */ * format ::
/* <Return> */ * The glyph format.
/* A renderer handle. 0~if none found. */ *
/* */ * @return:
/* <Note> */ * 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. */ * @note:
/* */ * An error will be returned if a module already exists by that name, or
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ * if the module requires a version of FreeType that is too great.
/* renderer by its name, use @FT_Get_Module. */ *
/* */ * 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_EXPORT( FT_Renderer )
FT_Get_Renderer( FT_Library library, FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format ); FT_Glyph_Format format );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Set_Renderer */ * FT_Set_Renderer
/* */ *
/* <Description> */ * @description:
/* Set the current renderer to use, and set additional mode. */ * Set the current renderer to use, and set additional mode.
/* */ *
/* <InOut> */ * @inout:
/* library :: A handle to the library object. */ * library ::
/* */ * A handle to the library object.
/* <Input> */ *
/* renderer :: A handle to the renderer object. */ * @input:
/* */ * renderer ::
/* num_params :: The number of additional parameters. */ * A handle to the renderer object.
/* */ *
/* parameters :: Additional parameters. */ * num_params ::
/* */ * The number of additional parameters.
/* <Return> */ *
/* FreeType error code. 0~means success. */ * parameters ::
/* */ * Additional parameters.
/* <Note> */ *
/* In case of success, the renderer will be used to convert glyph */ * @return:
/* images in the renderer's known format into bitmaps. */ * FreeType error code. 0~means success.
/* */ *
/* This doesn't change the current renderer for other formats. */ * @note:
/* */ * In case of success, the renderer will be used to convert glyph images
/* Currently, no FreeType renderer module uses `parameters'; you */ * in the renderer's known format into bitmaps.
/* should thus always pass NULL as the value. */ *
/* */ * 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_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library, FT_Set_Renderer( FT_Library library,
FT_Renderer renderer, FT_Renderer renderer,

View file

@ -1,28 +1,28 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftsizes.h */ * ftsizes.h
/* */ *
/* FreeType size objects management (specification). */ * FreeType size objects management (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Typical application would normally not need to use these functions. */ * Typical application would normally not need to use these functions.
/* However, they have been placed in a public API for the rare cases */ * However, they have been placed in a public API for the rare cases where
/* where they are needed. */ * they are needed.
/* */ *
/*************************************************************************/ */
#ifndef FTSIZES_H_ #ifndef FTSIZES_H_
@ -42,109 +42,110 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* sizes_management */ * sizes_management
/* */ *
/* <Title> */ * @title:
/* Size Management */ * Size Management
/* */ *
/* <Abstract> */ * @abstract:
/* Managing multiple sizes per face. */ * Managing multiple sizes per face.
/* */ *
/* <Description> */ * @description:
/* When creating a new face object (e.g., with @FT_New_Face), an */ * When creating a new face object (e.g., with @FT_New_Face), an @FT_Size
/* @FT_Size object is automatically created and used to store all */ * object is automatically created and used to store all pixel-size
/* pixel-size dependent information, available in the `face->size' */ * dependent information, available in the `face->size` field.
/* field. */ *
/* */ * It is however possible to create more sizes for a given face, mostly
/* It is however possible to create more sizes for a given face, */ * in order to manage several character pixel sizes of the same font
/* mostly in order to manage several character pixel sizes of the */ * family and style. See @FT_New_Size and @FT_Done_Size.
/* 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
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */ * contents of the current 'active' size; you thus need to use
/* modify the contents of the current `active' size; you thus need */ * @FT_Activate_Size to change it.
/* to use @FT_Activate_Size to change it. */ *
/* */ * 99% of applications won't need the functions provided here, especially
/* 99% of applications won't need the functions provided here, */ * if they use the caching sub-system, so be cautious when using these.
/* especially if they use the caching sub-system, so be cautious */ *
/* when using these. */ */
/* */
/*************************************************************************/
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_New_Size */ * FT_New_Size
/* */ *
/* <Description> */ * @description:
/* Create a new size object from a given face object. */ * Create a new size object from a given face object.
/* */ *
/* <Input> */ * @input:
/* face :: A handle to a parent face object. */ * face ::
/* */ * A handle to a parent face object.
/* <Output> */ *
/* asize :: A handle to a new size object. */ * @output:
/* */ * asize ::
/* <Return> */ * A handle to a new size object.
/* FreeType error code. 0~means success. */ *
/* */ * @return:
/* <Note> */ * FreeType error code. 0~means success.
/* 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, */ * @note:
/* @FT_Load_Glyph, @FT_Load_Char, etc. */ * 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_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Size( FT_Face face, FT_New_Size( FT_Face face,
FT_Size* size ); FT_Size* size );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Done_Size */ * FT_Done_Size
/* */ *
/* <Description> */ * @description:
/* Discard a given size object. Note that @FT_Done_Face */ * Discard a given size object. Note that @FT_Done_Face automatically
/* automatically discards all size objects allocated with */ * discards all size objects allocated with @FT_New_Size.
/* @FT_New_Size. */ *
/* */ * @input:
/* <Input> */ * size ::
/* size :: A handle to a target size object. */ * A handle to a target size object.
/* */ *
/* <Return> */ * @return:
/* FreeType error code. 0~means success. */ * FreeType error code. 0~means success.
/* */ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Done_Size( FT_Size size ); FT_Done_Size( FT_Size size );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Activate_Size */ * FT_Activate_Size
/* */ *
/* <Description> */ * @description:
/* Even though it is possible to create several size objects for a */ * Even though it is possible to create several size objects for a given
/* given face (see @FT_New_Size for details), functions like */ * face (see @FT_New_Size for details), functions like @FT_Load_Glyph or
/* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */ * @FT_Load_Char only use the one that has been activated last to
/* activated last to determine the `current character pixel size'. */ * determine the 'current character pixel size'.
/* */ *
/* This function can be used to `activate' a previously created size */ * This function can be used to 'activate' a previously created size
/* object. */ * object.
/* */ *
/* <Input> */ * @input:
/* size :: A handle to a target size object. */ * size ::
/* */ * A handle to a target size object.
/* <Return> */ *
/* FreeType error code. 0~means success. */ * @return:
/* */ * FreeType error code. 0~means success.
/* <Note> */ *
/* If `face' is the size's parent face object, this function changes */ * @note:
/* the value of `face->size' to the input size handle. */ * If `face` is the size's parent face object, this function changes the
/* */ * value of `face->size` to the input size handle.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Activate_Size( FT_Size size ); FT_Activate_Size( FT_Size size );

View file

@ -1,22 +1,22 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftsnames.h */ * ftsnames.h
/* */ *
/* Simple interface to access SFNT `name' tables (which are used */ * Simple interface to access SFNT 'name' tables (which are used
/* to hold font names, copyright info, notices, etc.) (specification). */ * to hold font names, copyright info, notices, etc.) (specification).
/* */ *
/* This is _not_ used to retrieve glyph names! */ * This is _not_ used to retrieve glyph names!
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTSNAMES_H_ #ifndef FTSNAMES_H_
@ -37,72 +37,74 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* sfnt_names */ * sfnt_names
/* */ *
/* <Title> */ * @title:
/* SFNT Names */ * SFNT Names
/* */ *
/* <Abstract> */ * @abstract:
/* Access the names embedded in TrueType and OpenType files. */ * Access the names embedded in TrueType and OpenType files.
/* */ *
/* <Description> */ * @description:
/* The TrueType and OpenType specifications allow the inclusion of */ * The TrueType and OpenType specifications allow the inclusion of a
/* a special names table (`name') in font files. This table contains */ * special names table ('name') in font files. This table contains
/* textual (and internationalized) information regarding the font, */ * textual (and internationalized) information regarding the font, like
/* like family name, copyright, version, etc. */ * family name, copyright, version, etc.
/* */ *
/* The definitions below are used to access them if available. */ * The definitions below are used to access them if available.
/* */ *
/* Note that this has nothing to do with glyph names! */ * Note that this has nothing to do with glyph names!
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_SfntName */ * FT_SfntName
/* */ *
/* <Description> */ * @description:
/* A structure used to model an SFNT `name' table entry. */ * A structure used to model an SFNT 'name' table entry.
/* */ *
/* <Fields> */ * @fields:
/* platform_id :: The platform ID for `string'. */ * platform_id ::
/* See @TT_PLATFORM_XXX for possible values. */ * 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, */ * encoding_id ::
/* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX */ * The encoding ID for `string`. See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,
/* for possible values. */ * @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 */ * language_id ::
/* possible values. */ * 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 */ * Registered OpenType values for `language_id` are always smaller than
/* than 0x8000 usually indicate a language tag string */ * 0x8000; values equal or larger than 0x8000 usually indicate a
/* (introduced in OpenType version 1.6). Use function */ * language tag string (introduced in OpenType version 1.6). Use
/* @FT_Get_Sfnt_LangTag with `language_id' as its */ * function @FT_Get_Sfnt_LangTag with `language_id` as its argument to
/* argument to retrieve the associated language tag. */ * retrieve the associated language tag.
/* */ *
/* name_id :: An identifier for `string'. */ * name_id ::
/* See @TT_NAME_ID_XXX for possible values. */ * 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 */ * string ::
/* either a string of bytes (without a terminating */ * The 'name' string. Note that its format differs depending on the
/* NULL byte) or containing UTF-16BE entities. */ * (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. */ *
/* */ * string_len ::
/* <Note> */ * The length of `string` in bytes.
/* Please refer to the TrueType or OpenType specification for more */ *
/* details. */ * @note:
/* */ * Please refer to the TrueType or OpenType specification for more
* details.
*/
typedef struct FT_SfntName_ typedef struct FT_SfntName_
{ {
FT_UShort platform_id; FT_UShort platform_id;
@ -116,83 +118,95 @@ FT_BEGIN_HEADER
} FT_SfntName; } FT_SfntName;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Get_Sfnt_Name_Count */ * FT_Get_Sfnt_Name_Count
/* */ *
/* <Description> */ * @description:
/* Retrieve the number of name strings in the SFNT `name' table. */ * Retrieve the number of name strings in the SFNT 'name' table.
/* */ *
/* <Input> */ * @input:
/* face :: A handle to the source face. */ * face ::
/* */ * A handle to the source face.
/* <Return> */ *
/* The number of strings in the `name' table. */ * @return:
/* */ * The number of strings in the 'name' table.
*
* @note:
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*/
FT_EXPORT( FT_UInt ) FT_EXPORT( FT_UInt )
FT_Get_Sfnt_Name_Count( FT_Face face ); FT_Get_Sfnt_Name_Count( FT_Face face );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Get_Sfnt_Name */ * FT_Get_Sfnt_Name
/* */ *
/* <Description> */ * @description:
/* Retrieve a string of the SFNT `name' table for a given index. */ * Retrieve a string of the SFNT 'name' table for a given index.
/* */ *
/* <Input> */ * @input:
/* face :: A handle to the source face. */ * face ::
/* */ * A handle to the source face.
/* idx :: The index of the `name' string. */ *
/* */ * idx ::
/* <Output> */ * The index of the 'name' string.
/* aname :: The indexed @FT_SfntName structure. */ *
/* */ * @output:
/* <Return> */ * aname ::
/* FreeType error code. 0~means success. */ * The indexed @FT_SfntName structure.
/* */ *
/* <Note> */ * @return:
/* The `string' array returned in the `aname' structure is not */ * FreeType error code. 0~means success.
/* null-terminated. Note that you don't have to deallocate `string' */ *
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */ * @note:
/* */ * The `string` array returned in the `aname` structure is not
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ * null-terminated. Note that you don't have to deallocate `string` by
/* `name' table entries, then do a loop until you get the right */ * yourself; FreeType takes care of it if you call @FT_Done_Face.
/* platform, encoding, and name ID. */ *
/* */ * Use @FT_Get_Sfnt_Name_Count to get the total number of available
/* `name' table format~1 entries can use language tags also, see */ * 'name' table entries, then do a loop until you get the right platform,
/* @FT_Get_Sfnt_LangTag. */ * encoding, and name ID.
/* */ *
* 'name' table format~1 entries can use language tags also, see
* @FT_Get_Sfnt_LangTag.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face, FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx, FT_UInt idx,
FT_SfntName *aname ); FT_SfntName *aname );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_SfntLangTag */ * FT_SfntLangTag
/* */ *
/* <Description> */ * @description:
/* A structure to model a language tag entry from an SFNT `name' */ * A structure to model a language tag entry from an SFNT 'name' table.
/* table. */ *
/* */ * @fields:
/* <Fields> */ * string ::
/* string :: The language tag string, encoded in UTF-16BE */ * The language tag string, encoded in UTF-16BE (without trailing
/* (without trailing NULL bytes). */ * `NULL` bytes).
/* */ *
/* string_len :: The length of `string' in *bytes*. */ * string_len ::
/* */ * The length of `string` in **bytes**.
/* <Note> */ *
/* Please refer to the TrueType or OpenType specification for more */ * @note:
/* details. */ * Please refer to the TrueType or OpenType specification for more
/* */ * details.
/* <Since> */ *
/* 2.8 */ * @since:
/* */ * 2.8
*/
typedef struct FT_SfntLangTag_ typedef struct FT_SfntLangTag_
{ {
FT_Byte* string; /* this string is *not* null-terminated! */ FT_Byte* string; /* this string is *not* null-terminated! */
@ -201,41 +215,47 @@ FT_BEGIN_HEADER
} FT_SfntLangTag; } FT_SfntLangTag;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Get_Sfnt_LangTag */ * FT_Get_Sfnt_LangTag
/* */ *
/* <Description> */ * @description:
/* Retrieve the language tag associated with a language ID of an SFNT */ * Retrieve the language tag associated with a language ID of an SFNT
/* `name' table entry. */ * 'name' table entry.
/* */ *
/* <Input> */ * @input:
/* face :: A handle to the source face. */ * face ::
/* */ * A handle to the source face.
/* langID :: The language ID, as returned by @FT_Get_Sfnt_Name. */ *
/* This is always a value larger than 0x8000. */ * langID ::
/* */ * The language ID, as returned by @FT_Get_Sfnt_Name. This is always a
/* <Output> */ * value larger than 0x8000.
/* alangTag :: The language tag associated with the `name' table */ *
/* entry's language ID. */ * @output:
/* */ * alangTag ::
/* <Return> */ * The language tag associated with the 'name' table entry's language
/* FreeType error code. 0~means success. */ * ID.
/* */ *
/* <Note> */ * @return:
/* The `string' array returned in the `alangTag' structure is not */ * FreeType error code. 0~means success.
/* null-terminated. Note that you don't have to deallocate `string' */ *
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */ * @note:
/* */ * The `string` array returned in the `alangTag` structure is not
/* Only `name' table format~1 supports language tags. For format~0 */ * null-terminated. Note that you don't have to deallocate `string` by
/* tables, this function always returns FT_Err_Invalid_Table. For */ * yourself; FreeType takes care of it if you call @FT_Done_Face.
/* invalid format~1 language ID values, FT_Err_Invalid_Argument is */ *
/* returned. */ * Only 'name' table format~1 supports language tags. For format~0
/* */ * tables, this function always returns FT_Err_Invalid_Table. For
/* <Since> */ * invalid format~1 language ID values, FT_Err_Invalid_Argument is
/* 2.8 */ * returned.
/* */ *
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*
* @since:
* 2.8
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Sfnt_LangTag( FT_Face face, FT_Get_Sfnt_LangTag( FT_Face face,
FT_UInt langID, FT_UInt langID,

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftstroke.h */ * ftstroke.h
/* */ *
/* FreeType path stroker (specification). */ * FreeType path stroker (specification).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTSTROKE_H_ #ifndef FTSTROKE_H_
@ -27,7 +27,7 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/************************************************************************ /**************************************************************************
* *
* @section: * @section:
* glyph_stroker * glyph_stroker
@ -39,11 +39,11 @@ FT_BEGIN_HEADER
* Generating bordered and stroked glyphs. * Generating bordered and stroked glyphs.
* *
* @description: * @description:
* This component generates stroked outlines of a given vectorial * This component generates stroked outlines of a given vectorial glyph.
* glyph. It also allows you to retrieve the `outside' and/or the * It also allows you to retrieve the 'outside' and/or the 'inside'
* `inside' borders of the stroke. * borders of the stroke.
* *
* This can be useful to generate `bordered' glyph, i.e., glyphs * This can be useful to generate 'bordered' glyph, i.e., glyphs
* displayed with a coloured (and anti-aliased) border around their * displayed with a coloured (and anti-aliased) border around their
* shape. * shape.
* *
@ -81,7 +81,7 @@ FT_BEGIN_HEADER
*/ */
/************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Stroker * FT_Stroker
@ -92,51 +92,48 @@ FT_BEGIN_HEADER
typedef struct FT_StrokerRec_* FT_Stroker; typedef struct FT_StrokerRec_* FT_Stroker;
/************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_Stroker_LineJoin * FT_Stroker_LineJoin
* *
* @description: * @description:
* These values determine how two joining lines are rendered * These values determine how two joining lines are rendered in a
* in a stroker. * stroker.
* *
* @values: * @values:
* FT_STROKER_LINEJOIN_ROUND :: * FT_STROKER_LINEJOIN_ROUND ::
* Used to render rounded line joins. Circular arcs are used * Used to render rounded line joins. Circular arcs are used to join
* to join two lines smoothly. * two lines smoothly.
* *
* FT_STROKER_LINEJOIN_BEVEL :: * FT_STROKER_LINEJOIN_BEVEL ::
* Used to render beveled line joins. The outer corner of * Used to render beveled line joins. The outer corner of the joined
* the joined lines is filled by enclosing the triangular * lines is filled by enclosing the triangular region of the corner
* region of the corner with a straight line between the * with a straight line between the outer corners of each stroke.
* outer corners of each stroke.
* *
* FT_STROKER_LINEJOIN_MITER_FIXED :: * FT_STROKER_LINEJOIN_MITER_FIXED ::
* Used to render mitered line joins, with fixed bevels if the * Used to render mitered line joins, with fixed bevels if the miter
* miter limit is exceeded. The outer edges of the strokes * limit is exceeded. The outer edges of the strokes for the two
* for the two segments are extended until they meet at an * segments are extended until they meet at an angle. If the segments
* angle. If the segments meet at too sharp an angle (such * meet at too sharp an angle (such that the miter would extend from
* that the miter would extend from the intersection of the * the intersection of the segments a distance greater than the product
* segments a distance greater than the product of the miter * of the miter limit value and the border radius), then a bevel join
* limit value and the border radius), then a bevel join (see * (see above) is used instead. This prevents long spikes being
* above) is used instead. This prevents long spikes being * created. `FT_STROKER_LINEJOIN_MITER_FIXED` generates a miter line
* created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter * join as used in PostScript and PDF.
* line join as used in PostScript and PDF.
* *
* FT_STROKER_LINEJOIN_MITER_VARIABLE :: * FT_STROKER_LINEJOIN_MITER_VARIABLE ::
* FT_STROKER_LINEJOIN_MITER :: * FT_STROKER_LINEJOIN_MITER ::
* Used to render mitered line joins, with variable bevels if * Used to render mitered line joins, with variable bevels if the miter
* the miter limit is exceeded. The intersection of the * limit is exceeded. The intersection of the strokes is clipped at a
* strokes is clipped at a line perpendicular to the bisector * line perpendicular to the bisector of the angle between the strokes,
* of the angle between the strokes, at the distance from the * at the distance from the intersection of the segments equal to the
* intersection of the segments equal to the product of the * product of the miter limit value and the border radius. This
* miter limit value and the border radius. This prevents * prevents long spikes being created.
* long spikes being created. * `FT_STROKER_LINEJOIN_MITER_VARIABLE` generates a mitered line join
* FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line * as used in XPS. `FT_STROKER_LINEJOIN_MITER` is an alias for
* join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias * `FT_STROKER_LINEJOIN_MITER_VARIABLE`, retained for backward
* for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for * compatibility.
* backward compatibility.
*/ */
typedef enum FT_Stroker_LineJoin_ typedef enum FT_Stroker_LineJoin_
{ {
@ -149,27 +146,25 @@ FT_BEGIN_HEADER
} FT_Stroker_LineJoin; } FT_Stroker_LineJoin;
/************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_Stroker_LineCap * FT_Stroker_LineCap
* *
* @description: * @description:
* These values determine how the end of opened sub-paths are * These values determine how the end of opened sub-paths are rendered in
* rendered in a stroke. * a stroke.
* *
* @values: * @values:
* FT_STROKER_LINECAP_BUTT :: * FT_STROKER_LINECAP_BUTT ::
* The end of lines is rendered as a full stop on the last * The end of lines is rendered as a full stop on the last point
* point itself. * itself.
* *
* FT_STROKER_LINECAP_ROUND :: * FT_STROKER_LINECAP_ROUND ::
* The end of lines is rendered as a half-circle around the * The end of lines is rendered as a half-circle around the last point.
* last point.
* *
* FT_STROKER_LINECAP_SQUARE :: * 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.
* last point.
*/ */
typedef enum FT_Stroker_LineCap_ typedef enum FT_Stroker_LineCap_
{ {
@ -180,14 +175,14 @@ FT_BEGIN_HEADER
} FT_Stroker_LineCap; } FT_Stroker_LineCap;
/************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_StrokerBorder * FT_StrokerBorder
* *
* @description: * @description:
* These values are used to select a given stroke border * These values are used to select a given stroke border in
* in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder. * @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
* *
* @values: * @values:
* FT_STROKER_BORDER_LEFT :: * FT_STROKER_BORDER_LEFT ::
@ -197,9 +192,9 @@ FT_BEGIN_HEADER
* Select the right border, relative to the drawing direction. * Select the right border, relative to the drawing direction.
* *
* @note: * @note:
* 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 * 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. * drawing orientation, which varies between font formats.
* *
* You can however use @FT_Outline_GetInsideBorder and * You can however use @FT_Outline_GetInsideBorder and
@ -213,14 +208,14 @@ FT_BEGIN_HEADER
} FT_StrokerBorder; } FT_StrokerBorder;
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Outline_GetInsideBorder * FT_Outline_GetInsideBorder
* *
* @description: * @description:
* Retrieve the @FT_StrokerBorder value corresponding to the * Retrieve the @FT_StrokerBorder value corresponding to the 'inside'
* `inside' borders of a given outline. * borders of a given outline.
* *
* @input: * @input:
* outline :: * outline ::
@ -234,14 +229,14 @@ FT_BEGIN_HEADER
FT_Outline_GetInsideBorder( FT_Outline* outline ); FT_Outline_GetInsideBorder( FT_Outline* outline );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Outline_GetOutsideBorder * FT_Outline_GetOutsideBorder
* *
* @description: * @description:
* Retrieve the @FT_StrokerBorder value corresponding to the * Retrieve the @FT_StrokerBorder value corresponding to the 'outside'
* `outside' borders of a given outline. * borders of a given outline.
* *
* @input: * @input:
* outline :: * outline ::
@ -255,7 +250,7 @@ FT_BEGIN_HEADER
FT_Outline_GetOutsideBorder( FT_Outline* outline ); FT_Outline_GetOutsideBorder( FT_Outline* outline );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_New * FT_Stroker_New
@ -269,7 +264,7 @@ FT_BEGIN_HEADER
* *
* @output: * @output:
* astroker :: * astroker ::
* A new stroker object handle. NULL in case of error. * A new stroker object handle. `NULL` in case of error.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -279,7 +274,7 @@ FT_BEGIN_HEADER
FT_Stroker *astroker ); FT_Stroker *astroker );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_Set * FT_Stroker_Set
@ -301,13 +296,12 @@ FT_BEGIN_HEADER
* The line join style. * The line join style.
* *
* miter_limit :: * miter_limit ::
* The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and * The miter limit for the `FT_STROKER_LINEJOIN_MITER_FIXED` and
* FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles, * `FT_STROKER_LINEJOIN_MITER_VARIABLE` line join styles, expressed as
* expressed as 16.16 fixed-point value. * 16.16 fixed-point value.
* *
* @note: * @note:
* The radius is expressed in the same units as the outline * The radius is expressed in the same units as the outline coordinates.
* coordinates.
* *
* This function calls @FT_Stroker_Rewind automatically. * This function calls @FT_Stroker_Rewind automatically.
*/ */
@ -319,16 +313,15 @@ FT_BEGIN_HEADER
FT_Fixed miter_limit ); FT_Fixed miter_limit );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_Rewind * FT_Stroker_Rewind
* *
* @description: * @description:
* Reset a stroker object without changing its attributes. * Reset a stroker object without changing its attributes. You should
* You should call this function before beginning a new * call this function before beginning a new series of calls to
* series of calls to @FT_Stroker_BeginSubPath or * @FT_Stroker_BeginSubPath or @FT_Stroker_EndSubPath.
* @FT_Stroker_EndSubPath.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -338,15 +331,15 @@ FT_BEGIN_HEADER
FT_Stroker_Rewind( FT_Stroker stroker ); FT_Stroker_Rewind( FT_Stroker stroker );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_ParseOutline * FT_Stroker_ParseOutline
* *
* @description: * @description:
* A convenience function used to parse a whole outline with * A convenience function used to parse a whole outline with the stroker.
* the stroker. The resulting outline(s) can be retrieved * The resulting outline(s) can be retrieved later by functions like
* later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export. * @FT_Stroker_GetCounts and @FT_Stroker_Export.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -356,18 +349,18 @@ FT_BEGIN_HEADER
* The source outline. * The source outline.
* *
* opened :: * opened ::
* A boolean. If~1, the outline is treated as an open path instead * A boolean. If~1, the outline is treated as an open path instead of
* of a closed one. * a closed one.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* If `opened' is~0 (the default), the outline is treated as a closed * If `opened` is~0 (the default), the outline is treated as a closed
* path, and the stroker generates two distinct `border' outlines. * path, and the stroker generates two distinct 'border' outlines.
* *
* If `opened' is~1, the outline is processed as an open path, and the * If `opened` is~1, the outline is processed as an open path, and the
* stroker generates a single `stroke' outline. * stroker generates a single 'stroke' outline.
* *
* This function calls @FT_Stroker_Rewind automatically. * This function calls @FT_Stroker_Rewind automatically.
*/ */
@ -377,7 +370,7 @@ FT_BEGIN_HEADER
FT_Bool opened ); FT_Bool opened );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_BeginSubPath * FT_Stroker_BeginSubPath
@ -399,8 +392,8 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function is useful when you need to stroke a path that is * This function is useful when you need to stroke a path that is not
* not stored as an @FT_Outline object. * stored as an @FT_Outline object.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Stroker_BeginSubPath( FT_Stroker stroker, FT_Stroker_BeginSubPath( FT_Stroker stroker,
@ -408,7 +401,7 @@ FT_BEGIN_HEADER
FT_Bool open ); FT_Bool open );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_EndSubPath * FT_Stroker_EndSubPath
@ -424,22 +417,22 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* You should call this function after @FT_Stroker_BeginSubPath. * You should call this function after @FT_Stroker_BeginSubPath. If the
* If the subpath was not `opened', this function `draws' a * subpath was not 'opened', this function 'draws' a single line segment
* single line segment to the start position when needed. * to the start position when needed.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Stroker_EndSubPath( FT_Stroker stroker ); FT_Stroker_EndSubPath( FT_Stroker stroker );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_LineTo * FT_Stroker_LineTo
* *
* @description: * @description:
* `Draw' a single line segment in the stroker's current sub-path, * 'Draw' a single line segment in the stroker's current sub-path, from
* from the last position. * the last position.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -460,13 +453,13 @@ FT_BEGIN_HEADER
FT_Vector* to ); FT_Vector* to );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_ConicTo * FT_Stroker_ConicTo
* *
* @description: * @description:
* `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. * from the last position.
* *
* @input: * @input:
@ -492,14 +485,14 @@ FT_BEGIN_HEADER
FT_Vector* to ); FT_Vector* to );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_CubicTo * FT_Stroker_CubicTo
* *
* @description: * @description:
* `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
* from the last position. * the last position.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -528,16 +521,16 @@ FT_BEGIN_HEADER
FT_Vector* to ); FT_Vector* to );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_GetBorderCounts * FT_Stroker_GetBorderCounts
* *
* @description: * @description:
* Call this function once you have finished parsing your paths * Call this function once you have finished parsing your paths with the
* with the stroker. It returns the number of points and * stroker. It returns the number of points and contours necessary to
* contours necessary to export one of the `border' or `stroke' * export one of the 'border' or 'stroke' outlines generated by the
* outlines generated by the stroker. * stroker.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -557,15 +550,15 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* When an outline, or a sub-path, is `closed', the stroker generates * When an outline, or a sub-path, is 'closed', the stroker generates two
* two independent `border' outlines, named `left' and `right'. * independent 'border' outlines, named 'left' and 'right'.
* *
* When the outline, or a sub-path, is `opened', the stroker merges * When the outline, or a sub-path, is 'opened', the stroker merges the
* the `border' outlines with caps. The `left' border receives all * 'border' outlines with caps. The 'left' border receives all points,
* points, while the `right' border becomes empty. * while the 'right' border becomes empty.
* *
* Use the function @FT_Stroker_GetCounts instead if you want to * Use the function @FT_Stroker_GetCounts instead if you want to retrieve
* retrieve the counts associated to both borders. * the counts associated to both borders.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Stroker_GetBorderCounts( FT_Stroker stroker, FT_Stroker_GetBorderCounts( FT_Stroker stroker,
@ -574,19 +567,17 @@ FT_BEGIN_HEADER
FT_UInt *anum_contours ); FT_UInt *anum_contours );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_ExportBorder * FT_Stroker_ExportBorder
* *
* @description: * @description:
* Call this function after @FT_Stroker_GetBorderCounts to * Call this function after @FT_Stroker_GetBorderCounts to export the
* export the corresponding border to your own @FT_Outline * corresponding border to your own @FT_Outline structure.
* structure.
* *
* Note that this function appends the border points and * Note that this function appends the border points and contours to your
* contours to your outline, but does not try to resize its * outline, but does not try to resize its arrays.
* arrays.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -599,19 +590,19 @@ FT_BEGIN_HEADER
* The target outline handle. * The target outline handle.
* *
* @note: * @note:
* Always call this function after @FT_Stroker_GetBorderCounts to * Always call this function after @FT_Stroker_GetBorderCounts to get
* get sure that there is enough room in your @FT_Outline object to * sure that there is enough room in your @FT_Outline object to receive
* receive all new data. * all new data.
* *
* When an outline, or a sub-path, is `closed', the stroker generates * When an outline, or a sub-path, is 'closed', the stroker generates two
* two independent `border' outlines, named `left' and `right'. * independent 'border' outlines, named 'left' and 'right'.
* *
* When the outline, or a sub-path, is `opened', the stroker merges * When the outline, or a sub-path, is 'opened', the stroker merges the
* the `border' outlines with caps. The `left' border receives all * 'border' outlines with caps. The 'left' border receives all points,
* points, while the `right' border becomes empty. * while the 'right' border becomes empty.
* *
* Use the function @FT_Stroker_Export instead if you want to * Use the function @FT_Stroker_Export instead if you want to retrieve
* retrieve all borders at once. * all borders at once.
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Stroker_ExportBorder( FT_Stroker stroker, FT_Stroker_ExportBorder( FT_Stroker stroker,
@ -619,16 +610,15 @@ FT_BEGIN_HEADER
FT_Outline* outline ); FT_Outline* outline );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_GetCounts * FT_Stroker_GetCounts
* *
* @description: * @description:
* Call this function once you have finished parsing your paths * Call this function once you have finished parsing your paths with the
* with the stroker. It returns the number of points and * stroker. It returns the number of points and contours necessary to
* contours necessary to export all points/borders from the stroked * export all points/borders from the stroked outline/path.
* outline/path.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -650,18 +640,17 @@ FT_BEGIN_HEADER
FT_UInt *anum_contours ); FT_UInt *anum_contours );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_Export * FT_Stroker_Export
* *
* @description: * @description:
* Call this function after @FT_Stroker_GetBorderCounts to * Call this function after @FT_Stroker_GetBorderCounts to export all
* export all borders to your own @FT_Outline structure. * borders to your own @FT_Outline structure.
* *
* Note that this function appends the border points and * Note that this function appends the border points and contours to your
* contours to your outline, but does not try to resize its * outline, but does not try to resize its arrays.
* arrays.
* *
* @input: * @input:
* stroker :: * stroker ::
@ -675,7 +664,7 @@ FT_BEGIN_HEADER
FT_Outline* outline ); FT_Outline* outline );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_Done * FT_Stroker_Done
@ -685,13 +674,13 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* stroker :: * stroker ::
* A stroker handle. Can be NULL. * A stroker handle. Can be `NULL`.
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Stroker_Done( FT_Stroker stroker ); FT_Stroker_Done( FT_Stroker stroker );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Glyph_Stroke * FT_Glyph_Stroke
@ -708,8 +697,7 @@ FT_BEGIN_HEADER
* A stroker handle. * A stroker handle.
* *
* destroy :: * destroy ::
* A Boolean. If~1, the source glyph object is destroyed * A Boolean. If~1, the source glyph object is destroyed on success.
* on success.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -719,8 +707,8 @@ FT_BEGIN_HEADER
* *
* Adding stroke may yield a significantly wider and taller glyph * Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You * depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts * may need to manually adjust horizontal and vertical advance amounts to
* to account for this added size. * account for this added size.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Glyph_Stroke( FT_Glyph *pglyph, FT_Glyph_Stroke( FT_Glyph *pglyph,
@ -728,14 +716,14 @@ FT_BEGIN_HEADER
FT_Bool destroy ); FT_Bool destroy );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Glyph_StrokeBorder * FT_Glyph_StrokeBorder
* *
* @description: * @description:
* Stroke a given outline glyph object with a given stroker, but * Stroke a given outline glyph object with a given stroker, but only
* only return either its inside or outside border. * return either its inside or outside border.
* *
* @inout: * @inout:
* pglyph :: * pglyph ::
@ -746,12 +734,11 @@ FT_BEGIN_HEADER
* A stroker handle. * A stroker handle.
* *
* inside :: * inside ::
* A Boolean. If~1, return the inside border, otherwise * A Boolean. If~1, return the inside border, otherwise the outside
* the outside border. * border.
* *
* destroy :: * destroy ::
* A Boolean. If~1, the source glyph object is destroyed * A Boolean. If~1, the source glyph object is destroyed on success.
* on success.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -761,8 +748,8 @@ FT_BEGIN_HEADER
* *
* Adding stroke may yield a significantly wider and taller glyph * Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You * depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts * may need to manually adjust horizontal and vertical advance amounts to
* to account for this added size. * account for this added size.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Glyph_StrokeBorder( FT_Glyph *pglyph, FT_Glyph_StrokeBorder( FT_Glyph *pglyph,

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftsynth.h */ * ftsynth.h
/* */ *
/* FreeType synthesizing code for emboldening and slanting */ * FreeType synthesizing code for emboldening and slanting
/* (specification). */ * (specification).
/* */ *
/* Copyright 2000-2018 by */ * Copyright (C) 2000-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /*************************************************************************/
@ -35,7 +35,7 @@
/* Main reason for not lifting the functions in this module to a */ /* 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 */ /* slanting are not configurable. Consider the functions as a */
/* code resource that should be copied into the application and */ /* code resource that should be copied into the application and */
/* adapted to the particular needs. */ /* adapted to the particular needs. */
@ -57,7 +57,7 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* 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 */ /* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftsystem.h */ * ftsystem.h
/* */ *
/* FreeType low-level system interface definition (specification). */ * FreeType low-level system interface definition (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTSYSTEM_H_ #ifndef FTSYSTEM_H_
@ -26,34 +26,33 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* system_interface */ * system_interface
/* */ *
/* <Title> */ * @title:
/* System Interface */ * System Interface
/* */ *
/* <Abstract> */ * @abstract:
/* How FreeType manages memory and i/o. */ * How FreeType manages memory and i/o.
/* */ *
/* <Description> */ * @description:
/* This section contains various definitions related to memory */ * This section contains various definitions related to memory management
/* management and i/o access. You need to understand this */ * and i/o access. You need to understand this information if you want to
/* information if you want to use a custom memory manager or you own */ * use a custom memory manager or you own i/o streams.
/* 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
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* FT_Memory * FT_Memory
@ -66,13 +65,13 @@ FT_BEGIN_HEADER
typedef struct FT_MemoryRec_* FT_Memory; typedef struct FT_MemoryRec_* FT_Memory;
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Alloc_Func * FT_Alloc_Func
* *
* @description: * @description:
* A function used to allocate `size' bytes from `memory'. * A function used to allocate `size` bytes from `memory`.
* *
* @input: * @input:
* memory :: * memory ::
@ -90,7 +89,7 @@ FT_BEGIN_HEADER
long size ); long size );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Free_Func * FT_Free_Func
@ -111,7 +110,7 @@ FT_BEGIN_HEADER
void* block ); void* block );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Realloc_Func * FT_Realloc_Func
@ -146,7 +145,7 @@ FT_BEGIN_HEADER
void* block ); void* block );
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* FT_MemoryRec * 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
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* FT_Stream * FT_Stream
@ -193,21 +192,21 @@ FT_BEGIN_HEADER
* A handle to an input stream. * A handle to an input stream.
* *
* @also: * @also:
* See @FT_StreamRec for the publicly accessible fields of a given * See @FT_StreamRec for the publicly accessible fields of a given stream
* stream object. * object.
* *
*/ */
typedef struct FT_StreamRec_* FT_Stream; typedef struct FT_StreamRec_* FT_Stream;
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* FT_StreamDesc * FT_StreamDesc
* *
* @description: * @description:
* A union type used to store either a long or a pointer. This is used * 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_ typedef union FT_StreamDesc_
@ -218,7 +217,7 @@ FT_BEGIN_HEADER
} FT_StreamDesc; } FT_StreamDesc;
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Stream_IoFunc * FT_Stream_IoFunc
@ -243,9 +242,8 @@ FT_BEGIN_HEADER
* The number of bytes effectively read by the stream. * The number of bytes effectively read by the stream.
* *
* @note: * @note:
* This function might be called to perform a seek or skip operation * This function might be called to perform a seek or skip operation with
* with a `count' of~0. A non-zero return value then indicates an * a `count` of~0. A non-zero return value then indicates an error.
* error.
* *
*/ */
typedef unsigned long typedef unsigned long
@ -255,7 +253,7 @@ FT_BEGIN_HEADER
unsigned long count ); unsigned long count );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* FT_Stream_CloseFunc * FT_Stream_CloseFunc
@ -272,7 +270,7 @@ FT_BEGIN_HEADER
(*FT_Stream_CloseFunc)( FT_Stream stream ); (*FT_Stream_CloseFunc)( FT_Stream stream );
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* FT_StreamRec * FT_StreamRec
@ -283,7 +281,7 @@ FT_BEGIN_HEADER
* @input: * @input:
* base :: * base ::
* For memory-based streams, this is the address of the first stream * For memory-based streams, this is the address of the first stream
* byte in memory. This field should always be set to NULL for * byte in memory. This field should always be set to `NULL` for
* disk-based streams. * disk-based streams.
* *
* size :: * size ::
@ -299,7 +297,7 @@ FT_BEGIN_HEADER
* *
* descriptor :: * descriptor ::
* This field is a union that can hold an integer or a pointer. It is * 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. * pointers.
* *
* pathname :: * pathname ::
@ -314,13 +312,13 @@ FT_BEGIN_HEADER
* The stream's close function. * The stream's close function.
* *
* memory :: * memory ::
* The memory manager to use to preload frames. This is set * The memory manager to use to preload frames. This is set internally
* internally by FreeType and shouldn't be touched by stream * by FreeType and shouldn't be touched by stream implementations.
* implementations.
* *
* cursor :: * cursor ::
* This field is set and used internally by FreeType when parsing * 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 :: * limit ::
* This field is set and used internally by FreeType when parsing * This field is set and used internally by FreeType when parsing

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fttrigon.h */ * fttrigon.h
/* */ *
/* FreeType trigonometric functions (specification). */ * FreeType trigonometric functions (specification).
/* */ *
/* Copyright 2001-2018 by */ * Copyright (C) 2001-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTTRIGON_H_ #ifndef FTTRIGON_H_
@ -31,15 +31,15 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* computations */ * computations
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* FT_Angle * FT_Angle
@ -52,7 +52,7 @@ FT_BEGIN_HEADER
typedef FT_Fixed FT_Angle; typedef FT_Fixed FT_Angle;
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI * FT_ANGLE_PI
@ -64,7 +64,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI ( 180L << 16 ) #define FT_ANGLE_PI ( 180L << 16 )
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_2PI * FT_ANGLE_2PI
@ -76,7 +76,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) #define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI2 * FT_ANGLE_PI2
@ -88,7 +88,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) #define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
/************************************************************************* /**************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI4 * FT_ANGLE_PI4
@ -100,7 +100,7 @@ FT_BEGIN_HEADER
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) #define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Sin * FT_Sin
@ -124,7 +124,7 @@ FT_BEGIN_HEADER
FT_Sin( FT_Angle angle ); FT_Sin( FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Cos * FT_Cos
@ -148,7 +148,7 @@ FT_BEGIN_HEADER
FT_Cos( FT_Angle angle ); FT_Cos( FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Tan * FT_Tan
@ -168,14 +168,14 @@ FT_BEGIN_HEADER
FT_Tan( FT_Angle angle ); FT_Tan( FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Atan2 * FT_Atan2
* *
* @description: * @description:
* Return the arc-tangent corresponding to a given vector (x,y) in * Return the arc-tangent corresponding to a given vector (x,y) in the 2d
* the 2d plane. * plane.
* *
* @input: * @input:
* x :: * x ::
@ -193,7 +193,7 @@ FT_BEGIN_HEADER
FT_Fixed y ); FT_Fixed y );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Angle_Diff * FT_Angle_Diff
@ -210,7 +210,7 @@ FT_BEGIN_HEADER
* Second angle. * Second angle.
* *
* @return: * @return:
* Constrained value of `value2-value1'. * Constrained value of `angle2-angle1`.
* *
*/ */
FT_EXPORT( FT_Angle ) FT_EXPORT( FT_Angle )
@ -218,15 +218,15 @@ FT_BEGIN_HEADER
FT_Angle angle2 ); FT_Angle angle2 );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Unit * FT_Vector_Unit
* *
* @description: * @description:
* Return the unit vector corresponding to a given angle. After the * 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 * call, the value of `vec.x` will be `cos(angle)`, and the value of
* `vec.y' will be `sin(angle)'. * `vec.y` will be `sin(angle)`.
* *
* This function is useful to retrieve both the sinus and cosinus of a * This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly. * given angle quickly.
@ -245,7 +245,7 @@ FT_BEGIN_HEADER
FT_Angle angle ); FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Rotate * FT_Vector_Rotate
@ -267,7 +267,7 @@ FT_BEGIN_HEADER
FT_Angle angle ); FT_Angle angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Length * FT_Vector_Length
@ -288,7 +288,7 @@ FT_BEGIN_HEADER
FT_Vector_Length( FT_Vector* vec ); FT_Vector_Length( FT_Vector* vec );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_Polarize * FT_Vector_Polarize
@ -314,7 +314,7 @@ FT_BEGIN_HEADER
FT_Angle *angle ); FT_Angle *angle );
/************************************************************************* /**************************************************************************
* *
* @function: * @function:
* FT_Vector_From_Polar * FT_Vector_From_Polar

View file

@ -1,328 +0,0 @@
/***************************************************************************/
/* */
/* ftttdrv.h */
/* */
/* FreeType API for controlling the TrueType driver */
/* (specification only). */
/* */
/* Copyright 2013-2017 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. */
/* */
/***************************************************************************/
#ifndef FTTTDRV_H_
#define FTTTDRV_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
/**************************************************************************
*
* @section:
* tt_driver
*
* @title:
* The TrueType driver
*
* @abstract:
* Controlling the TrueType driver module.
*
* @description:
* While FreeType's TrueType driver doesn't expose API functions by
* itself, it is possible to control its behaviour with @FT_Property_Set
* and @FT_Property_Get. The following lists the available properties
* together with the necessary macros and structures.
*
* The TrueType driver's module name is `truetype'.
*
* We start with a list of definitions, kindly provided by Greg
* Hitchcock.
*
* _Bi-Level_ _Rendering_
*
* Monochromatic rendering, exclusively used in the early days of
* TrueType by both Apple and Microsoft. Microsoft's GDI interface
* supported hinting of the right-side bearing point, such that the
* advance width could be non-linear. Most often this was done to
* achieve some level of glyph symmetry. To enable reasonable
* performance (e.g., not having to run hinting on all glyphs just to
* get the widths) there was a bit in the head table indicating if the
* side bearing was hinted, and additional tables, `hdmx' and `LTSH', to
* cache hinting widths across multiple sizes and device aspect ratios.
*
* _Font_ _Smoothing_
*
* Microsoft's GDI implementation of anti-aliasing. Not traditional
* anti-aliasing as the outlines were hinted before the sampling. The
* widths matched the bi-level rendering.
*
* _ClearType_ _Rendering_
*
* Technique that uses physical subpixels to improve rendering on LCD
* (and other) displays. Because of the higher resolution, many methods
* of improving symmetry in glyphs through hinting the right-side
* bearing were no longer necessary. This lead to what GDI calls
* `natural widths' ClearType, see
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec21. Since hinting
* has extra resolution, most non-linearity went away, but it is still
* possible for hints to change the advance widths in this mode.
*
* _ClearType_ _Compatible_ _Widths_
*
* One of the earliest challenges with ClearType was allowing the
* implementation in GDI to be selected without requiring all UI and
* documents to reflow. To address this, a compatible method of
* rendering ClearType was added where the font hints are executed once
* to determine the width in bi-level rendering, and then re-run in
* ClearType, with the difference in widths being absorbed in the font
* hints for ClearType (mostly in the white space of hints); see
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec20. Somewhat by
* definition, compatible width ClearType allows for non-linear widths,
* but only when the bi-level version has non-linear widths.
*
* _ClearType_ _Subpixel_ _Positioning_
*
* One of the nice benefits of ClearType is the ability to more crisply
* display fractional widths; unfortunately, the GDI model of integer
* bitmaps did not support this. However, the WPF and Direct Write
* frameworks do support fractional widths. DWrite calls this `natural
* mode', not to be confused with GDI's `natural widths'. Subpixel
* positioning, in the current implementation of Direct Write,
* unfortunately does not support hinted advance widths, see
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec22. Note that the
* TrueType interpreter fully allows the advance width to be adjusted in
* this mode, just the DWrite client will ignore those changes.
*
* _ClearType_ _Backward_ _Compatibility_
*
* This is a set of exceptions made in the TrueType interpreter to
* minimize hinting techniques that were problematic with the extra
* resolution of ClearType; see
* http://www.beatstamm.com/typography/RTRCh4.htm#Sec1 and
* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
* This technique is not to be confused with ClearType compatible
* widths. ClearType backward compatibility has no direct impact on
* changing advance widths, but there might be an indirect impact on
* disabling some deltas. This could be worked around in backward
* compatibility mode.
*
* _Native_ _ClearType_ _Mode_
*
* (Not to be confused with `natural widths'.) This mode removes all
* the exceptions in the TrueType interpreter when running with
* ClearType. Any issues on widths would still apply, though.
*
*/
/**************************************************************************
*
* @property:
* interpreter-version
*
* @description:
* Currently, three versions are available, two representing the
* bytecode interpreter with subpixel hinting support (old `Infinality'
* code and new stripped-down and higher performance `minimal' code) and
* one without, respectively. The default is subpixel support if
* TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support
* otherwise (since it isn't available then).
*
* If subpixel hinting is on, many TrueType bytecode instructions behave
* differently compared to B/W or grayscale rendering (except if `native
* ClearType' is selected by the font). Microsoft's main idea is to
* render at a much increased horizontal resolution, then sampling down
* the created output to subpixel precision. However, many older fonts
* are not suited to this and must be specially taken care of by
* applying (hardcoded) tweaks in Microsoft's interpreter.
*
* Details on subpixel hinting and some of the necessary tweaks can be
* found in Greg Hitchcock's whitepaper at
* `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
* Note that FreeType currently doesn't really `subpixel hint' (6x1, 6x2,
* or 6x5 supersampling) like discussed in the paper. Depending on the
* chosen interpreter, it simply ignores instructions on vertical stems
* to arrive at very similar results.
*
* The following example code demonstrates how to deactivate subpixel
* hinting (omitting the error handling).
*
* {
* FT_Library library;
* FT_Face face;
* FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "truetype",
* "interpreter-version",
* &interpreter_version );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* This property can be set via the `FREETYPE_PROPERTIES' environment
* variable (using values `35', `38', or `40').
*/
/**************************************************************************
*
* @enum:
* TT_INTERPRETER_VERSION_XXX
*
* @description:
* A list of constants used for the @interpreter-version property to
* select the hinting engine for Truetype fonts.
*
* The numeric value in the constant names represents the version
* number as returned by the `GETINFO' bytecode instruction.
*
* @values:
* TT_INTERPRETER_VERSION_35 ::
* Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
* Windows~98; only grayscale and B/W rasterizing is supported.
*
* TT_INTERPRETER_VERSION_38 ::
* Version~38 corresponds to MS rasterizer v.1.9; it is roughly
* equivalent to the hinting provided by DirectWrite ClearType (as can
* be found, for example, in the Internet Explorer~9 running on
* Windows~7). It is used in FreeType to select the `Infinality'
* subpixel hinting code. The code may be removed in a future
* version.
*
* TT_INTERPRETER_VERSION_40 ::
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
* equivalent to the hinting provided by DirectWrite ClearType (as can
* be found, for example, in Microsoft's Edge Browser on Windows~10).
* It is used in FreeType to select the `minimal' subpixel hinting
* code, a stripped-down and higher performance version of the
* `Infinality' code.
*
* @note:
* This property controls the behaviour of the bytecode interpreter
* and thus how outlines get hinted. It does *not* control how glyph
* get rasterized! In particular, it does not control subpixel color
* filtering.
*
* If FreeType has not been compiled with the configuration option
* TT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes
* an `FT_Err_Unimplemented_Feature' error.
*
* Depending on the graphics framework, Microsoft uses different
* bytecode and rendering engines. As a consequence, the version
* numbers returned by a call to the `GETINFO' bytecode instruction are
* more convoluted than desired.
*
* Here are two tables that try to shed some light on the possible
* values for the MS rasterizer engine, together with the additional
* features introduced by it.
*
* {
* GETINFO framework version feature
* -------------------------------------------------------------------
* 3 GDI (Win 3.1), v1.0 16-bit, first version
* TrueImage
* 33 GDI (Win NT 3.1), v1.5 32-bit
* HP Laserjet
* 34 GDI (Win 95) v1.6 font smoothing,
* new SCANTYPE opcode
* 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET
* bits in composite glyphs
* 36 MGDI (Win CE 2) v1.6+ classic ClearType
* 37 GDI (XP and later), v1.8 ClearType
* GDI+ old (before Vista)
* 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType,
* WPF Y-direction ClearType,
* additional error checking
* 39 DWrite (before Win 8) v2.0 subpixel ClearType flags
* in GETINFO opcode,
* bug fixes
* 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag
* DWrite (Win 8) in GETINFO opcode,
* Gray ClearType
* }
*
* The `version' field gives a rough orientation only, since some
* applications provided certain features much earlier (as an example,
* Microsoft Reader used subpixel and Y-direction ClearType already in
* Windows 2000). Similarly, updates to a given framework might include
* improved hinting support.
*
* {
* version sampling rendering comment
* x y x y
* --------------------------------------------------------------
* v1.0 normal normal B/W B/W bi-level
* v1.6 high high gray gray grayscale
* v1.8 high normal color-filter B/W (GDI) ClearType
* v1.9 high high color-filter gray Color ClearType
* v2.1 high normal gray B/W Gray ClearType
* v2.1 high high gray gray Gray ClearType
* }
*
* Color and Gray ClearType are the two available variants of
* `Y-direction ClearType', meaning grayscale rasterization along the
* Y-direction; the name used in the TrueType specification for this
* feature is `symmetric smoothing'. `Classic ClearType' is the
* original algorithm used before introducing a modified version in
* Win~XP. Another name for v1.6's grayscale rendering is `font
* smoothing', and `Color ClearType' is sometimes also called `DWrite
* ClearType'. To differentiate between today's Color ClearType and the
* earlier ClearType variant with B/W rendering along the vertical axis,
* the latter is sometimes called `GDI ClearType'.
*
* `Normal' and `high' sampling describe the (virtual) resolution to
* access the rasterized outline after the hinting process. `Normal'
* means 1 sample per grid line (i.e., B/W). In the current Microsoft
* implementation, `high' means an extra virtual resolution of 16x16 (or
* 16x1) grid lines per pixel for bytecode instructions like `MIRP'.
* After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid
* lines for color filtering if Color ClearType is activated.
*
* Note that `Gray ClearType' is essentially the same as v1.6's
* grayscale rendering. However, the GETINFO instruction handles it
* differently: v1.6 returns bit~12 (hinting for grayscale), while v2.1
* returns bits~13 (hinting for ClearType), 18 (symmetrical smoothing),
* and~19 (Gray ClearType). Also, this mode respects bits 2 and~3 for
* the version~1 gasp table exclusively (like Color ClearType), while
* v1.6 only respects the values of version~0 (bits 0 and~1).
*
* Keep in mind that the features of the above interpreter versions
* might not map exactly to FreeType features or behavior because it is
* a fundamentally different library with different internals.
*
*/
#define TT_INTERPRETER_VERSION_35 35
#define TT_INTERPRETER_VERSION_38 38
#define TT_INTERPRETER_VERSION_40 40
/* */
FT_END_HEADER
#endif /* FTTTDRV_H_ */
/* END */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fttypes.h */ * fttypes.h
/* */ *
/* FreeType simple types definitions (specification only). */ * FreeType simple types definitions (specification only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTTYPES_H_ #ifndef FTTYPES_H_
@ -31,326 +31,327 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* basic_types */ * basic_types
/* */ *
/* <Title> */ * @title:
/* Basic Data Types */ * Basic Data Types
/* */ *
/* <Abstract> */ * @abstract:
/* The basic data types defined by the library. */ * The basic data types defined by the library.
/* */ *
/* <Description> */ * @description:
/* This section contains the basic data types defined by FreeType~2, */ * This section contains the basic data types defined by FreeType~2,
/* ranging from simple scalar types to bitmap descriptors. More */ * ranging from simple scalar types to bitmap descriptors. More
/* font-specific structures are defined in a different section. */ * font-specific structures are defined in a different section.
/* */ *
/* <Order> */ * @order:
/* FT_Byte */ * FT_Byte
/* FT_Bytes */ * FT_Bytes
/* FT_Char */ * FT_Char
/* FT_Int */ * FT_Int
/* FT_UInt */ * FT_UInt
/* FT_Int16 */ * FT_Int16
/* FT_UInt16 */ * FT_UInt16
/* FT_Int32 */ * FT_Int32
/* FT_UInt32 */ * FT_UInt32
/* FT_Int64 */ * FT_Int64
/* FT_UInt64 */ * FT_UInt64
/* FT_Short */ * FT_Short
/* FT_UShort */ * FT_UShort
/* FT_Long */ * FT_Long
/* FT_ULong */ * FT_ULong
/* FT_Bool */ * FT_Bool
/* FT_Offset */ * FT_Offset
/* FT_PtrDist */ * FT_PtrDist
/* FT_String */ * FT_String
/* FT_Tag */ * FT_Tag
/* FT_Error */ * FT_Error
/* FT_Fixed */ * FT_Fixed
/* FT_Pointer */ * FT_Pointer
/* FT_Pos */ * FT_Pos
/* FT_Vector */ * FT_Vector
/* FT_BBox */ * FT_BBox
/* FT_Matrix */ * FT_Matrix
/* FT_FWord */ * FT_FWord
/* FT_UFWord */ * FT_UFWord
/* FT_F2Dot14 */ * FT_F2Dot14
/* FT_UnitVector */ * FT_UnitVector
/* FT_F26Dot6 */ * FT_F26Dot6
/* FT_Data */ * FT_Data
/* */ *
/* FT_MAKE_TAG */ * FT_MAKE_TAG
/* */ *
/* FT_Generic */ * FT_Generic
/* FT_Generic_Finalizer */ * FT_Generic_Finalizer
/* */ *
/* FT_Bitmap */ * FT_Bitmap
/* FT_Pixel_Mode */ * FT_Pixel_Mode
/* FT_Palette_Mode */ * FT_Palette_Mode
/* FT_Glyph_Format */ * FT_Glyph_Format
/* FT_IMAGE_TAG */ * FT_IMAGE_TAG
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Bool */ * FT_Bool
/* */ *
/* <Description> */ * @description:
/* A typedef of unsigned char, used for simple booleans. As usual, */ * A typedef of unsigned char, used for simple booleans. As usual,
/* values 1 and~0 represent true and false, respectively. */ * values 1 and~0 represent true and false, respectively.
/* */ */
typedef unsigned char FT_Bool; typedef unsigned char FT_Bool;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_FWord */ * FT_FWord
/* */ *
/* <Description> */ * @description:
/* A signed 16-bit integer used to store a distance in original font */ * A signed 16-bit integer used to store a distance in original font
/* units. */ * units.
/* */ */
typedef signed short FT_FWord; /* distance in FUnits */ typedef signed short FT_FWord; /* distance in FUnits */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_UFWord */ * FT_UFWord
/* */ *
/* <Description> */ * @description:
/* An unsigned 16-bit integer used to store a distance in original */ * An unsigned 16-bit integer used to store a distance in original font
/* font units. */ * units.
/* */ */
typedef unsigned short FT_UFWord; /* unsigned distance */ typedef unsigned short FT_UFWord; /* unsigned distance */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Char */ * FT_Char
/* */ *
/* <Description> */ * @description:
/* A simple typedef for the _signed_ char type. */ * A simple typedef for the _signed_ char type.
/* */ */
typedef signed char FT_Char; typedef signed char FT_Char;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Byte */ * FT_Byte
/* */ *
/* <Description> */ * @description:
/* A simple typedef for the _unsigned_ char type. */ * A simple typedef for the _unsigned_ char type.
/* */ */
typedef unsigned char FT_Byte; typedef unsigned char FT_Byte;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Bytes */ * FT_Bytes
/* */ *
/* <Description> */ * @description:
/* A typedef for constant memory areas. */ * A typedef for constant memory areas.
/* */ */
typedef const FT_Byte* FT_Bytes; typedef const FT_Byte* FT_Bytes;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Tag */ * FT_Tag
/* */ *
/* <Description> */ * @description:
/* 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; typedef FT_UInt32 FT_Tag;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_String */ * FT_String
/* */ *
/* <Description> */ * @description:
/* 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; typedef char FT_String;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Short */ * FT_Short
/* */ *
/* <Description> */ * @description:
/* A typedef for signed short. */ * A typedef for signed short.
/* */ */
typedef signed short FT_Short; typedef signed short FT_Short;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_UShort */ * FT_UShort
/* */ *
/* <Description> */ * @description:
/* A typedef for unsigned short. */ * A typedef for unsigned short.
/* */ */
typedef unsigned short FT_UShort; typedef unsigned short FT_UShort;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Int */ * FT_Int
/* */ *
/* <Description> */ * @description:
/* A typedef for the int type. */ * A typedef for the int type.
/* */ */
typedef signed int FT_Int; typedef signed int FT_Int;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_UInt */ * FT_UInt
/* */ *
/* <Description> */ * @description:
/* A typedef for the unsigned int type. */ * A typedef for the unsigned int type.
/* */ */
typedef unsigned int FT_UInt; typedef unsigned int FT_UInt;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Long */ * FT_Long
/* */ *
/* <Description> */ * @description:
/* A typedef for signed long. */ * A typedef for signed long.
/* */ */
typedef signed long FT_Long; typedef signed long FT_Long;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_ULong */ * FT_ULong
/* */ *
/* <Description> */ * @description:
/* A typedef for unsigned long. */ * A typedef for unsigned long.
/* */ */
typedef unsigned long FT_ULong; typedef unsigned long FT_ULong;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_F2Dot14 */ * FT_F2Dot14
/* */ *
/* <Description> */ * @description:
/* 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; typedef signed short FT_F2Dot14;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_F26Dot6 */ * FT_F26Dot6
/* */ *
/* <Description> */ * @description:
/* A signed 26.6 fixed-point type used for vectorial pixel */ * A signed 26.6 fixed-point type used for vectorial pixel coordinates.
/* coordinates. */ */
/* */
typedef signed long FT_F26Dot6; typedef signed long FT_F26Dot6;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Fixed */ * FT_Fixed
/* */ *
/* <Description> */ * @description:
/* This type is used to store 16.16 fixed-point values, like scaling */ * This type is used to store 16.16 fixed-point values, like scaling
/* values or matrix coefficients. */ * values or matrix coefficients.
/* */ */
typedef signed long FT_Fixed; typedef signed long FT_Fixed;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Error */ * FT_Error
/* */ *
/* <Description> */ * @description:
/* The FreeType error code type. A value of~0 is always interpreted */ * The FreeType error code type. A value of~0 is always interpreted as a
/* as a successful operation. */ * successful operation.
/* */ */
typedef int FT_Error; typedef int FT_Error;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Pointer */ * FT_Pointer
/* */ *
/* <Description> */ * @description:
/* A simple typedef for a typeless pointer. */ * A simple typedef for a typeless pointer.
/* */ */
typedef void* FT_Pointer; typedef void* FT_Pointer;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_Offset */ * FT_Offset
/* */ *
/* <Description> */ * @description:
/* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */ * 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, */ * _unsigned_ integer type used to express a file size or position, or a
/* or a memory block size. */ * memory block size.
/* */ */
typedef size_t FT_Offset; typedef size_t FT_Offset;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_PtrDist */ * FT_PtrDist
/* */ *
/* <Description> */ * @description:
/* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */ * This is equivalent to the ANSI~C `ptrdiff_t` type, i.e., the largest
/* largest _signed_ integer type used to express the distance */ * _signed_ integer type used to express the distance between two
/* between two pointers. */ * pointers.
/* */ */
typedef ft_ptrdiff_t FT_PtrDist; typedef ft_ptrdiff_t FT_PtrDist;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_UnitVector */ * FT_UnitVector
/* */ *
/* <Description> */ * @description:
/* A simple structure used to store a 2D vector unit vector. Uses */ * A simple structure used to store a 2D vector unit vector. Uses
/* FT_F2Dot14 types. */ * FT_F2Dot14 types.
/* */ *
/* <Fields> */ * @fields:
/* x :: Horizontal coordinate. */ * x ::
/* */ * Horizontal coordinate.
/* y :: Vertical coordinate. */ *
/* */ * y ::
* Vertical coordinate.
*/
typedef struct FT_UnitVector_ typedef struct FT_UnitVector_
{ {
FT_F2Dot14 x; FT_F2Dot14 x;
@ -359,29 +360,33 @@ FT_BEGIN_HEADER
} FT_UnitVector; } FT_UnitVector;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_Matrix */ * FT_Matrix
/* */ *
/* <Description> */ * @description:
/* A simple structure used to store a 2x2 matrix. Coefficients are */ * A simple structure used to store a 2x2 matrix. Coefficients are in
/* in 16.16 fixed-point format. The computation performed is: */ * 16.16 fixed-point format. The computation performed is:
/* */ *
/* { */ * ```
/* x' = x*xx + y*xy */ * x' = x*xx + y*xy
/* y' = x*yx + y*yy */ * y' = x*yx + y*yy
/* } */ * ```
/* */ *
/* <Fields> */ * @fields:
/* xx :: Matrix coefficient. */ * xx ::
/* */ * Matrix coefficient.
/* xy :: Matrix coefficient. */ *
/* */ * xy ::
/* yx :: Matrix coefficient. */ * Matrix coefficient.
/* */ *
/* yy :: Matrix coefficient. */ * yx ::
/* */ * Matrix coefficient.
*
* yy ::
* Matrix coefficient.
*/
typedef struct FT_Matrix_ typedef struct FT_Matrix_
{ {
FT_Fixed xx, xy; FT_Fixed xx, xy;
@ -390,19 +395,21 @@ FT_BEGIN_HEADER
} FT_Matrix; } FT_Matrix;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_Data */ * FT_Data
/* */ *
/* <Description> */ * @description:
/* Read-only binary data represented as a pointer and a length. */ * Read-only binary data represented as a pointer and a length.
/* */ *
/* <Fields> */ * @fields:
/* pointer :: The data. */ * pointer ::
/* */ * The data.
/* length :: The length of the data in bytes. */ *
/* */ * length ::
* The length of the data in bytes.
*/
typedef struct FT_Data_ typedef struct FT_Data_
{ {
const FT_Byte* pointer; const FT_Byte* pointer;
@ -411,51 +418,52 @@ FT_BEGIN_HEADER
} FT_Data; } FT_Data;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <FuncType> */ * @functype:
/* FT_Generic_Finalizer */ * FT_Generic_Finalizer
/* */ *
/* <Description> */ * @description:
/* Describe a function used to destroy the `client' data of any */ * Describe a function used to destroy the 'client' data of any FreeType
/* FreeType object. See the description of the @FT_Generic type for */ * object. See the description of the @FT_Generic type for details of
/* details of usage. */ * usage.
/* */ *
/* <Input> */ * @input:
/* The address of the FreeType object that is under finalization. */ * The address of the FreeType object that is under finalization. Its
/* Its client data is accessed through its `generic' field. */ * client data is accessed through its `generic` field.
/* */ */
typedef void (*FT_Generic_Finalizer)( void* object ); typedef void (*FT_Generic_Finalizer)( void* object );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_Generic */ * FT_Generic
/* */ *
/* <Description> */ * @description:
/* Client applications often need to associate their own data to a */ * Client applications often need to associate their own data to a
/* variety of FreeType core objects. For example, a text layout API */ * variety of FreeType core objects. For example, a text layout API
/* might want to associate a glyph cache to a given size object. */ * might want to associate a glyph cache to a given size object.
/* */ *
/* Some FreeType object contains a `generic' field, of type */ * Some FreeType object contains a `generic` field, of type `FT_Generic`,
/* FT_Generic, which usage is left to client applications and font */ * which usage is left to client applications and font servers.
/* servers. */ *
/* */ * It can be used to store a pointer to client-specific data, as well as
/* It can be used to store a pointer to client-specific data, as well */ * the address of a 'finalizer' function, which will be called by
/* as the address of a `finalizer' function, which will be called by */ * FreeType when the object is destroyed (for example, the previous
/* FreeType when the object is destroyed (for example, the previous */ * client example would put the address of the glyph cache destructor in
/* client example would put the address of the glyph cache destructor */ * the `finalizer` field).
/* in the `finalizer' field). */ *
/* */ * @fields:
/* <Fields> */ * data ::
/* data :: A typeless pointer to any client-specified data. This */ * A typeless pointer to any client-specified data. This field is
/* field is completely ignored by the FreeType library. */ * completely ignored by the FreeType library.
/* */ *
/* finalizer :: A pointer to a `generic finalizer' function, which */ * finalizer ::
/* will be called when the object is destroyed. If this */ * A pointer to a 'generic finalizer' function, which will be called
/* field is set to NULL, no code will be called. */ * when the object is destroyed. If this field is set to `NULL`, no
/* */ * code will be called.
*/
typedef struct FT_Generic_ typedef struct FT_Generic_
{ {
void* data; void* data;
@ -464,19 +472,19 @@ FT_BEGIN_HEADER
} FT_Generic; } FT_Generic;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Macro> */ * @macro:
/* FT_MAKE_TAG */ * FT_MAKE_TAG
/* */ *
/* <Description> */ * @description:
/* This macro converts four-letter tags that are used to label */ * This macro converts four-letter tags that are used to label TrueType
/* TrueType tables into an unsigned long, to be used within FreeType. */ * tables into an unsigned long, to be used within FreeType.
/* */ *
/* <Note> */ * @note:
/* The produced values *must* be 32-bit integers. Don't redefine */ * The produced values **must** be 32-bit integers. Don't redefine this
/* this macro. */ * macro.
/* */ */
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
(FT_Tag) \ (FT_Tag) \
( ( (FT_ULong)_x1 << 24 ) | \ ( ( (FT_ULong)_x1 << 24 ) | \
@ -494,53 +502,56 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* list_processing */ * list_processing
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_ListNode */ * FT_ListNode
/* */ *
/* <Description> */ * @description:
/* Many elements and objects in FreeType are listed through an */ * Many elements and objects in FreeType are listed through an @FT_List
/* @FT_List record (see @FT_ListRec). As its name suggests, an */ * record (see @FT_ListRec). As its name suggests, an FT_ListNode is a
/* FT_ListNode is a handle to a single list element. */ * handle to a single list element.
/* */ */
typedef struct FT_ListNodeRec_* FT_ListNode; typedef struct FT_ListNodeRec_* FT_ListNode;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* FT_List */ * FT_List
/* */ *
/* <Description> */ * @description:
/* A handle to a list record (see @FT_ListRec). */ * A handle to a list record (see @FT_ListRec).
/* */ */
typedef struct FT_ListRec_* FT_List; typedef struct FT_ListRec_* FT_List;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_ListNodeRec */ * FT_ListNodeRec
/* */ *
/* <Description> */ * @description:
/* A structure used to hold a single list element. */ * A structure used to hold a single list element.
/* */ *
/* <Fields> */ * @fields:
/* prev :: The previous element in the list. NULL if first. */ * prev ::
/* */ * The previous element in the list. `NULL` if first.
/* next :: The next element in the list. NULL if last. */ *
/* */ * next ::
/* data :: A typeless pointer to the listed object. */ * The next element in the list. `NULL` if last.
/* */ *
* data ::
* A typeless pointer to the listed object.
*/
typedef struct FT_ListNodeRec_ typedef struct FT_ListNodeRec_
{ {
FT_ListNode prev; FT_ListNode prev;
@ -550,20 +561,22 @@ FT_BEGIN_HEADER
} FT_ListNodeRec; } FT_ListNodeRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_ListRec */ * FT_ListRec
/* */ *
/* <Description> */ * @description:
/* A structure used to hold a simple doubly-linked list. These are */ * A structure used to hold a simple doubly-linked list. These are used
/* used in many parts of FreeType. */ * in many parts of FreeType.
/* */ *
/* <Fields> */ * @fields:
/* head :: The head (first element) of doubly-linked list. */ * head ::
/* */ * The head (first element) of doubly-linked list.
/* tail :: The tail (last element) of doubly-linked list. */ *
/* */ * tail ::
* The tail (last element) of doubly-linked list.
*/
typedef struct FT_ListRec_ typedef struct FT_ListRec_
{ {
FT_ListNode head; FT_ListNode head;
@ -575,13 +588,13 @@ FT_BEGIN_HEADER
#define FT_IS_EMPTY( list ) ( (list).head == 0 ) #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 */ /* concatenate C tokens */
#define FT_ERR_XCAT( x, y ) x ## y #define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( 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 ) #define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftwinfnt.h */ * ftwinfnt.h
/* */ *
/* FreeType API for accessing Windows fnt-specific data. */ * FreeType API for accessing Windows fnt-specific data.
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTWINFNT_H_ #ifndef FTWINFNT_H_
@ -32,44 +32,43 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* winfnt_fonts */ * winfnt_fonts
/* */ *
/* <Title> */ * @title:
/* Window FNT Files */ * Window FNT Files
/* */ *
/* <Abstract> */ * @abstract:
/* Windows FNT specific API. */ * Windows FNT-specific API.
/* */ *
/* <Description> */ * @description:
/* This section contains the declaration of Windows FNT specific */ * This section contains the declaration of Windows FNT-specific
/* functions. */ * functions.
/* */ *
/*************************************************************************/ */
/************************************************************************* /**************************************************************************
* *
* @enum: * @enum:
* FT_WinFNT_ID_XXX * FT_WinFNT_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `charset' byte in * A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX * Exact mapping tables for the various 'cpXXXX' encodings (except for
* encodings (except for cp1361) can be found at * 'cp1361') can be found at 'ftp://ftp.unicode.org/Public' in the
* ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS * `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a
* subdirectory. cp1361 is roughly a superset of * superset of `MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT`.
* MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
* *
* @values: * @values:
* FT_WinFNT_ID_DEFAULT :: * FT_WinFNT_ID_DEFAULT ::
* This is used for font enumeration and font creation as a * This is used for font enumeration and font creation as a 'don't
* `don't care' value. Valid font files don't contain this value. * care' value. Valid font files don't contain this value. When
* When querying for information about the character set of the font * querying for information about the character set of the font that is
* that is currently selected into a specified device context, this * currently selected into a specified device context, this return
* return value (of the related Windows API) simply denotes failure. * value (of the related Windows API) simply denotes failure.
* *
* FT_WinFNT_ID_SYMBOL :: * FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available. * There is no known mapping table available.
@ -80,26 +79,27 @@ FT_BEGIN_HEADER
* FT_WinFNT_ID_OEM :: * FT_WinFNT_ID_OEM ::
* From Michael Poettgen <michael@poettgen.de>: * From Michael Poettgen <michael@poettgen.de>:
* *
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM * The 'Windows Font Mapping' article says that `FT_WinFNT_ID_OEM` is
* is used for the charset of vector fonts, like `modern.fon', * used for the charset of vector fonts, like `modern.fon`,
* `roman.fon', and `script.fon' on Windows. * `roman.fon`, and `script.fon` on Windows.
* *
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value * The 'CreateFont' documentation says: The `FT_WinFNT_ID_OEM` value
* specifies a character set that is operating-system dependent. * specifies a character set that is operating-system dependent.
* *
* The `IFIMETRICS' documentation from the `Windows Driver * The 'IFIMETRICS' documentation from the 'Windows Driver Development
* Development Kit' says: This font supports an OEM-specific * Kit' says: This font supports an OEM-specific character set. The
* character set. The OEM character set is system dependent. * OEM character set is system dependent.
* *
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the * In general OEM, as opposed to ANSI (i.e., 'cp1252'), denotes the
* second default codepage that most international versions of * second default codepage that most international versions of Windows
* Windows have. It is one of the OEM codepages from * 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. * and is used for the 'DOS boxes', to support legacy applications. A
* A German Windows version for example usually uses ANSI codepage * German Windows version for example usually uses ANSI codepage 1252
* 1252 and OEM codepage 850. * and OEM codepage 850.
* *
* FT_WinFNT_ID_CP874 :: * FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11. * A superset of Thai TIS 620 and ISO 8859-11.
@ -112,8 +112,8 @@ FT_BEGIN_HEADER
* ordering and minor deviations). * ordering and minor deviations).
* *
* FT_WinFNT_ID_CP949 :: * FT_WinFNT_ID_CP949 ::
* A superset of Korean Hangul KS~C 5601-1987 (with different * A superset of Korean Hangul KS~C 5601-1987 (with different ordering
* ordering and minor deviations). * and minor deviations).
* *
* FT_WinFNT_ID_CP950 :: * FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big~5 ETen (with different * A superset of traditional Chinese Big~5 ETen (with different
@ -173,14 +173,14 @@ FT_BEGIN_HEADER
#define FT_WinFNT_ID_OEM 255 #define FT_WinFNT_ID_OEM 255
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_WinFNT_HeaderRec */ * FT_WinFNT_HeaderRec
/* */ *
/* <Description> */ * @description:
/* Windows FNT Header info. */ * Windows FNT Header info.
/* */ */
typedef struct FT_WinFNT_HeaderRec_ typedef struct FT_WinFNT_HeaderRec_
{ {
FT_UShort version; FT_UShort version;
@ -223,18 +223,18 @@ FT_BEGIN_HEADER
} FT_WinFNT_HeaderRec; } FT_WinFNT_HeaderRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_WinFNT_Header */ * FT_WinFNT_Header
/* */ *
/* <Description> */ * @description:
/* A handle to an @FT_WinFNT_HeaderRec structure. */ * A handle to an @FT_WinFNT_HeaderRec structure.
/* */ */
typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header; typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_WinFNT_Header * FT_Get_WinFNT_Header
@ -243,10 +243,12 @@ FT_BEGIN_HEADER
* Retrieve a Windows FNT font info header. * Retrieve a Windows FNT font info header.
* *
* @input: * @input:
* face :: A handle to the input face. * face ::
* A handle to the input face.
* *
* @output: * @output:
* aheader :: The WinFNT header. * aheader ::
* The WinFNT header.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.

View file

@ -1,73 +1,73 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* autohint.h */ * autohint.h
/* */ *
/* High-level `autohint' module-specific interface (specification). */ * High-level 'autohint' module-specific interface (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* The auto-hinter is used to load and automatically hint glyphs if a */ * The auto-hinter is used to load and automatically hint glyphs if a
/* format-specific hinter isn't available. */ * format-specific hinter isn't available.
/* */ *
/*************************************************************************/ */
#ifndef AUTOHINT_H_ #ifndef AUTOHINT_H_
#define AUTOHINT_H_ #define AUTOHINT_H_
/*************************************************************************/ /**************************************************************************
/* */ *
/* A small technical note regarding automatic hinting in order to */ * A small technical note regarding automatic hinting in order to clarify
/* clarify this module interface. */ * this module interface.
/* */ *
/* An automatic hinter might compute two kinds of data for a given face: */ * An automatic hinter might compute two kinds of data for a given face:
/* */ *
/* - global hints: Usually some metrics that describe global properties */ * - global hints: Usually some metrics that describe global properties
/* of the face. It is computed by scanning more or less */ * of the face. It is computed by scanning more or less
/* aggressively the glyphs in the face, and thus can be */ * aggressively the glyphs in the face, and thus can be
/* very slow to compute (even if the size of global */ * very slow to compute (even if the size of global hints
/* hints is really small). */ * is really small).
/* */ *
/* - glyph hints: These describe some important features of the glyph */ * - glyph hints: These describe some important features of the glyph
/* outline, as well as how to align them. They are */ * outline, as well as how to align them. They are
/* generally much faster to compute than global hints. */ * generally much faster to compute than global hints.
/* */ *
/* The current FreeType auto-hinter does a pretty good job while */ * The current FreeType auto-hinter does a pretty good job while performing
/* performing fast computations for both global and glyph hints. */ * fast computations for both global and glyph hints. However, we might be
/* However, we might be interested in introducing more complex and */ * interested in introducing more complex and powerful algorithms in the
/* powerful algorithms in the future, like the one described in the John */ * future, like the one described in the John D. Hobby paper, which
/* D. Hobby paper, which unfortunately requires a lot more horsepower. */ * unfortunately requires a lot more horsepower.
/* */ *
/* Because a sufficiently sophisticated font management system would */ * Because a sufficiently sophisticated font management system would
/* typically implement an LRU cache of opened face objects to reduce */ * typically implement an LRU cache of opened face objects to reduce memory
/* memory usage, it is a good idea to be able to avoid recomputing */ * usage, it is a good idea to be able to avoid recomputing global hints
/* global hints every time the same face is re-opened. */ * every time the same face is re-opened.
/* */ *
/* We thus provide the ability to cache global hints outside of the face */ * 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 */ * 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 */ * feature is purely optional, so most client programs won't even notice
/* it. */ * it.
/* */ *
/* I initially thought that it would be a good idea to cache the glyph */ * 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 */ * hints too. However, my general idea now is that if you really need to
/* to cache these too, you are simply in need of a new font format, */ * cache these too, you are simply in need of a new font format, where all
/* where all this information could be stored within the font file and */ * this information could be stored within the font file and decoded on the
/* decoded on the fly. */ * fly.
/* */ *
/*************************************************************************/ */
#include <ft2build.h> #include <ft2build.h>
@ -80,27 +80,31 @@ FT_BEGIN_HEADER
typedef struct FT_AutoHinterRec_ *FT_AutoHinter; typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <FuncType> */ * @functype:
/* FT_AutoHinter_GlobalGetFunc */ * FT_AutoHinter_GlobalGetFunc
/* */ *
/* <Description> */ * @description:
/* Retrieve the global hints computed for a given face object. The */ * Retrieve the global hints computed for a given face object. The
/* resulting data is dissociated from the face and will survive a */ * resulting data is dissociated from the face and will survive a call to
/* call to FT_Done_Face(). It must be discarded through the API */ * FT_Done_Face(). It must be discarded through the API
/* FT_AutoHinter_GlobalDoneFunc(). */ * FT_AutoHinter_GlobalDoneFunc().
/* */ *
/* <Input> */ * @input:
/* hinter :: A handle to the source auto-hinter. */ * hinter ::
/* */ * A handle to the source auto-hinter.
/* face :: A handle to the source face object. */ *
/* */ * face ::
/* <Output> */ * A handle to the source face object.
/* global_hints :: A typeless pointer to the global hints. */ *
/* */ * @output:
/* global_len :: The size in bytes of the global hints. */ * global_hints ::
/* */ * A typeless pointer to the global hints.
*
* global_len ::
* The size in bytes of the global hints.
*/
typedef void typedef void
(*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
FT_Face face, FT_Face face,
@ -108,69 +112,76 @@ FT_BEGIN_HEADER
long* global_len ); long* global_len );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <FuncType> */ * @functype:
/* FT_AutoHinter_GlobalDoneFunc */ * FT_AutoHinter_GlobalDoneFunc
/* */ *
/* <Description> */ * @description:
/* Discard the global hints retrieved through */ * Discard the global hints retrieved through
/* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */ * FT_AutoHinter_GlobalGetFunc(). This is the only way these hints are
/* are freed from memory. */ * freed from memory.
/* */ *
/* <Input> */ * @input:
/* hinter :: A handle to the auto-hinter module. */ * hinter ::
/* */ * A handle to the auto-hinter module.
/* global :: A pointer to retrieved global hints to discard. */ *
/* */ * global ::
* A pointer to retrieved global hints to discard.
*/
typedef void typedef void
(*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
void* global ); void* global );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <FuncType> */ * @functype:
/* FT_AutoHinter_GlobalResetFunc */ * FT_AutoHinter_GlobalResetFunc
/* */ *
/* <Description> */ * @description:
/* This function is used to recompute the global metrics in a given */ * This function is used to recompute the global metrics in a given font.
/* font. This is useful when global font data changes (e.g. Multiple */ * This is useful when global font data changes (e.g. Multiple Masters
/* Masters fonts where blend coordinates change). */ * fonts where blend coordinates change).
/* */ *
/* <Input> */ * @input:
/* hinter :: A handle to the source auto-hinter. */ * hinter ::
/* */ * A handle to the source auto-hinter.
/* face :: A handle to the face. */ *
/* */ * face ::
* A handle to the face.
*/
typedef void typedef void
(*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
FT_Face face ); FT_Face face );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <FuncType> */ * @functype:
/* FT_AutoHinter_GlyphLoadFunc */ * FT_AutoHinter_GlyphLoadFunc
/* */ *
/* <Description> */ * @description:
/* This function is used to load, scale, and automatically hint a */ * This function is used to load, scale, and automatically hint a glyph
/* glyph from a given face. */ * from a given face.
/* */ *
/* <Input> */ * @input:
/* face :: A handle to the face. */ * face ::
/* */ * A handle to the face.
/* glyph_index :: The glyph index. */ *
/* */ * glyph_index ::
/* load_flags :: The load flags. */ * The glyph index.
/* */ *
/* <Note> */ * load_flags ::
/* This function is capable of loading composite glyphs by hinting */ * The load flags.
/* each sub-glyph independently (which improves quality). */ *
/* */ * @note:
/* It will call the font driver with @FT_Load_Glyph, with */ * This function is capable of loading composite glyphs by hinting each
/* @FT_LOAD_NO_SCALE set. */ * sub-glyph independently (which improves quality).
/* */ *
* It will call the font driver with @FT_Load_Glyph, with
* @FT_LOAD_NO_SCALE set.
*/
typedef FT_Error typedef FT_Error
(*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
FT_GlyphSlot slot, FT_GlyphSlot slot,
@ -179,14 +190,14 @@ FT_BEGIN_HEADER
FT_Int32 load_flags ); FT_Int32 load_flags );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_AutoHinter_InterfaceRec */ * FT_AutoHinter_InterfaceRec
/* */ *
/* <Description> */ * @description:
/* The auto-hinter module's interface. */ * The auto-hinter module's interface.
/* */ */
typedef struct FT_AutoHinter_InterfaceRec_ typedef struct FT_AutoHinter_InterfaceRec_
{ {
FT_AutoHinter_GlobalResetFunc reset_face; FT_AutoHinter_GlobalResetFunc reset_face;
@ -197,8 +208,6 @@ FT_BEGIN_HEADER
} FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface; } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_AUTOHINTER_INTERFACE( \ #define FT_DEFINE_AUTOHINTER_INTERFACE( \
class_, \ class_, \
reset_face_, \ reset_face_, \
@ -214,27 +223,6 @@ FT_BEGIN_HEADER
load_glyph_ \ 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 FT_END_HEADER

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* cffotypes.h */ * cffotypes.h
/* */ *
/* Basic OpenType/CFF object type definitions (specification). */ * Basic OpenType/CFF object type definitions (specification).
/* */ *
/* Copyright 2017-2018 by */ * Copyright (C) 2017-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef CFFOTYPES_H_ #ifndef CFFOTYPES_H_
@ -33,14 +33,14 @@ FT_BEGIN_HEADER
typedef TT_Face CFF_Face; typedef TT_Face CFF_Face;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* CFF_Size */ * CFF_Size
/* */ *
/* <Description> */ * @description:
/* A handle to an OpenType size object. */ * A handle to an OpenType size object.
/* */ */
typedef struct CFF_SizeRec_ typedef struct CFF_SizeRec_
{ {
FT_SizeRec root; FT_SizeRec root;
@ -49,14 +49,14 @@ FT_BEGIN_HEADER
} CFF_SizeRec, *CFF_Size; } CFF_SizeRec, *CFF_Size;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* CFF_GlyphSlot */ * CFF_GlyphSlot
/* */ *
/* <Description> */ * @description:
/* A handle to an OpenType glyph slot object. */ * A handle to an OpenType glyph slot object.
/* */ */
typedef struct CFF_GlyphSlotRec_ typedef struct CFF_GlyphSlotRec_
{ {
FT_GlyphSlotRec root; FT_GlyphSlotRec root;
@ -70,14 +70,14 @@ FT_BEGIN_HEADER
} CFF_GlyphSlotRec, *CFF_GlyphSlot; } CFF_GlyphSlotRec, *CFF_GlyphSlot;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Type> */ * @type:
/* CFF_Internal */ * CFF_Internal
/* */ *
/* <Description> */ * @description:
/* The interface to the `internal' field of `FT_Size'. */ * The interface to the 'internal' field of `FT_Size`.
/* */ */
typedef struct CFF_InternalRec_ typedef struct CFF_InternalRec_
{ {
PSH_Globals topfont; PSH_Globals topfont;
@ -86,10 +86,10 @@ FT_BEGIN_HEADER
} CFF_InternalRec, *CFF_Internal; } CFF_InternalRec, *CFF_Internal;
/*************************************************************************/ /**************************************************************************
/* */ *
/* Subglyph transformation record. */ * Subglyph transformation record.
/* */ */
typedef struct CFF_Transform_ typedef struct CFF_Transform_
{ {
FT_Fixed xx, xy; /* transformation matrix coefficients */ FT_Fixed xx, xy; /* transformation matrix coefficients */

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* cfftypes.h */ * cfftypes.h
/* */ *
/* Basic OpenType/CFF type definitions and interface (specification */ * Basic OpenType/CFF type definitions and interface (specification
/* only). */ * only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef CFFTYPES_H_ #ifndef CFFTYPES_H_
@ -33,34 +33,39 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* CFF_IndexRec */ * CFF_IndexRec
/* */ *
/* <Description> */ * @description:
/* A structure used to model a CFF Index table. */ * A structure used to model a CFF Index table.
/* */ *
/* <Fields> */ * @fields:
/* stream :: The source input stream. */ * stream ::
/* */ * The source input stream.
/* start :: The position of the first index byte in the */ *
/* input stream. */ * start ::
/* */ * The position of the first index byte in the input stream.
/* count :: The number of elements in the index. */ *
/* */ * count ::
/* off_size :: The size in bytes of object offsets in index. */ * The number of elements in the index.
/* */ *
/* data_offset :: The position of first data byte in the index's */ * off_size ::
/* bytes. */ * The size in bytes of object offsets in index.
/* */ *
/* data_size :: The size of the data table in this index. */ * data_offset ::
/* */ * The position of first data byte in the index's bytes.
/* offsets :: A table of element offsets in the index. Must be */ *
/* loaded explicitly. */ * data_size ::
/* */ * The size of the data table in this index.
/* bytes :: If the index is loaded in memory, its bytes. */ *
/* */ * 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_ typedef struct CFF_IndexRec_
{ {
FT_Stream stream; FT_Stream stream;

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftcalc.h */ * ftcalc.h
/* */ *
/* Arithmetic computations (specification). */ * Arithmetic computations (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTCALC_H_ #ifndef FTCALC_H_
@ -27,11 +27,11 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* 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 #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
/* Provide assembler fragments for performance-critical functions. */ /* Provide assembler fragments for performance-critical functions. */
@ -246,29 +246,32 @@ FT_BEGIN_HEADER
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_MulDiv_No_Round */ * FT_MulDiv_No_Round
/* */ *
/* <Description> */ * @description:
/* A very simple function used to perform the computation `(a*b)/c' */ * A very simple function used to perform the computation '(a*b)/c'
/* (without rounding) with maximum accuracy (it uses a 64-bit */ * (without rounding) with maximum accuracy (it uses a 64-bit
/* intermediate integer whenever necessary). */ * intermediate integer whenever necessary).
/* */ *
/* This function isn't necessarily as fast as some processor specific */ * This function isn't necessarily as fast as some processor-specific
/* operations, but is at least completely portable. */ * operations, but is at least completely portable.
/* */ *
/* <Input> */ * @input:
/* a :: The first multiplier. */ * a ::
/* b :: The second multiplier. */ * The first multiplier.
/* c :: The divisor. */ * b ::
/* */ * The second multiplier.
/* <Return> */ * c ::
/* The result of `(a*b)/c'. This function never traps when trying to */ * The divisor.
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ *
/* on the signs of `a' and `b'. */ * @return:
/* */ * 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_BASE( FT_Long )
FT_MulDiv_No_Round( FT_Long a, FT_MulDiv_No_Round( FT_Long a,
FT_Long b, FT_Long b,
@ -276,12 +279,11 @@ FT_BEGIN_HEADER
/* /*
* A variant of FT_Matrix_Multiply which scales its result afterwards. * A variant of FT_Matrix_Multiply which scales its result afterwards. The
* The idea is that both `a' and `b' are scaled by factors of 10 so that * idea is that both `a' and `b' are scaled by factors of 10 so that the
* the values are as precise as possible to get a correct result during * values are as precise as possible to get a correct result during the
* the 64bit multiplication. Let `sa' and `sb' be the scaling factors of * 64bit multiplication. Let `sa' and `sb' be the scaling factors of `a'
* `a' and `b', respectively, then the scaling factor of the result is * and `b', respectively, then the scaling factor of the result is `sa*sb'.
* `sa*sb'.
*/ */
FT_BASE( void ) FT_BASE( void )
FT_Matrix_Multiply_Scaled( const FT_Matrix* a, FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
@ -289,6 +291,21 @@ FT_BEGIN_HEADER
FT_Long scaling ); FT_Long scaling );
/*
* 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 * A variant of FT_Vector_Transform. See comments for
* FT_Matrix_Multiply_Scaled. * FT_Matrix_Multiply_Scaled.
@ -300,22 +317,22 @@ FT_BEGIN_HEADER
/* /*
* This function normalizes a vector and returns its original length. * This function normalizes a vector and returns its original length. The
* The normalized vector is a 16.16 fixed-point unit vector with length * normalized vector is a 16.16 fixed-point unit vector with length close
* close to 0x10000. The accuracy of the returned length is limited to * to 0x10000. The accuracy of the returned length is limited to 16 bits
* 16 bits also. The function utilizes quick inverse square root * also. The function utilizes quick inverse square root approximation
* approximation without divisions and square roots relying on Newton's * without divisions and square roots relying on Newton's iterations
* iterations instead. * instead.
*/ */
FT_BASE( FT_UInt32 ) FT_BASE( FT_UInt32 )
FT_Vector_NormLen( FT_Vector* vector ); FT_Vector_NormLen( FT_Vector* vector );
/* /*
* Return -1, 0, or +1, depending on the orientation of a given corner. * Return -1, 0, or +1, depending on the orientation of a given corner. We
* We use the Cartesian coordinate system, with positive vertical values * use the Cartesian coordinate system, with positive vertical values going
* going upwards. The function returns +1 if the corner turns to the * upwards. The function returns +1 if the corner turns to the left, -1 to
* left, -1 to the right, and 0 for undecidable cases. * the right, and 0 for undecidable cases.
*/ */
FT_BASE( FT_Int ) FT_BASE( FT_Int )
ft_corner_orientation( FT_Pos in_x, ft_corner_orientation( FT_Pos in_x,
@ -341,6 +358,7 @@ FT_BEGIN_HEADER
*/ */
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
#if defined( __GNUC__ ) && \ #if defined( __GNUC__ ) && \
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) ) ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
@ -352,9 +370,34 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) ) #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 #endif
#endif /* __GNUC__ */ #endif /* _MSC_VER */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
#ifndef FT_MSB #ifndef FT_MSB
@ -376,23 +419,24 @@ FT_BEGIN_HEADER
#if 0 #if 0
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_SqrtFixed */ * FT_SqrtFixed
/* */ *
/* <Description> */ * @description:
/* Computes the square root of a 16.16 fixed-point value. */ * Computes the square root of a 16.16 fixed-point value.
/* */ *
/* <Input> */ * @input:
/* x :: The value to compute the root for. */ * x ::
/* */ * The value to compute the root for.
/* <Return> */ *
/* The result of `sqrt(x)'. */ * @return:
/* */ * The result of 'sqrt(x)'.
/* <Note> */ *
/* This function is not very fast. */ * @note:
/* */ * This function is not very fast.
*/
FT_BASE( FT_Int32 ) FT_BASE( FT_Int32 )
FT_SqrtFixed( FT_Int32 x ); FT_SqrtFixed( FT_Int32 x );
@ -411,12 +455,21 @@ FT_BEGIN_HEADER
/* /*
* 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 ) \ #define ADD_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) ) (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
#define SUB_LONG( a, b ) \ #define SUB_LONG( a, b ) \
@ -435,6 +488,19 @@ FT_BEGIN_HEADER
#define NEG_INT32( a ) \ #define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(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 */
FT_END_HEADER FT_END_HEADER

View file

@ -1,24 +1,24 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftdebug.h */ * ftdebug.h
/* */ *
/* Debugging and logging component (specification). */ * Debugging and logging component (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/* */ *
/* IMPORTANT: A description of FreeType's debugging support can be */ * IMPORTANT: A description of FreeType's debugging support can be
/* found in `docs/DEBUG.TXT'. Read it if you need to use or */ * found in 'docs/DEBUG.TXT'. Read it if you need to use or
/* understand this code. */ * understand this code.
/* */ *
/***************************************************************************/ */
#ifndef FTDEBUG_H_ #ifndef FTDEBUG_H_
@ -42,12 +42,12 @@ FT_BEGIN_HEADER
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* Define the trace enums as well as the trace levels array when they */ * Define the trace enums as well as the trace levels array when they are
/* are needed. */ * needed.
/* */ *
/*************************************************************************/ */
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
@ -62,31 +62,36 @@ FT_BEGIN_HEADER
} FT_Trace; } FT_Trace;
/* defining the array of trace levels, provided by `src/base/ftdebug.c' */ /* a pointer to the array of trace levels, */
extern int ft_trace_levels[trace_count]; /* provided by `src/base/ftdebug.c' */
extern int* ft_trace_levels;
#undef FT_TRACE_DEF #undef FT_TRACE_DEF
#endif /* FT_DEBUG_LEVEL_TRACE */ #endif /* FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Define the FT_TRACE macro */ * Define the FT_TRACE macro
/* */ *
/* IMPORTANT! */ * IMPORTANT!
/* */ *
/* Each component must define the macro FT_COMPONENT to a valid FT_Trace */ * Each component must define the macro FT_COMPONENT to a valid FT_Trace
/* value before using any TRACE macro. */ * value before using any TRACE macro.
/* */ *
/*************************************************************************/ */
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
/* 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 ) \ #define FT_TRACE( level, varformat ) \
do \ do \
{ \ { \
if ( ft_trace_levels[FT_COMPONENT] >= level ) \ if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
FT_Message varformat; \ FT_Message varformat; \
} while ( 0 ) } while ( 0 )
@ -97,62 +102,85 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_TRACE */ #endif /* !FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Trace_Get_Count */ * FT_Trace_Get_Count
/* */ *
/* <Description> */ * @description:
/* Return the number of available trace components. */ * Return the number of available trace components.
/* */ *
/* <Return> */ * @return:
/* The number of trace components. 0 if FreeType 2 is not built with */ * The number of trace components. 0 if FreeType 2 is not built with
/* FT_DEBUG_LEVEL_TRACE definition. */ * FT_DEBUG_LEVEL_TRACE definition.
/* */ *
/* <Note> */ * @note:
/* This function may be useful if you want to access elements of */ * This function may be useful if you want to access elements of the
/* the internal `ft_trace_levels' array by an index. */ * internal trace levels array by an index.
/* */ */
FT_BASE( FT_Int ) FT_BASE( FT_Int )
FT_Trace_Get_Count( void ); FT_Trace_Get_Count( void );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Trace_Get_Name */ * FT_Trace_Get_Name
/* */ *
/* <Description> */ * @description:
/* Return the name of a trace component. */ * Return the name of a trace component.
/* */ *
/* <Input> */ * @input:
/* The index of the trace component. */ * The index of the trace component.
/* */ *
/* <Return> */ * @return:
/* The name of the trace component. This is a statically allocated */ * 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 */ * C~string, so do not free it after use. `NULL` if FreeType is not
/* built with FT_DEBUG_LEVEL_TRACE definition. */ * built with FT_DEBUG_LEVEL_TRACE definition.
/* */ *
/* <Note> */ * @note:
/* Use @FT_Trace_Get_Count to get the number of available trace */ * Use @FT_Trace_Get_Count to get the number of available trace
/* components. */ * components.
/* */ */
/* This function may be useful if you want to control FreeType 2's */
/* debug level in your application. */
/* */
FT_BASE( const char* ) FT_BASE( const char* )
FT_Trace_Get_Name( FT_Int idx ); FT_Trace_Get_Name( FT_Int idx );
/*************************************************************************/ /**************************************************************************
/* */ *
/* You need two opening and closing parentheses! */ * @function:
/* */ * FT_Trace_Disable
/* Example: FT_TRACE0(( "Value is %i", foo )) */ *
/* */ * @description:
/* Output of the FT_TRACEX macros is sent to stderr. */ * Switch off tracing temporarily. It can be activated again with
/* */ * @FT_Trace_Enable.
/*************************************************************************/ */
FT_BASE( void )
FT_Trace_Disable( void );
/**************************************************************************
*
* @function:
* FT_Trace_Enable
*
* @description:
* Activate tracing. Use it after tracing has been switched off with
* @FT_Trace_Disable.
*/
FT_BASE( void )
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_TRACE0( varformat ) FT_TRACE( 0, varformat )
#define FT_TRACE1( varformat ) FT_TRACE( 1, 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 FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
/*************************************************************************/ /**************************************************************************
/* */ *
/* Define the FT_ERROR macro. */ * Define the FT_ERROR macro.
/* */ *
/* Output of this macro is sent to stderr. */ * Output of this macro is sent to stderr.
/* */ *
/*************************************************************************/ */
#ifdef FT_DEBUG_LEVEL_ERROR #ifdef FT_DEBUG_LEVEL_ERROR
@ -183,12 +211,12 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_ERROR */ #endif /* !FT_DEBUG_LEVEL_ERROR */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw' */ * Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw` makes
/* makes it possible to easily set a breakpoint at this function. */ * it possible to easily set a breakpoint at this function.
/* */ *
/*************************************************************************/ */
#ifdef FT_DEBUG_LEVEL_ERROR #ifdef FT_DEBUG_LEVEL_ERROR
@ -215,11 +243,11 @@ FT_BEGIN_HEADER
#endif /* !FT_DEBUG_LEVEL_ERROR */ #endif /* !FT_DEBUG_LEVEL_ERROR */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Define `FT_Message' and `FT_Panic' when needed. */ * Define `FT_Message` and `FT_Panic` when needed.
/* */ *
/*************************************************************************/ */
#ifdef FT_DEBUG_LEVEL_ERROR #ifdef FT_DEBUG_LEVEL_ERROR

View file

@ -1,400 +0,0 @@
/***************************************************************************/
/* */
/* ftdriver.h */
/* */
/* FreeType font driver interface (specification). */
/* */
/* Copyright 1996-2017 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. */
/* */
/***************************************************************************/
#ifndef FTDRIVER_H_
#define FTDRIVER_H_
#include <ft2build.h>
#include FT_MODULE_H
FT_BEGIN_HEADER
typedef FT_Error
(*FT_Face_InitFunc)( FT_Stream stream,
FT_Face face,
FT_Int typeface_index,
FT_Int num_params,
FT_Parameter* parameters );
typedef void
(*FT_Face_DoneFunc)( FT_Face face );
typedef FT_Error
(*FT_Size_InitFunc)( FT_Size size );
typedef void
(*FT_Size_DoneFunc)( FT_Size size );
typedef FT_Error
(*FT_Slot_InitFunc)( FT_GlyphSlot slot );
typedef void
(*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
typedef FT_Error
(*FT_Size_RequestFunc)( FT_Size size,
FT_Size_Request req );
typedef FT_Error
(*FT_Size_SelectFunc)( FT_Size size,
FT_ULong size_index );
typedef FT_Error
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
FT_Size size,
FT_UInt glyph_index,
FT_Int32 load_flags );
typedef FT_Error
(*FT_Face_GetKerningFunc)( FT_Face face,
FT_UInt left_glyph,
FT_UInt right_glyph,
FT_Vector* kerning );
typedef FT_Error
(*FT_Face_AttachFunc)( FT_Face face,
FT_Stream stream );
typedef FT_Error
(*FT_Face_GetAdvancesFunc)( FT_Face face,
FT_UInt first,
FT_UInt count,
FT_Int32 flags,
FT_Fixed* advances );
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Driver_ClassRec */
/* */
/* <Description> */
/* The font driver class. This structure mostly contains pointers to */
/* driver methods. */
/* */
/* <Fields> */
/* 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. */
/* <Note> */
/* Most function pointers, with the exception of `load_glyph', can be */
/* set to 0 to indicate a default behaviour. */
/* */
typedef struct FT_Driver_ClassRec_
{
FT_Module_Class root;
FT_Long face_object_size;
FT_Long size_object_size;
FT_Long slot_object_size;
FT_Face_InitFunc init_face;
FT_Face_DoneFunc done_face;
FT_Size_InitFunc init_size;
FT_Size_DoneFunc done_size;
FT_Slot_InitFunc init_slot;
FT_Slot_DoneFunc done_slot;
FT_Slot_LoadFunc load_glyph;
FT_Face_GetKerningFunc get_kerning;
FT_Face_AttachFunc attach_file;
FT_Face_GetAdvancesFunc get_advances;
/* since version 2.2 */
FT_Size_RequestFunc request_size;
FT_Size_SelectFunc select_size;
} FT_Driver_ClassRec, *FT_Driver_Class;
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DECLARE_DRIVER */
/* */
/* <Description> */
/* Used to create a forward declaration of an FT_Driver_ClassRec */
/* struct instance. */
/* */
/* <Macro> */
/* FT_DEFINE_DRIVER */
/* */
/* <Description> */
/* 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). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_DRIVER( class_ ) \
FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_;
#define FT_DEFINE_DRIVER( \
class_, \
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_CALLBACK_TABLE_DEF \
const FT_Driver_ClassRec class_ = \
{ \
FT_DEFINE_ROOT_MODULE( 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_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_DRIVER( \
class_, \
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_ ) \
void \
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; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
return error; \
\
error = class_ ## _pic_init( library ); \
if ( error ) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
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->load_glyph = load_glyph_; \
\
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; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER
#endif /* FTDRIVER_H_ */
/* END */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftdrv.h */ * ftdrv.h
/* */ *
/* FreeType internal font driver interface (specification). */ * FreeType internal font driver interface (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTDRV_H_ #ifndef FTDRV_H_
@ -87,73 +87,80 @@ FT_BEGIN_HEADER
FT_Fixed* advances ); FT_Fixed* advances );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_Driver_ClassRec */ * FT_Driver_ClassRec
/* */ *
/* <Description> */ * @description:
/* The font driver class. This structure mostly contains pointers to */ * The font driver class. This structure mostly contains pointers to
/* driver methods. */ * driver methods.
/* */ *
/* <Fields> */ * @fields:
/* root :: The parent module. */ * root ::
/* */ * The parent module.
/* face_object_size :: The size of a face object in bytes. */ *
/* */ * face_object_size ::
/* size_object_size :: The size of a size object in bytes. */ * The size of a face object in bytes.
/* */ *
/* slot_object_size :: The size of a glyph object in bytes. */ * size_object_size ::
/* */ * The size of a size object in bytes.
/* init_face :: The format-specific face constructor. */ *
/* */ * slot_object_size ::
/* done_face :: The format-specific face destructor. */ * The size of a glyph object in bytes.
/* */ *
/* init_size :: The format-specific size constructor. */ * init_face ::
/* */ * The format-specific face constructor.
/* done_size :: The format-specific size destructor. */ *
/* */ * done_face ::
/* init_slot :: The format-specific slot constructor. */ * The format-specific face destructor.
/* */ *
/* done_slot :: The format-specific slot destructor. */ * init_size ::
/* */ * The format-specific size constructor.
/* */ *
/* load_glyph :: A function handle to load a glyph to a slot. */ * done_size ::
/* This field is mandatory! */ * The format-specific size destructor.
/* */ *
/* get_kerning :: A function handle to return the unscaled */ * init_slot ::
/* kerning for a given pair of glyphs. Can be */ * The format-specific slot constructor.
/* set to 0 if the format doesn't support */ *
/* kerning. */ * done_slot ::
/* */ * The format-specific slot destructor.
/* 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 */ * load_glyph ::
/* add data from AFM or PFM files on a Type 1 */ * A function handle to load a glyph to a slot. This field is
/* face, or a CIDMap on a CID-keyed face. */ * mandatory!
/* */ *
/* get_advances :: A function handle used to return advance */ * get_kerning ::
/* widths of `count' glyphs (in font units), */ * A function handle to return the unscaled kerning for a given pair of
/* starting at `first'. The `vertical' flag must */ * glyphs. Can be set to 0 if the format doesn't support kerning.
/* be set to get vertical advance heights. The */ *
/* `advances' buffer is caller-allocated. */ * attach_file ::
/* The idea of this function is to be able to */ * This function handle is used to read additional data for a face from
/* perform device-independent text layout without */ * another file/stream. For example, this can be used to add data from
/* loading a single glyph image. */ * AFM or PFM files on a Type 1 face, or a CIDMap on a CID-keyed face.
/* */ *
/* request_size :: A handle to a function used to request the new */ * get_advances ::
/* character size. Can be set to 0 if the */ * A function handle used to return advance widths of 'count' glyphs
/* scaling done in the base layer suffices. */ * (in font units), starting at 'first'. The 'vertical' flag must be
/* */ * set to get vertical advance heights. The 'advances' buffer is
/* select_size :: A handle to a function used to select a new */ * caller-allocated. The idea of this function is to be able to
/* fixed size. It is used only if */ * perform device-independent text layout without loading a single
/* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */ * glyph image.
/* to 0 if the scaling done in the base layer */ *
/* suffices. */ * request_size ::
/* <Note> */ * A handle to a function used to request the new character size. Can
/* Most function pointers, with the exception of `load_glyph', can be */ * be set to 0 if the scaling done in the base layer suffices.
/* set to 0 to indicate a default behaviour. */ *
/* */ * 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.
* @note:
* Most function pointers, with the exception of `load_glyph`, can be set
* to 0 to indicate a default behaviour.
*/
typedef struct FT_Driver_ClassRec_ typedef struct FT_Driver_ClassRec_
{ {
FT_Module_Class root; FT_Module_Class root;
@ -184,45 +191,28 @@ FT_BEGIN_HEADER
} FT_Driver_ClassRec, *FT_Driver_Class; } FT_Driver_ClassRec, *FT_Driver_Class;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Macro> */ * @macro:
/* FT_DECLARE_DRIVER */ * FT_DECLARE_DRIVER
/* */ *
/* <Description> */ * @description:
/* Used to create a forward declaration of an FT_Driver_ClassRec */ * Used to create a forward declaration of an FT_Driver_ClassRec struct
/* struct instance. */ * instance.
/* */ *
/* <Macro> */ * @macro:
/* FT_DEFINE_DRIVER */ * FT_DEFINE_DRIVER
/* */ *
/* <Description> */ * @description:
/* Used to initialize an instance of FT_Driver_ClassRec struct. */ * Used to initialize an instance of FT_Driver_ClassRec struct.
/* */ *
/* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */ * `ftinit.c` (ft_create_default_module_classes) already contains a
/* called with a pointer where the allocated structure is returned. */ * mechanism to call these functions for the default modules described in
/* And when it is no longer needed a `destroy' function needs to be */ * `ftmodule.h`.
/* called to release that allocation. */ *
/* */ * The struct will be allocated in the global scope (or the scope where
/* `ftinit.c' (ft_create_default_module_classes) already contains a */ * the macro is used).
/* 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). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_DRIVER( class_ ) \ #define FT_DECLARE_DRIVER( class_ ) \
FT_CALLBACK_TABLE \ FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_; const FT_Driver_ClassRec class_;
@ -289,108 +279,6 @@ FT_BEGIN_HEADER
select_size_ \ select_size_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_DRIVER( \
class_, \
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_ ) \
void \
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; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
return error; \
\
error = class_ ## _pic_init( library ); \
if ( error ) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
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->load_glyph = load_glyph_; \
\
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; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER FT_END_HEADER

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftgloadr.h */ * ftgloadr.h
/* */ *
/* The FreeType glyph loader (specification). */ * The FreeType glyph loader (specification).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg */ * David Turner, Robert Wilhelm, and Werner Lemberg
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTGLOADR_H_ #ifndef FTGLOADR_H_
@ -27,15 +27,15 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* FT_GlyphLoader */ * FT_GlyphLoader
/* */ *
/* <Description> */ * @description:
/* The glyph loader is an internal object used to load several glyphs */ * The glyph loader is an internal object used to load several glyphs
/* together (for example, in the case of composites). */ * together (for example, in the case of composites).
/* */ */
typedef struct FT_SubGlyphRec_ typedef struct FT_SubGlyphRec_
{ {
FT_Int index; FT_Int index;
@ -138,11 +138,6 @@ FT_BEGIN_HEADER
FT_BASE( void ) FT_BASE( void )
FT_GlyphLoader_Add( FT_GlyphLoader loader ); 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 );
/* */ /* */

View file

@ -1,10 +1,10 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fthash.h */ * fthash.h
/* */ *
/* Hashing functions (specification). */ * Hashing functions (specification).
/* */ *
/***************************************************************************/ */
/* /*
* Copyright 2000 Computing Research Labs, New Mexico State University * Copyright 2000 Computing Research Labs, New Mexico State University
@ -30,13 +30,13 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 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 */ * 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 */ * taken from Mark Leisher's xmbdfed package
/* */ *
/*************************************************************************/ */
#ifndef FTHASH_H_ #ifndef FTHASH_H_

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftmemory.h */ * ftmemory.h
/* */ *
/* The FreeType memory management macros (specification). */ * The FreeType memory management macros (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg */ * David Turner, Robert Wilhelm, and Werner Lemberg
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTMEMORY_H_ #ifndef FTMEMORY_H_
@ -28,16 +28,16 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Macro> */ * @macro:
/* FT_SET_ERROR */ * FT_SET_ERROR
/* */ *
/* <Description> */ * @description:
/* This macro is used to set an implicit `error' variable to a given */ * 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 */ * expression's value (usually a function call), and convert it to a
/* boolean which is set whenever the value is != 0. */ * boolean which is set whenever the value is != 0.
/* */ */
#undef FT_SET_ERROR #undef FT_SET_ERROR
#define FT_SET_ERROR( expression ) \ #define FT_SET_ERROR( expression ) \
( ( error = (expression) ) != 0 ) ( ( error = (expression) ) != 0 )
@ -59,8 +59,8 @@ FT_BEGIN_HEADER
/* /*
* C++ refuses to handle statements like p = (void*)anything, with `p' a * C++ refuses to handle statements like p = (void*)anything, with `p' a
* typed pointer. Since we don't have a `typeof' operator in standard * typed pointer. Since we don't have a `typeof' operator in standard C++,
* C++, we have to use a template to emulate it. * we have to use a template to emulate it.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
@ -107,8 +107,8 @@ extern "C++"
/* /*
* The allocation functions return a pointer, and the error code * The allocation functions return a pointer, and the error code is written
* is written to through the `p_error' parameter. * to through the `p_error' parameter.
*/ */
/* The `q' variants of the functions below (`q' for `quick') don't fill */ /* 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. * Return the maximum number of addressable elements in an array. We limit
* We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid * ourselves to INT_MAX, rather than UINT_MAX, to avoid any problems.
* any problems.
*/ */
#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) ) #define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) ) #define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
/*************************************************************************/ /**************************************************************************
/* */ *
/* The following functions macros expect that their pointer argument is */ * The following functions macros expect that their pointer argument is
/* _typed_ in order to automatically compute array element sizes. */ * _typed_ in order to automatically compute array element sizes.
/* */ */
#define FT_MEM_NEW_ARRAY( ptr, count ) \ #define FT_MEM_NEW_ARRAY( ptr, count ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \

File diff suppressed because it is too large Load diff

View file

@ -1,71 +0,0 @@
/***************************************************************************/
/* */
/* ftpic.h */
/* */
/* The FreeType position independent code services (declaration). */
/* */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* 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. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* 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_BASE( FT_Error )
ft_pic_container_init( FT_Library library );
/* Destroy the contents of the container. */
FT_BASE( void )
ft_pic_container_destroy( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* FTPIC_H_ */
/* END */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftpsprop.h */ * ftpsprop.h
/* */ *
/* Get and set properties of PostScript drivers (specification). */ * Get and set properties of PostScript drivers (specification).
/* */ *
/* Copyright 2017-2018 by */ * Copyright (C) 2017-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTPSPROP_H_ #ifndef FTPSPROP_H_

View file

@ -1,24 +1,24 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftrfork.h */ * ftrfork.h
/* */ *
/* Embedded resource forks accessor (specification). */ * Embedded resource forks accessor (specification).
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* Masatake YAMATO and Redhat K.K. */ * Masatake YAMATO and Redhat K.K.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /****************************************************************************
/* Development of the code in this file is support of */ * Development of the code in this file is support of
/* Information-technology Promotion Agency, Japan. */ * Information-technology Promotion Agency, Japan.
/***************************************************************************/ */
#ifndef FTRFORK_H_ #ifndef FTRFORK_H_
@ -72,85 +72,65 @@ FT_BEGIN_HEADER
} FT_RFork_Rule; } FT_RFork_Rule;
/* For fast translation between rule index and rule type, /* For fast translation between rule index and rule type,
* the macros FT_RFORK_xxx should be kept consistent with * the macros FT_RFORK_xxx should be kept consistent with the
* the raccess_guess_funcs table * raccess_guess_funcs table
*/ */
typedef struct ft_raccess_guess_rec_ { typedef struct ft_raccess_guess_rec_ {
ft_raccess_guess_func func; ft_raccess_guess_func func;
FT_RFork_Rule type; FT_RFork_Rule type;
} ft_raccess_guess_rec; } ft_raccess_guess_rec;
#ifndef FT_CONFIG_OPTION_PIC
/* this array is a storage in non-PIC mode, so ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
static const type name[] = { static const type name[] = {
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
{ raccess_guess_ ## func_suffix, \ { raccess_guess_ ## func_suffix, \
FT_RFork_Rule_ ## type_suffix }, FT_RFork_Rule_ ## type_suffix },
/* this array is a storage, thus a final `;' is needed */
#define CONST_FT_RFORK_RULE_ARRAY_END }; #define CONST_FT_RFORK_RULE_ARRAY_END };
#else /* FT_CONFIG_OPTION_PIC */
/* this array is a function in PIC mode, so no ; is needed in END */
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
void \
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_PIC */
#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */ #endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Raccess_Guess */ * FT_Raccess_Guess
/* */ *
/* <Description> */ * @description:
/* Guess a file name and offset where the actual resource fork is */ * Guess a file name and offset where the actual resource fork is stored.
/* stored. The macro FT_RACCESS_N_RULES holds the number of */ * The macro FT_RACCESS_N_RULES holds the number of guessing rules; the
/* guessing rules; the guessed result for the Nth rule is */ * guessed result for the Nth rule is represented as a triplet: a new
/* represented as a triplet: a new file name (new_names[N]), a file */ * file name (new_names[N]), a file offset (offsets[N]), and an error
/* offset (offsets[N]), and an error code (errors[N]). */ * code (errors[N]).
/* */ *
/* <Input> */ * @input:
/* library :: */ * library ::
/* A FreeType library instance. */ * A FreeType library instance.
/* */ *
/* stream :: */ * stream ::
/* A file stream containing the resource fork. */ * A file stream containing the resource fork.
/* */ *
/* base_name :: */ * base_name ::
/* The (base) file name of the resource fork used for some */ * The (base) file name of the resource fork used for some guessing
/* guessing rules. */ * rules.
/* */ *
/* <Output> */ * @output:
/* new_names :: */ * new_names ::
/* An array of guessed file names in which the resource forks may */ * An array of guessed file names in which the resource forks may
/* exist. If `new_names[N]' is NULL, the guessed file name is */ * exist. If 'new_names[N]' is `NULL`, the guessed file name is equal
/* equal to `base_name'. */ * to `base_name`.
/* */ *
/* offsets :: */ * offsets ::
/* An array of guessed file offsets. `offsets[N]' holds the file */ * An array of guessed file offsets. 'offsets[N]' holds the file
/* offset of the possible start of the resource fork in file */ * offset of the possible start of the resource fork in file
/* `new_names[N]'. */ * 'new_names[N]'.
/* */ *
/* errors :: */ * errors ::
/* An array of FreeType error codes. `errors[N]' is the error */ * An array of FreeType error codes. 'errors[N]' is the error code of
/* code of Nth guessing rule function. If `errors[N]' is not */ * Nth guessing rule function. If 'errors[N]' is not FT_Err_Ok,
/* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */ * 'new_names[N]' and 'offsets[N]' are meaningless.
/* */ */
FT_BASE( void ) FT_BASE( void )
FT_Raccess_Guess( FT_Library library, FT_Raccess_Guess( FT_Library library,
FT_Stream stream, FT_Stream stream,
@ -160,37 +140,37 @@ FT_BEGIN_HEADER
FT_Error* errors ); FT_Error* errors );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Raccess_Get_HeaderInfo */ * FT_Raccess_Get_HeaderInfo
/* */ *
/* <Description> */ * @description:
/* Get the information from the header of resource fork. The */ * Get the information from the header of resource fork. The information
/* information includes the file offset where the resource map */ * includes the file offset where the resource map starts, and the file
/* starts, and the file offset where the resource data starts. */ * offset where the resource data starts. `FT_Raccess_Get_DataOffsets`
/* `FT_Raccess_Get_DataOffsets' requires these two data. */ * requires these two data.
/* */ *
/* <Input> */ * @input:
/* library :: */ * library ::
/* A FreeType library instance. */ * A FreeType library instance.
/* */ *
/* stream :: */ * stream ::
/* A file stream containing the resource fork. */ * A file stream containing the resource fork.
/* */ *
/* rfork_offset :: */ * rfork_offset ::
/* The file offset where the resource fork starts. */ * The file offset where the resource fork starts.
/* */ *
/* <Output> */ * @output:
/* map_offset :: */ * map_offset ::
/* The file offset where the resource map starts. */ * The file offset where the resource map starts.
/* */ *
/* rdata_pos :: */ * rdata_pos ::
/* The file offset where the resource data starts. */ * The file offset where the resource data starts.
/* */ *
/* <Return> */ * @return:
/* FreeType error code. FT_Err_Ok means success. */ * FreeType error code. FT_Err_Ok means success.
/* */ */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Raccess_Get_HeaderInfo( FT_Library library, FT_Raccess_Get_HeaderInfo( FT_Library library,
FT_Stream stream, FT_Stream stream,
@ -199,55 +179,54 @@ FT_BEGIN_HEADER
FT_Long *rdata_pos ); FT_Long *rdata_pos );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Function> */ * @function:
/* FT_Raccess_Get_DataOffsets */ * FT_Raccess_Get_DataOffsets
/* */ *
/* <Description> */ * @description:
/* Get the data offsets for a tag in a resource fork. Offsets are */ * Get the data offsets for a tag in a resource fork. Offsets are stored
/* stored in an array because, in some cases, resources in a resource */ * in an array because, in some cases, resources in a resource fork have
/* fork have the same tag. */ * the same tag.
/* */ *
/* <Input> */ * @input:
/* library :: */ * library ::
/* A FreeType library instance. */ * A FreeType library instance.
/* */ *
/* stream :: */ * stream ::
/* A file stream containing the resource fork. */ * A file stream containing the resource fork.
/* */ *
/* map_offset :: */ * map_offset ::
/* The file offset where the resource map starts. */ * The file offset where the resource map starts.
/* */ *
/* rdata_pos :: */ * rdata_pos ::
/* The file offset where the resource data starts. */ * The file offset where the resource data starts.
/* */ *
/* tag :: */ * tag ::
/* The resource tag. */ * The resource tag.
/* */ *
/* sort_by_res_id :: */ * sort_by_res_id ::
/* A Boolean to sort the fragmented resource by their ids. */ * A Boolean to sort the fragmented resource by their ids. The
/* The fragmented resources for `POST' resource should be sorted */ * fragmented resources for 'POST' resource should be sorted to restore
/* to restore Type1 font properly. For `sfnt' resources, sorting */ * Type1 font properly. For 'sfnt' resources, sorting may induce a
/* may induce a different order of the faces in comparison to that */ * different order of the faces in comparison to that by QuickDraw API.
/* by QuickDraw API. */ *
/* */ * @output:
/* <Output> */ * offsets ::
/* offsets :: */ * The stream offsets for the resource data specified by 'tag'. This
/* The stream offsets for the resource data specified by `tag'. */ * array is allocated by the function, so you have to call @ft_mem_free
/* This array is allocated by the function, so you have to call */ * after use.
/* @ft_mem_free after use. */ *
/* */ * count ::
/* count :: */ * The length of offsets array.
/* The length of offsets array. */ *
/* */ * @return:
/* <Return> */ * FreeType error code. FT_Err_Ok means success.
/* FreeType error code. FT_Err_Ok means success. */ *
/* */ * @note:
/* <Note> */ * Normally you should use `FT_Raccess_Get_HeaderInfo` to get the value
/* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */ * for `map_offset` and `rdata_pos`.
/* value for `map_offset' and `rdata_pos'. */ */
/* */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Raccess_Get_DataOffsets( FT_Library library, FT_Raccess_Get_DataOffsets( FT_Library library,
FT_Stream stream, FT_Stream stream,

View file

@ -1,31 +1,31 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftserv.h */ * ftserv.h
/* */ *
/* The FreeType services (specification only). */ * The FreeType services (specification only).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Each module can export one or more `services'. Each service is */ * Each module can export one or more 'services'. Each service is
/* identified by a constant string and modeled by a pointer; the latter */ * identified by a constant string and modeled by a pointer; the latter
/* generally corresponds to a structure containing function pointers. */ * generally corresponds to a structure containing function pointers.
/* */ *
/* Note that a service's data cannot be a mere function pointer because */ * Note that a service's data cannot be a mere function pointer because in
/* in C it is possible that function pointers might be implemented */ * C it is possible that function pointers might be implemented differently
/* differently than data pointers (e.g. 48 bits instead of 32). */ * than data pointers (e.g. 48 bits instead of 32).
/* */ *
/*************************************************************************/ */
#ifndef FTSERV_H_ #ifndef FTSERV_H_
@ -34,7 +34,8 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /**************************************************************************
*
* @macro: * @macro:
* FT_FACE_FIND_SERVICE * FT_FACE_FIND_SERVICE
* *
@ -46,15 +47,15 @@ FT_BEGIN_HEADER
* The source face handle. * The source face handle.
* *
* id :: * id ::
* A string describing the service as defined in the service's * A string describing the service as defined in the service's header
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to * files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with * 'multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'. * `FT_SERVICE_ID_`.
* *
* @output: * @output:
* ptr :: * ptr ::
* A variable that receives the service pointer. Will be NULL * A variable that receives the service pointer. Will be `NULL` if not
* if not found. * found.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
@ -85,7 +86,8 @@ FT_BEGIN_HEADER
#endif /* !C++ */ #endif /* !C++ */
/* /**************************************************************************
*
* @macro: * @macro:
* FT_FACE_FIND_GLOBAL_SERVICE * FT_FACE_FIND_GLOBAL_SERVICE
* *
@ -97,15 +99,15 @@ FT_BEGIN_HEADER
* The source face handle. * The source face handle.
* *
* id :: * id ::
* A string describing the service as defined in the service's * A string describing the service as defined in the service's header
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to * files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with * 'multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'. * `FT_SERVICE_ID_`.
* *
* @output: * @output:
* ptr :: * ptr ::
* A variable that receives the service pointer. Will be NULL * A variable that receives the service pointer. Will be `NULL` if not
* if not found. * found.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
@ -144,8 +146,8 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* /*
* The following structure is used to _describe_ a given service * The following structure is used to _describe_ a given service to the
* to the library. This is useful to build simple static service lists. * library. This is useful to build simple static service lists.
*/ */
typedef struct FT_ServiceDescRec_ typedef struct FT_ServiceDescRec_
{ {
@ -157,35 +159,26 @@ FT_BEGIN_HEADER
typedef const FT_ServiceDescRec* FT_ServiceDesc; typedef const FT_ServiceDescRec* FT_ServiceDesc;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Macro> */ * @macro:
/* FT_DEFINE_SERVICEDESCREC1 */ * FT_DEFINE_SERVICEDESCREC1
/* FT_DEFINE_SERVICEDESCREC2 */ * FT_DEFINE_SERVICEDESCREC2
/* FT_DEFINE_SERVICEDESCREC3 */ * FT_DEFINE_SERVICEDESCREC3
/* FT_DEFINE_SERVICEDESCREC4 */ * FT_DEFINE_SERVICEDESCREC4
/* FT_DEFINE_SERVICEDESCREC5 */ * FT_DEFINE_SERVICEDESCREC5
/* FT_DEFINE_SERVICEDESCREC6 */ * FT_DEFINE_SERVICEDESCREC6
/* FT_DEFINE_SERVICEDESCREC7 */ * FT_DEFINE_SERVICEDESCREC7
/* FT_DEFINE_SERVICEDESCREC8 */ * FT_DEFINE_SERVICEDESCREC8
/* */ * FT_DEFINE_SERVICEDESCREC9
/* <Description> */ * FT_DEFINE_SERVICEDESCREC10
/* Used to initialize an array of FT_ServiceDescRec structures. */ *
/* */ * @description:
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs to */ * Used to initialize an array of FT_ServiceDescRec structures.
/* 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 */ * The array will be allocated in the global scope (or the scope where
/* release that allocation. */ * the macro is used).
/* */ */
/* 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 */
/* allocated in the global scope (or the scope where the macro is */
/* used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICEDESCREC1( class_, \ #define FT_DEFINE_SERVICEDESCREC1( class_, \
serv_id_1, serv_data_1 ) \ serv_id_1, serv_data_1 ) \
static const FT_ServiceDescRec class_[] = \ static const FT_ServiceDescRec class_[] = \
@ -356,504 +349,15 @@ FT_BEGIN_HEADER
{ NULL, NULL } \ { NULL, NULL } \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
serv_id_1, serv_data_1 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) ) \
return error; \
\
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; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC2( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) ) \
return error; \
\
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 = NULL; \
clazz[2].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC3( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) ) \
return error; \
\
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 = NULL; \
clazz[3].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC4( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) ) \
return error; \
\
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 = NULL; \
clazz[4].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC5( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) ) \
return error; \
\
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 = NULL; \
clazz[5].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC6( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) ) \
return error; \
\
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 = NULL; \
clazz[6].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC7( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
return error; \
\
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 = NULL; \
clazz[7].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC8( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 9 ) ) \
return error; \
\
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 = NULL; \
clazz[8].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC9( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 10 ) ) \
return error; \
\
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 = NULL; \
clazz[9].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC10( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9, \
serv_id_10, serv_data_10 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 11 ) ) \
return error; \
\
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; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* /*
* Parse a list of FT_ServiceDescRec descriptors and look for * Parse a list of FT_ServiceDescRec descriptors and look for a specific
* a specific service by ID. Note that the last element in the * service by ID. Note that the last element in the array must be { NULL,
* array must be { NULL, NULL }, and that the function should * NULL }, and that the function should return NULL if the service isn't
* return NULL if the service isn't available. * available.
* *
* This function can be used by modules to implement their * This function can be used by modules to implement their `get_service'
* `get_service' method. * method.
*/ */
FT_BASE( FT_Pointer ) FT_BASE( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors, ft_service_list_lookup( FT_ServiceDesc service_descriptors,
@ -870,14 +374,14 @@ FT_BEGIN_HEADER
/* /*
* This structure is used to store a cache for several frequently used * This structure is used to store a cache for several frequently used
* services. It is the type of `face->internal->services'. You * services. It is the type of `face->internal->services'. You should
* should only use FT_FACE_LOOKUP_SERVICE to access it. * only use FT_FACE_LOOKUP_SERVICE to access it.
* *
* All fields should have the type FT_Pointer to relax compilation * All fields should have the type FT_Pointer to relax compilation
* dependencies. We assume the developer isn't completely stupid. * dependencies. We assume the developer isn't completely stupid.
* *
* Each field must be named `service_XXXX' where `XXX' corresponds to * Each field must be named `service_XXXX' where `XXX' corresponds to the
* the correct FT_SERVICE_ID_XXXX macro. See the definition of * correct FT_SERVICE_ID_XXXX macro. See the definition of
* FT_FACE_LOOKUP_SERVICE below how this is implemented. * FT_FACE_LOOKUP_SERVICE below how this is implemented.
* *
*/ */
@ -901,7 +405,8 @@ FT_BEGIN_HEADER
#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1) #define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
/* /**************************************************************************
*
* @macro: * @macro:
* FT_FACE_LOOKUP_SERVICE * FT_FACE_LOOKUP_SERVICE
* *
@ -910,7 +415,7 @@ FT_BEGIN_HEADER
* using its cache. * using its cache.
* *
* @input: * @input:
* face:: * face ::
* The source face handle containing the cache. * The source face handle containing the cache.
* *
* field :: * field ::
@ -921,7 +426,7 @@ FT_BEGIN_HEADER
* *
* @output: * @output:
* ptr :: * ptr ::
* A variable receiving the service data. NULL if not available. * A variable receiving the service data. `NULL` if not available.
*/ */
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftstream.h */ * ftstream.h
/* */ *
/* Stream handling (specification). */ * Stream handling (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTSTREAM_H_ #ifndef FTSTREAM_H_
@ -147,11 +147,11 @@ FT_BEGIN_HEADER
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 } #define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
/*************************************************************************/ /**************************************************************************
/* */ *
/* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */ * Integer extraction macros -- the 'buffer' parameter must ALWAYS be of
/* type `char*' or equivalent (1-byte elements). */ * type 'char*' or equivalent (1-byte elements).
/* */ */
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] ) #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) ) #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 ) | \ #define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) ) FT_BYTE_U16( p, 1, 0 ) )
@ -213,7 +217,10 @@ FT_BEGIN_HEADER
FT_BYTE_U32( p, 1, 8 ) | \ FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) ) 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 ) \ #define FT_NEXT_CHAR( buffer ) \
( (signed char)*buffer++ ) ( (signed char)*buffer++ )
@ -258,10 +265,14 @@ FT_BEGIN_HEADER
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) ) ( (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`.
*/
#if 0 #if 0
#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( 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_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
#endif #endif
#define FT_READ_MACRO( func, type, var ) \ #define FT_READ_MACRO( func, type, var ) \
( var = (type)func( stream, &error ), \ ( var = (type)func( stream, &error ), \
error != FT_Err_Ok ) 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
* valid.
*/
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var ) #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_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 ) #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 */ /* 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 */ /* 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. */ /* 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! */ /* a stream frame! */
/* */ /* */
/* Nested frames are not permitted. */
/* */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Stream_EnterFrame( FT_Stream stream, FT_Stream_EnterFrame( FT_Stream stream,
FT_ULong count ); FT_ULong count );
@ -401,25 +422,29 @@ FT_BEGIN_HEADER
FT_BASE( void ) FT_BASE( void )
FT_Stream_ExitFrame( FT_Stream stream ); FT_Stream_ExitFrame( FT_Stream stream );
/* Extract a stream frame. If the stream is disk-based, a heap block */ /* 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 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. */ /* Useful to optimize access to memory-based streams transparently. */
/* */ /* */
/* All extracted frames must be `freed' with a call to the function */ /* `FT_Stream_GetXXX' functions can't be used. */
/* FT_Stream_ReleaseFrame(). */ /* */
/* An extracted frame must be `freed' with a call to the function */
/* `FT_Stream_ReleaseFrame'. */
/* */ /* */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Stream_ExtractFrame( FT_Stream stream, FT_Stream_ExtractFrame( FT_Stream stream,
FT_ULong count, FT_ULong count,
FT_Byte** pbytes ); FT_Byte** pbytes );
/* release an extract frame (see FT_Stream_ExtractFrame) */ /* release an extract frame (see `FT_Stream_ExtractFrame') */
FT_BASE( void ) FT_BASE( void )
FT_Stream_ReleaseFrame( FT_Stream stream, FT_Stream_ReleaseFrame( FT_Stream stream,
FT_Byte** pbytes ); FT_Byte** pbytes );
/* read a byte from an entered frame */ /* read a byte from an entered frame */
FT_BASE( FT_Char ) FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream ); FT_Stream_GetChar( FT_Stream stream );

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fttrace.h */ * fttrace.h
/* */ *
/* Tracing handling (specification only). */ * Tracing handling (specification only).
/* */ *
/* Copyright 2002-2018 by */ * Copyright (C) 2002-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/* definitions of trace levels for FreeType 2 */ /* definitions of trace levels for FreeType 2 */
@ -23,23 +23,24 @@ FT_TRACE_DEF( any )
/* base components */ /* base components */
FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */ 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( 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( io ) /* i/o interface (ftsystem.c) */
FT_TRACE_DEF( list ) /* list management (ftlist.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( objs ) /* base objects (ftobjs.c) */
FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */ FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */ FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.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( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */ FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.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 */ /* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ 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 */ /* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */ FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.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( 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( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */ FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */ FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */ FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */ FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
/* TrueType driver components */ /* TrueType driver components */
FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */ FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.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( ttinterp ) /* bytecode interpreter (ttinterp.c) */
FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */ FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.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 */ /* Type 1 driver components */
FT_TRACE_DEF( t1afm ) FT_TRACE_DEF( t1afm )
@ -72,14 +75,14 @@ FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse ) FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */ /* PostScript helper module `psaux' */
FT_TRACE_DEF( t1decode )
FT_TRACE_DEF( cffdecode ) FT_TRACE_DEF( cffdecode )
FT_TRACE_DEF( psobjs )
FT_TRACE_DEF( psconv ) FT_TRACE_DEF( psconv )
FT_TRACE_DEF( psobjs )
FT_TRACE_DEF( t1decode )
/* PostScript hinting module `pshinter' */ /* PostScript hinting module `pshinter' */
FT_TRACE_DEF( pshrec )
FT_TRACE_DEF( pshalgo ) FT_TRACE_DEF( pshalgo )
FT_TRACE_DEF( pshrec )
/* Type 2 driver components */ /* Type 2 driver components */
FT_TRACE_DEF( cffdriver ) FT_TRACE_DEF( cffdriver )
@ -117,7 +120,6 @@ FT_TRACE_DEF( bdflib )
FT_TRACE_DEF( pfr ) FT_TRACE_DEF( pfr )
/* OpenType validation components */ /* OpenType validation components */
FT_TRACE_DEF( otvmodule )
FT_TRACE_DEF( otvcommon ) FT_TRACE_DEF( otvcommon )
FT_TRACE_DEF( otvbase ) FT_TRACE_DEF( otvbase )
FT_TRACE_DEF( otvgdef ) FT_TRACE_DEF( otvgdef )
@ -125,29 +127,30 @@ FT_TRACE_DEF( otvgpos )
FT_TRACE_DEF( otvgsub ) FT_TRACE_DEF( otvgsub )
FT_TRACE_DEF( otvjstf ) FT_TRACE_DEF( otvjstf )
FT_TRACE_DEF( otvmath ) FT_TRACE_DEF( otvmath )
FT_TRACE_DEF( otvmodule )
/* TrueTypeGX/AAT validation components */ /* TrueTypeGX/AAT validation components */
FT_TRACE_DEF( gxvmodule ) FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvcommon ) FT_TRACE_DEF( gxvcommon )
FT_TRACE_DEF( gxvfeat ) FT_TRACE_DEF( gxvfeat )
FT_TRACE_DEF( gxvmort )
FT_TRACE_DEF( gxvmorx )
FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvjust ) FT_TRACE_DEF( gxvjust )
FT_TRACE_DEF( gxvkern ) FT_TRACE_DEF( gxvkern )
FT_TRACE_DEF( gxvopbd ) FT_TRACE_DEF( gxvmodule )
FT_TRACE_DEF( gxvtrak ) FT_TRACE_DEF( gxvmort )
FT_TRACE_DEF( gxvprop ) FT_TRACE_DEF( gxvmorx )
FT_TRACE_DEF( gxvlcar ) FT_TRACE_DEF( gxvlcar )
FT_TRACE_DEF( gxvopbd )
FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvtrak )
/* autofit components */ /* autofit components */
FT_TRACE_DEF( afmodule )
FT_TRACE_DEF( afhints )
FT_TRACE_DEF( afcjk ) FT_TRACE_DEF( afcjk )
FT_TRACE_DEF( afglobal )
FT_TRACE_DEF( afhints )
FT_TRACE_DEF( afmodule )
FT_TRACE_DEF( aflatin ) FT_TRACE_DEF( aflatin )
FT_TRACE_DEF( aflatin2 ) FT_TRACE_DEF( aflatin2 )
FT_TRACE_DEF( afwarp )
FT_TRACE_DEF( afshaper ) FT_TRACE_DEF( afshaper )
FT_TRACE_DEF( afglobal ) FT_TRACE_DEF( afwarp )
/* END */ /* END */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftvalid.h */ * ftvalid.h
/* */ *
/* FreeType validation support (specification). */ * FreeType validation support (specification).
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef FTVALID_H_ #ifndef FTVALID_H_
@ -42,31 +42,31 @@ FT_BEGIN_HEADER
typedef struct FT_ValidatorRec_ volatile* FT_Validator; typedef struct FT_ValidatorRec_ volatile* FT_Validator;
/*************************************************************************/ /**************************************************************************
/* */ *
/* There are three distinct validation levels defined here: */ * There are three distinct validation levels defined here:
/* */ *
/* FT_VALIDATE_DEFAULT :: */ * FT_VALIDATE_DEFAULT ::
/* A table that passes this validation level can be used reliably by */ * A table that passes this validation level can be used reliably by
/* FreeType. It generally means that all offsets have been checked to */ * FreeType. It generally means that all offsets have been checked to
/* prevent out-of-bound reads, that array counts are correct, etc. */ * prevent out-of-bound reads, that array counts are correct, etc.
/* */ *
/* FT_VALIDATE_TIGHT :: */ * FT_VALIDATE_TIGHT ::
/* A table that passes this validation level can be used reliably and */ * A table that passes this validation level can be used reliably and
/* doesn't contain invalid data. For example, a charmap table that */ * doesn't contain invalid data. For example, a charmap table that
/* returns invalid glyph indices will not pass, even though it can */ * returns invalid glyph indices will not pass, even though it can be
/* be used with FreeType in default mode (the library will simply */ * used with FreeType in default mode (the library will simply return an
/* return an error later when trying to load the glyph). */ * error later when trying to load the glyph).
/* */ *
/* It also checks that fields which must be a multiple of 2, 4, or 8, */ * It also checks that fields which must be a multiple of 2, 4, or 8,
/* don't have incorrect values, etc. */ * don't have incorrect values, etc.
/* */ *
/* FT_VALIDATE_PARANOID :: */ * FT_VALIDATE_PARANOID ::
/* Only for font debugging. Checks that a table follows the */ * Only for font debugging. Checks that a table follows the
/* specification by 100%. Very few fonts will be able to pass this */ * specification by 100%. Very few fonts will be able to pass this level
/* level anyway but it can be useful for certain tools like font */ * anyway but it can be useful for certain tools like font
/* editors/converters. */ * editors/converters.
/* */ */
typedef enum FT_ValidationLevel_ typedef enum FT_ValidationLevel_
{ {
FT_VALIDATE_DEFAULT = 0, FT_VALIDATE_DEFAULT = 0,

View file

@ -1,31 +1,30 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* internal.h */ * internal.h
/* */ *
/* Internal header files (specification only). */ * Internal header files (specification only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* This file is automatically included by `ft2build.h'. */ * This file is automatically included by `ft2build.h`. Do not include it
/* Do not include it manually! */ * manually!
/* */ *
/*************************************************************************/ */
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> #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_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> #define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> #define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* psaux.h */ * psaux.h
/* */ *
/* Auxiliary functions and data structures related to PostScript fonts */ * Auxiliary functions and data structures related to PostScript fonts
/* (specification). */ * (specification).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef PSAUX_H_ #ifndef PSAUX_H_
@ -35,10 +35,10 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/***********************************************************************/ /**************************************************************************
/* */ *
/* PostScript modules driver class. */ * PostScript modules driver class.
/* */ */
typedef struct PS_DriverRec_ typedef struct PS_DriverRec_
{ {
FT_DriverRec root; FT_DriverRec root;
@ -64,23 +64,27 @@ FT_BEGIN_HEADER
typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs; typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* PS_Table_FuncsRec */ * PS_Table_FuncsRec
/* */ *
/* <Description> */ * @description:
/* A set of function pointers to manage PS_Table objects. */ * A set of function pointers to manage PS_Table objects.
/* */ *
/* <Fields> */ * @fields:
/* table_init :: Used to initialize a table. */ * table_init ::
/* */ * Used to initialize a table.
/* table_done :: Finalizes resp. destroy a given table. */ *
/* */ * table_done ::
/* table_add :: Adds a new object to a table. */ * Finalizes resp. destroy a given table.
/* */ *
/* table_release :: Releases table data, then finalizes it. */ * table_add ::
/* */ * Adds a new object to a table.
*
* table_release ::
* Releases table data, then finalizes it.
*/
typedef struct PS_Table_FuncsRec_ typedef struct PS_Table_FuncsRec_
{ {
FT_Error FT_Error
@ -103,41 +107,47 @@ FT_BEGIN_HEADER
} PS_Table_FuncsRec; } PS_Table_FuncsRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* PS_TableRec */ * PS_TableRec
/* */ *
/* <Description> */ * @description:
/* A PS_Table is a simple object used to store an array of objects in */ * A PS_Table is a simple object used to store an array of objects in a
/* a single memory block. */ * single memory block.
/* */ *
/* <Fields> */ * @fields:
/* block :: The address in memory of the growheap's block. This */ * block ::
/* can change between two object adds, due to */ * The address in memory of the growheap's block. This can change
/* reallocation. */ * between two object adds, due to reallocation.
/* */ *
/* cursor :: The current top of the grow heap within its block. */ * cursor ::
/* */ * The current top of the grow heap within its block.
/* capacity :: The current size of the heap block. Increments by */ *
/* 1kByte chunks. */ * capacity ::
/* */ * The current size of the heap block. Increments by 1kByte chunks.
/* init :: Set to 0xDEADBEEF if `elements' and `lengths' have */ *
/* been allocated. */ * init ::
/* */ * Set to 0xDEADBEEF if 'elements' and 'lengths' have been allocated.
/* max_elems :: The maximum number of elements in table. */ *
/* */ * max_elems ::
/* num_elems :: The current number of elements in table. */ * The maximum number of elements in table.
/* */ *
/* elements :: A table of element addresses within the block. */ * num_elems ::
/* */ * The current number of elements in table.
/* lengths :: A table of element sizes within the block. */ *
/* */ * elements ::
/* memory :: The object used for memory operations */ * A table of element addresses within the block.
/* (alloc/realloc). */ *
/* */ * lengths ::
/* funcs :: A table of method pointers for this object. */ * 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.
*/
typedef struct PS_TableRec_ typedef struct PS_TableRec_
{ {
FT_Byte* block; /* current memory block */ FT_Byte* block; /* current memory block */
@ -425,27 +435,33 @@ FT_BEGIN_HEADER
} PS_Parser_FuncsRec; } PS_Parser_FuncsRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* PS_ParserRec */ * PS_ParserRec
/* */ *
/* <Description> */ * @description:
/* A PS_Parser is an object used to parse a Type 1 font very quickly. */ * A PS_Parser is an object used to parse a Type 1 font very quickly.
/* */ *
/* <Fields> */ * @fields:
/* cursor :: The current position in the text. */ * cursor ::
/* */ * The current position in the text.
/* base :: Start of the processed text. */ *
/* */ * base ::
/* limit :: End of the processed text. */ * Start of the processed text.
/* */ *
/* error :: The last error returned. */ * limit ::
/* */ * End of the processed text.
/* memory :: The object used for memory operations (alloc/realloc). */ *
/* */ * error ::
/* funcs :: A table of functions for the parser. */ * The last error returned.
/* */ *
* memory ::
* The object used for memory operations (alloc/realloc).
*
* funcs ::
* A table of functions for the parser.
*/
typedef struct PS_ParserRec_ typedef struct PS_ParserRec_
{ {
FT_Byte* cursor; FT_Byte* cursor;
@ -484,51 +500,67 @@ FT_BEGIN_HEADER
} PS_Builder_FuncsRec; } PS_Builder_FuncsRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Structure> */ * @struct:
/* PS_Builder */ * PS_Builder
/* */ *
/* <Description> */ * @description:
/* A structure used during glyph loading to store its outline. */ * A structure used during glyph loading to store its outline.
/* */ *
/* <Fields> */ * @fields:
/* memory :: The current memory object. */ * memory ::
/* */ * The current memory object.
/* face :: The current face object. */ *
/* */ * face ::
/* glyph :: The current glyph slot. */ * The current face object.
/* */ *
/* loader :: XXX */ * glyph ::
/* */ * The current glyph slot.
/* base :: The base glyph outline. */ *
/* */ * loader ::
/* current :: The current glyph outline. */ * XXX
/* */ *
/* pos_x :: The horizontal translation (if composite glyph). */ * base ::
/* */ * The base glyph outline.
/* pos_y :: The vertical translation (if composite glyph). */ *
/* */ * current ::
/* left_bearing :: The left side bearing point. */ * The current glyph outline.
/* */ *
/* advance :: The horizontal advance vector. */ * pos_x ::
/* */ * The horizontal translation (if composite glyph).
/* bbox :: Unused. */ *
/* */ * pos_y ::
/* path_begun :: A flag which indicates that a new path has begun. */ * The vertical translation (if composite glyph).
/* */ *
/* load_points :: If this flag is not set, no points are loaded. */ * left_bearing ::
/* */ * The left side bearing point.
/* no_recurse :: Set but not used. */ *
/* */ * advance ::
/* metrics_only :: A boolean indicating that we only want to compute */ * The horizontal advance vector.
/* the metrics of a given glyph, not load all of its */ *
/* points. */ * bbox ::
/* */ * Unused.
/* is_t1 :: Set if current font type is Type 1. */ *
/* */ * path_begun ::
/* funcs :: An array of function pointers for the builder. */ * 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.
*/
struct PS_Builder_ struct PS_Builder_
{ {
FT_Memory memory; FT_Memory memory;
@ -729,54 +761,70 @@ FT_BEGIN_HEADER
} T1_ParseState; } T1_ParseState;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Structure> */ * @struct:
/* T1_BuilderRec */ * T1_BuilderRec
/* */ *
/* <Description> */ * @description:
/* A structure used during glyph loading to store its outline. */ * A structure used during glyph loading to store its outline.
/* */ *
/* <Fields> */ * @fields:
/* memory :: The current memory object. */ * memory ::
/* */ * The current memory object.
/* face :: The current face object. */ *
/* */ * face ::
/* glyph :: The current glyph slot. */ * The current face object.
/* */ *
/* loader :: XXX */ * glyph ::
/* */ * The current glyph slot.
/* base :: The base glyph outline. */ *
/* */ * loader ::
/* current :: The current glyph outline. */ * XXX
/* */ *
/* max_points :: maximum points in builder outline */ * base ::
/* */ * The base glyph outline.
/* max_contours :: Maximum number of contours in builder outline. */ *
/* */ * current ::
/* pos_x :: The horizontal translation (if composite glyph). */ * The current glyph outline.
/* */ *
/* pos_y :: The vertical translation (if composite glyph). */ * max_points ::
/* */ * maximum points in builder outline
/* left_bearing :: The left side bearing point. */ *
/* */ * max_contours ::
/* advance :: The horizontal advance vector. */ * Maximum number of contours in builder outline.
/* */ *
/* bbox :: Unused. */ * pos_x ::
/* */ * The horizontal translation (if composite glyph).
/* parse_state :: An enumeration which controls the charstring */ *
/* parsing state. */ * pos_y ::
/* */ * The vertical translation (if composite glyph).
/* load_points :: If this flag is not set, no points are loaded. */ *
/* */ * left_bearing ::
/* no_recurse :: Set but not used. */ * The left side bearing point.
/* */ *
/* metrics_only :: A boolean indicating that we only want to compute */ * advance ::
/* the metrics of a given glyph, not load all of its */ * The horizontal advance vector.
/* points. */ *
/* */ * bbox ::
/* funcs :: An array of function pointers for the builder. */ * Unused.
/* */ *
* parse_state ::
* An enumeration which controls the charstring parsing state.
*
* 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.
*
* funcs ::
* An array of function pointers for the builder.
*/
typedef struct T1_BuilderRec_ typedef struct T1_BuilderRec_
{ {
FT_Memory memory; FT_Memory memory;
@ -817,19 +865,19 @@ FT_BEGIN_HEADER
#if 0 #if 0
/*************************************************************************/ /**************************************************************************
/* */ *
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ * T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine
/* calls during glyph loading. */ * calls during glyph loading.
/* */ */
#define T1_MAX_SUBRS_CALLS 8 #define T1_MAX_SUBRS_CALLS 8
/*************************************************************************/ /**************************************************************************
/* */ *
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ * T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A
/* minimum of 16 is required. */ * minimum of 16 is required.
/* */ */
#define T1_MAX_CHARSTRINGS_OPERANDS 32 #define T1_MAX_CHARSTRINGS_OPERANDS 32
#endif /* 0 */ #endif /* 0 */
@ -993,53 +1041,70 @@ FT_BEGIN_HEADER
} CFF_Builder_FuncsRec; } CFF_Builder_FuncsRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Structure> */ * @struct:
/* CFF_Builder */ * CFF_Builder
/* */ *
/* <Description> */ * @description:
/* A structure used during glyph loading to store its outline. */ * A structure used during glyph loading to store its outline.
/* */ *
/* <Fields> */ * @fields:
/* memory :: The current memory object. */ * memory ::
/* */ * The current memory object.
/* face :: The current face object. */ *
/* */ * face ::
/* glyph :: The current glyph slot. */ * The current face object.
/* */ *
/* loader :: The current glyph loader. */ * glyph ::
/* */ * The current glyph slot.
/* base :: The base glyph outline. */ *
/* */ * loader ::
/* current :: The current glyph outline. */ * The current glyph loader.
/* */ *
/* pos_x :: The horizontal translation (if composite glyph). */ * base ::
/* */ * The base glyph outline.
/* pos_y :: The vertical translation (if composite glyph). */ *
/* */ * current ::
/* left_bearing :: The left side bearing point. */ * The current glyph outline.
/* */ *
/* advance :: The horizontal advance vector. */ * pos_x ::
/* */ * The horizontal translation (if composite glyph).
/* bbox :: Unused. */ *
/* */ * pos_y ::
/* path_begun :: A flag which indicates that a new path has begun. */ * The vertical translation (if composite glyph).
/* */ *
/* load_points :: If this flag is not set, no points are loaded. */ * left_bearing ::
/* */ * The left side bearing point.
/* no_recurse :: Set but not used. */ *
/* */ * advance ::
/* metrics_only :: A boolean indicating that we only want to compute */ * The horizontal advance vector.
/* the metrics of a given glyph, not load all of its */ *
/* points. */ * bbox ::
/* */ * Unused.
/* hints_funcs :: Auxiliary pointer for hinting. */ *
/* */ * path_begun ::
/* hints_globals :: Auxiliary pointer for hinting. */ * A flag which indicates that a new path has begun.
/* */ *
/* funcs :: A table of method pointers for this object. */ * 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.
*
* hints_funcs ::
* Auxiliary pointer for hinting.
*
* hints_globals ::
* Auxiliary pointer for hinting.
*
* funcs ::
* A table of method pointers for this object.
*/
struct CFF_Builder_ struct CFF_Builder_
{ {
FT_Memory memory; FT_Memory memory;
@ -1211,25 +1276,27 @@ FT_BEGIN_HEADER
typedef struct AFM_StreamRec_* AFM_Stream; typedef struct AFM_StreamRec_* AFM_Stream;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* AFM_ParserRec */ * AFM_ParserRec
/* */ *
/* <Description> */ * @description:
/* An AFM_Parser is a parser for the AFM files. */ * An AFM_Parser is a parser for the AFM files.
/* */ *
/* <Fields> */ * @fields:
/* memory :: The object used for memory operations (alloc and */ * memory ::
/* realloc). */ * The object used for memory operations (alloc and realloc).
/* */ *
/* stream :: This is an opaque object. */ * stream ::
/* */ * This is an opaque object.
/* FontInfo :: The result will be stored here. */ *
/* */ * FontInfo ::
/* get_index :: A user provided function to get a glyph index by its */ * The result will be stored here.
/* name. */ *
/* */ * get_index ::
* A user provided function to get a glyph index by its name.
*/
typedef struct AFM_ParserRec_ typedef struct AFM_ParserRec_
{ {
FT_Memory memory; FT_Memory memory;

View file

@ -1,21 +1,21 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* pshints.h */ * pshints.h
/* */ *
/* Interface to Postscript-specific (Type 1 and Type 2) hints */ * Interface to Postscript-specific (Type 1 and Type 2) hints
/* recorders (specification only). These are used to support native */ * recorders (specification only). These are used to support native
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */ * T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
/* */ *
/* Copyright 2001-2018 by */ * Copyright (C) 2001-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef PSHINTS_H_ #ifndef PSHINTS_H_
@ -73,7 +73,7 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* T1_Hints * T1_Hints
@ -86,16 +86,16 @@ FT_BEGIN_HEADER
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally * @T1_Hints_FuncsRec structure. Recording glyph hints is normally
* achieved through the following scheme: * 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. * This rewinds the recorder and prepare it for new input.
* *
* - For each hint found in the glyph charstring, call the corresponding * - 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. * not return an error code.
* *
* - Close the recording session by calling the `close' method. It * - Close the recording session by calling the 'close' method. It
* returns an error code if the hints were invalid or something * returns an error code if the hints were invalid or something strange
* strange happened (e.g., memory shortage). * happened (e.g., memory shortage).
* *
* The hints accumulated in the object can later be used by the * The hints accumulated in the object can later be used by the
* PostScript hinter. * PostScript hinter.
@ -104,7 +104,7 @@ FT_BEGIN_HEADER
typedef struct T1_HintsRec_* T1_Hints; typedef struct T1_HintsRec_* T1_Hints;
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* T1_Hints_Funcs * T1_Hints_Funcs
@ -117,7 +117,7 @@ FT_BEGIN_HEADER
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs; typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T1_Hints_OpenFunc * T1_Hints_OpenFunc
@ -139,14 +139,14 @@ FT_BEGIN_HEADER
(*T1_Hints_OpenFunc)( T1_Hints hints ); (*T1_Hints_OpenFunc)( T1_Hints hints );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T1_Hints_SetStemFunc * T1_Hints_SetStemFunc
* *
* @description: * @description:
* A method of the @T1_Hints class used to record a new horizontal or * 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. * operators.
* *
* @input: * @input:
@ -164,15 +164,15 @@ FT_BEGIN_HEADER
* Use vertical coordinates (y) for horizontal stems (dim=0). Use * Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1). * horizontal coordinates (x) for vertical stems (dim=1).
* *
* `coords[0]' is the absolute stem position (lowest coordinate); * 'coords[0]' is the absolute stem position (lowest coordinate);
* `coords[1]' is the length. * 'coords[1]' is the length.
* *
* The length can be negative, in which case it must be either -20 or * 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. * specification.
* *
* If the length is -21 (corresponding to a bottom ghost stem), then * If the length is -21 (corresponding to a bottom ghost stem), then the
* the real stem position is `coords[0]+coords[1]'. * real stem position is 'coords[0]+coords[1]'.
* *
*/ */
typedef void typedef void
@ -181,7 +181,7 @@ FT_BEGIN_HEADER
FT_Fixed* coords ); FT_Fixed* coords );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T1_Hints_SetStem3Func * T1_Hints_SetStem3Func
@ -215,7 +215,7 @@ FT_BEGIN_HEADER
FT_Fixed* coords ); FT_Fixed* coords );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T1_Hints_ResetFunc * T1_Hints_ResetFunc
@ -238,7 +238,7 @@ FT_BEGIN_HEADER
FT_UInt end_point ); FT_UInt end_point );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T1_Hints_CloseFunc * T1_Hints_CloseFunc
@ -267,7 +267,7 @@ FT_BEGIN_HEADER
FT_UInt end_point ); FT_UInt end_point );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T1_Hints_ApplyFunc * T1_Hints_ApplyFunc
@ -297,7 +297,7 @@ FT_BEGIN_HEADER
* On input, all points within the outline are in font coordinates. On * On input, all points within the outline are in font coordinates. On
* output, they are in 1/64th of pixels. * 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. * must correspond to the same font as the glyph.
* *
*/ */
@ -308,7 +308,7 @@ FT_BEGIN_HEADER
FT_Render_Mode hint_mode ); FT_Render_Mode hint_mode );
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* T1_Hints_FuncsRec * T1_Hints_FuncsRec
@ -360,7 +360,7 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* T2_Hints * T2_Hints
@ -373,16 +373,16 @@ FT_BEGIN_HEADER
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally * @T2_Hints_FuncsRec structure. Recording glyph hints is normally
* achieved through the following scheme: * 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. * This rewinds the recorder and prepare it for new input.
* *
* - For each hint found in the glyph charstring, call the corresponding * - For each hint found in the glyph charstring, call the corresponding
* method (`stems', `hintmask', `counters'). Note that these * method ('stems', 'hintmask', 'counters'). Note that these functions
* functions do not return an error code. * do not return an error code.
* *
* - Close the recording session by calling the `close' method. It * - Close the recording session by calling the 'close' method. It
* returns an error code if the hints were invalid or something * returns an error code if the hints were invalid or something strange
* strange happened (e.g., memory shortage). * happened (e.g., memory shortage).
* *
* The hints accumulated in the object can later be used by the * The hints accumulated in the object can later be used by the
* Postscript hinter. * Postscript hinter.
@ -391,7 +391,7 @@ FT_BEGIN_HEADER
typedef struct T2_HintsRec_* T2_Hints; typedef struct T2_HintsRec_* T2_Hints;
/************************************************************************* /**************************************************************************
* *
* @type: * @type:
* T2_Hints_Funcs * T2_Hints_Funcs
@ -404,7 +404,7 @@ FT_BEGIN_HEADER
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs; typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T2_Hints_OpenFunc * T2_Hints_OpenFunc
@ -426,7 +426,7 @@ FT_BEGIN_HEADER
(*T2_Hints_OpenFunc)( T2_Hints hints ); (*T2_Hints_OpenFunc)( T2_Hints hints );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T2_Hints_StemsFunc * T2_Hints_StemsFunc
@ -434,7 +434,7 @@ FT_BEGIN_HEADER
* @description: * @description:
* A method of the @T2_Hints class used to set the table of stems in * A method of the @T2_Hints class used to set the table of stems in
* either the vertical or horizontal dimension. Equivalent to the * 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.
* *
* @input: * @input:
* hints :: * hints ::
@ -447,18 +447,18 @@ FT_BEGIN_HEADER
* The number of stems. * The number of stems.
* *
* coords :: * coords ::
* An array of `count' (position,length) pairs in 16.16 format. * An array of 'count' (position,length) pairs in 16.16 format.
* *
* @note: * @note:
* Use vertical coordinates (y) for horizontal stems (dim=0). Use * Use vertical coordinates (y) for horizontal stems (dim=0). Use
* horizontal coordinates (x) for vertical stems (dim=1). * horizontal coordinates (x) for vertical stems (dim=1).
* *
* There are `2*count' elements in the `coords' array. Each even * There are '2*count' elements in the 'coords' array. Each even element
* element is an absolute position in font units, each odd element is a * is an absolute position in font units, each odd element is a length in
* length in font units. * 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.
* -21. It is interpreted as a `ghost' stem, according to the Type 1 * It is interpreted as a 'ghost' stem, according to the Type 1
* specification. * specification.
* *
*/ */
@ -469,22 +469,22 @@ FT_BEGIN_HEADER
FT_Fixed* coordinates ); FT_Fixed* coordinates );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T2_Hints_MaskFunc * T2_Hints_MaskFunc
* *
* @description: * @description:
* A method of the @T2_Hints class used to set a given hintmask (this * 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).
* *
* @input: * @input:
* hints :: * hints ::
* A handle to the Type 2 hints recorder. * A handle to the Type 2 hints recorder.
* *
* end_point :: * end_point ::
* The glyph index of the last point to which the previously defined * The glyph index of the last point to which the previously defined or
* or activated hints apply. * activated hints apply.
* *
* bit_count :: * bit_count ::
* The number of bits in the hint mask. * The number of bits in the hint mask.
@ -494,13 +494,13 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* If the hintmask starts the charstring (before any glyph point * 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., * must be equal to the total number of hints defined so far (i.e.,
* horizontal+verticals). * 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. * respects the same format.
* *
*/ */
@ -511,14 +511,14 @@ FT_BEGIN_HEADER
const FT_Byte* bytes ); const FT_Byte* bytes );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T2_Hints_CounterFunc * T2_Hints_CounterFunc
* *
* @description: * @description:
* A method of the @T2_Hints class used to set a given counter mask * A method of the @T2_Hints class used to set a given counter mask (this
* (this corresponds to the `hintmask' Type 2 operator). * corresponds to the 'hintmask' Type 2 operator).
* *
* @input: * @input:
* hints :: * hints ::
@ -536,13 +536,13 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* If the hintmask starts the charstring (before any glyph point * 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., * must be equal to the total number of hints defined so far (i.e.,
* horizontal+verticals). * 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. * respects the same format.
* *
*/ */
@ -552,7 +552,7 @@ FT_BEGIN_HEADER
const FT_Byte* bytes ); const FT_Byte* bytes );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T2_Hints_CloseFunc * T2_Hints_CloseFunc
@ -581,15 +581,14 @@ FT_BEGIN_HEADER
FT_UInt end_point ); FT_UInt end_point );
/************************************************************************* /**************************************************************************
* *
* @functype: * @functype:
* T2_Hints_ApplyFunc * T2_Hints_ApplyFunc
* *
* @description: * @description:
* A method of the @T2_Hints class used to apply hints to the * A method of the @T2_Hints class used to apply hints to the
* corresponding glyph outline. Must be called after the `close' * corresponding glyph outline. Must be called after the 'close' method.
* method.
* *
* @input: * @input:
* hints :: * hints ::
@ -611,7 +610,7 @@ FT_BEGIN_HEADER
* On input, all points within the outline are in font coordinates. On * On input, all points within the outline are in font coordinates. On
* output, they are in 1/64th of pixels. * 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 than the glyph. * must correspond to the same font than the glyph.
* *
*/ */
@ -622,7 +621,7 @@ FT_BEGIN_HEADER
FT_Render_Mode hint_mode ); FT_Render_Mode hint_mode );
/************************************************************************* /**************************************************************************
* *
* @struct: * @struct:
* T2_Hints_FuncsRec * T2_Hints_FuncsRec
@ -680,8 +679,6 @@ FT_BEGIN_HEADER
typedef PSHinter_Interface* PSHinter_Service; typedef PSHinter_Interface* PSHinter_Service;
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_PSHINTER_INTERFACE( \ #define FT_DEFINE_PSHINTER_INTERFACE( \
class_, \ class_, \
get_globals_funcs_, \ get_globals_funcs_, \
@ -694,25 +691,6 @@ FT_BEGIN_HEADER
get_t2_funcs_ \ get_t2_funcs_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_PSHINTER_INTERFACE( \
class_, \
get_globals_funcs_, \
get_t1_funcs_, \
get_t2_funcs_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
PSHinter_Interface* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_globals_funcs = get_globals_funcs_; \
clazz->get_t1_funcs = get_t1_funcs_; \
clazz->get_t2_funcs = get_t2_funcs_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER FT_END_HEADER

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svbdf.h */ * svbdf.h
/* */ *
/* The FreeType BDF services (specification). */ * The FreeType BDF services (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVBDF_H_ #ifndef SVBDF_H_
@ -46,8 +46,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_BDFRec( class_, \ #define FT_DEFINE_SERVICE_BDFRec( class_, \
get_charset_id_, \ get_charset_id_, \
get_property_ ) \ get_property_ ) \
@ -56,20 +54,6 @@ FT_BEGIN_HEADER
get_charset_id_, get_property_ \ get_charset_id_, get_property_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_BDFRec( class_, \
get_charset_id_, \
get_property_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_BDFRec* clazz ) \
{ \
clazz->get_charset_id = get_charset_id_; \
clazz->get_property = get_property_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svcfftl.h */ * svcfftl.h
/* */ *
/* The FreeType CFF tables loader service (specification). */ * The FreeType CFF tables loader service (specification).
/* */ *
/* Copyright 2017-2018 by */ * Copyright (C) 2017-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVCFFTL_H_ #ifndef SVCFFTL_H_
@ -65,8 +65,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \ #define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \ get_standard_encoding_, \
load_private_dict_, \ load_private_dict_, \
@ -82,26 +80,6 @@ FT_BEGIN_HEADER
blend_build_vector_ \ blend_build_vector_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
fd_select_get_, \
blend_check_vector_, \
blend_build_vector_ ) \
void \
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_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER FT_END_HEADER

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svcid.h */ * svcid.h
/* */ *
/* The FreeType CID font services (specification). */ * The FreeType CID font services (specification).
/* */ *
/* Copyright 2007-2018 by */ * Copyright (C) 2007-2019 by
/* Derek Clegg and Michael Toftdal. */ * Derek Clegg and Michael Toftdal.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVCID_H_ #ifndef SVCID_H_
@ -48,8 +48,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CIDREC( class_, \ #define FT_DEFINE_SERVICE_CIDREC( class_, \
get_ros_, \ get_ros_, \
get_is_cid_, \ get_is_cid_, \
@ -59,25 +57,6 @@ FT_BEGIN_HEADER
get_ros_, get_is_cid_, get_cid_from_glyph_index_ \ get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CIDREC( class_, \
get_ros_, \
get_is_cid_, \
get_cid_from_glyph_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_CIDRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_ros = get_ros_; \
clazz->get_is_cid = get_is_cid_; \
clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svfntfmt.h */ * svfntfmt.h
/* */ *
/* The FreeType font format service (specification only). */ * The FreeType font format service (specification only).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVFNTFMT_H_ #ifndef SVFNTFMT_H_
@ -27,8 +27,8 @@ FT_BEGIN_HEADER
/* /*
* A trivial service used to return the name of a face's font driver, * A trivial service used to return the name of a face's font driver,
* according to the XFree86 nomenclature. Note that the service data * according to the XFree86 nomenclature. Note that the service data is a
* is a simple constant string pointer. * simple constant string pointer.
*/ */
#define FT_SERVICE_ID_FONT_FORMAT "font-format" #define FT_SERVICE_ID_FONT_FORMAT "font-format"

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svgldict.h */ * svgldict.h
/* */ *
/* The FreeType glyph dictionary services (specification). */ * The FreeType glyph dictionary services (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVGLDICT_H_ #ifndef SVGLDICT_H_
@ -26,8 +26,8 @@ FT_BEGIN_HEADER
/* /*
* A service used to retrieve glyph names, as well as to find the * A service used to retrieve glyph names, as well as to find the index of
* index of a given glyph name in a font. * a given glyph name in a font.
* *
*/ */
@ -52,8 +52,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \ #define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \ get_name_, \
name_index_ ) \ name_index_ ) \
@ -62,23 +60,6 @@ FT_BEGIN_HEADER
get_name_, name_index_ \ get_name_, name_index_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_GlyphDictRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_name = get_name_; \
clazz->name_index = name_index_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,28 +1,28 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svgxval.h */ * svgxval.h
/* */ *
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ * FreeType API for validating TrueTypeGX/AAT tables (specification).
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* Masatake YAMATO, Red Hat K.K., */ * Masatake YAMATO, Red Hat K.K.,
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/***************************************************************************/ /****************************************************************************
/* */ *
/* gxvalid is derived from both gxlayout module and otvalid module. */ * gxvalid is derived from both gxlayout module and otvalid module.
/* Development of gxlayout is supported by the Information-technology */ * Development of gxlayout is supported by the Information-technology
/* Promotion Agency(IPA), Japan. */ * Promotion Agency(IPA), Japan.
/* */ *
/***************************************************************************/ */
#ifndef SVGXVAL_H_ #ifndef SVGXVAL_H_

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svkern.h */ * svkern.h
/* */ *
/* The FreeType Kerning service (specification). */ * The FreeType Kerning service (specification).
/* */ *
/* Copyright 2006-2018 by */ * Copyright (C) 2006-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVKERN_H_ #ifndef SVKERN_H_

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svmetric.h */ * svmetric.h
/* */ *
/* The FreeType services for metrics variations (specification). */ * The FreeType services for metrics variations (specification).
/* */ *
/* Copyright 2016-2018 by */ * Copyright (C) 2016-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVMETRIC_H_ #ifndef SVMETRIC_H_
@ -93,8 +93,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \ #define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \ hadvance_adjust_, \
lsb_adjust_, \ lsb_adjust_, \
@ -116,32 +114,6 @@ FT_BEGIN_HEADER
metrics_adjust_ \ metrics_adjust_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
rsb_adjust_, \
vadvance_adjust_, \
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
metrics_adjust_ ) \
void \
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_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svmm.h */ * svmm.h
/* */ *
/* The FreeType Multiple Masters and GX var services (specification). */ * The FreeType Multiple Masters and GX var services (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVMM_H_ #ifndef SVMM_H_
@ -86,6 +86,16 @@ FT_BEGIN_HEADER
typedef void typedef void
(*FT_Done_Blend_Func)( FT_Face ); (*FT_Done_Blend_Func)( FT_Face );
typedef FT_Error
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
FT_UInt len,
FT_Fixed* weight_vector );
typedef FT_Error
(*FT_Get_MM_WeightVector_Func)( FT_Face face,
FT_UInt* len,
FT_Fixed* weight_vector );
FT_DEFINE_SERVICE( MultiMasters ) FT_DEFINE_SERVICE( MultiMasters )
{ {
@ -97,6 +107,8 @@ FT_BEGIN_HEADER
FT_Set_Var_Design_Func set_var_design; FT_Set_Var_Design_Func set_var_design;
FT_Get_Var_Design_Func get_var_design; FT_Get_Var_Design_Func get_var_design;
FT_Set_Instance_Func set_instance; 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 */ /* for internal use; only needed for code sharing between modules */
FT_Get_Var_Blend_Func get_var_blend; FT_Get_Var_Blend_Func get_var_blend;
@ -104,8 +116,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \ #define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \ get_mm_, \
set_mm_design_, \ set_mm_design_, \
@ -115,6 +125,8 @@ FT_BEGIN_HEADER
set_var_design_, \ set_var_design_, \
get_var_design_, \ get_var_design_, \
set_instance_, \ set_instance_, \
set_weightvector_, \
get_weightvector_, \
get_var_blend_, \ get_var_blend_, \
done_blend_ ) \ done_blend_ ) \
static const FT_Service_MultiMastersRec class_ = \ static const FT_Service_MultiMastersRec class_ = \
@ -127,40 +139,12 @@ FT_BEGIN_HEADER
set_var_design_, \ set_var_design_, \
get_var_design_, \ get_var_design_, \
set_instance_, \ set_instance_, \
set_weightvector_, \
get_weightvector_, \
get_var_blend_, \ get_var_blend_, \
done_blend_ \ done_blend_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#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_ ) \
void \
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_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svotval.h */ * svotval.h
/* */ *
/* The FreeType OpenType validation service (specification). */ * The FreeType OpenType validation service (specification).
/* */ *
/* Copyright 2004-2018 by */ * Copyright (C) 2004-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVOTVAL_H_ #ifndef SVOTVAL_H_

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svpfr.h */ * svpfr.h
/* */ *
/* Internal PFR service functions (specification). */ * Internal PFR service functions (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVPFR_H_ #ifndef SVPFR_H_

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svpostnm.h */ * svpostnm.h
/* */ *
/* The FreeType PostScript name services (specification). */ * The FreeType PostScript name services (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVPOSTNM_H_ #ifndef SVPOSTNM_H_
@ -25,10 +25,10 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /*
* A trivial service used to retrieve the PostScript name of a given * A trivial service used to retrieve the PostScript name of a given font
* font when available. The `get_name' field should never be NULL. * when available. The `get_name' field should never be `NULL`.
* *
* The corresponding function can return NULL to indicate that the * The corresponding function can return `NULL` to indicate that the
* PostScript name is not available. * 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.
@ -47,28 +47,12 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \ #define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
static const FT_Service_PsFontNameRec class_ = \ static const FT_Service_PsFontNameRec class_ = \
{ \ { \
get_ps_font_name_ \ get_ps_font_name_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsFontNameRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_ps_font_name = get_ps_font_name_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svprop.h */ * svprop.h
/* */ *
/* The FreeType property service (specification). */ * The FreeType property service (specification).
/* */ *
/* Copyright 2012-2018 by */ * Copyright (C) 2012-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVPROP_H_ #ifndef SVPROP_H_
@ -45,8 +45,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \ #define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
set_property_, \ set_property_, \
get_property_ ) \ get_property_ ) \
@ -56,20 +54,6 @@ FT_BEGIN_HEADER
get_property_ \ get_property_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
set_property_, \
get_property_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_PropertiesRec* clazz ) \
{ \
clazz->set_property = set_property_; \
clazz->get_property = get_property_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svpscmap.h */ * svpscmap.h
/* */ *
/* The FreeType PostScript charmap service (specification). */ * The FreeType PostScript charmap service (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVPSCMAP_H_ #ifndef SVPSCMAP_H_
@ -35,21 +35,20 @@ FT_BEGIN_HEADER
(*PS_Unicode_ValueFunc)( const char* glyph_name ); (*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* typedef const char*
(*PS_Macintosh_NameFunc)( FT_UInt name_index ); (*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.
*/ */
typedef const char* typedef const char*
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index ); (*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
/* /*
* Simple unicode -> glyph index charmap built from font glyph names * Simple unicode -> glyph index charmap built from font glyph names table.
* table.
*/ */
typedef struct PS_UniMap_ typedef struct PS_UniMap_
{ {
@ -72,7 +71,7 @@ FT_BEGIN_HEADER
/* /*
* A function which returns a glyph name for a given index. Returns * A function which returns a glyph name for a given index. Returns
* NULL if invalid index. * `NULL` if invalid index.
*/ */
typedef const char* typedef const char*
(*PS_GetGlyphNameFunc)( FT_Pointer data, (*PS_GetGlyphNameFunc)( FT_Pointer data,
@ -118,8 +117,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \ #define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
unicode_value_, \ unicode_value_, \
unicodes_init_, \ unicodes_init_, \
@ -136,35 +133,6 @@ FT_BEGIN_HEADER
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \ adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#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_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsCMapsRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
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_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svpsinfo.h */ * svpsinfo.h
/* */ *
/* The FreeType PostScript info service (specification). */ * The FreeType PostScript info service (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVPSINFO_H_ #ifndef SVPSINFO_H_
@ -62,8 +62,6 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSINFOREC( class_, \ #define FT_DEFINE_SERVICE_PSINFOREC( class_, \
get_font_info_, \ get_font_info_, \
ps_get_font_extra_, \ ps_get_font_extra_, \
@ -76,29 +74,6 @@ FT_BEGIN_HEADER
get_font_private_, get_font_value_ \ get_font_private_, get_font_value_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
get_font_info_, \
ps_get_font_extra_, \
has_glyph_names_, \
get_font_private_, \
get_font_value_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_PsInfoRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
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_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svsfnt.h */ * svsfnt.h
/* */ *
/* The FreeType SFNT table loading service (specification). */ * The FreeType SFNT table loading service (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVSFNT_H_ #ifndef SVSFNT_H_
@ -70,27 +70,12 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \ #define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
static const FT_Service_SFNT_TableRec class_ = \ static const FT_Service_SFNT_TableRec class_ = \
{ \ { \
load_, get_, info_ \ load_, get_, info_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec* clazz ) \
{ \
clazz->load_table = load_; \
clazz->get_table = get_; \
clazz->table_info = info_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svttcmap.h */ * svttcmap.h
/* */ *
/* The FreeType TrueType/sfnt cmap extra information service. */ * The FreeType TrueType/sfnt cmap extra information service.
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* Masatake YAMATO, Redhat K.K., */ * Masatake YAMATO, Redhat K.K.,
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
/* Development of this service is support of /* Development of this service is support of
Information-technology Promotion Agency, Japan. */ Information-technology Promotion Agency, Japan. */
@ -32,29 +32,28 @@ FT_BEGIN_HEADER
#define FT_SERVICE_ID_TT_CMAP "tt-cmaps" #define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* TT_CMapInfo */ * TT_CMapInfo
/* */ *
/* <Description> */ * @description:
/* A structure used to store TrueType/sfnt specific cmap information */ * A structure used to store TrueType/sfnt specific cmap information
/* which is not covered by the generic @FT_CharMap structure. This */ * which is not covered by the generic @FT_CharMap structure. This
/* structure can be accessed with the @FT_Get_TT_CMap_Info function. */ * structure can be accessed with the @FT_Get_TT_CMap_Info function.
/* */ *
/* <Fields> */ * @fields:
/* language :: */ * language ::
/* The language ID used in Mac fonts. Definitions of values are in */ * The language ID used in Mac fonts. Definitions of values are in
/* `ttnameid.h'. */ * `ttnameid.h`.
/* */ *
/* format :: */ * format ::
/* The cmap format. OpenType 1.6 defines the formats 0 (byte */ * The cmap format. OpenType 1.6 defines the formats 0 (byte encoding
/* encoding table), 2~(high-byte mapping through table), 4~(segment */ * table), 2~(high-byte mapping through table), 4~(segment mapping to
/* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */ * delta values), 6~(trimmed table mapping), 8~(mixed 16-bit and 32-bit
/* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */ * coverage), 10~(trimmed array), 12~(segmented coverage), 13~(last
/* coverage), 13~(last resort font), and 14 (Unicode Variation */ * resort font), and 14 (Unicode Variation Sequences).
/* Sequences). */ */
/* */
typedef struct TT_CMapInfo_ typedef struct TT_CMapInfo_
{ {
FT_ULong language; FT_ULong language;
@ -73,7 +72,6 @@ FT_BEGIN_HEADER
TT_CMap_Info_GetFunc get_cmap_info; TT_CMap_Info_GetFunc get_cmap_info;
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \ #define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
static const FT_Service_TTCMapsRec class_ = \ static const FT_Service_TTCMapsRec class_ = \
@ -81,20 +79,6 @@ FT_BEGIN_HEADER
get_cmap_info_ \ get_cmap_info_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_TTCMapsRec* clazz ) \
{ \
FT_UNUSED( library ); \
\
clazz->get_cmap_info = get_cmap_info_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svtteng.h */ * svtteng.h
/* */ *
/* The FreeType TrueType engine query service (specification). */ * The FreeType TrueType engine query service (specification).
/* */ *
/* Copyright 2006-2018 by */ * Copyright (C) 2006-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVTTENG_H_ #ifndef SVTTENG_H_

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svttglyf.h */ * svttglyf.h
/* */ *
/* The FreeType TrueType glyph service. */ * The FreeType TrueType glyph service.
/* */ *
/* Copyright 2007-2018 by */ * Copyright (C) 2007-2019 by
/* David Turner. */ * David Turner.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVTTGLYF_H_ #ifndef SVTTGLYF_H_
#define SVTTGLYF_H_ #define SVTTGLYF_H_
@ -39,25 +39,12 @@ FT_BEGIN_HEADER
}; };
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \ #define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
static const FT_Service_TTGlyfRec class_ = \ static const FT_Service_TTGlyfRec class_ = \
{ \ { \
get_location_ \ get_location_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_TTGlyfRec* clazz ) \
{ \
clazz->get_location = get_location_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* svwinfnt.h */ * svwinfnt.h
/* */ *
/* The FreeType Windows FNT/FONT service (specification). */ * The FreeType Windows FNT/FONT service (specification).
/* */ *
/* Copyright 2003-2018 by */ * Copyright (C) 2003-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef SVWINFNT_H_ #ifndef SVWINFNT_H_

File diff suppressed because it is too large Load diff

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* t1types.h */ * t1types.h
/* */ *
/* Basic Type1/Type2 type definitions and interface (specification */ * Basic Type1/Type2 type definitions and interface (specification
/* only). */ * only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef T1TYPES_H_ #ifndef T1TYPES_H_
@ -45,28 +45,31 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* T1_EncodingRec */ * T1_EncodingRec
/* */ *
/* <Description> */ * @description:
/* A structure modeling a custom encoding. */ * A structure modeling a custom encoding.
/* */ *
/* <Fields> */ * @fields:
/* num_chars :: The number of character codes in the encoding. */ * num_chars ::
/* Usually 256. */ * The number of character codes in the encoding. Usually 256.
/* */ *
/* code_first :: The lowest valid character code in the encoding. */ * 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 */ * code_last ::
/* character codes. */ * 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_index ::
/* char_name :: An array of corresponding glyph names. */ * An array of corresponding glyph indices.
/* */ *
* char_name ::
* An array of corresponding glyph names.
*/
typedef struct T1_EncodingRecRec_ typedef struct T1_EncodingRecRec_
{ {
FT_Int num_chars; FT_Int num_chars;

File diff suppressed because it is too large Load diff

View file

@ -1,20 +1,20 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* t1tables.h */ * t1tables.h
/* */ *
/* Basic Type 1/Type 2 tables definitions and interface (specification */ * Basic Type 1/Type 2 tables definitions and interface (specification
/* only). */ * only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef T1TABLES_H_ #ifndef T1TABLES_H_
@ -34,58 +34,58 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* type1_tables */ * type1_tables
/* */ *
/* <Title> */ * @title:
/* Type 1 Tables */ * Type 1 Tables
/* */ *
/* <Abstract> */ * @abstract:
/* Type~1 (PostScript) specific font tables. */ * Type~1-specific font tables.
/* */ *
/* <Description> */ * @description:
/* This section contains the definition of Type 1-specific tables, */ * This section contains the definition of Type~1-specific tables,
/* including structures related to other PostScript font formats. */ * including structures related to other PostScript font formats.
/* */ *
/* <Order> */ * @order:
/* PS_FontInfoRec */ * PS_FontInfoRec
/* PS_FontInfo */ * PS_FontInfo
/* PS_PrivateRec */ * PS_PrivateRec
/* PS_Private */ * PS_Private
/* */ *
/* CID_FaceDictRec */ * CID_FaceDictRec
/* CID_FaceDict */ * CID_FaceDict
/* CID_FaceInfoRec */ * CID_FaceInfoRec
/* CID_FaceInfo */ * CID_FaceInfo
/* */ *
/* FT_Has_PS_Glyph_Names */ * FT_Has_PS_Glyph_Names
/* FT_Get_PS_Font_Info */ * FT_Get_PS_Font_Info
/* FT_Get_PS_Font_Private */ * FT_Get_PS_Font_Private
/* FT_Get_PS_Font_Value */ * FT_Get_PS_Font_Value
/* */ *
/* T1_Blend_Flags */ * T1_Blend_Flags
/* T1_EncodingType */ * T1_EncodingType
/* PS_Dict_Keys */ * PS_Dict_Keys
/* */ *
/*************************************************************************/ */
/* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */ /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
/* structures in order to support Multiple Master fonts. */ /* structures in order to support Multiple Master fonts. */
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* PS_FontInfoRec */ * PS_FontInfoRec
/* */ *
/* <Description> */ * @description:
/* A structure used to model a Type~1 or Type~2 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 */ * Note that for Multiple Master fonts, each instance has its own
/* FontInfo dictionary. */ * FontInfo dictionary.
/* */ */
typedef struct PS_FontInfoRec_ typedef struct PS_FontInfoRec_
{ {
FT_String* version; FT_String* version;
@ -101,40 +101,39 @@ FT_BEGIN_HEADER
} PS_FontInfoRec; } PS_FontInfoRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* PS_FontInfo */ * PS_FontInfo
/* */ *
/* <Description> */ * @description:
/* A handle to a @PS_FontInfoRec structure. */ * A handle to a @PS_FontInfoRec structure.
/* */ */
typedef struct PS_FontInfoRec_* PS_FontInfo; typedef struct PS_FontInfoRec_* PS_FontInfo;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* T1_FontInfo */ * T1_FontInfo
/* */ *
/* <Description> */ * @description:
/* This type is equivalent to @PS_FontInfoRec. It is deprecated but */ * This type is equivalent to @PS_FontInfoRec. It is deprecated but kept
/* kept to maintain source compatibility between various versions of */ * to maintain source compatibility between various versions of FreeType.
/* FreeType. */ */
/* */
typedef PS_FontInfoRec T1_FontInfo; typedef PS_FontInfoRec T1_FontInfo;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* PS_PrivateRec */ * PS_PrivateRec
/* */ *
/* <Description> */ * @description:
/* A structure used to model a Type~1 or Type~2 private dictionary. */ * A structure used to model a Type~1 or Type~2 private dictionary. Note
/* Note that for Multiple Master fonts, each instance has its own */ * that for Multiple Master fonts, each instance has its own Private
/* Private dictionary. */ * dictionary.
/* */ */
typedef struct PS_PrivateRec_ typedef struct PS_PrivateRec_
{ {
FT_Int unique_id; FT_Int unique_id;
@ -176,56 +175,55 @@ FT_BEGIN_HEADER
} PS_PrivateRec; } PS_PrivateRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* PS_Private */ * PS_Private
/* */ *
/* <Description> */ * @description:
/* A handle to a @PS_PrivateRec structure. */ * A handle to a @PS_PrivateRec structure.
/* */ */
typedef struct PS_PrivateRec_* PS_Private; typedef struct PS_PrivateRec_* PS_Private;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* T1_Private */ * T1_Private
/* */ *
/* <Description> */ * @description:
/* This type is equivalent to @PS_PrivateRec. It is deprecated but */ * This type is equivalent to @PS_PrivateRec. It is deprecated but kept
/* kept to maintain source compatibility between various versions of */ * to maintain source compatibility between various versions of FreeType.
/* FreeType. */ */
/* */
typedef PS_PrivateRec T1_Private; typedef PS_PrivateRec T1_Private;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Enum> */ * @enum:
/* T1_Blend_Flags */ * T1_Blend_Flags
/* */ *
/* <Description> */ * @description:
/* A set of flags used to indicate which fields are present in a */ * A set of flags used to indicate which fields are present in a given
/* given blend dictionary (font info or private). Used to support */ * blend dictionary (font info or private). Used to support Multiple
/* Multiple Masters fonts. */ * Masters fonts.
/* */ *
/* <Values> */ * @values:
/* T1_BLEND_UNDERLINE_POSITION :: */ * T1_BLEND_UNDERLINE_POSITION ::
/* T1_BLEND_UNDERLINE_THICKNESS :: */ * T1_BLEND_UNDERLINE_THICKNESS ::
/* T1_BLEND_ITALIC_ANGLE :: */ * T1_BLEND_ITALIC_ANGLE ::
/* T1_BLEND_BLUE_VALUES :: */ * T1_BLEND_BLUE_VALUES ::
/* T1_BLEND_OTHER_BLUES :: */ * T1_BLEND_OTHER_BLUES ::
/* T1_BLEND_STANDARD_WIDTH :: */ * T1_BLEND_STANDARD_WIDTH ::
/* T1_BLEND_STANDARD_HEIGHT :: */ * T1_BLEND_STANDARD_HEIGHT ::
/* T1_BLEND_STEM_SNAP_WIDTHS :: */ * T1_BLEND_STEM_SNAP_WIDTHS ::
/* T1_BLEND_STEM_SNAP_HEIGHTS :: */ * T1_BLEND_STEM_SNAP_HEIGHTS ::
/* T1_BLEND_BLUE_SCALE :: */ * T1_BLEND_BLUE_SCALE ::
/* T1_BLEND_BLUE_SHIFT :: */ * T1_BLEND_BLUE_SHIFT ::
/* T1_BLEND_FAMILY_BLUES :: */ * T1_BLEND_FAMILY_BLUES ::
/* T1_BLEND_FAMILY_OTHER_BLUES :: */ * T1_BLEND_FAMILY_OTHER_BLUES ::
/* T1_BLEND_FORCE_BOLD :: */ * T1_BLEND_FORCE_BOLD ::
/* */ */
typedef enum T1_Blend_Flags_ typedef enum T1_Blend_Flags_
{ {
/* required fields in a FontInfo blend dictionary */ /* required fields in a FontInfo blend dictionary */
@ -252,7 +250,7 @@ FT_BEGIN_HEADER
/* these constants are deprecated; use the corresponding */ /* 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_position T1_BLEND_UNDERLINE_POSITION
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
@ -330,14 +328,23 @@ FT_BEGIN_HEADER
typedef PS_BlendRec T1_Blend; typedef PS_BlendRec T1_Blend;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* CID_FaceDictRec */ * CID_FaceDictRec
/* */ *
/* <Description> */ * @description:
/* 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_ typedef struct CID_FaceDictRec_
{ {
PS_PrivateRec private_dict; PS_PrivateRec private_dict;
@ -345,8 +352,8 @@ FT_BEGIN_HEADER
FT_UInt len_buildchar; FT_UInt len_buildchar;
FT_Fixed forcebold_threshold; FT_Fixed forcebold_threshold;
FT_Pos stroke_width; 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 paint_type;
FT_Byte font_type; FT_Byte font_type;
FT_Matrix font_matrix; FT_Matrix font_matrix;
@ -359,38 +366,38 @@ FT_BEGIN_HEADER
} CID_FaceDictRec; } CID_FaceDictRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* CID_FaceDict */ * CID_FaceDict
/* */ *
/* <Description> */ * @description:
/* A handle to a @CID_FaceDictRec structure. */ * A handle to a @CID_FaceDictRec structure.
/* */ */
typedef struct CID_FaceDictRec_* CID_FaceDict; typedef struct CID_FaceDictRec_* CID_FaceDict;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* CID_FontDict */ * CID_FontDict
/* */ *
/* <Description> */ * @description:
/* This type is equivalent to @CID_FaceDictRec. It is deprecated but */ * This type is equivalent to @CID_FaceDictRec. It is deprecated but
/* kept to maintain source compatibility between various versions of */ * kept to maintain source compatibility between various versions of
/* FreeType. */ * FreeType.
/* */ */
typedef CID_FaceDictRec CID_FontDict; typedef CID_FaceDictRec CID_FontDict;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* CID_FaceInfoRec */ * CID_FaceInfoRec
/* */ *
/* <Description> */ * @description:
/* A structure used to represent CID Face information. */ * A structure used to represent CID Face information.
/* */ */
typedef struct CID_FaceInfoRec_ typedef struct CID_FaceInfoRec_
{ {
FT_String* cid_font_name; FT_String* cid_font_name;
@ -421,40 +428,38 @@ FT_BEGIN_HEADER
} CID_FaceInfoRec; } CID_FaceInfoRec;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* CID_FaceInfo */ * CID_FaceInfo
/* */ *
/* <Description> */ * @description:
/* A handle to a @CID_FaceInfoRec structure. */ * A handle to a @CID_FaceInfoRec structure.
/* */ */
typedef struct CID_FaceInfoRec_* CID_FaceInfo; typedef struct CID_FaceInfoRec_* CID_FaceInfo;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Struct> */ * @struct:
/* CID_Info */ * CID_Info
/* */ *
/* <Description> */ * @description:
/* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */ * This type is equivalent to @CID_FaceInfoRec. It is deprecated but kept
/* kept to maintain source compatibility between various versions of */ * to maintain source compatibility between various versions of FreeType.
/* FreeType. */ */
/* */
typedef CID_FaceInfoRec CID_Info; typedef CID_FaceInfoRec CID_Info;
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Has_PS_Glyph_Names * FT_Has_PS_Glyph_Names
* *
* @description: * @description:
* Return true if a given face provides reliable PostScript glyph * Return true if a given face provides reliable PostScript glyph names.
* names. This is similar to using the @FT_HAS_GLYPH_NAMES macro, * This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
* except that certain fonts (mostly TrueType) contain incorrect * certain fonts (mostly TrueType) contain incorrect glyph name tables.
* glyph name tables.
* *
* When this function returns true, the caller is sure that the glyph * When this function returns true, the caller is sure that the glyph
* names returned by @FT_Get_Glyph_Name are reliable. * names returned by @FT_Get_Glyph_Name are reliable.
@ -471,7 +476,7 @@ FT_BEGIN_HEADER
FT_Has_PS_Glyph_Names( FT_Face face ); FT_Has_PS_Glyph_Names( FT_Face face );
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Get_PS_Font_Info * FT_Get_PS_Font_Info
@ -492,12 +497,12 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* String pointers within the @PS_FontInfoRec structure are owned by * String pointers within the @PS_FontInfoRec structure are owned by the
* the face and don't need to be freed by the caller. Missing entries * face and don't need to be freed by the caller. Missing entries in
* in the font's FontInfo dictionary are represented by NULL pointers. * the font's FontInfo dictionary are represented by `NULL` pointers.
* *
* If the font's format is not PostScript-based, this function will * 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.
* *
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
@ -505,7 +510,7 @@ FT_BEGIN_HEADER
PS_FontInfo afont_info ); PS_FontInfo afont_info );
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Get_PS_Font_Private * FT_Get_PS_Font_Private
@ -530,7 +535,7 @@ FT_BEGIN_HEADER
* the face and don't need to be freed by the caller. * the face and don't need to be freed by the caller.
* *
* If the font's format is not PostScript-based, this function returns * 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.
* *
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
@ -538,25 +543,24 @@ FT_BEGIN_HEADER
PS_Private afont_private ); PS_Private afont_private );
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Enum> */ * @enum:
/* T1_EncodingType */ * T1_EncodingType
/* */ *
/* <Description> */ * @description:
/* An enumeration describing the `Encoding' entry in a Type 1 */ * An enumeration describing the 'Encoding' entry in a Type 1 dictionary.
/* dictionary. */ *
/* */ * @values:
/* <Values> */ * T1_ENCODING_TYPE_NONE ::
/* T1_ENCODING_TYPE_NONE :: */ * T1_ENCODING_TYPE_ARRAY ::
/* T1_ENCODING_TYPE_ARRAY :: */ * T1_ENCODING_TYPE_STANDARD ::
/* T1_ENCODING_TYPE_STANDARD :: */ * T1_ENCODING_TYPE_ISOLATIN1 ::
/* T1_ENCODING_TYPE_ISOLATIN1 :: */ * T1_ENCODING_TYPE_EXPERT ::
/* T1_ENCODING_TYPE_EXPERT :: */ *
/* */ * @since:
/* <Since> */ * 2.4.8
/* 2.4.8 */ */
/* */
typedef enum T1_EncodingType_ typedef enum T1_EncodingType_
{ {
T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_NONE = 0,
@ -568,66 +572,66 @@ FT_BEGIN_HEADER
} T1_EncodingType; } T1_EncodingType;
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Enum> */ * @enum:
/* PS_Dict_Keys */ * PS_Dict_Keys
/* */ *
/* <Description> */ * @description:
/* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */ * An enumeration used in calls to @FT_Get_PS_Font_Value to identify the
/* the Type~1 dictionary entry to retrieve. */ * Type~1 dictionary entry to retrieve.
/* */ *
/* <Values> */ * @values:
/* PS_DICT_FONT_TYPE :: */ * PS_DICT_FONT_TYPE ::
/* PS_DICT_FONT_MATRIX :: */ * PS_DICT_FONT_MATRIX ::
/* PS_DICT_FONT_BBOX :: */ * PS_DICT_FONT_BBOX ::
/* PS_DICT_PAINT_TYPE :: */ * PS_DICT_PAINT_TYPE ::
/* PS_DICT_FONT_NAME :: */ * PS_DICT_FONT_NAME ::
/* PS_DICT_UNIQUE_ID :: */ * PS_DICT_UNIQUE_ID ::
/* PS_DICT_NUM_CHAR_STRINGS :: */ * PS_DICT_NUM_CHAR_STRINGS ::
/* PS_DICT_CHAR_STRING_KEY :: */ * PS_DICT_CHAR_STRING_KEY ::
/* PS_DICT_CHAR_STRING :: */ * PS_DICT_CHAR_STRING ::
/* PS_DICT_ENCODING_TYPE :: */ * PS_DICT_ENCODING_TYPE ::
/* PS_DICT_ENCODING_ENTRY :: */ * PS_DICT_ENCODING_ENTRY ::
/* PS_DICT_NUM_SUBRS :: */ * PS_DICT_NUM_SUBRS ::
/* PS_DICT_SUBR :: */ * PS_DICT_SUBR ::
/* PS_DICT_STD_HW :: */ * PS_DICT_STD_HW ::
/* PS_DICT_STD_VW :: */ * PS_DICT_STD_VW ::
/* PS_DICT_NUM_BLUE_VALUES :: */ * PS_DICT_NUM_BLUE_VALUES ::
/* PS_DICT_BLUE_VALUE :: */ * PS_DICT_BLUE_VALUE ::
/* PS_DICT_BLUE_FUZZ :: */ * PS_DICT_BLUE_FUZZ ::
/* PS_DICT_NUM_OTHER_BLUES :: */ * PS_DICT_NUM_OTHER_BLUES ::
/* PS_DICT_OTHER_BLUE :: */ * PS_DICT_OTHER_BLUE ::
/* PS_DICT_NUM_FAMILY_BLUES :: */ * PS_DICT_NUM_FAMILY_BLUES ::
/* PS_DICT_FAMILY_BLUE :: */ * PS_DICT_FAMILY_BLUE ::
/* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */ * PS_DICT_NUM_FAMILY_OTHER_BLUES ::
/* PS_DICT_FAMILY_OTHER_BLUE :: */ * PS_DICT_FAMILY_OTHER_BLUE ::
/* PS_DICT_BLUE_SCALE :: */ * PS_DICT_BLUE_SCALE ::
/* PS_DICT_BLUE_SHIFT :: */ * PS_DICT_BLUE_SHIFT ::
/* PS_DICT_NUM_STEM_SNAP_H :: */ * PS_DICT_NUM_STEM_SNAP_H ::
/* PS_DICT_STEM_SNAP_H :: */ * PS_DICT_STEM_SNAP_H ::
/* PS_DICT_NUM_STEM_SNAP_V :: */ * PS_DICT_NUM_STEM_SNAP_V ::
/* PS_DICT_STEM_SNAP_V :: */ * PS_DICT_STEM_SNAP_V ::
/* PS_DICT_FORCE_BOLD :: */ * PS_DICT_FORCE_BOLD ::
/* PS_DICT_RND_STEM_UP :: */ * PS_DICT_RND_STEM_UP ::
/* PS_DICT_MIN_FEATURE :: */ * PS_DICT_MIN_FEATURE ::
/* PS_DICT_LEN_IV :: */ * PS_DICT_LEN_IV ::
/* PS_DICT_PASSWORD :: */ * PS_DICT_PASSWORD ::
/* PS_DICT_LANGUAGE_GROUP :: */ * PS_DICT_LANGUAGE_GROUP ::
/* PS_DICT_VERSION :: */ * PS_DICT_VERSION ::
/* PS_DICT_NOTICE :: */ * PS_DICT_NOTICE ::
/* PS_DICT_FULL_NAME :: */ * PS_DICT_FULL_NAME ::
/* PS_DICT_FAMILY_NAME :: */ * PS_DICT_FAMILY_NAME ::
/* PS_DICT_WEIGHT :: */ * PS_DICT_WEIGHT ::
/* PS_DICT_IS_FIXED_PITCH :: */ * PS_DICT_IS_FIXED_PITCH ::
/* PS_DICT_UNDERLINE_POSITION :: */ * PS_DICT_UNDERLINE_POSITION ::
/* PS_DICT_UNDERLINE_THICKNESS :: */ * PS_DICT_UNDERLINE_THICKNESS ::
/* PS_DICT_FS_TYPE :: */ * PS_DICT_FS_TYPE ::
/* PS_DICT_ITALIC_ANGLE :: */ * PS_DICT_ITALIC_ANGLE ::
/* */ *
/* <Since> */ * @since:
/* 2.4.8 */ * 2.4.8
/* */ */
typedef enum PS_Dict_Keys_ typedef enum PS_Dict_Keys_
{ {
/* conventionally in the font dictionary */ /* conventionally in the font dictionary */
@ -687,7 +691,7 @@ FT_BEGIN_HEADER
} PS_Dict_Keys; } PS_Dict_Keys;
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Get_PS_Font_Value * FT_Get_PS_Font_Value
@ -716,38 +720,38 @@ FT_BEGIN_HEADER
* The value matching the above key, if it exists. * The value matching the above key, if it exists.
* *
* @return: * @return:
* The amount of memory (in bytes) required to hold the requested * The amount of memory (in bytes) required to hold the requested value
* value (if it exists, -1 otherwise). * (if it exists, -1 otherwise).
* *
* @note: * @note:
* The values returned are not pointers into the internal structures of * 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 * 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. * 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. * 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. * 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 * example, the FontMatrix or FontBBox, but also to retrieve name keys
* from the CharStrings dictionary, and the charstrings themselves. It * from the CharStrings dictionary, and the charstrings themselves. It
* is ignored for atomic values. * is ignored for atomic values.
* *
* PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To * `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 * get the value as in the font stream, you need to divide by 65536000.0
* 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale). * (to remove the FT_Fixed scale, and the x1000 scale).
* *
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
* be retrieved. So, for example, PostScript procedures such as NP, * be retrieved. So, for example, PostScript procedures such as NP, ND,
* ND, and RD are not available. Arbitrary keys are, obviously, not be * and RD are not available. Arbitrary keys are, obviously, not be
* available either. * available either.
* *
* If the font's format is not PostScript-based, this function returns * 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.
* *
* @since: * @since:
* 2.4.8 * 2.4.8

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ttnameid.h */ * ttnameid.h
/* */ *
/* TrueType name ID definitions (specification only). */ * TrueType name ID definitions (specification only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef TTNAMEID_H_ #ifndef TTNAMEID_H_
@ -26,53 +26,54 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* <Section> */ * @section:
/* truetype_tables */ * truetype_tables
/* */ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Possible values for the `platform' identifier code in the name */ * Possible values for the 'platform' identifier code in the name records
/* records of an SFNT `name' table. */ * of an SFNT 'name' table.
/* */ *
/*************************************************************************/ */
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_PLATFORM_XXX * TT_PLATFORM_XXX
* *
* @description: * @description:
* 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. * @FT_CharMapRec and @FT_SfntName structures.
* *
* @values: * @values:
* TT_PLATFORM_APPLE_UNICODE :: * TT_PLATFORM_APPLE_UNICODE ::
* Used by Apple to indicate a Unicode character map and/or name entry. * 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 * that name entries in this format are coded as big-endian UCS-2
* character codes _only_. * character codes _only_.
* *
* TT_PLATFORM_MACINTOSH :: * TT_PLATFORM_MACINTOSH ::
* Used by Apple to indicate a MacOS-specific charmap and/or name entry. * Used by Apple to indicate a MacOS-specific charmap and/or name
* See @TT_MAC_ID_XXX for corresponding `encoding_id' values. Note that * entry. See @TT_MAC_ID_XXX for corresponding `encoding_id` values.
* most TrueType fonts contain an Apple roman charmap to be usable on * Note that most TrueType fonts contain an Apple roman charmap to be
* MacOS systems (even if they contain a Microsoft charmap as well). * usable on MacOS systems (even if they contain a Microsoft charmap as
* well).
* *
* TT_PLATFORM_ISO :: * TT_PLATFORM_ISO ::
* This value was used to specify ISO/IEC 10646 charmaps. It is however * This value was used to specify ISO/IEC 10646 charmaps. It is
* now deprecated. See @TT_ISO_ID_XXX for a list of corresponding * however now deprecated. See @TT_ISO_ID_XXX for a list of
* `encoding_id' values. * corresponding `encoding_id` values.
* *
* TT_PLATFORM_MICROSOFT :: * TT_PLATFORM_MICROSOFT ::
* Used by Microsoft to indicate Windows-specific charmaps. See * 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 * 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 :: * TT_PLATFORM_CUSTOM ::
* Used to indicate application-specific charmaps. * Used to indicate application-specific charmaps.
@ -91,13 +92,13 @@ FT_BEGIN_HEADER
#define TT_PLATFORM_ADOBE 7 /* artificial */ #define TT_PLATFORM_ADOBE 7 /* artificial */
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_APPLE_ID_XXX * TT_APPLE_ID_XXX
* *
* @description: * @description:
* 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. * @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.
* *
* @values: * @values:
@ -117,8 +118,8 @@ FT_BEGIN_HEADER
* Unicode 3.1 and beyond, using UTF-32. * Unicode 3.1 and beyond, using UTF-32.
* *
* TT_APPLE_ID_VARIANT_SELECTOR :: * TT_APPLE_ID_VARIANT_SELECTOR ::
* From Adobe, not Apple. Not a normal cmap. Specifies variations * From Adobe, not Apple. Not a normal cmap. Specifies variations on
* on a real cmap. * a real cmap.
* *
* TT_APPLE_ID_FULL_UNICODE :: * TT_APPLE_ID_FULL_UNICODE ::
* Used for fallback fonts that provide complete Unicode coverage with * 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 */ #define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_MAC_ID_XXX * TT_MAC_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for
* @TT_PLATFORM_MACINTOSH charmaps and name entries. * @TT_PLATFORM_MACINTOSH charmaps and name entries.
*/ */
@ -180,14 +181,14 @@ FT_BEGIN_HEADER
#define TT_MAC_ID_UNINTERP 32 #define TT_MAC_ID_UNINTERP 32
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_ISO_ID_XXX * TT_ISO_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for @TT_PLATFORM_ISO
* @TT_PLATFORM_ISO charmaps and name entries. * charmaps and name entries.
* *
* Their use is now deprecated. * Their use is now deprecated.
* *
@ -205,13 +206,13 @@ FT_BEGIN_HEADER
#define TT_ISO_ID_8859_1 2 #define TT_ISO_ID_8859_1 2
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_MS_ID_XXX * TT_MS_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for
* @TT_PLATFORM_MICROSOFT charmaps and name entries. * @TT_PLATFORM_MICROSOFT charmaps and name entries.
* *
* @values: * @values:
@ -219,16 +220,15 @@ FT_BEGIN_HEADER
* Microsoft symbol encoding. See @FT_ENCODING_MS_SYMBOL. * Microsoft symbol encoding. See @FT_ENCODING_MS_SYMBOL.
* *
* TT_MS_ID_UNICODE_CS :: * TT_MS_ID_UNICODE_CS ::
* Microsoft WGL4 charmap, matching Unicode. See * Microsoft WGL4 charmap, matching Unicode. See @FT_ENCODING_UNICODE.
* @FT_ENCODING_UNICODE.
* *
* TT_MS_ID_SJIS :: * TT_MS_ID_SJIS ::
* Shift JIS Japanese encoding. See @FT_ENCODING_SJIS. * Shift JIS Japanese encoding. See @FT_ENCODING_SJIS.
* *
* TT_MS_ID_PRC :: * TT_MS_ID_PRC ::
* Chinese encodings as used in the People's Republic of China (PRC). * Chinese encodings as used in the People's Republic of China (PRC).
* This means the encodings GB~2312 and its supersets GBK and * This means the encodings GB~2312 and its supersets GBK and GB~18030.
* GB~18030. See @FT_ENCODING_PRC. * See @FT_ENCODING_PRC.
* *
* TT_MS_ID_BIG_5 :: * TT_MS_ID_BIG_5 ::
* Traditional Chinese as used in Taiwan and Hong Kong. See * 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 #define TT_MS_ID_GB2312 TT_MS_ID_PRC
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_ADOBE_ID_XXX * TT_ADOBE_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `encoding_id' for * A list of valid values for the `encoding_id` for @TT_PLATFORM_ADOBE
* @TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! * charmaps. This is a FreeType-specific extension!
* *
* @values: * @values:
* TT_ADOBE_ID_STANDARD :: * TT_ADOBE_ID_STANDARD ::
@ -284,14 +284,14 @@ FT_BEGIN_HEADER
#define TT_ADOBE_ID_LATIN_1 3 #define TT_ADOBE_ID_LATIN_1 3
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_MAC_LANGID_XXX * TT_MAC_LANGID_XXX
* *
* @description: * @description:
* Possible values of the language identifier field in the name records * 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 * @TT_PLATFORM_MACINTOSH. These values are also used as return values
* for function @FT_Get_CMap_Language_ID. * for function @FT_Get_CMap_Language_ID.
* *
@ -424,24 +424,24 @@ FT_BEGIN_HEADER
#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 #define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_MS_LANGID_XXX * TT_MS_LANGID_XXX
* *
* @description: * @description:
* Possible values of the language identifier field in the name records * 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_MICROSOFT. These values are also used as return values * @TT_PLATFORM_MICROSOFT. These values are also used as return values
* for function @FT_Get_CMap_Language_ID. * for function @FT_Get_CMap_Language_ID.
* *
* The canonical source for Microsoft's IDs is * 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 * however, we only provide macros for language identifiers present in
* the OpenType specification: Microsoft has abandoned the concept of * 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. * provides a better mechanism for languages not covered here.
* *
* More legacy values not listed in the reference can be found in the * 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_MS_LANGID_UIGHUR_PRC
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_NAME_ID_XXX * TT_NAME_ID_XXX
* *
* @description: * @description:
* Possible values of the `name' identifier field in the name records of * Possible values of the 'name' identifier field in the name records of
* an SFNT `name' table. These values are platform independent. * an SFNT 'name' table. These values are platform independent.
*/ */
#define TT_NAME_ID_COPYRIGHT 0 #define TT_NAME_ID_COPYRIGHT 0
@ -834,14 +834,14 @@ FT_BEGIN_HEADER
#define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY #define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY
/*********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* TT_UCR_XXX * TT_UCR_XXX
* *
* @description: * @description:
* Possible bit mask values for the `ulUnicodeRangeX' fields in an SFNT * Possible bit mask values for the `ulUnicodeRangeX` fields in an SFNT
* `OS/2' table. * 'OS/2' table.
*/ */
/* ulUnicodeRange1 */ /* ulUnicodeRange1 */

File diff suppressed because it is too large Load diff

View file

@ -1,19 +1,19 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* tttags.h */ * tttags.h
/* */ *
/* Tags for TrueType and OpenType tables (specification only). */ * Tags for TrueType and OpenType tables (specification only).
/* */ *
/* Copyright 1996-2018 by */ * Copyright (C) 1996-2019 by
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* */ *
/* This file is part of the FreeType project, and may only be used, */ * This file is part of the FreeType project, and may only be used,
/* modified, and distributed under the terms of the FreeType project */ * modified, and distributed under the terms of the FreeType project
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* this file you indicate that you have read the license and */ * this file you indicate that you have read the license and
/* understand and accept it fully. */ * understand and accept it fully.
/* */ *
/***************************************************************************/ */
#ifndef TTAGS_H_ #ifndef TTAGS_H_
@ -46,6 +46,8 @@ FT_BEGIN_HEADER
#define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' ) #define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) #define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) #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_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) #define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )

View file

@ -1,63 +0,0 @@
/***************************************************************************/
/* */
/* ttunpat.h */
/* */
/* Definitions for the unpatented TrueType hinting system. */
/* Obsolete, retained for backward compatibility. */
/* */
/* Copyright 2003-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by Graham Asher <graham.asher@btinternet.com> */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef TTUNPAT_H_
#define TTUNPAT_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
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* Deprecated.
*
* 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' )
/* */
FT_END_HEADER
#endif /* TTUNPAT_H_ */
/* END */

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