update freetype to 2.10.0

This commit is contained in:
chenxianyin 2020-08-06 15:14:44 +08:00
parent f6c5065036
commit 3ae90fe7e6
55 changed files with 15999 additions and 13058 deletions

View File

@ -1,44 +1,42 @@
/* ftconfig.h. Generated from ftconfig.in by configure. */ /* ftconfig.h. Generated from ftconfig.in by configure. */
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftconfig.in */ * ftconfig.in
/* */ *
/* UNIX-specific configuration file (specification only). */ * UNIX-specific configuration file (specification only).
/* */ *
/* Copyright 1996-2004, 2006-2009, 2011, 2013, 2014 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. */ *
/* */ */
/*************************************************************************/
#ifndef FTCONFIG_H_
#define FTCONFIG_H_
#ifndef __FTCONFIG_H__ #include "../ft2build.h"
#define __FTCONFIG_H__
#include <ft2build.h>
#include FT_CONFIG_OPTIONS_H #include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_STANDARD_LIBRARY_H #include FT_CONFIG_STANDARD_LIBRARY_H
@ -46,30 +44,28 @@
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.
/* */ *
/*************************************************************************/ */
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
/* 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
@ -86,67 +82,66 @@ FT_BEGIN_HEADER
#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ #else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
/* Following cpp computation of the bit length of int and long */ /* Following cpp computation of the bit length of `int` and `long` */
/* is copied from default include/config/ftconfig.h. */ /* is copied from default `include/freetype/config/ftconfig.h`. */
/* If any improvement is required for this file, it should be */ /* If any improvement is required for this file, it should be */
/* applied to the original header file for the builders that */ /* applied to the original header file for the builders that do */
/* does not use configure script. */ /* not use configure script. */
/* 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
#define FT_SIZEOF_INT (32 / FT_CHAR_BIT) #define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL #elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_INT (64 / FT_CHAR_BIT) #define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
#else #else
#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 )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) #define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT) #define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
#else #else
#error "Unsupported size of `long' type!" #error "Unsupported size of `long' type!"
#endif #endif
#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ #endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
/* `FT_UNUSED` indicates that a given parameter is not used -- */
/* FT_UNUSED is a macro used to indicate that a given parameter is not */ /* this is only used to get rid of unpleasant compiler warnings. */
/* used -- 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"
@ -166,7 +161,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
@ -174,33 +169,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;
/* */ /* */
@ -209,50 +204,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;
/* */ /* */
@ -274,7 +269,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 >= 4 #if FT_SIZEOF_INT >= 4
typedef int FT_Fast; typedef int FT_Fast;
@ -288,37 +283,53 @@ 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 == 8 #if FT_SIZEOF_LONG == 8
/* 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
/*************************************************************************/ /* we handle the LLP64 scheme separately for GCC and clang, */
/* */ /* suppressing the `long long` warning */
/* A 64-bit data type may create compilation problems if you compile */ #elif ( FT_SIZEOF_LONG == 4 ) && \
/* in strict ANSI mode. To avoid them, we disable other 64-bit data */ defined( HAVE_LONG_LONG_INT ) && \
/* types if __STDC__ is defined. You can however ignore this rule */ defined( __GNUC__ )
/* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ #pragma GCC diagnostic ignored "-Wlong-long"
/* */ #define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
/**************************************************************************
*
* A 64-bit data type may create compilation problems if you compile in
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
* `__STDC__` is defined. You can however ignore this rule by defining the
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
*/
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ #if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
/* this compiler provides the __int64 type */ #define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* 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
@ -335,12 +346,12 @@ 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
#endif /* _MSC_VER */ #endif /* __STDC_VERSION__ >= 199901L */
#endif /* FT_SIZEOF_LONG == 8 */ #endif /* FT_SIZEOF_LONG == 8 */
@ -350,11 +361,46 @@ FT_BEGIN_HEADER
#endif #endif
#ifdef _WIN64
/* only 64bit Windows uses the LLP64 data model, i.e., */
/* 32bit integers, 64bit pointers */
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
#else
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
#endif
/**************************************************************************
*
* miscellaneous
*
*/
#define FT_BEGIN_STMNT do { #define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 ) #define FT_END_STMNT } while ( 0 )
#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 */
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
#else
#define FT_TYPEOF( type ) /* empty */
#endif
/* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
/* respectively, a function that gets used only within the scope of a */
/* module. Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
/* `FT_LOCAL_ARRAY_DEF`. */
/* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x #define FT_LOCAL( x ) static x
@ -376,6 +422,12 @@ 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, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header file */
/* in the `include/freetype/internal` directory, and the function body */
/* is in a file in `src/base`. */
/* */
#ifndef FT_BASE #ifndef FT_BASE
#ifdef __cplusplus #ifdef __cplusplus
@ -398,14 +450,68 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */ #endif /* !FT_BASE_DEF */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
/* */
/* - `FT_EXPORT( return_type )` */
/* */
/* is used in a function declaration, as in */
/* */
/* ``` */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* ``` */
/* */
/* - `FT_EXPORT_DEF( return_type )` */
/* */
/* is used in a function definition, as in */
/* */
/* ``` */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* ``` */
/* */
/* You can provide your own implementation of `FT_EXPORT` and */
/* `FT_EXPORT_DEF` here if you want. */
/* */
/* To export a variable, use `FT_EXPORT_VAR`. */
/* */
#ifndef FT_EXPORT #ifndef FT_EXPORT
#ifdef __cplusplus #ifdef FT2_BUILD_LIBRARY
#if defined( _WIN32 ) && defined( DLL_EXPORT )
#define FT_EXPORT( x ) __declspec( dllexport ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
#define FT_EXPORT( x ) __global x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x #define FT_EXPORT( x ) extern "C" x
#else #else
#define FT_EXPORT( x ) extern x #define FT_EXPORT( x ) extern x
#endif #endif
#else
#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
#endif
#endif /* !FT_EXPORT */ #endif /* !FT_EXPORT */
@ -430,18 +536,25 @@ FT_BEGIN_HEADER
#endif /* !FT_EXPORT_VAR */ #endif /* !FT_EXPORT_VAR */
/* The following macros are needed to compile the library with a */ /* The following macros are needed to compile the library with a */
/* 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 */
/* functions which are accessed by (global) function pointers. */ /* functions which are accessed by (global) function pointers. */
/* */ /* */
/* */ /* */
/* FT_CALLBACK_DEF is used to _define_ a callback function. */ /* FT_CALLBACK_DEF is used to _define_ a callback function, */
/* located in the same source code file as the structure that uses */
/* it. */
/* */
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
/* and define a callback function, respectively, in a similar way */
/* as FT_BASE and FT_BASE_DEF work. */
/* */ /* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */ /* contains pointers to callback functions. */
@ -451,7 +564,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
@ -461,6 +574,16 @@ FT_BEGIN_HEADER
#endif #endif
#endif /* FT_CALLBACK_DEF */ #endif /* FT_CALLBACK_DEF */
#ifndef FT_BASE_CALLBACK
#ifdef __cplusplus
#define FT_BASE_CALLBACK( x ) extern "C" x
#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_BASE_CALLBACK( x ) extern x
#define FT_BASE_CALLBACK_DEF( x ) x
#endif
#endif /* FT_BASE_CALLBACK */
#ifndef FT_CALLBACK_TABLE #ifndef FT_CALLBACK_TABLE
#ifdef __cplusplus #ifdef __cplusplus
#define FT_CALLBACK_TABLE extern "C" #define FT_CALLBACK_TABLE extern "C"
@ -475,7 +598,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTCONFIG_H__ */ #endif /* FTCONFIG_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,35 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftstdlib.h */ * ftstdlib.h
/* */ *
/* ANSI-specific library and header configuration file (specification */ * ANSI-specific library and header configuration file (specification
/* only). */ * only).
/* */ *
/* Copyright 2002-2007, 2009, 2011-2012 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 */ * Load a file which defines `FTSTDLIB_H_` before this one to override it.
/* it. */ *
/* */ */
/*************************************************************************/
#ifndef __FTSTDLIB_H__ #ifndef FTSTDLIB_H_
#define __FTSTDLIB_H__ #define FTSTDLIB_H_
#include <stddef.h> #include <stddef.h>
@ -38,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>
@ -64,14 +63,16 @@
#define FT_INT_MAX INT_MAX #define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN #define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX #define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#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>
@ -91,11 +92,11 @@
#define ft_strstr strstr #define ft_strstr strstr
/**********************************************************************/ /**************************************************************************
/* */ *
/* file handling */ * file handling
/* */ *
/**********************************************************************/ */
#include <stdio.h> #include <stdio.h>
@ -109,11 +110,11 @@
#define ft_sprintf sprintf #define ft_sprintf sprintf
/**********************************************************************/ /**************************************************************************
/* */ *
/* sorting */ * sorting
/* */ *
/**********************************************************************/ */
#include <stdlib.h> #include <stdlib.h>
@ -121,11 +122,11 @@
#define ft_qsort qsort #define ft_qsort qsort
/**********************************************************************/ /**************************************************************************
/* */ *
/* memory allocation */ * memory allocation
/* */ *
/**********************************************************************/ */
#define ft_scalloc calloc #define ft_scalloc calloc
@ -134,41 +135,41 @@
#define ft_srealloc realloc #define ft_srealloc realloc
/**********************************************************************/ /**************************************************************************
/* */ *
/* miscellaneous */ * miscellaneous
/* */ *
/**********************************************************************/ */
#define ft_atol atol #define ft_strtol strtol
#define ft_labs labs #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>
#endif /* __FTSTDLIB_H__ */ #endif /* FTSTDLIB_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

View File

@ -1,42 +1,44 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ft2build.h */ * ft2build.h
/* */ *
/* FreeType 2 build and setup macros. */ * FreeType 2 build and setup macros.
/* */ *
/* Copyright 1996-2001, 2006, 2013 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 is the `entry point' for FreeType header file inclusions. It is */ * This is the 'entry point' for FreeType header file inclusions. It is
/* the only header file which should be included directly; all other */ * the only header file which should be included directly; all other
/* FreeType header files should be accessed with macro names (after */ * FreeType header files should be accessed with macro names (after
/* including `ft2build.h'). */ * including `ft2build.h`).
/* */ *
/* A typical example is */ * A typical example is
/* */ *
/* #include <ft2build.h> */ * ```
/* #include FT_FREETYPE_H */ * #include "ft2build.h"
/* */ * #include FT_FREETYPE_H
/*************************************************************************/ * ```
*
*/
#ifndef __FT2BUILD_H__ #ifndef FT2BUILD_H_
#define __FT2BUILD_H__ #define FT2BUILD_H_
#include <config/ftheader.h> #include <freetype/config/ftheader.h>
#endif /* __FT2BUILD_H__ */ #endif /* FT2BUILD_H_ */
/* END */ /* END */

View File

@ -1,26 +1,26 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftadvanc.h */ * ftadvanc.h
/* */ *
/* Quick computation of advance widths (specification only). */ * Quick computation of advance widths (specification only).
/* */ *
/* Copyright 2008, 2013, 2014 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_
#define __FTADVANC_H__ #define FTADVANC_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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 0x20000000UL
/*************************************************************************/ /**************************************************************************
/* */ *
/* <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,
@ -181,7 +182,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTADVANC_H__ */ #endif /* FTADVANC_H_ */
/* END */ /* END */

View File

@ -1,402 +0,0 @@
/***************************************************************************/
/* */
/* ftautoh.h */
/* */
/* FreeType API for controlling the auto-hinter (specification only). */
/* */
/* Copyright 2012, 2013 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+1C80 - U+1CDF // Meetei Mayak
* U+A800 - U+A82F // Syloti Nagri
* 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_Byte* 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;
/* */
FT_END_HEADER
#endif /* __FTAUTOH_H__ */
/* END */

View File

@ -1,37 +1,37 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbbox.h */ * ftbbox.h
/* */ *
/* FreeType exact bbox computation (specification). */ * FreeType exact bbox computation (specification).
/* */ *
/* Copyright 1996-2001, 2003, 2007, 2011, 2013 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_
#define __FTBBOX_H__ #define FTBBOX_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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 Bézier 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 );
@ -90,7 +91,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTBBOX_H__ */ #endif /* FTBBOX_H_ */
/* END */ /* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbdf.h */ * ftbdf.h
/* */ *
/* FreeType API for accessing BDF-specific strings (specification). */ * FreeType API for accessing BDF-specific strings (specification).
/* */ *
/* Copyright 2002-2004, 2006, 2009, 2014 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_
#define __FTBDF_H__ #define FTBDF_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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,40 +81,40 @@ 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
* *
* @description: * @description:
* This structure models a given BDF/PCF property. * This structure models a given BDF/PCF property.
* *
* @fields: * @fields:
* type :: * type ::
* The property type. * The property type.
* *
* 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.
* *
* u.cardinal :: * u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/ */
typedef struct BDF_PropertyRec_ typedef struct BDF_PropertyRec_
{ {
BDF_PropertyType type; BDF_PropertyType type;
@ -128,73 +128,76 @@ 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 ::
* A handle to the input face. * A handle to the input face.
* *
* @output: * @output:
* acharset_encoding :: * acharset_encoding ::
* Charset encoding, as a C~string, owned by the face. * Charset encoding, as a C~string, owned by the face.
* *
* acharset_registry :: * acharset_registry ::
* Charset registry, as a C~string, owned by the face. * Charset registry, as a C~string, owned by the face.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with BDF faces, returning an error otherwise. * This function only works with BDF faces, returning an error otherwise.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face, FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding, const char* *acharset_encoding,
const char* *acharset_registry ); const char* *acharset_registry );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_BDF_Property * FT_Get_BDF_Property
* *
* @description: * @description:
* 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 ::
* @output: * The property name.
* aproperty :: The property. *
* * @output:
* @return: * aproperty ::
* FreeType error code. 0~means success. * The property.
* *
* @note: * @return:
* This function works with BDF _and_ PCF fonts. It returns an error * FreeType error code. 0~means success.
* otherwise. It also returns an error if the property is not in the *
* font. * @note:
* * This function works with BDF _and_ PCF fonts. It returns an error
* A `property' is a either key-value pair within the STARTPROPERTIES * otherwise. It also returns an error if the property is not in the
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the * font.
* `info->props' array within a `FontRec' structure of a PCF font. *
* * A 'property' is a either key-value pair within the STARTPROPERTIES
* Integer properties are always stored as `signed' within PCF fonts; * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value * `info->props` array within a `FontRec` structure of a PCF font.
* for BDF fonts only. *
* * Integer properties are always stored as 'signed' within PCF fonts;
* In case of error, `aproperty->type' is always set to * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* @BDF_PROPERTY_TYPE_NONE. * for BDF fonts only.
*/ *
* In case of error, `aproperty->type` is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face, FT_Get_BDF_Property( FT_Face face,
const char* prop_name, const char* prop_name,
@ -204,7 +207,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTBDF_H__ */ #endif /* FTBDF_H_ */
/* END */ /* END */

View File

@ -1,27 +1,28 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbitmap.h */ * ftbitmap.h
/* */ *
/* FreeType utility functions for bitmaps (specification). */ * FreeType utility functions for bitmaps (specification).
/* */ *
/* Copyright 2004-2006, 2008, 2013, 2014 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_
#define __FTBITMAP_H__ #define FTBITMAP_H_
#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,100 +34,126 @@
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_New */ * 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`.
*/
FT_EXPORT( void )
FT_Bitmap_Init( FT_Bitmap *abitmap );
/* deprecated */
FT_EXPORT( void ) FT_EXPORT( void )
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,
@ -134,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,
@ -174,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 created with @FT_Bitmap_New. */ * 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 );
@ -226,7 +324,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTBITMAP_H__ */ #endif /* FTBITMAP_H_ */
/* END */ /* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftbzip2.h */ * ftbzip2.h
/* */ *
/* Bzip2-compressed stream support. */ * Bzip2-compressed stream support.
/* */ *
/* Copyright 2010 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_
#define __FTBZIP2_H__ #define FTBZIP2_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -31,62 +31,62 @@
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 ::
* The target embedding stream. * The target embedding stream.
* *
* source :: * source ::
* The source stream. * The source stream.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @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.
* *
* 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 )
FT_Stream_OpenBzip2( FT_Stream stream, FT_Stream_OpenBzip2( FT_Stream stream,
FT_Stream source ); FT_Stream source );
@ -96,7 +96,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTBZIP2_H__ */ #endif /* FTBZIP2_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

View File

@ -1,262 +0,0 @@
/***************************************************************************/
/* */
/* ftcffdrv.h */
/* */
/* FreeType API for controlling the CFF driver (specification only). */
/* */
/* Copyright 2013, 2014 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) Aligment 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
* no-stem-darkening
* darkening-parameters
*
*/
/**************************************************************************
*
* @property:
* hinting-engine
*
* @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.
*
*/
/**************************************************************************
*
* @enum:
* FT_CFF_HINTING_XXX
*
* @description:
* A list of constants used for the @hinting-engine 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
*
* @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.
*
*/
/**************************************************************************
*
* @property:
* darkening-parameters
*
* @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.
*
*/
/* */
FT_END_HEADER
#endif /* __FTCFFDRV_H__ */
/* END */

View File

@ -1,121 +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
/* tt_driver */ * t1_cid_driver
/* */ * tt_driver
/***************************************************************************/ * pcf_driver
* properties
* 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
*
* @title:
* Error Codes
*
* @sections:
* error_enumerations
* error_code_values
*
*/
/* END */

View File

@ -1,24 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftcid.h */ * ftcid.h
/* */ *
/* FreeType API for accessing CID font information (specification). */ * FreeType API for accessing CID font information (specification).
/* */ *
/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */ * Copyright (C) 2007-2019 by
/* */ * Dereg Clegg and Michael Toftdal.
/* This file is part of the FreeType project, and may only be used, */ *
/* modified, and distributed under the terms of the FreeType project */ * This file is part of the FreeType project, and may only be used,
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * modified, and distributed under the terms of the FreeType project
/* this file you indicate that you have read the license and */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* understand and accept it fully. */ * this file you indicate that you have read the license and
/* */ * understand and accept it fully.
/***************************************************************************/ *
*/
#ifndef __FTCID_H__ #ifndef FTCID_H_
#define __FTCID_H__ #define FTCID_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -31,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
@ -60,17 +61,17 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* @output: * @output:
* registry :: * registry ::
* The registry, as a C~string, owned by the face. * The registry, as a C~string, owned by the face.
* *
* ordering :: * ordering ::
* The ordering, as a C~string, owned by the face. * The ordering, as a C~string, owned by the face.
* *
* supplement :: * supplement ::
* The supplement. * The supplement.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -86,33 +87,33 @@ FT_BEGIN_HEADER
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry, const char* *registry,
const char* *ordering, const char* *ordering,
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
* constrast 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 SNFT wrapper. * for CID-keyed fonts in an SFNT wrapper.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* @output: * @output:
* is_cid :: * is_cid ::
* The type of the face as an @FT_Bool. * The type of the face as an @FT_Bool.
* *
* @return: * @return:
* 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
@ -122,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
@ -132,21 +133,21 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* glyph_index :: * glyph_index ::
* The input glyph index. * The input glyph index.
* *
* @output: * @output:
* cid :: * cid ::
* The CID as an @FT_UInt. * The CID as an @FT_UInt.
* *
* @return: * @return:
* 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
@ -161,7 +162,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTCID_H__ */ #endif /* FTCID_H_ */
/* END */ /* END */

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,33 +1,57 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fterrdef.h */ * fterrdef.h
/* */ *
/* FreeType error codes (specification). */ * FreeType error codes (specification).
/* */ *
/* Copyright 2002, 2004, 2006, 2007, 2010-2013 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:
/***** LIST OF ERROR CODES/MESSAGES *****/ * error_code_values
/***** *****/ *
/*******************************************************************/ * @title:
/*******************************************************************/ * Error Code Values
*
* @abstract:
* All possible error codes returned by FreeType functions.
*
* @description:
* The list below is taken verbatim from the file `fterrdef.h` (loaded
* automatically by including `FT_FREETYPE_H`). The first argument of the
* `FT_ERROR_DEF_` macro is the error label; by default, the prefix
* `FT_Err_` gets added so that you get error names like
* `FT_Err_Cannot_Open_Resource`. The second argument is the error code,
* and the last argument an error string, which is not used by FreeType.
*
* Within your application you should **only** use error names and
* **never** its numeric values! The latter might (and actually do)
* change in forthcoming FreeType versions.
*
* Macro `FT_NOERRORDEF_` defines `FT_Err_Ok`, which is always zero. See
* the 'Error Enumerations' subsection how to automatically generate a
* list of error strings.
*
*/
/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */ /**************************************************************************
/* including this file. */ *
* @enum:
* FT_Err_XXX
*
*/
/* generic errors */ /* generic errors */
@ -206,6 +230,10 @@
"invalid PostScript (post) table format" ) "invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
"invalid PostScript (post) table" ) "invalid PostScript (post) table" )
FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C,
"found FDEF or IDEF opcode in glyf bytecode" )
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
"missing bitmap in strike" )
/* CFF, CID, and Type 1 errors */ /* CFF, CID, and Type 1 errors */
@ -218,7 +246,7 @@
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
"no Unicode glyph name found" ) "no Unicode glyph name found" )
FT_ERRORDEF_( Glyph_Too_Big, 0xA4, FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
"glyph to big for hinting" ) "glyph too big for hinting" )
/* BDF errors */ /* BDF errors */
@ -245,5 +273,7 @@
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
"Font glyphs corrupted or missing fields" ) "Font glyphs corrupted or missing fields" )
/* */
/* END */ /* END */

View File

@ -1,87 +1,125 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fterrors.h */ * fterrors.h
/* */ *
/* FreeType error code handling (specification). */ * FreeType error code handling (specification).
/* */ *
/* Copyright 1996-2002, 2004, 2007, 2013 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 special header file is used to define the handling of FT2 */ * @section:
/* enumeration constants. It can also be used to generate error message */ * error_enumerations
/* strings with a small macro trick explained below. */ *
/* */ * @title:
/* I - Error Formats */ * Error Enumerations
/* ----------------- */ *
/* */ * @abstract:
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ * How to handle errors and error strings.
/* defined in ftoption.h in order to make the higher byte indicate */ *
/* the module where the error has happened (this is not compatible */ * @description:
/* with standard builds of FreeType 2). See the file `ftmoderr.h' for */ * The header file `fterrors.h` (which is automatically included by
/* more details. */ * `freetype.h` defines the handling of FreeType's enumeration
/* */ * constants. It can also be used to generate error message strings
/* */ * with a small macro trick explained below.
/* II - Error Message strings */ *
/* -------------------------- */ * **Error Formats**
/* */ *
/* The error definitions below are made through special macros that */ * The configuration macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` can be
/* allow client applications to build a table of error message strings */ * defined in `ftoption.h` in order to make the higher byte indicate the
/* if they need it. The strings are not included in a normal build of */ * module where the error has happened (this is not compatible with
/* FreeType 2 to save space (most client applications do not use */ * standard builds of FreeType~2, however). See the file `ftmoderr.h`
/* them). */ * for more details.
/* */ *
/* To do so, you have to define the following macros before including */ * **Error Message Strings**
/* this file: */ *
/* */ * Error definitions are set up with special macros that allow client
/* FT_ERROR_START_LIST :: */ * applications to build a table of error message strings. The strings
/* This macro is called before anything else to define the start of */ * are not included in a normal build of FreeType~2 to save space (most
/* the error list. It is followed by several FT_ERROR_DEF calls */ * client applications do not use them).
/* (see below). */ *
/* */ * To do so, you have to define the following macros before including
/* FT_ERROR_DEF( e, v, s ) :: */ * this file.
/* This macro is called to define one single error. */ *
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */ * ```
/* `v' is the error numerical value. */ * FT_ERROR_START_LIST
/* `s' is the corresponding error string. */ * ```
/* */ *
/* FT_ERROR_END_LIST :: */ * This macro is called before anything else to define the start of the
/* This macro ends the list. */ * error list. It is followed by several `FT_ERROR_DEF` calls.
/* */ *
/* Additionally, you have to undefine __FTERRORS_H__ before #including */ * ```
/* this file. */ * FT_ERROR_DEF( e, v, s )
/* */ * ```
/* Here is a simple example: */ *
/* */ * This macro is called to define one single error. 'e' is the error
/* { */ * code identifier (e.g., `Invalid_Argument`), 'v' is the error's
/* #undef __FTERRORS_H__ */ * numerical value, and 's' is the corresponding error string.
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */ *
/* #define FT_ERROR_START_LIST { */ * ```
/* #define FT_ERROR_END_LIST { 0, 0 } }; */ * FT_ERROR_END_LIST
/* */ * ```
/* const struct */ *
/* { */ * This macro ends the list.
/* int err_code; */ *
/* const char* err_msg; */ * Additionally, you have to undefine `FTERRORS_H_` before #including
/* } ft_errors[] = */ * this file.
/* */ *
/* #include FT_ERRORS_H */ * Here is a simple example.
/* } */ *
/* */ * ```
/*************************************************************************/ * #undef FTERRORS_H_
* #define FT_ERRORDEF( e, v, s ) { e, s },
* #define FT_ERROR_START_LIST {
* #define FT_ERROR_END_LIST { 0, NULL } };
*
* const struct
* {
* int err_code;
* const char* err_msg;
* } ft_errors[] =
*
* #include FT_ERRORS_H
* ```
*
* An alternative to using an array is a switch statement.
*
* ```
* #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.
*/
/* */
#ifndef __FTERRORS_H__ /* In previous FreeType versions we used `__FTERRORS_H__`. However, */
/* using two successive underscores in a non-system symbol name */
/* violates the C (and C++) standard, so it was changed to the */
/* current form. In spite of this, we have to make */
/* */
/* ``` */
/* #undefine __FTERRORS_H__ */
/* ``` */
/* */
/* work for backward compatibility. */
/* */
#if !( defined( FTERRORS_H_ ) && defined ( __FTERRORS_H__ ) )
#define FTERRORS_H_
#define __FTERRORS_H__ #define __FTERRORS_H__
@ -102,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_
@ -130,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 ) };
@ -192,7 +232,54 @@
#undef FT_ERR_PREFIX #undef FT_ERR_PREFIX
#endif #endif
#endif /* __FTERRORS_H__ */ /* 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__) */
/* END */ /* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftfntfmt.h */ * ftfntfmt.h
/* */ *
/* Support functions for font formats. */ * Support functions for font formats.
/* */ *
/* Copyright 2002-2016 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_
#define FTFNTFMT_H_ #define FTFNTFMT_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftgasp.h */ * ftgasp.h
/* */ *
/* Access of TrueType's `gasp' table (specification). */ * Access of TrueType's 'gasp' table (specification).
/* */ *
/* Copyright 2007, 2008, 2011 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 _FT_GASP_H_ #ifndef FTGASP_H_
#define _FT_GASP_H_ #define FTGASP_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -29,7 +29,10 @@
#endif #endif
/*************************************************************************** FT_BEGIN_HEADER
/**************************************************************************
* *
* @section: * @section:
* gasp_table * gasp_table
@ -38,16 +41,16 @@
* 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
@ -63,7 +66,7 @@
* *
* 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 ::
@ -77,13 +80,13 @@
* 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:
@ -92,26 +95,36 @@
#define FT_GASP_NO_TABLE -1 #define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01 #define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02 #define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_GRIDFIT 0x04
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08 #define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/************************************************************************* /**************************************************************************
* *
* @func: * @function:
* FT_Get_Gasp * FT_Get_Gasp
* *
* @description: * @description:
* Read the `gasp' table from a TrueType or OpenType font file and * For a TrueType or OpenType font file, return the rasterizer behaviour
* return the entry corresponding to a given character pixel size. * flags from the font's 'gasp' table corresponding to a given character
* pixel size.
* *
* @input: * @input:
* face :: The source face handle. * face ::
* ppem :: The vertical character pixel size. * The source face handle.
*
* 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:
* If you want to use the MM functionality of OpenType variation fonts
* (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
* function **after** setting an instance since the return values can
* change.
* *
* @since: * @since:
* 2.3.0 * 2.3.0
@ -123,7 +136,9 @@
/* */ /* */
#endif /* _FT_GASP_H_ */ FT_END_HEADER
#endif /* FTGASP_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +1,34 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftgxval.h */ * ftgxval.h
/* */ *
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ * FreeType API for validating TrueTypeGX/AAT tables (specification).
/* */ *
/* Copyright 2004-2006, 2013 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_
#define __FTGXVAL_H__ #define FTGXVAL_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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,71 +92,71 @@ 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 )
/* */ /* */
/* Up to 0x1000 is used by otvalid. /* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */ Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000 #define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \ #define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX ) ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/********************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_VALIDATE_GXXXX * FT_VALIDATE_GXXXX
* *
* @description: * @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated. * indicate which TrueTypeGX/AAT Type tables should be validated.
* *
* @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,
* opbd, trak, prop and lcar). * opbd, trak, prop and lcar).
* *
*/ */
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) #define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) #define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
@ -181,47 +181,47 @@ FT_BEGIN_HEADER
FT_VALIDATE_lcar ) FT_VALIDATE_lcar )
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_TrueTypeGX_Validate * FT_TrueTypeGX_Validate
* *
* @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 ::
* A handle to the input face. * A handle to the input face.
* *
* validation_flags :: * validation_flags ::
* A bit field that specifies the tables to be validated. See * A bit field that specifies the tables to be validated. See
* @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.
* *
* @note: * @note:
* This function only works with TrueTypeGX fonts, returning an error * This function only works with TrueTypeGX fonts, returning an error
* 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.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face, FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags, FT_UInt validation_flags,
@ -229,119 +229,117 @@ FT_BEGIN_HEADER
FT_UInt table_length ); FT_UInt table_length );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_TrueTypeGX_Free * FT_TrueTypeGX_Free
* *
* @description: * @description:
* Free the buffer allocated by TrueTypeGX validator. * Free the buffer allocated by TrueTypeGX validator.
* *
* @input: * @input:
* face :: * face ::
* 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 * @FT_TrueTypeGX_Validate only.
* @FT_TrueTypeGX_Validate only. */
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_TrueTypeGX_Free( FT_Face face, FT_TrueTypeGX_Free( FT_Face face,
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 )
#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.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* validation_flags :: * validation_flags ::
* A bit field that specifies the dialect to be validated. See * A bit field that specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values. * @FT_VALIDATE_CKERNXXX for possible values.
* *
* @output: * @output:
* ckern_table :: * ckern_table ::
* A pointer to the kern table. * A pointer to the kern table.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @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 )
FT_ClassicKern_Validate( FT_Face face, FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags, FT_UInt validation_flags,
FT_Bytes *ckern_table ); FT_Bytes *ckern_table );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_ClassicKern_Free * FT_ClassicKern_Free
* *
* @description: * @description:
* Free the buffer allocated by classic Kern validator. * Free the buffer allocated by classic Kern validator.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* table :: * table ::
* The pointer to the buffer that is allocated by * The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate. * @FT_ClassicKern_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
* @FT_ClassicKern_Validate only. * @FT_ClassicKern_Validate only.
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_ClassicKern_Free( FT_Face face, FT_ClassicKern_Free( FT_Face face,
FT_Bytes table ); FT_Bytes table );
@ -351,7 +349,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTGXVAL_H__ */ #endif /* FTGXVAL_H_ */
/* END */ /* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftgzip.h */ * ftgzip.h
/* */ *
/* Gzip-compressed stream support. */ * Gzip-compressed stream support.
/* */ *
/* Copyright 2002-2004, 2006, 2013 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_
#define __FTGZIP_H__ #define FTGZIP_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -31,105 +31,108 @@
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 ::
* The target embedding stream. * The target embedding stream.
* *
* source :: * source ::
* The source stream. * The source stream.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @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.
* *
* 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 )
FT_Stream_OpenGzip( FT_Stream stream, FT_Stream_OpenGzip( FT_Stream stream,
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 ::
* A FreeType memory handle. * A FreeType memory handle.
* *
* input :: * input ::
* The input buffer. * The input buffer.
* *
* input_len :: * input_len ::
* The length of the input buffer. * The length of the input buffer.
* *
* @output: * @output:
* output:: * output ::
* The output buffer. * The output buffer.
* *
* @inout: * @inout:
* output_len :: * output_len ::
* Before calling the function, this is the the total size of the * Before calling the function, this is the total size of the output
* output buffer, which must be large enough to hold the entire * buffer, which must be large enough to hold the entire uncompressed
* uncompressed data (so the size of the uncompressed data must be * data (so the size of the uncompressed data must be known in
* known in advance). After calling the function, `output_len' is the * advance). After calling the function, `output_len` is the size of
* 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:
* 2.5.1
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Gzip_Uncompress( FT_Memory memory, FT_Gzip_Uncompress( FT_Memory memory,
FT_Byte* output, FT_Byte* output,
@ -142,7 +145,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTGZIP_H__ */ #endif /* FTGZIP_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,27 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftincrem.h */ * ftincrem.h
/* */ *
/* FreeType incremental loading (specification). */ * FreeType incremental loading (specification).
/* */ *
/* Copyright 2002, 2003, 2006-2008, 2010, 2014 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_
#define __FTINCREM_H__ #define FTINCREM_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_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!"
@ -31,7 +32,7 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************** /**************************************************************************
* *
* @section: * @section:
* incremental * incremental
@ -44,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
@ -59,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.
@ -84,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 ::
@ -108,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.
* *
*/ */
@ -122,7 +124,7 @@ FT_BEGIN_HEADER
} FT_Incremental_MetricsRec; } FT_Incremental_MetricsRec;
/*************************************************************************** /**************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_Metrics * FT_Incremental_Metrics
@ -134,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
@ -146,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:
@ -168,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.
@ -181,7 +183,7 @@ FT_BEGIN_HEADER
FT_Data* adata ); FT_Data* adata );
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental_FreeGlyphDataFunc * FT_Incremental_FreeGlyphDataFunc
@ -205,7 +207,7 @@ FT_BEGIN_HEADER
FT_Data* data ); FT_Data* data );
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental_GetGlyphMetricsFunc * FT_Incremental_GetGlyphMetricsFunc
@ -213,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 ::
@ -228,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 ::
@ -251,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 ::
@ -262,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_
@ -275,7 +277,7 @@ FT_BEGIN_HEADER
} FT_Incremental_FuncsRec; } FT_Incremental_FuncsRec;
/*************************************************************************** /**************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_InterfaceRec * FT_Incremental_InterfaceRec
@ -285,30 +287,30 @@ 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;
* *
* *
* // set up incremental descriptor * // set up incremental descriptor
* inc_int.funcs = my_funcs; * inc_int.funcs = my_funcs;
* inc_int.object = my_object; * inc_int.object = my_object;
* *
* // set up optional parameter * // set up optional parameter
* parameter.tag = FT_PARAM_TAG_INCREMENTAL; * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
* parameter.data = &inc_int; * parameter.data = &inc_int;
* *
* // set up FT_Open_Args structure * // set up FT_Open_Args structure
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname; * open_args.pathname = my_font_pathname;
* open_args.num_params = 1; * open_args.num_params = 1;
* open_args.params = &parameter; // we use one optional argument * open_args.params = &parameter; // we use one optional argument
* *
* // 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_
@ -319,7 +321,7 @@ FT_BEGIN_HEADER
} FT_Incremental_InterfaceRec; } FT_Incremental_InterfaceRec;
/*************************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Incremental_Interface * FT_Incremental_Interface
@ -331,24 +333,12 @@ FT_BEGIN_HEADER
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface; typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* A constant used as the tag of @FT_Parameter structures to indicate
* an incremental loading object to be used by FreeType.
*
*/
#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTINCREM_H__ */ #endif /* FTINCREM_H_ */
/* END */ /* END */

View File

@ -1,27 +1,28 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* 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-2008, 2010, 2013, 2014 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 __FT_LCD_FILTER_H__ #ifndef FTLCDFIL_H_
#define __FT_LCD_FILTER_H__ #define FTLCDFIL_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_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!"
@ -32,69 +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 LCD-optimized bitmaps. * API to control subpixel rendering.
* *
* @description: * @description:
* The @FT_Library_SetLcdFilter API can be used to specify a low-pass * FreeType provides two alternative subpixel rendering technologies.
* filter, which is then applied to LCD-optimized bitmaps generated * Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
* through @FT_Render_Glyph. This is useful to reduce color fringes * `ftoption.h` file, this enables patented ClearType-style rendering.
* that would occur with unfiltered rendering. * Otherwise, Harmony LCD rendering is enabled. These technologies are
* controlled differently and API described below, although always
* available, performs its function when appropriate method is enabled
* and does nothing otherwise.
* *
* Note that no filter is active by default, and that this function is * ClearType-style LCD rendering exploits the color-striped structure of
* *not* implemented in default builds of the library. You need to * LCD pixels, increasing the available resolution in the direction of
* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file * the stripe (usually horizontal RGB) by a factor of~3. Using the
* in order to activate it. * subpixels coverages unfiltered can create severe color fringes
* especially when rendering thin features. Indeed, to produce
* black-on-white text, the nearby color subpixels must be dimmed
* equally.
* *
* FreeType generates alpha coverage maps, which are linear by nature. * A good 5-tap FIR filter should be applied to subpixel coverages
* For instance, the value 0x80 in bitmap representation means that * regardless of pixel boundaries and should have these properties:
* (within numerical precision) 0x80/0xFF fraction of that pixel is
* covered by the glyph's outline. The blending function for placing
* text over a background is
* *
* { * 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
* dst = alpha * src + (1 - alpha) * dst , * any shifts in appearance.
* }
* *
* which is known as OVER. However, when calculating the output of the * 2. It should be color-balanced, meaning a~+ b~=~c, to reduce color
* OVER operator, the source colors should first be transformed to a * fringes by distributing the computed coverage for one subpixel to
* linear color space, then alpha blended in that space, and transformed * all subpixels equally.
* back to the output color space.
* *
* When linear light blending is used, the default FIR5 filtering * 3. It should be normalized, meaning 2a~+ 2b~+ c~=~1.0 to maintain
* weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as * overall brightness.
* they have been designed for black on white rendering while lacking
* gamma correction. To preserve color neutrality, weights for a FIR5
* filter should be chosen according to two free parameters `a' and `c',
* and the FIR weights should be
* *
* { * Boxy 3-tap filter {0, 1/3, 1/3, 1/3, 0} is sharper but is less
* [a - c, a + c, 2 * a, a + c, a - c] . * forgiving of non-ideal gamma curves of a screen (and viewing angles),
* } * beveled filters are fuzzier but more tolerant.
* *
* This formula generates equal weights for all the color primaries * Use the @FT_Library_SetLcdFilter or @FT_Library_SetLcdFilterWeights
* across the filter kernel, which makes it colorless. One suggested * API to specify a low-pass filter, which is then applied to
* set of weights is * subpixel-rendered bitmaps generated through @FT_Render_Glyph.
* *
* { * Harmony LCD rendering is suitable to panels with any regular subpixel
* [0x10, 0x50, 0x60, 0x50, 0x10] , * 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.
* *
* where `a' has value 0x30 and `b' value 0x20. The weights in filter * The subpixel geometry must be specified by xy-coordinates for each
* may have a sum larger than 0x100, which increases coloration slightly * subpixel. By convention they may come in the RGB order: {{-1/3, 0},
* but also improves contrast. * {0, 0}, {1/3, 0}} for standard RGB striped panel or {{-1/6, 1/4},
* {-1/6, -1/4}, {1/3, 0}} for a certain PenTile panel.
*
* Use the @FT_Library_SetLcdGeometry API to specify subpixel positions.
* If one follows the RGB order convention, the same order applies to the
* resulting @FT_PIXEL_MODE_LCD and @FT_PIXEL_MODE_LCD_V bitmaps. Note,
* however, that the coordinate frame for the latter must be rotated
* clockwise. Harmony with default LCD geometry is equivalent to
* ClearType with light filter.
*
* As a result of ClearType filtering or Harmony rendering, the
* dimensions of LCD bitmaps can be either wider or taller than the
* dimensions of the corresponding outline with regard to the pixel grid.
* For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
* the left, and 2~subpixels to the right. The bitmap offset values are
* adjusted accordingly, so clients shouldn't need to modify their layout
* and glyph positioning code when enabling the filter.
*
* The ClearType and Harmony rendering is applicable to glyph bitmaps
* rendered through @FT_Render_Glyph, @FT_Load_Glyph, @FT_Load_Char, and
* @FT_Glyph_To_Bitmap, when @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V
* is specified. This API does not control @FT_Outline_Render and
* @FT_Outline_Get_Bitmap.
*
* The described algorithms can completely remove color artefacts when
* combined with gamma-corrected alpha blending in linear space. Each of
* the 3~alpha values (subpixels) must by independently used to blend one
* color channel. That is, red alpha blends the red channel of the text
* color with the red channel of the background pixel.
*/ */
/**************************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_LcdFilter * FT_LcdFilter
@ -108,32 +138,32 @@ 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.
* *
* FT_LCD_FILTER_LIGHT :: * FT_LCD_FILTER_LIGHT ::
* The light filter is a variant that produces less blurriness at the * this is a boxy, normalized, and color-balanced three-tap filter with
* cost of slightly more color fringes than the default one. It might * weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units.
* be better, depending on taste, your monitor, or your personal vision.
* *
* 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
* different enumeration, sometimes incorrectly forwarded to FreeType.
* *
* @since: * @since:
* 2.3.0 * 2.3.0 (`FT_LCD_FILTER_LEGACY1` since 2.6.2)
*/ */
typedef enum FT_LcdFilter_ typedef enum FT_LcdFilter_
{ {
FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2, FT_LCD_FILTER_LIGHT = 2,
FT_LCD_FILTER_LEGACY1 = 3,
FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_LEGACY = 16,
FT_LCD_FILTER_MAX /* do not remove */ FT_LCD_FILTER_MAX /* do not remove */
@ -143,7 +173,7 @@ FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @func: * @function:
* FT_Library_SetLcdFilter * FT_Library_SetLcdFilter
* *
* @description: * @description:
@ -159,39 +189,23 @@ 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.
* *
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
*
* It does _not_ affect the output of @FT_Outline_Render and
* @FT_Outline_Get_Bitmap.
*
* If this feature is activated, the dimensions of LCD glyph bitmaps are
* either larger or taller than the dimensions of the corresponding
* outline with regards to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
* up to 3~pixels to the right.
*
* The bitmap offset values are adjusted correctly, so clients shouldn't
* need to modify their layout and glyph positioning code when enabling
* the filter.
*
* @since: * @since:
* 2.3.0 * 2.3.0
*/ */
@ -202,15 +216,12 @@ FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @func: * @function:
* FT_Library_SetLcdFilterWeights * FT_Library_SetLcdFilterWeights
* *
* @description: * @description:
* Use this function to override the filter weights selected by * This function can be used to enable LCD filter with custom weights,
* @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple * instead of using presets in @FT_Library_SetLcdFilter.
* (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
* 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
* FT_LCD_FILTER_LEGACY.
* *
* @input: * @input:
* library :: * library ::
@ -218,20 +229,20 @@ 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.
* *
* This function must be called after @FT_Library_SetLcdFilter to have * LCD filter weights can also be set per face using @FT_Face_Properties
* any effect. * with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
* *
* @since: * @since:
* 2.4.0 * 2.4.0
@ -240,12 +251,78 @@ FT_BEGIN_HEADER
FT_Library_SetLcdFilterWeights( FT_Library library, FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights ); unsigned char *weights );
/**************************************************************************
*
* @type:
* FT_LcdFiveTapFilter
*
* @description:
* A typedef for passing the five LCD filter weights to
* @FT_Face_Properties within an @FT_Parameter structure.
*
* @since:
* 2.8
*
*/
#define FT_LCD_FILTER_FIVE_TAPS 5
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] );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FT_LCD_FILTER_H__ */ #endif /* FTLCDFIL_H_ */
/* END */ /* END */

View File

@ -1,34 +1,34 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftlist.h */ * ftlist.h
/* */ *
/* Generic list support for FreeType (specification). */ * Generic list support for FreeType (specification).
/* */ *
/* Copyright 1996-2001, 2003, 2007, 2010, 2013, 2014 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_
#define __FTLIST_H__ #define FTLIST_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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,
@ -270,7 +291,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTLIST_H__ */ #endif /* FTLIST_H_ */
/* END */ /* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftlzw.h */ * ftlzw.h
/* */ *
/* LZW-compressed stream support. */ * LZW-compressed stream support.
/* */ *
/* Copyright 2004, 2006 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_
#define __FTLZW_H__ #define FTLZW_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -31,59 +31,60 @@
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 ::
* stream :: The target embedding stream. * The target embedding stream.
* *
* source :: The source stream. * source ::
* * The source stream.
* @return: *
* FreeType error code. 0~means success. * @return:
* * FreeType error code. 0~means success.
* @note: *
* The source stream must be opened _before_ calling this function. * @note:
* * The source stream must be opened _before_ calling this function.
* Calling the internal function `FT_Stream_Close' on the new stream will *
* *not* call `FT_Stream_Close' on the source stream. None of the stream * Calling the internal function `FT_Stream_Close` on the new stream will
* objects will be released to the heap. * **not** call `FT_Stream_Close` on the source stream. None of the
* * stream objects will be released to the heap.
* The stream implementation is very basic and resets the decompression *
* process each time seeking backwards is needed within the stream * The stream implementation is very basic and resets the decompression
* * process each time seeking backwards is needed within the stream
* In certain builds of the library, LZW compression recognition is *
* automatically handled when calling @FT_New_Face or @FT_Open_Face. * In certain builds of the library, LZW compression recognition is
* This means that if no font driver is capable of handling the raw * automatically handled when calling @FT_New_Face or @FT_Open_Face.
* compressed file, the library will try to open a LZW stream from it * This means that if no font driver is capable of handling the raw
* and re-open the face with it. * compressed file, the library will try to open a LZW stream from it and
* * re-open the face with it.
* This function may return `FT_Err_Unimplemented_Feature' if your build *
* of FreeType was not compiled with LZW support. * This function may return `FT_Err_Unimplemented_Feature` if your build
*/ * of FreeType was not compiled with LZW support.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Stream_OpenLZW( FT_Stream stream, FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source ); FT_Stream source );
@ -93,7 +94,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTLZW_H__ */ #endif /* FTLZW_H_ */
/* END */ /* END */

View File

@ -1,101 +1,105 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftmac.h */ * ftmac.h
/* */ *
/* Additional Mac-specific API. */ * Additional Mac-specific API.
/* */ *
/* Copyright 1996-2001, 2004, 2006, 2007, 2013 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_
#define __FTMAC_H__ #define FTMAC_H_
#include <ft2build.h> #include "ft2build.h"
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* gcc-3.4.1 and later can warn about functions tagged as deprecated */ /* gcc-3.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE #ifndef FT_DEPRECATED_ATTRIBUTE
#if defined(__GNUC__) && \ #if defined( __GNUC__ ) && \
((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) ( ( __GNUC__ >= 4 ) || \
#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) )
#define FT_DEPRECATED_ATTRIBUTE __attribute__(( deprecated ))
#else #else
#define FT_DEPRECATED_ATTRIBUTE #define FT_DEPRECATED_ATTRIBUTE
#endif #endif
#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,
@ -104,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,
@ -133,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,
@ -161,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,
@ -193,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,
@ -228,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,
@ -268,7 +284,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTMAC_H__ */ #endif /* FTMAC_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +1,107 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftmoderr.h */ * ftmoderr.h
/* */ *
/* FreeType module error offsets (specification). */ * FreeType module error offsets (specification).
/* */ *
/* Copyright 2001-2005, 2010, 2013 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_
#define __FTMODERR_H__ #define FTMODERR_H_
/*******************************************************************/ /*******************************************************************/
@ -188,7 +197,7 @@
#undef FT_NEED_EXTERN_C #undef FT_NEED_EXTERN_C
#endif /* __FTMODERR_H__ */ #endif /* FTMODERR_H_ */
/* END */ /* END */

View File

@ -1,36 +1,36 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftotval.h */ * ftotval.h
/* */ *
/* FreeType API for validating OpenType tables (specification). */ * FreeType API for validating OpenType tables (specification).
/* */ *
/* Copyright 2004-2007, 2013, 2014 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_
#define __FTOTVAL_H__ #define FTOTVAL_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -43,62 +43,62 @@
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
* *
* @description: * @description:
* A list of bit-field constants used with @FT_OpenType_Validate to * A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated. * indicate which OpenType tables should be validated.
* *
* @values: * @values:
* FT_VALIDATE_BASE :: * FT_VALIDATE_BASE ::
* Validate BASE table. * Validate BASE table.
* *
* FT_VALIDATE_GDEF :: * FT_VALIDATE_GDEF ::
* Validate GDEF table. * Validate GDEF table.
* *
* FT_VALIDATE_GPOS :: * FT_VALIDATE_GPOS ::
* Validate GPOS table. * Validate GPOS table.
* *
* FT_VALIDATE_GSUB :: * FT_VALIDATE_GSUB ::
* Validate GSUB table. * Validate GSUB table.
* *
* FT_VALIDATE_JSTF :: * FT_VALIDATE_JSTF ::
* Validate JSTF table. * Validate JSTF table.
* *
* FT_VALIDATE_MATH :: * FT_VALIDATE_MATH ::
* Validate MATH table. * Validate MATH table.
* *
* FT_VALIDATE_OT :: * FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
* *
*/ */
#define FT_VALIDATE_BASE 0x0100 #define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200 #define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400 #define FT_VALIDATE_GPOS 0x0400
@ -106,60 +106,61 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_JSTF 0x1000 #define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_MATH 0x2000 #define FT_VALIDATE_MATH 0x2000
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \ #define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \ FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \ FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \ FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \ FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH FT_VALIDATE_MATH )
/**********************************************************************
* /**************************************************************************
* @function: *
* FT_OpenType_Validate * @function:
* * FT_OpenType_Validate
* @description: *
* Validate various OpenType tables to assure that all offsets and * @description:
* indices are valid. The idea is that a higher-level library that * Validate various OpenType tables to assure that all offsets and
* actually does the text layout can access those tables without * indices are valid. The idea is that a higher-level library that
* error checking (which can be quite time consuming). * actually does the text layout can access those tables without error
* * checking (which can be quite time consuming).
* @input: *
* face :: * @input:
* A handle to the input face. * face ::
* * A handle to the input face.
* validation_flags :: *
* A bit field that specifies the tables to be validated. See * validation_flags ::
* @FT_VALIDATE_OTXXX for possible values. * A bit field that specifies the tables to be validated. See
* * @FT_VALIDATE_OTXXX for possible values.
* @output: *
* BASE_table :: * @output:
* A pointer to the BASE table. * BASE_table ::
* * A pointer to the BASE table.
* GDEF_table :: *
* A pointer to the GDEF table. * GDEF_table ::
* * A pointer to the GDEF table.
* GPOS_table :: *
* A pointer to the GPOS table. * GPOS_table ::
* * A pointer to the GPOS table.
* GSUB_table :: *
* A pointer to the GSUB table. * GSUB_table ::
* * A pointer to the GSUB table.
* JSTF_table :: *
* A pointer to the JSTF table. * JSTF_table ::
* * A pointer to the JSTF table.
* @return: *
* FreeType error code. 0~means success. * @return:
* * FreeType error code. 0~means success.
* @note: *
* This function only works with OpenType fonts, returning an error * @note:
* otherwise. * This function only works with OpenType fonts, returning an error
* * otherwise.
* After use, the application should deallocate the five tables with *
* @FT_OpenType_Free. A NULL value indicates that the table either * After use, the application should deallocate the five tables with
* doesn't exist in the font, or the application hasn't asked for * @FT_OpenType_Free. A `NULL` value indicates that the table either
* validation. * doesn't exist in the font, or the application hasn't asked for
*/ * validation.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_OpenType_Validate( FT_Face face, FT_OpenType_Validate( FT_Face face,
FT_UInt validation_flags, FT_UInt validation_flags,
@ -169,36 +170,38 @@ FT_BEGIN_HEADER
FT_Bytes *GSUB_table, FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table ); FT_Bytes *JSTF_table );
/**********************************************************************
* /**************************************************************************
* @function: *
* FT_OpenType_Free * @function:
* * FT_OpenType_Free
* @description: *
* Free the buffer allocated by OpenType validator. * @description:
* * Free the buffer allocated by OpenType validator.
* @input: *
* face :: * @input:
* A handle to the input face. * face ::
* * A handle to the input face.
* table :: *
* The pointer to the buffer that is allocated by * table ::
* @FT_OpenType_Validate. * The pointer to the buffer that is allocated by
* * @FT_OpenType_Validate.
* @note: *
* This function must be used to free the buffer allocated by * @note:
* @FT_OpenType_Validate only. * This function must be used to free the buffer allocated by
*/ * @FT_OpenType_Validate only.
*/
FT_EXPORT( void ) FT_EXPORT( void )
FT_OpenType_Free( FT_Face face, FT_OpenType_Free( FT_Face face,
FT_Bytes table ); FT_Bytes table );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTOTVAL_H__ */ #endif /* FTOTVAL_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,204 @@
/****************************************************************************
*
* ftparams.h
*
* FreeType API for possible FT_Parameter tags (specification only).
*
* Copyright (C) 2017-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 FTPARAMS_H_
#define FTPARAMS_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:
* parameter_tags
*
* @title:
* Parameter Tags
*
* @abstract:
* Macros for driver property and font loading parameter tags.
*
* @description:
* This section contains macros for the @FT_Parameter structure that are
* used with various functions to activate some special functionality or
* different behaviour of various components of FreeType.
*
*/
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* family names in the 'name' table (introduced in OpenType version 1.4).
* Use this for backward compatibility with legacy systems that have a
* four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* subfamily names in the 'name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* An @FT_Parameter tag to be used with @FT_Open_Face to indicate
* incremental glyph loading.
*
*/
#define FT_PARAM_TAG_INCREMENTAL \
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding argument specifies the five LCD filter weights for a
* given face (if using @FT_LOAD_TARGET_LCD, for example), overriding the
* global default values or the values set up with
* @FT_Library_SetLcdFilterWeights.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \
FT_MAKE_TAG( 'l', 'c', 'd', 'f' )
/**************************************************************************
*
* @enum:
* 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 font
* driver's random seed value with a face-specific one; see @random-seed.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_RANDOM_SEED \
FT_MAKE_TAG( 's', 'e', 'e', 'd' )
/**************************************************************************
*
* @enum:
* 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).
*
* This is a passive setting that only takes effect if the font driver or
* autohinter honors it, which the CFF, Type~1, and CID drivers always
* do, but the autohinter only in 'light' hinting mode (as of version
* 2.9).
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_STEM_DARKENING \
FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* Deprecated, no effect.
*
* Previously: A constant used as the tag of an @FT_Parameter structure
* to indicate that unpatented methods only should be used by the
* TrueType bytecode interpreter for a typeface opened by @FT_Open_Face.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING \
FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
/* */
FT_END_HEADER
#endif /* FTPARAMS_H_ */
/* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftpfr.h */ * ftpfr.h
/* */ *
/* FreeType API for accessing PFR-specific data (specification only). */ * FreeType API for accessing PFR-specific data (specification only).
/* */ *
/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 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_
#define __FTPFR_H__ #define FTPFR_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -32,60 +32,61 @@
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
* *
* @description: * @description:
* 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: *
* aoutline_resolution :: * @output:
* Outline resolution. This is equivalent to `face->units_per_EM' * aoutline_resolution ::
* for non-PFR fonts. Optional (parameter can be NULL). * Outline resolution. This is equivalent to `face->units_per_EM` for
* * non-PFR fonts. Optional (parameter can be `NULL`).
* ametrics_resolution :: *
* Metrics resolution. This is equivalent to `outline_resolution' * ametrics_resolution ::
* for non-PFR fonts. Optional (parameter can be NULL). * Metrics resolution. This is equivalent to `outline_resolution` for
* * non-PFR fonts. Optional (parameter can be `NULL`).
* ametrics_x_scale :: *
* A 16.16 fixed-point number used to scale distance expressed * ametrics_x_scale ::
* in metrics units to device sub-pixels. This is equivalent to * A 16.16 fixed-point number used to scale distance expressed in
* `face->size->x_scale', but for metrics only. Optional (parameter * metrics units to device subpixels. This is equivalent to
* can be NULL). * `face->size->x_scale`, but for metrics only. Optional (parameter
* * can be `NULL`).
* ametrics_y_scale :: *
* Same as `ametrics_x_scale' but for the vertical direction. * ametrics_y_scale ::
* optional (parameter can be NULL). * Same as `ametrics_x_scale` but for the vertical direction.
* * optional (parameter can be `NULL`).
* @return: *
* FreeType error code. 0~means success. * @return:
* * FreeType error code. 0~means success.
* @note: *
* If the input face is not a PFR, this function will return an error. * @note:
* However, in all cases, it will return valid values. * If the input face is not a PFR, this function will return an error.
*/ * However, in all cases, it will return valid values.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_PFR_Metrics( FT_Face face, FT_Get_PFR_Metrics( FT_Face face,
FT_UInt *aoutline_resolution, FT_UInt *aoutline_resolution,
@ -94,37 +95,41 @@ FT_BEGIN_HEADER
FT_Fixed *ametrics_y_scale ); FT_Fixed *ametrics_y_scale );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Kerning * FT_Get_PFR_Kerning
* *
* @description: * @description:
* Return the kerning pair corresponding to two glyphs in a PFR face. * Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of * The distance is expressed in metrics units, unlike the result of
* @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 ::
* right :: Index of the right glyph. * Index of the left glyph.
* *
* @output: * right ::
* avector :: A kerning vector. * Index of the right glyph.
* *
* @return: * @output:
* FreeType error code. 0~means success. * avector ::
* * A kerning vector.
* @note: *
* This function always return distances in original PFR metrics * @return:
* units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED * FreeType error code. 0~means success.
* mode, which always returns distances converted to outline units. *
* * @note:
* You can use the value of the `x_scale' and `y_scale' parameters * This function always return distances in original PFR metrics units.
* returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. * This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED mode,
*/ * which always returns distances converted to outline units.
*
* You can use the value of the `x_scale` and `y_scale` parameters
* returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face, FT_Get_PFR_Kerning( FT_Face face,
FT_UInt left, FT_UInt left,
@ -132,30 +137,33 @@ FT_BEGIN_HEADER
FT_Vector *avector ); FT_Vector *avector );
/********************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Advance * FT_Get_PFR_Advance
* *
* @description: * @description:
* Return a given glyph advance, expressed in original metrics units, * Return a given glyph advance, expressed in original metrics units,
* 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 ::
* @output: * The glyph index.
* aadvance :: The glyph advance in metrics units. *
* * @output:
* @return: * aadvance ::
* FreeType error code. 0~means success. * The glyph advance in metrics units.
* *
* @note: * @return:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics * FreeType error code. 0~means success.
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels). *
*/ * @note:
* You can use the `x_scale` or `y_scale` results of @FT_Get_PFR_Metrics
* to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face, FT_Get_PFR_Advance( FT_Face face,
FT_UInt gindex, FT_UInt gindex,
@ -166,7 +174,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTPFR_H__ */ #endif /* FTPFR_H_ */
/* END */ /* END */

View File

@ -1,26 +1,26 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftrender.h */ * ftrender.h
/* */ *
/* FreeType renderer modules public interface (specification). */ * FreeType renderer modules public interface (specification).
/* */ *
/* Copyright 1996-2001, 2005, 2006, 2010 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_
#define __FTRENDER_H__ #define FTRENDER_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_MODULE_H #include FT_MODULE_H
#include FT_GLYPH_H #include FT_GLYPH_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 */
@ -75,6 +75,7 @@ FT_BEGIN_HEADER
{ {
FT_Long glyph_size; FT_Long glyph_size;
FT_Glyph_Format glyph_format; FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init; FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done; FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy; FT_Glyph_CopyFunc glyph_copy;
@ -87,7 +88,7 @@ FT_BEGIN_HEADER
typedef FT_Error typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer, (*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot, FT_GlyphSlot slot,
FT_UInt mode, FT_Render_Mode mode,
const FT_Vector* origin ); const FT_Vector* origin );
typedef FT_Error typedef FT_Error
@ -115,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;
@ -157,69 +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, only the B/W renderer, if compiled with */ * in the renderer's known format into bitmaps.
/* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */ *
/* anti-aliasing mode; this option must be set directly in */ * This doesn't change the current renderer for other formats.
/* `ftraster.c' and is undefined by default) accepts a single tag */ *
/* `pal5' to set its gray palette as a character string with */ * Currently, no FreeType renderer module uses `parameters`; you should
/* 5~elements. Consequently, the third and fourth argument are zero */ * thus always pass `NULL` as the value.
/* normally. */ */
/* */
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,
@ -231,7 +239,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTRENDER_H__ */ #endif /* FTRENDER_H_ */
/* END */ /* END */

View File

@ -1,35 +1,35 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftsizes.h */ * ftsizes.h
/* */ *
/* FreeType size objects management (specification). */ * FreeType size objects management (specification).
/* */ *
/* Copyright 1996-2001, 2003, 2004, 2006, 2009, 2013 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_
#define __FTSIZES_H__ #define FTSIZES_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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 );
@ -153,7 +154,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTSIZES_H__ */ #endif /* FTSIZES_H_ */
/* END */ /* END */

View File

@ -1,30 +1,31 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* 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-2003, 2006, 2009, 2010, 2013 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 __FT_SFNT_NAMES_H__ #ifndef FTSNAMES_H_
#define __FT_SFNT_NAMES_H__ #define FTSNAMES_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_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!"
@ -36,65 +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' 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 ::
/* */ * The platform ID for `string`. See @TT_PLATFORM_XXX for possible
/* encoding_id :: The encoding ID for `string'. */ * values.
/* */ *
/* language_id :: The language ID for `string'. */ * encoding_id ::
/* */ * The encoding ID for `string`. See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,
/* name_id :: An identifier for `string'. */ * @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX for possible
/* */ * values.
/* string :: The `name' string. Note that its format differs */ *
/* depending on the (platform,encoding) pair. It can */ * language_id ::
/* be a Pascal String, a UTF-16 one, etc. */ * The language ID for `string`. See @TT_MAC_LANGID_XXX and
/* */ * @TT_MS_LANGID_XXX for possible values.
/* Generally speaking, the string is not */ *
/* zero-terminated. Please refer to the TrueType */ * Registered OpenType values for `language_id` are always smaller than
/* specification for details. */ * 0x8000; values equal or larger than 0x8000 usually indicate a
/* */ * language tag string (introduced in OpenType version 1.6). Use
/* string_len :: The length of `string' in bytes. */ * function @FT_Get_Sfnt_LangTag with `language_id` as its argument to
/* */ * retrieve the associated language tag.
/* <Note> */ *
/* Possible values for `platform_id', `encoding_id', `language_id', */ * name_id ::
/* and `name_id' are given in the file `ttnameid.h'. For details */ * An identifier for `string`. See @TT_NAME_ID_XXX for possible
/* please refer to the TrueType or OpenType specification. */ * values.
/* */ *
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ * string ::
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ * The 'name' string. Note that its format differs depending on the
/* */ * (platform,encoding) pair, being either a string of bytes (without a
* terminating `NULL` byte) or containing UTF-16BE entities.
*
* string_len ::
* The length of `string` in bytes.
*
* @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;
@ -103,98 +113,161 @@ FT_BEGIN_HEADER
FT_UShort name_id; FT_UShort name_id;
FT_Byte* string; /* this string is *not* null-terminated! */ FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */ FT_UInt string_len; /* in bytes */
} 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. The application should deallocate it if it is no */ *
/* longer in use. */ * @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 entries, then do a loop until you get the right platform,
* encoding, and name ID.
*
* 'name' table format~1 entries can use language tags also, see
* @FT_Get_Sfnt_LangTag.
*
* 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 );
/*************************************************************************** /**************************************************************************
* *
* @constant: * @struct:
* FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY * FT_SfntLangTag
* *
* @description: * @description:
* A constant used as the tag of @FT_Parameter structures to make * A structure to model a language tag entry from an SFNT 'name' table.
* FT_Open_Face() ignore preferred family subfamily names in `name'
* table since OpenType version 1.4. For backwards compatibility with
* legacy systems that have a 4-face-per-family restriction.
* *
* @fields:
* string ::
* The language tag string, encoded in UTF-16BE (without trailing
* `NULL` bytes).
*
* string_len ::
* The length of `string` in **bytes**.
*
* @note:
* Please refer to the TrueType or OpenType specification for more
* details.
*
* @since:
* 2.8
*/ */
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) typedef struct FT_SfntLangTag_
{
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
} FT_SfntLangTag;
/*************************************************************************** /**************************************************************************
* *
* @constant: * @function:
* FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY * FT_Get_Sfnt_LangTag
* *
* @description: * @description:
* A constant used as the tag of @FT_Parameter structures to make * Retrieve the language tag associated with a language ID of an SFNT
* FT_Open_Face() ignore preferred subfamily names in `name' table since * 'name' table entry.
* OpenType version 1.4. For backwards compatibility with legacy
* systems that have a 4-face-per-family restriction.
* *
* @input:
* 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.
*
* @output:
* alangTag ::
* The language tag associated with the 'name' table entry's language
* ID.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The `string` array returned in the `alangTag` structure is not
* null-terminated. Note that you don't have to deallocate `string` by
* yourself; FreeType takes care of it if you call @FT_Done_Face.
*
* Only 'name' table format~1 supports language tags. For format~0
* tables, this function always returns FT_Err_Invalid_Table. For
* invalid format~1 language ID values, FT_Err_Invalid_Argument is
* returned.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_SFNT_NAMES` is not defined in `ftoption.h`.
*
* @since:
* 2.8
*/ */
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) FT_EXPORT( FT_Error )
FT_Get_Sfnt_LangTag( FT_Face face,
FT_UInt langID,
FT_SfntLangTag *alangTag );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FT_SFNT_NAMES_H__ */ #endif /* FTSNAMES_H_ */
/* END */ /* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftstroke.h */ * ftstroke.h
/* */ *
/* FreeType path stroker (specification). */ * FreeType path stroker (specification).
/* */ *
/* Copyright 2002-2006, 2008, 2009, 2011-2012, 2014 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 __FT_STROKE_H__ #ifndef FTSTROKE_H_
#define __FT_STROKE_H__ #define FTSTROKE_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_OUTLINE_H #include FT_OUTLINE_H
#include FT_GLYPH_H #include FT_GLYPH_H
@ -27,116 +27,113 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/************************************************************************ /**************************************************************************
* *
* @section: * @section:
* glyph_stroker * glyph_stroker
* *
* @title: * @title:
* Glyph Stroker * Glyph Stroker
* *
* @abstract: * @abstract:
* 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.
* *
* @order: * @order:
* FT_Stroker * FT_Stroker
* *
* FT_Stroker_LineJoin * FT_Stroker_LineJoin
* FT_Stroker_LineCap * FT_Stroker_LineCap
* FT_StrokerBorder * FT_StrokerBorder
* *
* FT_Outline_GetInsideBorder * FT_Outline_GetInsideBorder
* FT_Outline_GetOutsideBorder * FT_Outline_GetOutsideBorder
* *
* FT_Glyph_Stroke * FT_Glyph_Stroke
* FT_Glyph_StrokeBorder * FT_Glyph_StrokeBorder
* *
* FT_Stroker_New * FT_Stroker_New
* FT_Stroker_Set * FT_Stroker_Set
* FT_Stroker_Rewind * FT_Stroker_Rewind
* FT_Stroker_ParseOutline * FT_Stroker_ParseOutline
* FT_Stroker_Done * FT_Stroker_Done
* *
* FT_Stroker_BeginSubPath * FT_Stroker_BeginSubPath
* FT_Stroker_EndSubPath * FT_Stroker_EndSubPath
* *
* FT_Stroker_LineTo * FT_Stroker_LineTo
* FT_Stroker_ConicTo * FT_Stroker_ConicTo
* FT_Stroker_CubicTo * FT_Stroker_CubicTo
* *
* FT_Stroker_GetBorderCounts * FT_Stroker_GetBorderCounts
* FT_Stroker_ExportBorder * FT_Stroker_ExportBorder
* FT_Stroker_GetCounts * FT_Stroker_GetCounts
* FT_Stroker_Export * FT_Stroker_Export
* *
*/ */
/************************************************************** /**************************************************************************
* *
* @type: * @type:
* FT_Stroker * FT_Stroker
* *
* @description: * @description:
* Opaque handle to a path stroker object. * Opaque handle to a path stroker object.
*/ */
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.
* backwards 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 zier 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:
@ -474,7 +467,7 @@ FT_BEGIN_HEADER
* The target stroker handle. * The target stroker handle.
* *
* control :: * control ::
* A pointer to a Bézier control point. * A pointer to a Bezier control point.
* *
* to :: * to ::
* A pointer to the destination point. * A pointer to the destination point.
@ -492,24 +485,24 @@ FT_BEGIN_HEADER
FT_Vector* to ); FT_Vector* to );
/************************************************************** /**************************************************************************
* *
* @function: * @function:
* FT_Stroker_CubicTo * FT_Stroker_CubicTo
* *
* @description: * @description:
* `Draw' a single cubic zier 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 ::
* The target stroker handle. * The target stroker handle.
* *
* control1 :: * control1 ::
* A pointer to the first Bézier control point. * A pointer to the first Bezier control point.
* *
* control2 :: * control2 ::
* A pointer to second Bézier control point. * A pointer to second Bezier control point.
* *
* to :: * to ::
* A pointer to the destination point. * A pointer to the destination point.
@ -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,
@ -774,7 +761,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FT_STROKE_H__ */ #endif /* FTSTROKE_H_ */
/* END */ /* END */

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-2001, 2003, 2006, 2008, 2012, 2013 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,17 +35,17 @@
/* 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. */
#ifndef __FTSYNTH_H__ #ifndef FTSYNTH_H_
#define __FTSYNTH_H__ #define FTSYNTH_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -57,13 +57,15 @@
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. */
/* */ /* */
/* For emboldened outlines the height, width, and advance metrics are */ /* For emboldened outlines the height, width, and advance metrics are */
/* increased by the strength of the emboldening. You can also call */ /* increased by the strength of the emboldening -- this even affects */
/* @FT_Outline_Get_CBox to get precise values. */ /* mono-width fonts! */
/* */
/* You can also call @FT_Outline_Get_CBox to get precise values. */
FT_EXPORT( void ) FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
@ -76,7 +78,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTSYNTH_H__ */ #endif /* FTSYNTH_H_ */
/* END */ /* END */

View File

@ -1,59 +1,58 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftsystem.h */ * ftsystem.h
/* */ *
/* FreeType low-level system interface definition (specification). */ * FreeType low-level system interface definition (specification).
/* */ *
/* Copyright 1996-2001, 2002, 2005, 2010, 2014 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_
#define __FTSYSTEM_H__ #define FTSYSTEM_H_
#include <ft2build.h> #include "ft2build.h"
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
@ -265,14 +263,14 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* stream :: * stream ::
* A handle to the target stream. * A handle to the target stream.
* *
*/ */
typedef void typedef void
(*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
@ -349,7 +347,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTSYSTEM_H__ */ #endif /* FTSYSTEM_H_ */
/* END */ /* END */

View File

@ -1,23 +1,23 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fttrigon.h */ * fttrigon.h
/* */ *
/* FreeType trigonometric functions (specification). */ * FreeType trigonometric functions (specification).
/* */ *
/* Copyright 2001, 2003, 2005, 2007, 2013 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_
#define __FTTRIGON_H__ #define FTTRIGON_H_
#include FT_FREETYPE_H #include FT_FREETYPE_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 `sin(angle)', and the value of * call, the value of `vec.x` will be `cos(angle)`, and the value of
* `vec.y' will be `cos(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
@ -344,7 +344,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTTRIGON_H__ */ #endif /* FTTRIGON_H_ */
/* END */ /* END */

View File

@ -1,170 +0,0 @@
/***************************************************************************/
/* */
/* ftttdrv.h */
/* */
/* FreeType API for controlling the TrueType driver */
/* (specification only). */
/* */
/* Copyright 2013 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'.
*
*/
/**************************************************************************
*
* @property:
* interpreter-version
*
* @description:
* Currently, two versions are available, representing the bytecode
* interpreter with and without subpixel hinting support,
* 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. The
* 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) font-specific
* tweaks.
*
* 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'.
*
* The following example code demonstrates how to activate subpixel
* hinting (omitting the error handling).
*
* {
* FT_Library library;
* FT_Face face;
* FT_UInt interpreter_version = TT_INTERPRETER_VERSION_38;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "truetype",
* "interpreter-version",
* &interpreter_version );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
*/
/**************************************************************************
*
* @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).
*
* @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 configuration option
* FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
* `FT_Err_Unimplemented_Feature' error.
*
* Depending on the graphics framework, Microsoft uses different
* bytecode engines. As a consequence, the version numbers returned by
* a call to the `GETINFO[1]' bytecode instruction are more convoluted
* than desired.
*
* {
* framework Windows version result of GETINFO[1]
* ----------------------------------------------------
* GDI before XP 35
* GDI XP and later 37
* GDI+ old before Vista 37
* GDI+ old Vista, 7 38
* GDI+ after 7 40
* DWrite before 8 39
* DWrite 8 and later 40
* }
*
* Since FreeType doesn't provide all capabilities of DWrite ClearType,
* using version~38 seems justified.
*
*/
#define TT_INTERPRETER_VERSION_35 35
#define TT_INTERPRETER_VERSION_38 38
/* */
FT_END_HEADER
#endif /* __FTTTDRV_H__ */
/* END */

View File

@ -1,26 +1,26 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* fttypes.h */ * fttypes.h
/* */ *
/* FreeType simple types definitions (specification only). */ * FreeType simple types definitions (specification only).
/* */ *
/* Copyright 1996-2002, 2004, 2006-2009, 2012-2014 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_
#define __FTTYPES_H__ #define FTTYPES_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_CONFIG_CONFIG_H #include FT_CONFIG_CONFIG_H
#include FT_SYSTEM_H #include FT_SYSTEM_H
#include FT_IMAGE_H #include FT_IMAGE_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 )
@ -596,7 +609,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTTYPES_H__ */ #endif /* FTTYPES_H_ */
/* END */ /* END */

View File

@ -1,25 +1,25 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* ftwinfnt.h */ * ftwinfnt.h
/* */ *
/* FreeType API for accessing Windows fnt-specific data. */ * FreeType API for accessing Windows fnt-specific data.
/* */ *
/* Copyright 2003, 2004, 2008 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_
#define __FTWINFNT_H__ #define FTWINFNT_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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.
@ -78,28 +77,29 @@ FT_BEGIN_HEADER
* Mac Roman encoding. * Mac Roman encoding.
* *
* FT_WinFNT_ID_OEM :: * FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <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
* *
* http://www.microsoft.com/globaldev/reference/cphome.mspx, * 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.
@ -264,7 +266,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTWINFNT_H__ */ #endif /* FTWINFNT_H_ */
/* END */ /* END */

View File

@ -1,84 +0,0 @@
/***************************************************************************/
/* */
/* ftxf86.h */
/* */
/* Support functions for X11. */
/* */
/* Copyright 2002-2004, 2006, 2007, 2013 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 __FTXF86_H__
#define __FTXF86_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> */
/* font_formats */
/* */
/* <Title> */
/* Font Formats */
/* */
/* <Abstract> */
/* Getting the font format. */
/* */
/* <Description> */
/* The single function in this section can be used to get the font */
/* format. Note that this information is not needed normally; */
/* however, there are special cases (like in PDF devices) where it is */
/* important to differentiate, in spite of FreeType's uniform API. */
/* */
/* This function is in the X11/xf86 namespace for historical reasons */
/* and in no way depends on that windowing system. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_X11_Font_Format */
/* */
/* <Description> */
/* Return a string describing the format of a given face, using values */
/* that can be used as an X11 FONT_PROPERTY. Possible values are */
/* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
/* `PFR', and `Windows~FNT'. */
/* */
/* <Input> */
/* face :: */
/* Input face handle. */
/* */
/* <Return> */
/* Font format string. NULL in case of error. */
/* */
FT_EXPORT( const char* )
FT_Get_X11_Font_Format( FT_Face face );
/* */
FT_END_HEADER
#endif /* __FTXF86_H__ */

View File

@ -1,27 +1,27 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* 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-2004, 2006, 2008, 2009, 2011, 2014 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_
#define __T1TABLES_H__ #define T1TABLES_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_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
@ -291,7 +289,7 @@ FT_BEGIN_HEADER
} PS_DesignMapRec, *PS_DesignMap; } PS_DesignMapRec, *PS_DesignMap;
/* backwards-compatible definition */ /* backward compatible definition */
typedef PS_DesignMapRec T1_DesignMap; typedef PS_DesignMapRec T1_DesignMap;
@ -326,18 +324,27 @@ FT_BEGIN_HEADER
} PS_BlendRec, *PS_Blend; } PS_BlendRec, *PS_Blend;
/* backwards-compatible definition */ /* backward compatible definition */
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,47 +428,45 @@ 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.
* *
* @input: * @input:
* face :: * face ::
* face handle * face handle
* *
* @return: * @return:
* Boolean. True if glyph names are reliable. * Boolean. True if glyph names 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
@ -482,21 +487,22 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* face :: * face ::
* PostScript face handle. * PostScript face handle.
* *
* @output: * @output:
* afont_info :: * afont_info ::
* Output font info structure pointer. * Output font info structure pointer.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* The string pointers within the font info 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. * face and don't need to be freed by the caller. Missing entries in
* the font's FontInfo dictionary are represented by `NULL` pointers.
* *
* If the font's format is not PostScript-based, this function will * 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 )
@ -504,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
@ -515,11 +521,11 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* face :: * face ::
* PostScript face handle. * PostScript face handle.
* *
* @output: * @output:
* afont_private :: * afont_private ::
* Output private dictionary structure pointer. * Output private dictionary structure pointer.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
@ -529,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 )
@ -537,22 +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:
* 2.4.8
*/
typedef enum T1_EncodingType_ typedef enum T1_EncodingType_
{ {
T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_NONE = 0,
@ -564,63 +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:
* 2.4.8
*/
typedef enum PS_Dict_Keys_ typedef enum PS_Dict_Keys_
{ {
/* conventionally in the font dictionary */ /* conventionally in the font dictionary */
@ -680,7 +691,7 @@ FT_BEGIN_HEADER
} PS_Dict_Keys; } PS_Dict_Keys;
/************************************************************************ /**************************************************************************
* *
* @function: * @function:
* FT_Get_PS_Font_Value * FT_Get_PS_Font_Value
@ -690,57 +701,60 @@ FT_BEGIN_HEADER
* *
* @input: * @input:
* face :: * face ::
* PostScript face handle. * PostScript face handle.
* *
* key :: * key ::
* An enumeration value representing the dictionary key to retrieve. * An enumeration value representing the dictionary key to retrieve.
* *
* idx :: * idx ::
* For array values, this specifies the index to be returned. * For array values, this specifies the index to be returned.
* *
* value :: * value ::
* A pointer to memory into which to write the value. * A pointer to memory into which to write the value.
* *
* valen_len :: * valen_len ::
* The size, in bytes, of the memory supplied for the value. * The size, in bytes, of the memory supplied for the value.
* *
* @output: * @output:
* value :: * value ::
* 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:
* 2.4.8
* *
*/ */
FT_EXPORT( FT_Long ) FT_EXPORT( FT_Long )
@ -754,7 +768,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __T1TABLES_H__ */ #endif /* T1TABLES_H_ */
/* END */ /* END */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,26 @@
/***************************************************************************/ /****************************************************************************
/* */ *
/* tttags.h */ * tttags.h
/* */ *
/* Tags for TrueType and OpenType tables (specification only). */ * Tags for TrueType and OpenType tables (specification only).
/* */ *
/* Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 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_
#define __TTAGS_H__ #define TTAGS_H_
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
@ -43,8 +43,11 @@ FT_BEGIN_HEADER
#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' ) #define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' ) #define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#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' )
@ -61,6 +64,7 @@ FT_BEGIN_HEADER
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) #define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) #define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) #define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
#define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) #define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) #define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) #define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
@ -79,6 +83,7 @@ FT_BEGIN_HEADER
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) #define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) #define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) #define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
#define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) #define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) #define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) #define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
@ -100,12 +105,19 @@ FT_BEGIN_HEADER
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
#define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' )
#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' ) #define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
/* used by "Keyboard.dfont" on legacy Mac OS X */
#define TTAG_0xA5kbd FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' )
/* used by "LastResort.dfont" on legacy Mac OS X */
#define TTAG_0xA5lst FT_MAKE_TAG( 0xA5, 'l', 's', 't' )
FT_END_HEADER FT_END_HEADER
#endif /* __TTAGS_H__ */ #endif /* TTAGS_H_ */
/* END */ /* END */

View File

@ -1,60 +0,0 @@
/***************************************************************************/
/* */
/* ttunpat.h */
/* */
/* Definitions for the unpatented TrueType hinting system */
/* */
/* Copyright 2003, 2006 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:
* 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 */

Binary file not shown.