updated freetype to 2.2.1, tested ok, please forgive me for possible left issues :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17933 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
3f990ca3cc
commit
4894b87045
@ -8,7 +8,6 @@ FT2_SRC = [ FDirName $(HAIKU_TOP) src libs freetype2 ] ;
|
||||
FT2_LIB = freetype ;
|
||||
|
||||
FT2_COMPONENTS ?= gzip # support for gzip-compressed files.
|
||||
autohint # auto-hinter
|
||||
autofit
|
||||
base # base component (public APIs)
|
||||
bdf # BDF font driver
|
||||
@ -16,7 +15,6 @@ FT2_COMPONENTS ?= gzip # support for gzip-compressed files.
|
||||
cff # CFF/CEF font driver
|
||||
cid # Postscript CID-keyed font driver
|
||||
lzw # LZW routines
|
||||
otvalid
|
||||
pcf # PCF font driver
|
||||
pfr # PFR/TrueDoc font driver
|
||||
psaux # Common Postscript routines module
|
||||
@ -65,6 +63,8 @@ rule FT2_Library
|
||||
# <libname> The name of the library.
|
||||
# <sources> The sources.
|
||||
|
||||
DEFINES += FT2_BUILD_LIBRARY ;
|
||||
|
||||
local library = lib$(1).so ;
|
||||
local sources = $(2) ;
|
||||
|
||||
|
216
headers/libs/freetype2/freetype/cache/ftccmap.h
vendored
216
headers/libs/freetype2/freetype/cache/ftccmap.h
vendored
@ -1,216 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftccmap.h */
|
||||
/* */
|
||||
/* FreeType charmap cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003 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 __FTCCMAP_H__
|
||||
#define __FTCCMAP_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FTC_CMapCache */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* An opaque handle used to manager a charmap cache. This cache is */
|
||||
/* to hold character codes -> glyph indices mappings. */
|
||||
/* */
|
||||
typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FTC_CMapDesc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to an @FTC_CMapDescRec structure used to describe a given */
|
||||
/* charmap in a charmap cache. */
|
||||
/* */
|
||||
/* Each @FTC_CMapDesc describes which charmap (of which @FTC_FaceID) */
|
||||
/* we want to use in @FTC_CMapCache_Lookup. */
|
||||
/* */
|
||||
typedef struct FTC_CMapDescRec_* FTC_CMapDesc;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @enum: */
|
||||
/* FTC_CMapType */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The list of valid @FTC_CMapDesc types. They indicate how we want */
|
||||
/* to address a charmap within an @FTC_FaceID. */
|
||||
/* */
|
||||
/* @values: */
|
||||
/* FTC_CMAP_BY_INDEX :: */
|
||||
/* Address a charmap by its index in the corresponding @FT_Face. */
|
||||
/* */
|
||||
/* FTC_CMAP_BY_ENCODING :: */
|
||||
/* Use a @FT_Face charmap that corresponds to a given encoding. */
|
||||
/* */
|
||||
/* FTC_CMAP_BY_ID :: */
|
||||
/* Use an @FT_Face charmap that corresponds to a given */
|
||||
/* (platform,encoding) ID. See @FTC_CMapIdRec. */
|
||||
/* */
|
||||
typedef enum FTC_CMapType_
|
||||
{
|
||||
FTC_CMAP_BY_INDEX = 0,
|
||||
FTC_CMAP_BY_ENCODING = 1,
|
||||
FTC_CMAP_BY_ID = 2
|
||||
|
||||
} FTC_CMapType;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FTC_CMapIdRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A short structure to identify a charmap by a (platform,encoding) */
|
||||
/* pair of values. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* platform :: The platform ID. */
|
||||
/* */
|
||||
/* encoding :: The encoding ID. */
|
||||
/* */
|
||||
typedef struct FTC_CMapIdRec_
|
||||
{
|
||||
FT_UInt platform;
|
||||
FT_UInt encoding;
|
||||
|
||||
} FTC_CMapIdRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FTC_CMapDescRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure to describe a given charmap to @FTC_CMapCache. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* face_id :: @FTC_FaceID of the face this charmap belongs to. */
|
||||
/* */
|
||||
/* type :: The type of charmap, see @FTC_CMapType. */
|
||||
/* */
|
||||
/* u.index :: For @FTC_CMAP_BY_INDEX types, this is the charmap */
|
||||
/* index (within a @FT_Face) we want to use. */
|
||||
/* */
|
||||
/* u.encoding :: For @FTC_CMAP_BY_ENCODING types, this is the charmap */
|
||||
/* encoding we want to use. see @FT_Encoding. */
|
||||
/* */
|
||||
/* u.id :: For @FTC_CMAP_BY_ID types, this is the */
|
||||
/* (platform,encoding) pair we want to use. see */
|
||||
/* @FTC_CMapIdRec and @FT_CharMapRec. */
|
||||
/* */
|
||||
typedef struct FTC_CMapDescRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FTC_CMapType type;
|
||||
|
||||
union
|
||||
{
|
||||
FT_UInt index;
|
||||
FT_Encoding encoding;
|
||||
FTC_CMapIdRec id;
|
||||
|
||||
} u;
|
||||
|
||||
} FTC_CMapDescRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_New */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Creates a new charmap cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* acache :: A new cache handle. NULL in case of error. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Like all other caches, this one will be destroyed with the cache */
|
||||
/* manager. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_CMapCache_New( FTC_Manager manager,
|
||||
FTC_CMapCache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Translates a character code into a glyph index, using the charmap */
|
||||
/* cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* cache :: A charmap cache handle. */
|
||||
/* */
|
||||
/* cmap_desc :: A charmap descriptor handle. */
|
||||
/* */
|
||||
/* char_code :: The character code (in the corresponding charmap). */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Glyph index. 0 means "no glyph". */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* This function doesn't return @FTC_Node handles, since there is no */
|
||||
/* real use for them with typical uses of charmaps. */
|
||||
/* */
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_CMapCache_Lookup( FTC_CMapCache cache,
|
||||
FTC_CMapDesc cmap_desc,
|
||||
FT_UInt32 char_code );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCCMAP_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -201,7 +201,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the "long long" type */
|
||||
/* GCC provides the `long long' type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
@ -265,9 +265,9 @@ FT_BEGIN_HEADER
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_DEF( x ) extern "C" x
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#else
|
||||
#define FT_BASE_DEF( x ) extern x
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -96,58 +96,62 @@
|
||||
|
||||
/* configuration files */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_CONFIG_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* FreeType 2 configuration data. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_CONFIG_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* FreeType 2 configuration data.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_CONFIG_H
|
||||
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_STANDARD_LIBRARY_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* FreeType 2 configuration data. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_STANDARD_LIBRARY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* FreeType 2 interface to the standard C library functions.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_STANDARD_LIBRARY_H
|
||||
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_OPTIONS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* FreeType 2 project-specific configuration options. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_OPTIONS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* FreeType 2 project-specific configuration options.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_OPTIONS_H
|
||||
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CONFIG_MODULES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list of FreeType 2 modules that are statically linked to new */
|
||||
/* library instances in @FT_Init_FreeType. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_MODULES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list of FreeType 2 modules that are statically linked to new library
|
||||
* instances in @FT_Init_FreeType.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_MODULES_H
|
||||
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
|
||||
#endif
|
||||
@ -155,436 +159,543 @@
|
||||
|
||||
/* public headers */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_FREETYPE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the base FreeType 2 API. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_FREETYPE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* base FreeType 2 API.
|
||||
*
|
||||
*/
|
||||
#define FT_FREETYPE_H <freetype/freetype.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ERRORS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list of FreeType 2 error codes (and messages). */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ERRORS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list of FreeType 2 error codes (and messages).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_ERRORS_H <freetype/fterrors.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MODULE_ERRORS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list of FreeType 2 module error offsets (and messages). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MODULE_ERRORS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list of FreeType 2 module error offsets (and messages).
|
||||
*
|
||||
*/
|
||||
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_SYSTEM_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the FreeType 2 interface to low-level operations (i.e. memory */
|
||||
/* management and stream i/o). */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SYSTEM_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 interface to low-level operations (i.e., memory management
|
||||
* and stream i/o).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_SYSTEM_H <freetype/ftsystem.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_IMAGE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* types definitions related to glyph images (i.e. bitmaps, outlines, */
|
||||
/* scan-converter parameters). */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_IMAGE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing types
|
||||
* definitions related to glyph images (i.e., bitmaps, outlines,
|
||||
* scan-converter parameters).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_IMAGE_H <freetype/ftimage.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TYPES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the basic data types defined by FreeType 2. */
|
||||
/* */
|
||||
/* It is included by @FT_FREETYPE_H. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TYPES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* basic data types defined by FreeType 2.
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_TYPES_H <freetype/fttypes.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_LIST_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the list management API of FreeType 2. */
|
||||
/* */
|
||||
/* (Most applications will never need to include this file.) */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LIST_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list management API of FreeType 2.
|
||||
*
|
||||
* (Most applications will never need to include this file.)
|
||||
*
|
||||
*/
|
||||
#define FT_LIST_H <freetype/ftlist.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_OUTLINE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the scalable outline management API of FreeType 2. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OUTLINE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* scalable outline management API of FreeType 2.
|
||||
*
|
||||
*/
|
||||
#define FT_OUTLINE_H <freetype/ftoutln.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_SIZES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API used to manage multiple @FT_Size objects per face. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SIZES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API used to manage multiple @FT_Size objects per face.
|
||||
*
|
||||
*/
|
||||
#define FT_SIZES_H <freetype/ftsizes.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MODULE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the module management API of FreeType 2. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MODULE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* module management API of FreeType 2.
|
||||
*
|
||||
*/
|
||||
#define FT_MODULE_H <freetype/ftmodapi.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_RENDER_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the renderer module management API of FreeType 2. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_RENDER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* renderer module management API of FreeType 2.
|
||||
*
|
||||
*/
|
||||
#define FT_RENDER_H <freetype/ftrender.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TYPE1_TABLES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the types and API specific to the Type 1 format. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TYPE1_TABLES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* types and API specific to the Type 1 format.
|
||||
*
|
||||
*/
|
||||
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TRUETYPE_IDS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the enumeration values used to identify name strings, languages, */
|
||||
/* encodings, etc. This file really contains a _large_ set of */
|
||||
/* constant macro definitions, taken from the TrueType and OpenType */
|
||||
/* specifications. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_IDS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* enumeration values used to identify name strings, languages,
|
||||
* encodings, etc. This file really contains a _large_ set of constant
|
||||
* macro definitions, taken from the TrueType and OpenType
|
||||
* specifications.
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TRUETYPE_TABLES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the types and API specific to the TrueType (as well as OpenType) */
|
||||
/* format. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_TABLES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* types and API specific to the TrueType (as well as OpenType) format.
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_TRUETYPE_TAGS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of TrueType 4-byte `tags' used to identify blocks */
|
||||
/* in SFNT-based font formats (i.e. TrueType and OpenType). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_TAGS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of TrueType four-byte `tags' used to identify blocks in
|
||||
* SFNT-based font formats (i.e., TrueType and OpenType).
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_BDF_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to access BDF-specific strings from a */
|
||||
/* face. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BDF_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to access BDF-specific strings from a face.
|
||||
*
|
||||
*/
|
||||
#define FT_BDF_H <freetype/ftbdf.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_GZIP_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to support for gzip-compressed files. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GZIP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to support for gzip-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_GZIP_H <freetype/ftgzip.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_LZW_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to support for LZW-compressed files. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LZW_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to support for LZW-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_LZW_H <freetype/ftlzw.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_WINFONTS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to support Windows .FNT files */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_WINFONTS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API to support Windows FNT files.
|
||||
*
|
||||
*/
|
||||
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_GLYPH_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional glyph management component. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GLYPH_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional glyph management component.
|
||||
*
|
||||
*/
|
||||
#define FT_GLYPH_H <freetype/ftglyph.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_BITMAP_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional bitmap conversion component. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BITMAP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional bitmap conversion component.
|
||||
*
|
||||
*/
|
||||
#define FT_BITMAP_H <freetype/ftbitmap.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_BBOX_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional exact bounding box computation routines. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BBOX_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional exact bounding box computation routines.
|
||||
*
|
||||
*/
|
||||
#define FT_BBOX_H <freetype/ftbbox.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the API of the optional FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional FreeType 2 cache sub-system.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_H <freetype/ftcache.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_IMAGE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `glyph image' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/* It is used to define a cache for @FT_Glyph elements. You can also */
|
||||
/* see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need */
|
||||
/* to store small glyph bitmaps, as it will use less memory. */
|
||||
/* */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* glyph image-related cache declarations. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_IMAGE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* `glyph image' API of the FreeType 2 cache sub-system.
|
||||
*
|
||||
* It is used to define a cache for @FT_Glyph elements. You can also
|
||||
* see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
|
||||
* store small glyph bitmaps, as it will use less memory.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* glyph image-related cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_IMAGE_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_SMALL_BITMAPS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `small bitmaps' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/* It is used to define a cache for small glyph bitmaps in a */
|
||||
/* relatively memory-efficient way. You can also use the API defined */
|
||||
/* in @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, */
|
||||
/* including scalable outlines. */
|
||||
/* */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* small bitmaps-related cache declarations. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_SMALL_BITMAPS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* `small bitmaps' API of the FreeType 2 cache sub-system.
|
||||
*
|
||||
* It is used to define a cache for small glyph bitmaps in a relatively
|
||||
* memory-efficient way. You can also use the API defined in
|
||||
* @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
|
||||
* including scalable outlines.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* small bitmaps-related cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_CACHE_CHARMAP_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `charmap' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* charmap-based cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_H
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_CHARMAP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* `charmap' API of the FreeType 2 cache sub-system.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* charmap-based cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MAC_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the Macintosh-specific FreeType 2 API. The latter is used to */
|
||||
/* access fonts embedded in resource forks. */
|
||||
/* */
|
||||
/* This header file must be explicitly included by client */
|
||||
/* applications compiled on the Mac (note that the base API still */
|
||||
/* works though). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MAC_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* Macintosh-specific FreeType 2 API. The latter is used to access
|
||||
* fonts embedded in resource forks.
|
||||
*
|
||||
* This header file must be explicitly included by client applications
|
||||
* compiled on the Mac (note that the base API still works though).
|
||||
*
|
||||
*/
|
||||
#define FT_MAC_H <freetype/ftmac.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_MULTIPLE_MASTERS_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the optional multiple-masters management API of FreeType 2. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MULTIPLE_MASTERS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional multiple-masters management API of FreeType 2.
|
||||
*
|
||||
*/
|
||||
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_SFNT_NAMES_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the optional FreeType 2 API used to access embedded `name' strings */
|
||||
/* in SFNT-based font formats (i.e. TrueType and OpenType). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SFNT_NAMES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType 2 API used to access embedded `name' strings in
|
||||
* SFNT-based font formats (i.e., TrueType and OpenType).
|
||||
*
|
||||
*/
|
||||
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_OPENTYPE_VALIDATE_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the optional FreeType 2 API used to validate OpenType tables */
|
||||
/* (BASE, GDEF, GPOS, GSUB, JSTF). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OPENTYPE_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType 2 API used to validate OpenType tables (BASE, GDEF,
|
||||
* GPOS, GSUB, JSTF).
|
||||
*
|
||||
*/
|
||||
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GX_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType 2 API used to validate TrueTypeGX/AAT tables (feat,
|
||||
* mort, morx, bsln, just, kern, opbd, trak, prop).
|
||||
*
|
||||
*/
|
||||
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_PFR_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to access PFR-specific data.
|
||||
*
|
||||
*/
|
||||
#define FT_PFR_H <freetype/ftpfr.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_STROKER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to stroke outline path.
|
||||
*/
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SYNTHESIS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to perform artificial obliquing and emboldening.
|
||||
*/
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_XFREE86_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to provide functions specific to the XFree86 and
|
||||
* X.Org X11 servers.
|
||||
*/
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRIGONOMETRY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType 2 API used to perform trigonometric computations (e.g.,
|
||||
* cosines and arc tangents).
|
||||
*/
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
|
||||
/* */
|
||||
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
|
||||
|
||||
#define FT_CACHE_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
|
||||
#define FT_CACHE_INTERNAL_MRU_H <freetype/cache/ftcmru.h>
|
||||
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/cache/ftccache.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/cache/ftcglyph.h>
|
||||
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/cache/ftcimage.h>
|
||||
#define FT_CACHE_INTERNAL_SBITS_H <freetype/cache/ftcsbits.h>
|
||||
/* The internals of the cache sub-system are no longer exposed. We */
|
||||
/* default to FT_CACHE_H at the moment just in case, but we know of */
|
||||
/* no rogue client that uses them. */
|
||||
/* */
|
||||
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
|
||||
|
||||
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
|
||||
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
|
||||
|
||||
/* now include internal headers definitions from <freetype/internal/...> */
|
||||
|
||||
/*
|
||||
* Include internal headers definitions from <freetype/internal/...>
|
||||
* only when building the library.
|
||||
*/
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
|
||||
#include FT_INTERNAL_INTERNAL_H
|
||||
#endif /* FT2_BUILD_LIBRARY */
|
||||
|
||||
|
||||
#endif /* __FT2_BUILD_H__ */
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* This file registers the FreeType modules compiled into the library.
|
||||
*
|
||||
* If you use GNU make, this file IS NOT USED! Instead, it is created in
|
||||
* the objects directory (normally `<topdir>/objs/') based on information
|
||||
* from `<topdir>/modules.cfg'.
|
||||
*
|
||||
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
|
||||
* FreeType without GNU make.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_USE_MODULE(autofit_module_class)
|
||||
FT_USE_MODULE(tt_driver_class)
|
||||
FT_USE_MODULE(t1_driver_class)
|
||||
@ -15,5 +27,6 @@ FT_USE_MODULE(sfnt_module_class)
|
||||
FT_USE_MODULE(ft_smooth_renderer_class)
|
||||
FT_USE_MODULE(ft_smooth_lcd_renderer_class)
|
||||
FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
|
||||
FT_USE_MODULE(otv_module_class)
|
||||
FT_USE_MODULE(bdf_driver_class)
|
||||
|
||||
/* EOF */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -38,22 +38,22 @@ FT_BEGIN_HEADER
|
||||
/* library from a single source directory. */
|
||||
/* */
|
||||
/* - You can put a copy of this file in your build directory, more */
|
||||
/* precisely in "$BUILD/freetype/config/ftoption.h", where "$BUILD" */
|
||||
/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
|
||||
/* is the name of a directory that is included _before_ the FreeType */
|
||||
/* include path during compilation. */
|
||||
/* */
|
||||
/* The default FreeType Makefiles and Jamfiles use the build */
|
||||
/* directory "builds/<system>" by default, but you can easily change */
|
||||
/* directory `builds/<system>' by default, but you can easily change */
|
||||
/* that for your own projects. */
|
||||
/* */
|
||||
/* - Copy the file <ft2build.h> to "$BUILD/ft2build.h" and modify it */
|
||||
/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
|
||||
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
|
||||
/* locate this file during the build. For example, */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
|
||||
/* #include <freetype/config/ftheader.h> */
|
||||
/* */
|
||||
/* will use "$BUILD/myftoptions.h" instead of this file for macro */
|
||||
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
|
||||
/* definitions. */
|
||||
/* */
|
||||
/* Note also that you can similarly pre-define the macro */
|
||||
@ -89,7 +89,7 @@ FT_BEGIN_HEADER
|
||||
/* building the library. */
|
||||
/* */
|
||||
/* ObNote: The compiler-specific 64-bit integers are detected in the */
|
||||
/* file "ftconfig.h" either statically or through the */
|
||||
/* file `ftconfig.h' either statically or through the */
|
||||
/* `configure' script on supported platforms. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_FORCE_INT64
|
||||
@ -100,7 +100,7 @@ FT_BEGIN_HEADER
|
||||
/* LZW-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'compress' program. This is mostly used to parse many of the PCF */
|
||||
/* `compress' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with various X11 distributions. The implementation */
|
||||
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
|
||||
/* (see src/lzw/ftgzip.c). */
|
||||
@ -115,7 +115,7 @@ FT_BEGIN_HEADER
|
||||
/* Gzip-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* `gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* that come with XFree86. The implementation uses `zlib' to */
|
||||
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
|
||||
/* */
|
||||
@ -328,7 +328,7 @@ FT_BEGIN_HEADER
|
||||
/* should define FT_DEBUG_MEMORY here. */
|
||||
/* */
|
||||
/* Note that the memory debugger is only activated at runtime when */
|
||||
/* when the _environment_ variable "FT2_DEBUG_MEMORY" is defined also! */
|
||||
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
|
||||
/* */
|
||||
/* Do not #undef this macro here since the build system might define */
|
||||
/* it for certain configurations only. */
|
||||
@ -471,7 +471,7 @@ FT_BEGIN_HEADER
|
||||
/* component offsets in composite glyphs. */
|
||||
/* */
|
||||
/* Apple and MS disagree on the default behavior of component offsets */
|
||||
/* in composites. Apple says that they should be scaled by the scale */
|
||||
/* in composites. Apple says that they should be scaled by the scaling */
|
||||
/* factors in the transformation matrix (roughly, it's more complex) */
|
||||
/* while MS says they should not. OpenType defines two bits in the */
|
||||
/* composite flags array which can be used to disambiguate, but old */
|
||||
@ -493,6 +493,14 @@ FT_BEGIN_HEADER
|
||||
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
|
||||
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_BDF
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
@ -547,14 +555,44 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with CJK script support. */
|
||||
/* */
|
||||
#define AF_CONFIG_OPTION_CJK
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/*
|
||||
* This temporary macro is used to control various optimizations for
|
||||
* reducing the heap footprint of memory-mapped TrueType files.
|
||||
*
|
||||
*/
|
||||
/* #define FT_OPTIMIZE_MEMORY */
|
||||
/*
|
||||
* This temporary macro is used to control various optimizations for
|
||||
* reducing the heap footprint of memory-mapped TrueType files.
|
||||
*/
|
||||
#define FT_OPTIMIZE_MEMORY
|
||||
|
||||
|
||||
/*
|
||||
* Define this variable if you want to keep the layout of internal
|
||||
* structures that was used prior to FreeType 2.2. This also compiles in
|
||||
* a few obsolete functions to avoid linking problems on typical Unix
|
||||
* distributions.
|
||||
*
|
||||
* For embedded systems or building a new distribution from scratch, it
|
||||
* is recommended to disable the macro since it reduces the library's code
|
||||
* size and activates a few memory-saving optimizations as well.
|
||||
*/
|
||||
#define FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* ANSI-specific library and header configuration file (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -51,22 +51,23 @@
|
||||
/* old Crays where `int' is 36 bits), we do not make any guarantee */
|
||||
/* about the correct behaviour of FT2 with all fonts. */
|
||||
/* */
|
||||
/* In these case, "ftconfig.h" will refuse to compile anyway with a */
|
||||
/* message like "couldn't find 32-bit type" or something similar. */
|
||||
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
|
||||
/* message like `couldn't find 32-bit type' or something similar. */
|
||||
/* */
|
||||
/* IMPORTANT NOTE: We do not define aliases for heap management and */
|
||||
/* i/o routines (i.e. malloc/free/fopen/fread/...) */
|
||||
/* since these functions should all be encapsulated */
|
||||
/* by platform-specific implementations of */
|
||||
/* "ftsystem.c". */
|
||||
/* `ftsystem.c'. */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#define FT_INT_MAX INT_MAX
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_ULONG_MAX ULONG_MAX
|
||||
|
||||
|
||||
@ -80,14 +81,15 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#define ft_isalnum isalnum
|
||||
#define ft_isupper isupper
|
||||
#define ft_islower islower
|
||||
#define ft_isdigit isdigit
|
||||
#define ft_islower islower
|
||||
#define ft_isupper isupper
|
||||
#define ft_isxdigit isxdigit
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define ft_memchr memchr
|
||||
#define ft_memcmp memcmp
|
||||
#define ft_memcpy memcpy
|
||||
#define ft_memmove memmove
|
||||
@ -101,8 +103,21 @@
|
||||
#define ft_strrchr strrchr
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* file handling */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define FT_FILE FILE
|
||||
#define ft_fclose fclose
|
||||
#define ft_fopen fopen
|
||||
#define ft_fread fread
|
||||
#define ft_fseek fseek
|
||||
#define ft_ftell ftell
|
||||
#define ft_sprintf sprintf
|
||||
|
||||
|
||||
@ -116,9 +131,32 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ft_qsort qsort
|
||||
|
||||
#define ft_exit exit /* only used to exit from unhandled exceptions */
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* memory allocation */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#define ft_scalloc calloc
|
||||
#define ft_sfree free
|
||||
#define ft_smalloc malloc
|
||||
#define ft_srealloc realloc
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* miscellaneous */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#define ft_atol atol
|
||||
#define ft_labs labs
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
@ -134,13 +172,13 @@
|
||||
/* jmp_buf is defined as a macro */
|
||||
/* on certain platforms */
|
||||
|
||||
#define ft_longjmp longjmp /* likewise */
|
||||
#define ft_setjmp setjmp /* same thing here */
|
||||
#define ft_longjmp longjmp /* " */
|
||||
|
||||
|
||||
/* the following is only used for debugging purposes, i.e. when */
|
||||
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
|
||||
/* */
|
||||
/* the following is only used for debugging purposes, i.e., if */
|
||||
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -61,7 +61,7 @@ FT_BEGIN_HEADER
|
||||
/* Computes the exact bounding box of an outline. This is slower */
|
||||
/* than computing the control box. However, it uses an advanced */
|
||||
/* algorithm which returns _very_ quickly when the two boxes */
|
||||
/* coincide. Otherwise, the outline Bezier arcs are walked over to */
|
||||
/* coincide. Otherwise, the outline Bézier arcs are walked over to */
|
||||
/* extract their extrema. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -87,3 +87,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing BDF-specific strings (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -182,7 +182,7 @@ FT_BEGIN_HEADER
|
||||
* otherwise. It also returns an error if the property is not in the
|
||||
* font.
|
||||
*
|
||||
* In case of error, "aproperty->type" is always set to
|
||||
* In case of error, `aproperty->type' is always set to
|
||||
* @BDF_PROPERTY_TYPE_NONE.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
|
||||
/* bitmaps into 8bpp format (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005 by */
|
||||
/* Copyright 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -57,7 +57,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Bitmap_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initialize a pointer to an FT_Bitmap structure. */
|
||||
/* Initialize a pointer to an @FT_Bitmap structure. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* abitmap :: A pointer to the bitmap structure. */
|
||||
@ -85,7 +85,7 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Copy( FT_Library library,
|
||||
const FT_Bitmap *source,
|
||||
FT_Bitmap *target);
|
||||
@ -120,10 +120,10 @@ FT_BEGIN_HEADER
|
||||
/* The current implementation restricts `xStrength' to be less than */
|
||||
/* or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
|
||||
/* */
|
||||
/* Don't embolden the bitmap owned by a @FT_GlyphSlot directly! Call */
|
||||
/* @FT_Bitmap_Copy to get a copy and work on the copy instead. */
|
||||
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
|
||||
/* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Embolden( FT_Library library,
|
||||
FT_Bitmap* bitmap,
|
||||
FT_Pos xStrength,
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType Cache subsystem (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,21 +16,6 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/********* *********/
|
||||
/********* WARNING, THIS IS BETA CODE. *********/
|
||||
/********* *********/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCACHE_H__
|
||||
#define __FTCACHE_H__
|
||||
|
||||
@ -42,51 +27,105 @@
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Cache Sub-System */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* How to cache face, size, and glyph data with FreeType 2. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section describes the FreeType 2 cache sub-system which is */
|
||||
/* still in beta. */
|
||||
/* */
|
||||
/* <Order> */
|
||||
/* FTC_Manager */
|
||||
/* FTC_FaceID */
|
||||
/* FTC_Face_Requester */
|
||||
/* */
|
||||
/* FTC_Manager_New */
|
||||
/* FTC_Manager_Reset */
|
||||
/* FTC_Manager_Done */
|
||||
/* FTC_Manager_LookupFace */
|
||||
/* FTC_Manager_LookupSize */
|
||||
/* FTC_Manager_RemoveFaceID */
|
||||
/* */
|
||||
/* FTC_Node */
|
||||
/* FTC_Node_Unref */
|
||||
/* */
|
||||
/* FTC_Font */
|
||||
/* FTC_ImageCache */
|
||||
/* FTC_ImageCache_New */
|
||||
/* FTC_ImageCache_Lookup */
|
||||
/* */
|
||||
/* FTC_SBit */
|
||||
/* FTC_SBitCache */
|
||||
/* FTC_SBitCache_New */
|
||||
/* FTC_SBitCache_Lookup */
|
||||
/* */
|
||||
/* FTC_CMapCache */
|
||||
/* FTC_CMapCache_New */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
/*************************************************************************
|
||||
*
|
||||
* <Section>
|
||||
* cache_subsystem
|
||||
*
|
||||
* <Title>
|
||||
* Cache Sub-System
|
||||
*
|
||||
* <Abstract>
|
||||
* How to cache face, size, and glyph data with FreeType 2.
|
||||
*
|
||||
* <Description>
|
||||
* This section describes the FreeType 2 cache sub-system, which is used
|
||||
* to limit the number of concurrently opened @FT_Face and @FT_Size
|
||||
* objects, as well as caching information like character maps and glyph
|
||||
* images while limiting their maximum memory usage.
|
||||
*
|
||||
* Note that all types and functions begin with the `FTC_' prefix.
|
||||
*
|
||||
* The cache is highly portable and thus doesn't know anything about the
|
||||
* fonts installed on your system, or how to access them. This implies
|
||||
* the following scheme:
|
||||
*
|
||||
* First, available or installed font faces are uniquely identified by
|
||||
* @FTC_FaceID values, provided to the cache by the client. Note that
|
||||
* the cache only stores and compares these values, and doesn't try to
|
||||
* interpret them in any way.
|
||||
*
|
||||
* Second, the cache calls, only when needed, a client-provided function
|
||||
* to convert a @FTC_FaceID into a new @FT_Face object. The latter is
|
||||
* then completely managed by the cache, including its termination
|
||||
* through @FT_Done_Face.
|
||||
*
|
||||
* Clients are free to map face IDs to anything else. The most simple
|
||||
* usage is to associate them to a (pathname,face_index) pair that is
|
||||
* used to call @FT_New_Face. However, more complex schemes are also
|
||||
* possible.
|
||||
*
|
||||
* Note that for the cache to work correctly, the face ID values must be
|
||||
* *persistent*, which means that the contents they point to should not
|
||||
* change at runtime, or that their value should not become invalid.
|
||||
*
|
||||
* If this is unavoidable (e.g., when a font is uninstalled at runtime),
|
||||
* you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
|
||||
* the cache get rid of any references to the old @FTC_FaceID it may
|
||||
* keep internally. Failure to do so will lead to incorrect behaviour
|
||||
* or even crashes.
|
||||
*
|
||||
* To use the cache, start with calling @FTC_Manager_New to create a new
|
||||
* @FTC_Manager object, which models a single cache instance. You can
|
||||
* then look up @FT_Face and @FT_Size objects with
|
||||
* @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
|
||||
*
|
||||
* If you want to use the charmap caching, call @FTC_CMapCache_New, then
|
||||
* later use @FTC_CMapCache_Lookup to perform the equivalent of
|
||||
* @FT_Get_Char_Index, only much faster.
|
||||
*
|
||||
* If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
|
||||
* later use @FTC_ImageCache_Lookup to retrieve the corresponding
|
||||
* @FT_Glyph objects from the cache.
|
||||
*
|
||||
* If you need lots of small bitmaps, it is much more memory efficient
|
||||
* to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
|
||||
* returns @FTC_SBitRec structures, which are used to store small
|
||||
* bitmaps directly. (A small bitmap is one whose metrics and
|
||||
* dimensions all fit into 8-bit integers).
|
||||
*
|
||||
* We hope to also provide a kerning cache in the near future.
|
||||
*
|
||||
*
|
||||
* <Order>
|
||||
* FTC_Manager
|
||||
* FTC_FaceID
|
||||
* FTC_Face_Requester
|
||||
*
|
||||
* FTC_Manager_New
|
||||
* FTC_Manager_Reset
|
||||
* FTC_Manager_Done
|
||||
* FTC_Manager_LookupFace
|
||||
* FTC_Manager_LookupSize
|
||||
* FTC_Manager_RemoveFaceID
|
||||
*
|
||||
* FTC_Node
|
||||
* FTC_Node_Unref
|
||||
*
|
||||
* FTC_ImageCache
|
||||
* FTC_ImageCache_New
|
||||
* FTC_ImageCache_Lookup
|
||||
*
|
||||
* FTC_SBit
|
||||
* FTC_SBitCache
|
||||
* FTC_SBitCache_New
|
||||
* FTC_SBitCache_Lookup
|
||||
*
|
||||
* FTC_CMapCache
|
||||
* FTC_CMapCache_New
|
||||
* FTC_CMapCache_Lookup
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -100,108 +139,84 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_FaceID */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An opaque pointer type that is used to identity face objects. The */
|
||||
/* contents of such objects is application-dependent. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type: FTC_FaceID
|
||||
*
|
||||
* @description:
|
||||
* An opaque pointer type that is used to identity face objects. The
|
||||
* contents of such objects is application-dependent.
|
||||
*
|
||||
* These pointers are typically used to point to a user-defined
|
||||
* structure containing a font file path, and face index.
|
||||
*
|
||||
* @note:
|
||||
* Never use NULL as a valid @FTC_FaceID.
|
||||
*
|
||||
* Face IDs are passed by the client to the cache manager, which calls,
|
||||
* when needed, the @FTC_Face_Requester to translate them into new
|
||||
* @FT_Face objects.
|
||||
*
|
||||
* If the content of a given face ID changes at runtime, or if the value
|
||||
* becomes invalid (e.g., when uninstalling a font), you should
|
||||
* immediately call @FTC_Manager_RemoveFaceID before any other cache
|
||||
* function.
|
||||
*
|
||||
* Failure to do so will result in incorrect behaviour or even
|
||||
* memory leaks and crashes.
|
||||
*/
|
||||
typedef struct FTC_FaceIDRec_* FTC_FaceID;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FTC_Face_Requester */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A callback function provided by client applications. It is used */
|
||||
/* to translate a given @FTC_FaceID into a new valid @FT_Face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face_id :: The face ID to resolve. */
|
||||
/* */
|
||||
/* library :: A handle to a FreeType library object. */
|
||||
/* */
|
||||
/* data :: Application-provided request data. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aface :: A new @FT_Face handle. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The face requester should not perform funny things on the returned */
|
||||
/* face object, like creating a new @FT_Size for it, or setting a */
|
||||
/* transformation through @FT_Set_Transform! */
|
||||
/* */
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FTC_Face_Requester
|
||||
*
|
||||
* @description:
|
||||
* A callback function provided by client applications. It is used by
|
||||
* the cache manager to translate a given @FTC_FaceID into a new valid
|
||||
* @FT_Face object, on demand.
|
||||
*
|
||||
* <Input>
|
||||
* face_id ::
|
||||
* The face ID to resolve.
|
||||
*
|
||||
* library ::
|
||||
* A handle to a FreeType library object.
|
||||
*
|
||||
* req_data ::
|
||||
* Application-provided request data (see note below).
|
||||
*
|
||||
* <Output>
|
||||
* aface ::
|
||||
* A new @FT_Face handle.
|
||||
*
|
||||
* <Return>
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* <Note>
|
||||
* The third parameter `req_data' is the same as the one passed by the
|
||||
* client when @FTC_Manager_New is called.
|
||||
*
|
||||
* The face requester should not perform funny things on the returned
|
||||
* face object, like creating a new @FT_Size for it, or setting a
|
||||
* transformation through @FT_Set_Transform!
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FTC_Face_Requester)( FTC_FaceID face_id,
|
||||
FT_Library library,
|
||||
FT_Pointer request_data,
|
||||
FT_Face* aface );
|
||||
|
||||
/* */
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_FontRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to describe a given `font' to the cache */
|
||||
/* manager. Note that a `font' is the combination of a given face */
|
||||
/* with a given character size. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* face_id :: The ID of the face to use. */
|
||||
/* */
|
||||
/* pix_width :: The character width in integer pixels. */
|
||||
/* */
|
||||
/* pix_height :: The character height in integer pixels. */
|
||||
/* */
|
||||
typedef struct FTC_FontRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_UShort pix_width;
|
||||
FT_UShort pix_height;
|
||||
#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
|
||||
|
||||
} FTC_FontRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_FONT_COMPARE( f1, f2 ) \
|
||||
( (f1)->face_id == (f2)->face_id && \
|
||||
(f1)->pix_width == (f2)->pix_width && \
|
||||
(f1)->pix_height == (f2)->pix_height )
|
||||
|
||||
#define FT_POINTER_TO_ULONG( p ) ((FT_ULong)(FT_Pointer)(p))
|
||||
|
||||
#define FTC_FACE_ID_HASH( i ) \
|
||||
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
|
||||
#define FTC_FACE_ID_HASH( i ) \
|
||||
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
|
||||
( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
|
||||
|
||||
#define FTC_FONT_HASH( f ) \
|
||||
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
|
||||
((f)->pix_width << 8) ^ \
|
||||
((f)->pix_height) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_Font */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple handle to an @FTC_FontRec structure. */
|
||||
/* */
|
||||
typedef FTC_FontRec* FTC_Font;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
@ -220,8 +235,20 @@ FT_BEGIN_HEADER
|
||||
/* FTC_Manager */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This object is used to cache one or more @FT_Face objects, along */
|
||||
/* with corresponding @FT_Size objects. */
|
||||
/* This object corresponds to one instance of the cache-subsystem. */
|
||||
/* It is used to cache one or more @FT_Face objects, along with */
|
||||
/* corresponding @FT_Size objects. */
|
||||
/* */
|
||||
/* The manager intentionally limits the total number of opened */
|
||||
/* @FT_Face and @FT_Size objects to control memory usage. See the */
|
||||
/* `max_faces' and `max_sizes' parameters of @FTC_Manager_New. */
|
||||
/* */
|
||||
/* The manager is also used to cache `nodes' of various types while */
|
||||
/* limiting their total memory usage. */
|
||||
/* */
|
||||
/* All limitations are enforced by keeping lists of managed objects */
|
||||
/* in most-recently-used order, and flushing old nodes to make room */
|
||||
/* for new ones. */
|
||||
/* */
|
||||
typedef struct FTC_ManagerRec_* FTC_Manager;
|
||||
|
||||
@ -236,9 +263,9 @@ FT_BEGIN_HEADER
|
||||
/* reference-counted. A node with a count of 0 might be flushed */
|
||||
/* out of a full cache whenever a lookup request is performed. */
|
||||
/* */
|
||||
/* If you lookup nodes, you have the ability to "acquire" them, i.e., */
|
||||
/* If you lookup nodes, you have the ability to `acquire' them, i.e., */
|
||||
/* to increment their reference count. This will prevent the node */
|
||||
/* from being flushed out of the cache until you explicitly "release" */
|
||||
/* from being flushed out of the cache until you explicitly `release' */
|
||||
/* it (see @FTC_Node_Unref). */
|
||||
/* */
|
||||
/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
|
||||
@ -255,16 +282,23 @@ FT_BEGIN_HEADER
|
||||
/* Creates a new cache manager. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: The parent FreeType library handle to use. */
|
||||
/* library :: The parent FreeType library handle to use. */
|
||||
/* */
|
||||
/* max_bytes :: Maximum number of bytes to use for cached data. */
|
||||
/* Use 0 for defaults. */
|
||||
/* max_faces :: Maximum number of opened @FT_Face objects managed by */
|
||||
/* this cache instance. Use 0 for defaults. */
|
||||
/* */
|
||||
/* requester :: An application-provided callback used to translate */
|
||||
/* face IDs into real @FT_Face objects. */
|
||||
/* max_sizes :: Maximum number of opened @FT_Size objects managed by */
|
||||
/* this cache instance. Use 0 for defaults. */
|
||||
/* */
|
||||
/* req_data :: A generic pointer that is passed to the requester */
|
||||
/* each time it is called (see @FTC_Face_Requester). */
|
||||
/* max_bytes :: Maximum number of bytes to use for cached data nodes. */
|
||||
/* Use 0 for defaults. Note that this value does not */
|
||||
/* account for managed @FT_Face and @FT_Size objects. */
|
||||
/* */
|
||||
/* requester :: An application-provided callback used to translate */
|
||||
/* face IDs into real @FT_Face objects. */
|
||||
/* */
|
||||
/* req_data :: A generic pointer that is passed to the requester */
|
||||
/* each time it is called (see @FTC_Face_Requester). */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* amanager :: A handle to a new manager object. 0 in case of */
|
||||
@ -346,6 +380,14 @@ FT_BEGIN_HEADER
|
||||
/* the @FT_Set_Transform function) on a returned face! If you need */
|
||||
/* to transform glyphs, do it yourself after glyph loading. */
|
||||
/* */
|
||||
/* When you perform a lookup, out-of-memory errors are detected */
|
||||
/* _within_ the lookup and force incremental flushes of the cache */
|
||||
/* until enough memory is released for the lookup to succeed. */
|
||||
/* */
|
||||
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
|
||||
/* already been completely flushed, and still no memory was available */
|
||||
/* for the operation. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_LookupFace( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
@ -402,7 +444,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieve the @FT_Size object that corresponds to a given */
|
||||
/* @FTC_Scaler through a cache manager. */
|
||||
/* @FTC_ScalerRec pointer through a cache manager. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
@ -423,6 +465,15 @@ FT_BEGIN_HEADER
|
||||
/* if you need it. Note that this object is also owned by the */
|
||||
/* manager. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* When you perform a lookup, out-of-memory errors are detected */
|
||||
/* _within_ the lookup and force incremental flushes of the cache */
|
||||
/* until enough memory is released for the lookup to succeed. */
|
||||
/* */
|
||||
/* If a lookup fails with `FT_Err_Out_Of_Memory' the cache has */
|
||||
/* already been completely flushed, and still no memory is available */
|
||||
/* for the operation. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_LookupSize( FTC_Manager manager,
|
||||
FTC_Scaler scaler,
|
||||
@ -449,7 +500,33 @@ FT_BEGIN_HEADER
|
||||
FTC_Manager manager );
|
||||
|
||||
|
||||
/* remove all nodes belonging to a given face_id */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FTC_Manager_RemoveFaceID
|
||||
*
|
||||
* @description:
|
||||
* A special function used to indicate to the cache manager that
|
||||
* a given @FTC_FaceID is no longer valid, either because its
|
||||
* content changed, or because it was deallocated or uninstalled.
|
||||
*
|
||||
* @input:
|
||||
* manager ::
|
||||
* The cache manager handle.
|
||||
*
|
||||
* face_id ::
|
||||
* The @FTC_FaceID to be removed.
|
||||
*
|
||||
* @note:
|
||||
* This function flushes all nodes from the cache corresponding to this
|
||||
* `face_id', with the exception of nodes with a non-null reference
|
||||
* count.
|
||||
*
|
||||
* Such nodes are however modified internally so as to never appear
|
||||
* in later lookups with the same `face_id' value, and to be immediately
|
||||
* destroyed when released by all their users.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FTC_Manager_RemoveFaceID( FTC_Manager manager,
|
||||
FTC_FaceID face_id );
|
||||
@ -462,65 +539,74 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FTC_CMapCache
|
||||
* FTC_CMapCache
|
||||
*
|
||||
* @description:
|
||||
* An opaque handle used to manager a charmap cache. This cache is
|
||||
* to hold character codes -> glyph indices mappings.
|
||||
* An opaque handle used to model a charmap cache. This cache is to
|
||||
* hold character codes -> glyph indices mappings.
|
||||
*
|
||||
*/
|
||||
typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_New */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Create a new charmap cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* acache :: A new cache handle. NULL in case of error. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Like all other caches, this one will be destroyed with the cache */
|
||||
/* manager. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FTC_CMapCache_New
|
||||
*
|
||||
* @description:
|
||||
* Create a new charmap cache.
|
||||
*
|
||||
* @input:
|
||||
* manager ::
|
||||
* A handle to the cache manager.
|
||||
*
|
||||
* @output:
|
||||
* acache ::
|
||||
* A new cache handle. NULL in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* Like all other caches, this one will be destroyed with the cache
|
||||
* manager.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_CMapCache_New( FTC_Manager manager,
|
||||
FTC_CMapCache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Translate a character code into a glyph index, using the charmap */
|
||||
/* cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* cache :: A charmap cache handle. */
|
||||
/* */
|
||||
/* face_id :: The source face ID. */
|
||||
/* */
|
||||
/* cmap_index :: The index of the charmap in the source face. */
|
||||
/* */
|
||||
/* char_code :: The character code (in the corresponding charmap). */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Glyph index. 0 means `no glyph'. */
|
||||
/* */
|
||||
/************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FTC_CMapCache_Lookup
|
||||
*
|
||||
* @description:
|
||||
* Translate a character code into a glyph index, using the charmap
|
||||
* cache.
|
||||
*
|
||||
* @input:
|
||||
* cache ::
|
||||
* A charmap cache handle.
|
||||
*
|
||||
* face_id ::
|
||||
* The source face ID.
|
||||
*
|
||||
* cmap_index ::
|
||||
* The index of the charmap in the source face.
|
||||
*
|
||||
* char_code ::
|
||||
* The character code (in the corresponding charmap).
|
||||
*
|
||||
* @return:
|
||||
* Glyph index. 0 means `no glyph'.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_CMapCache_Lookup( FTC_CMapCache cache,
|
||||
FTC_FaceID face_id,
|
||||
@ -546,26 +632,63 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FTC_ImageTypeRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used to model the type of images in a glyph cache.
|
||||
*
|
||||
* @fields:
|
||||
* face_id ::
|
||||
* The face ID.
|
||||
*
|
||||
* width ::
|
||||
* The width in pixels.
|
||||
*
|
||||
* height ::
|
||||
* The height in pixels.
|
||||
*
|
||||
* flags ::
|
||||
* The load flags, as in @FT_Load_Glyph.
|
||||
*
|
||||
*/
|
||||
typedef struct FTC_ImageTypeRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_Int width;
|
||||
FT_Int height;
|
||||
FT_Int32 flags;
|
||||
FTC_FaceID face_id;
|
||||
FT_Int width;
|
||||
FT_Int height;
|
||||
FT_Int32 flags;
|
||||
|
||||
} FTC_ImageTypeRec;
|
||||
|
||||
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
|
||||
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FTC_ImageType
|
||||
*
|
||||
* @description:
|
||||
* A handle to an @FTC_ImageTypeRec structure.
|
||||
*
|
||||
*/
|
||||
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
|
||||
|
||||
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
|
||||
( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \
|
||||
(d1)->flags == (d2)->flags )
|
||||
|
||||
#define FTC_IMAGE_TYPE_HASH( d ) \
|
||||
(FT_UFast)( FTC_FONT_HASH( &(d)->font ) ^ \
|
||||
( (d)->flags << 4 ) )
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
|
||||
( (d1)->face_id == (d2)->face_id && \
|
||||
(d1)->width == (d2)->width && \
|
||||
(d1)->flags == (d2)->flags )
|
||||
|
||||
#define FTC_IMAGE_TYPE_HASH( d ) \
|
||||
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
|
||||
( (d)->width << 8 ) ^ (d)->height ^ \
|
||||
( (d)->flags << 4 ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -636,12 +759,12 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the glyph image, after increasing its reference */
|
||||
/* count. This ensures that the node (as well as the FT_Glyph) will */
|
||||
/* count. This ensures that the node (as well as the @FT_Glyph) will */
|
||||
/* always be kept in the cache until you call @FTC_Node_Unref to */
|
||||
/* `release' it. */
|
||||
/* */
|
||||
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
||||
/* that the FT_Glyph could be flushed out of the cache on the next */
|
||||
/* that the @FT_Glyph could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
/* */
|
||||
@ -807,6 +930,66 @@ FT_BEGIN_HEADER
|
||||
FTC_Node *anode );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*@***********************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_FontRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to describe a given `font' to the cache */
|
||||
/* manager. Note that a `font' is the combination of a given face */
|
||||
/* with a given character size. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* face_id :: The ID of the face to use. */
|
||||
/* */
|
||||
/* pix_width :: The character width in integer pixels. */
|
||||
/* */
|
||||
/* pix_height :: The character height in integer pixels. */
|
||||
/* */
|
||||
typedef struct FTC_FontRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_UShort pix_width;
|
||||
FT_UShort pix_height;
|
||||
|
||||
} FTC_FontRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
#define FTC_FONT_COMPARE( f1, f2 ) \
|
||||
( (f1)->face_id == (f2)->face_id && \
|
||||
(f1)->pix_width == (f2)->pix_width && \
|
||||
(f1)->pix_height == (f2)->pix_height )
|
||||
|
||||
#define FTC_FONT_HASH( f ) \
|
||||
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
|
||||
((f)->pix_width << 8) ^ \
|
||||
((f)->pix_height) )
|
||||
|
||||
typedef FTC_FontRec* FTC_Font;
|
||||
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Face( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
FT_Face *aface );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Size( FTC_Manager manager,
|
||||
FTC_Font font,
|
||||
FT_Face *aface,
|
||||
FT_Size *asize );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
@ -6,6 +6,20 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* general_remarks */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* General Remarks */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* user_allocation */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
@ -15,6 +29,7 @@
|
||||
/* Core API */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* version */
|
||||
/* basic_types */
|
||||
/* base_interface */
|
||||
/* glyph_management */
|
||||
@ -24,6 +39,7 @@
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
@ -40,7 +56,6 @@
|
||||
/* bdf_fonts */
|
||||
/* pfr_fonts */
|
||||
/* winfnt_fonts */
|
||||
/* ot_validation */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType error codes (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2004 by */
|
||||
/* Copyright 2002, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -52,6 +52,8 @@
|
||||
"broken table" )
|
||||
FT_ERRORDEF_( Invalid_Offset, 0x09, \
|
||||
"broken offset within table" )
|
||||
FT_ERRORDEF_( Array_Too_Large, 0x0A, \
|
||||
"array allocation size too large" )
|
||||
|
||||
/* glyph/character errors */
|
||||
|
||||
@ -226,6 +228,8 @@
|
||||
"`ENCODING' field missing" )
|
||||
FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \
|
||||
"`BBX' field missing" )
|
||||
FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \
|
||||
"`BBX' too big" )
|
||||
|
||||
|
||||
/* END */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType convenience functions to handle glyphs (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -134,10 +134,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used for bitmap glyph images. This really is a */
|
||||
/* `sub-class' of `FT_GlyphRec'. */
|
||||
/* `sub-class' of @FT_GlyphRec. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The root FT_Glyph fields. */
|
||||
/* root :: The root @FT_Glyph fields. */
|
||||
/* */
|
||||
/* left :: The left-side bearing, i.e., the horizontal distance */
|
||||
/* from the current pen position to the left border of the */
|
||||
@ -150,11 +150,11 @@ FT_BEGIN_HEADER
|
||||
/* bitmap :: A descriptor for the bitmap. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You can typecast FT_Glyph to FT_BitmapGlyph if you have */
|
||||
/* glyph->format == FT_GLYPH_FORMAT_BITMAP. This lets you access */
|
||||
/* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
|
||||
/* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
|
||||
/* the bitmap's contents easily. */
|
||||
/* */
|
||||
/* The corresponding pixel buffer is always owned by the BitmapGlyph */
|
||||
/* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
|
||||
/* and is thus created and destroyed with it. */
|
||||
/* */
|
||||
typedef struct FT_BitmapGlyphRec_
|
||||
@ -186,21 +186,21 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used for outline (vectorial) glyph images. This */
|
||||
/* really is a `sub-class' of `FT_GlyphRec'. */
|
||||
/* really is a `sub-class' of @FT_GlyphRec. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The root FT_Glyph fields. */
|
||||
/* root :: The root @FT_Glyph fields. */
|
||||
/* */
|
||||
/* outline :: A descriptor for the outline. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You can typecast FT_Glyph to FT_OutlineGlyph if you have */
|
||||
/* glyph->format == FT_GLYPH_FORMAT_OUTLINE. This lets you access */
|
||||
/* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */
|
||||
/* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
|
||||
/* the outline's content easily. */
|
||||
/* */
|
||||
/* As the outline is extracted from a glyph slot, its coordinates are */
|
||||
/* expressed normally in 26.6 pixels, unless the flag */
|
||||
/* FT_LOAD_NO_SCALE was used in FT_Load_Glyph() or FT_Load_Char(). */
|
||||
/* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
|
||||
/* */
|
||||
/* The outline's tables are always owned by the object and are */
|
||||
/* destroyed with it. */
|
||||
@ -277,8 +277,7 @@ FT_BEGIN_HEADER
|
||||
/* expressed in 1/64th of a pixel. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code (the glyph format is not scalable if it is */
|
||||
/* not zero). */
|
||||
/* FreeType error code (if not 0, the glyph format is not scalable). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The 2x2 transformation matrix is also applied to the glyph's */
|
||||
@ -335,11 +334,11 @@ FT_BEGIN_HEADER
|
||||
/* @FT_Glyph_BBox_Mode values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_glyph_bbox_unscaled :: see @FT_GLYPH_BBOX_UNSCALED */
|
||||
/* ft_glyph_bbox_subpixels :: see @FT_GLYPH_BBOX_SUBPIXELS */
|
||||
/* ft_glyph_bbox_gridfit :: see @FT_GLYPH_BBOX_GRIDFIT */
|
||||
/* ft_glyph_bbox_truncate :: see @FT_GLYPH_BBOX_TRUNCATE */
|
||||
/* ft_glyph_bbox_pixels :: see @FT_GLYPH_BBOX_PIXELS */
|
||||
/* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
|
||||
/* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
|
||||
/* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
|
||||
/* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
|
||||
/* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
|
||||
/* */
|
||||
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
|
||||
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
|
||||
@ -354,11 +353,11 @@ FT_BEGIN_HEADER
|
||||
/* FT_Glyph_Get_CBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns a glyph's `control box'. The control box encloses all the */
|
||||
/* outline's points, including Bezier control points. Though it */
|
||||
/* Return a glyph's `control box'. The control box encloses all the */
|
||||
/* outline's points, including Bézier control points. Though it */
|
||||
/* coincides with the exact bounding box for most glyphs, it can be */
|
||||
/* slightly larger in some situations (like when rotating an outline */
|
||||
/* which contains Bezier outside arcs). */
|
||||
/* which contains Bézier outside arcs). */
|
||||
/* */
|
||||
/* Computing the control box is very fast, while getting the bounding */
|
||||
/* box can take much more time as it needs to walk over all segments */
|
||||
@ -379,32 +378,36 @@ FT_BEGIN_HEADER
|
||||
/* Coordinates are relative to the glyph origin, using the Y-upwards */
|
||||
/* convention. */
|
||||
/* */
|
||||
/* If the glyph has been loaded with FT_LOAD_NO_SCALE, `bbox_mode' */
|
||||
/* must be set to `FT_GLYPH_BBOX_UNSCALED' to get unscaled font */
|
||||
/* units in 26.6 pixel format. The value `FT_GLYPH_BBOX_SUBPIXELS' */
|
||||
/* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
|
||||
/* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
|
||||
/* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
|
||||
/* is another name for this constant. */
|
||||
/* */
|
||||
/* Note that the maximum coordinates are exclusive, which means that */
|
||||
/* one can compute the width and height of the glyph image (be it in */
|
||||
/* integer or 26.6 pixels) as: */
|
||||
/* */
|
||||
/* { */
|
||||
/* width = bbox.xMax - bbox.xMin; */
|
||||
/* height = bbox.yMax - bbox.yMin; */
|
||||
/* } */
|
||||
/* */
|
||||
/* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
|
||||
/* `FT_GLYPH_BBOX_GRIDFIT', the coordinates will also be grid-fitted, */
|
||||
/* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
|
||||
/* which corresponds to: */
|
||||
/* */
|
||||
/* { */
|
||||
/* bbox.xMin = FLOOR(bbox.xMin); */
|
||||
/* bbox.yMin = FLOOR(bbox.yMin); */
|
||||
/* bbox.xMax = CEILING(bbox.xMax); */
|
||||
/* bbox.yMax = CEILING(bbox.yMax); */
|
||||
/* } */
|
||||
/* */
|
||||
/* To get the bbox in pixel coordinates, set `bbox_mode' to */
|
||||
/* `FT_GLYPH_BBOX_TRUNCATE'. */
|
||||
/* @FT_GLYPH_BBOX_TRUNCATE. */
|
||||
/* */
|
||||
/* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
|
||||
/* to `FT_GLYPH_BBOX_PIXELS'. */
|
||||
/* to @FT_GLYPH_BBOX_PIXELS. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Glyph_Get_CBox( FT_Glyph glyph,
|
||||
@ -443,7 +446,7 @@ FT_BEGIN_HEADER
|
||||
/* The glyph image is translated with the `origin' vector before */
|
||||
/* rendering. */
|
||||
/* */
|
||||
/* The first parameter is a pointer to a FT_Glyph handle, that will */
|
||||
/* The first parameter is a pointer to an @FT_Glyph handle, that will */
|
||||
/* be replaced by this function. Typically, you would use (omitting */
|
||||
/* error handling): */
|
||||
/* */
|
||||
@ -502,6 +505,8 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( void )
|
||||
FT_Done_Glyph( FT_Glyph glyph );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* other helpful functions */
|
||||
|
||||
@ -563,3 +568,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
358
headers/libs/freetype2/freetype/ftgxval.h
Normal file
358
headers/libs/freetype2/freetype/ftgxval.h
Normal file
@ -0,0 +1,358 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftgxval.h */
|
||||
/* */
|
||||
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005, 2006 by */
|
||||
/* Masatake YAMATO, Redhat K.K, */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* gxvalid is derived from both gxlayout module and otvalid module. */
|
||||
/* Development of gxlayout is supported by the Information-technology */
|
||||
/* Promotion Agency(IPA), Japan. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTGXVAL_H__
|
||||
#define __FTGXVAL_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> */
|
||||
/* gx_validation */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* TrueTypeGX/AAT Validation */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* An API to validate TrueTypeGX/AAT tables. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains the declaration of functions to validate */
|
||||
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
|
||||
/* trak, prop, lcar). */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* */
|
||||
/* Warning: Use FT_VALIDATE_XXX to validate a table. */
|
||||
/* Following definitions are for gxvalid developers. */
|
||||
/* */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#define FT_VALIDATE_feat_INDEX 0
|
||||
#define FT_VALIDATE_mort_INDEX 1
|
||||
#define FT_VALIDATE_morx_INDEX 2
|
||||
#define FT_VALIDATE_bsln_INDEX 3
|
||||
#define FT_VALIDATE_just_INDEX 4
|
||||
#define FT_VALIDATE_kern_INDEX 5
|
||||
#define FT_VALIDATE_opbd_INDEX 6
|
||||
#define FT_VALIDATE_trak_INDEX 7
|
||||
#define FT_VALIDATE_prop_INDEX 8
|
||||
#define FT_VALIDATE_lcar_INDEX 9
|
||||
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_VALIDATE_GX_LENGTH
|
||||
*
|
||||
* @description:
|
||||
* The number of tables checked in this module. Use it as a parameter
|
||||
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
|
||||
*/
|
||||
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
|
||||
|
||||
/* */
|
||||
|
||||
/* Up to 0x1000 is used by otvalid.
|
||||
Ox2xxx is reserved for feature OT extension. */
|
||||
#define FT_VALIDATE_GX_START 0x4000
|
||||
#define FT_VALIDATE_GX_BITFIELD( tag ) \
|
||||
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_GXXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
|
||||
* indicate which TrueTypeGX/AAT Type tables should be validated.
|
||||
*
|
||||
* @values:
|
||||
* FT_VALIDATE_feat ::
|
||||
* Validate `feat' table.
|
||||
*
|
||||
* FT_VALIDATE_mort ::
|
||||
* Validate `mort' table.
|
||||
*
|
||||
* FT_VALIDATE_morx ::
|
||||
* Validate `morx' table.
|
||||
*
|
||||
* FT_VALIDATE_bsln ::
|
||||
* Validate `bsln' table.
|
||||
*
|
||||
* FT_VALIDATE_just ::
|
||||
* Validate `just' table.
|
||||
*
|
||||
* FT_VALIDATE_kern ::
|
||||
* Validate `kern' table.
|
||||
*
|
||||
* FT_VALIDATE_opbd ::
|
||||
* Validate `opbd' table.
|
||||
*
|
||||
* FT_VALIDATE_trak ::
|
||||
* Validate `trak' table.
|
||||
*
|
||||
* FT_VALIDATE_prop ::
|
||||
* Validate `prop' table.
|
||||
*
|
||||
* FT_VALIDATE_lcar ::
|
||||
* Validate `lcar' table.
|
||||
*
|
||||
* FT_VALIDATE_GX ::
|
||||
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
|
||||
* opbd, trak, prop and lcar).
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
|
||||
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
|
||||
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
|
||||
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
|
||||
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
|
||||
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
|
||||
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
|
||||
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
|
||||
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
|
||||
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
|
||||
|
||||
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
|
||||
FT_VALIDATE_mort | \
|
||||
FT_VALIDATE_morx | \
|
||||
FT_VALIDATE_bsln | \
|
||||
FT_VALIDATE_just | \
|
||||
FT_VALIDATE_kern | \
|
||||
FT_VALIDATE_opbd | \
|
||||
FT_VALIDATE_trak | \
|
||||
FT_VALIDATE_prop | \
|
||||
FT_VALIDATE_lcar )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_TrueTypeGX_Validate
|
||||
*
|
||||
* @description:
|
||||
* Validate various TrueTypeGX tables to assure that all offsets and
|
||||
* indices are valid. The idea is that a higher-level library which
|
||||
* actually does the text layout can access those tables without
|
||||
* error checking (which can be quite time consuming).
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the tables to be validated. See
|
||||
* @FT_VALIDATE_GXXXX for possible values.
|
||||
*
|
||||
* table_length ::
|
||||
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
|
||||
* should be passed.
|
||||
*
|
||||
* @output:
|
||||
* tables ::
|
||||
* The array where all validated sfnt tables are stored.
|
||||
* The array itself must be allocated by a client.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with TrueTypeGX fonts, returning an error
|
||||
* otherwise.
|
||||
*
|
||||
* After use, the application should deallocate the buffers pointed to by
|
||||
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
|
||||
* indicates that the table either doesn't exist in the font, the
|
||||
* application hasn't asked for validation, or the validator doesn't have
|
||||
* the ability to validate the sfnt table.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_TrueTypeGX_Validate( FT_Face face,
|
||||
FT_UInt validation_flags,
|
||||
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
|
||||
FT_UInt table_length );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_TrueTypeGX_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by TrueTypeGX validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer allocated by
|
||||
* @FT_TrueTypeGX_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_TrueTypeGX_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_TrueTypeGX_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_CKERNXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_ClassicKern_Validate
|
||||
* to indicate the classic kern dialect or dialects. If the selected
|
||||
* type doesn't fit, @FT_ClassicKern_Validate regards the table as
|
||||
* invalid.
|
||||
*
|
||||
* @values:
|
||||
* FT_VALIDATE_MS ::
|
||||
* Handle the `kern' table as a classic Microsoft kern table.
|
||||
*
|
||||
* FT_VALIDATE_APPLE ::
|
||||
* Handle the `kern' table as a classic Apple kern table.
|
||||
*
|
||||
* FT_VALIDATE_CKERN ::
|
||||
* Handle the `kern' as either classic Apple or Microsoft kern table.
|
||||
*/
|
||||
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
|
||||
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
|
||||
|
||||
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_ClassicKern_Validate
|
||||
*
|
||||
* @description:
|
||||
* Validate classic (16bit format) kern table to assure that the offsets
|
||||
* and indices are valid. The idea is that a higher-level library which
|
||||
* actually does the text layout can access those tables without error
|
||||
* checking (which can be quite time consuming).
|
||||
*
|
||||
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
|
||||
* the new 32bit format and the classic 16bit format, while
|
||||
* FT_ClassicKern_Validate only supports the classic 16bit format.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the dialect to be validated. See
|
||||
* @FT_VALIDATE_CKERNXXX for possible values.
|
||||
*
|
||||
* @output:
|
||||
* ckern_table ::
|
||||
* A pointer to the kern table.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* After use, the application should deallocate the buffers pointed to by
|
||||
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
|
||||
* indicates that the table doesn't exist in the font.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_ClassicKern_Validate( FT_Face face,
|
||||
FT_UInt validation_flags,
|
||||
FT_Bytes *ckern_table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_ClassicKern_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by classic Kern validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer that is allocated by
|
||||
* @FT_ClassicKern_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_ClassicKern_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_ClassicKern_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTGXVAL_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Gzip-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -55,13 +55,15 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse gzip-compressed font files. This is
|
||||
* mainly used to support the compressed *.pcf.gz fonts that come
|
||||
* mainly used to support the compressed `*.pcf.gz' fonts that come
|
||||
* with XFree86.
|
||||
*
|
||||
* @input:
|
||||
* stream :: The target embedding stream.
|
||||
* stream ::
|
||||
* The target embedding stream.
|
||||
*
|
||||
* source :: The source stream.
|
||||
* source ::
|
||||
* The source stream.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
@ -69,8 +71,8 @@ FT_BEGIN_HEADER
|
||||
* @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
|
||||
* *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
|
||||
@ -82,8 +84,8 @@ FT_BEGIN_HEADER
|
||||
* compressed file, the library will try to open a gzipped stream from
|
||||
* it and re-open the face with it.
|
||||
*
|
||||
* This function may return "FT_Err_Unimplemented" if your build of
|
||||
* FreeType was not compiled with zlib support.
|
||||
* This function may return `FT_Err_Unimplemented_Feature' if your build
|
||||
* of FreeType was not compiled with zlib support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stream_OpenGzip( FT_Stream stream,
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* FreeType glyph image formats and default raster interface */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -129,7 +129,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_PIXEL_MODE_GRAY :: */
|
||||
/* An 8-bit bitmap, generally used to represent anti-aliased glyph */
|
||||
/* images. Each pixel is stored in one byte. Note that the number */
|
||||
/* of value "gray" levels is stored in the `num_bytes' field of */
|
||||
/* of value `gray' levels is stored in the `num_bytes' field of */
|
||||
/* the @FT_Bitmap structure (it generally is 256). */
|
||||
/* */
|
||||
/* FT_PIXEL_MODE_GRAY2 :: */
|
||||
@ -144,15 +144,15 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* FT_PIXEL_MODE_LCD :: */
|
||||
/* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
|
||||
/* images used for display on LCD displays; the bitmap's width is */
|
||||
/* three times wider than the original glyph image. See also */
|
||||
/* images used for display on LCD displays; the bitmap is three */
|
||||
/* times wider than the original glyph image. See also */
|
||||
/* @FT_RENDER_MODE_LCD. */
|
||||
/* */
|
||||
/* FT_PIXEL_MODE_LCD_V :: */
|
||||
/* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
|
||||
/* images used for display on rotated LCD displays; the bitmap's */
|
||||
/* height is three times taller than the original glyph image. */
|
||||
/* See also @FT_RENDER_MODE_LCD_V. */
|
||||
/* images used for display on rotated LCD displays; the bitmap */
|
||||
/* is three times taller than the original glyph image. See also */
|
||||
/* @FT_RENDER_MODE_LCD_V. */
|
||||
/* */
|
||||
typedef enum FT_Pixel_Mode_
|
||||
{
|
||||
@ -179,11 +179,11 @@ FT_BEGIN_HEADER
|
||||
/* @FT_Pixel_Mode values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_pixel_mode_none :: see @FT_PIXEL_MODE_NONE */
|
||||
/* ft_pixel_mode_mono :: see @FT_PIXEL_MODE_MONO */
|
||||
/* ft_pixel_mode_grays :: see @FT_PIXEL_MODE_GRAY */
|
||||
/* ft_pixel_mode_pal2 :: see @FT_PIXEL_MODE_GRAY2 */
|
||||
/* ft_pixel_mode_pal4 :: see @FT_PIXEL_MODE_GRAY4 */
|
||||
/* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */
|
||||
/* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */
|
||||
/* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */
|
||||
/* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */
|
||||
/* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */
|
||||
/* */
|
||||
#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
|
||||
#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
|
||||
@ -203,8 +203,8 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
|
||||
/* */
|
||||
/* An enumeration type used to describe the format of a bitmap */
|
||||
/* palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
|
||||
/* An enumeration type to describe the format of a bitmap palette, */
|
||||
/* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* ft_palette_mode_rgb :: The palette is an array of 3-bytes RGB */
|
||||
@ -258,7 +258,7 @@ FT_BEGIN_HEADER
|
||||
/* most cases. */
|
||||
/* */
|
||||
/* num_grays :: This field is only used with */
|
||||
/* `FT_PIXEL_MODE_GRAY'; it gives the number of gray */
|
||||
/* @FT_PIXEL_MODE_GRAY; it gives the number of gray */
|
||||
/* levels used in the bitmap. */
|
||||
/* */
|
||||
/* pixel_mode :: The pixel mode, i.e., how pixel bits are stored. */
|
||||
@ -313,16 +313,16 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* n_points :: The number of points in the outline. */
|
||||
/* */
|
||||
/* points :: A pointer to an array of `n_points' FT_Vector */
|
||||
/* points :: A pointer to an array of `n_points' @FT_Vector */
|
||||
/* elements, giving the outline's point coordinates. */
|
||||
/* */
|
||||
/* tags :: A pointer to an array of `n_points' chars, giving */
|
||||
/* each outline point's type. If bit 0 is unset, the */
|
||||
/* point is `off' the curve, i.e. a Bezier control */
|
||||
/* point is `off' the curve, i.e., a Bézier control */
|
||||
/* point, while it is `on' when set. */
|
||||
/* */
|
||||
/* Bit 1 is meaningful for `off' points only. If set, */
|
||||
/* it indicates a third-order Bezier arc control point; */
|
||||
/* it indicates a third-order Bézier arc control point; */
|
||||
/* and a second-order control point if unset. */
|
||||
/* */
|
||||
/* contours :: An array of `n_contours' shorts, giving the end */
|
||||
@ -333,7 +333,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* flags :: A set of bit flags used to characterize the outline */
|
||||
/* and give hints to the scan-converter and hinter on */
|
||||
/* how to convert/grid-fit it. See FT_Outline_Flags. */
|
||||
/* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
|
||||
/* */
|
||||
typedef struct FT_Outline_
|
||||
{
|
||||
@ -362,7 +362,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_OUTLINE_NONE :: Value 0 is reserved. */
|
||||
/* */
|
||||
/* FT_OUTLINE_OWNER :: If set, this flag indicates that the */
|
||||
/* outline's field arrays (i.e. */
|
||||
/* outline's field arrays (i.e., */
|
||||
/* `points', `flags' & `contours') are */
|
||||
/* `owned' by the outline object, and */
|
||||
/* should thus be freed when it is */
|
||||
@ -486,8 +486,8 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_MoveToFunc)( FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_MoveToFunc)( const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
|
||||
|
||||
@ -512,8 +512,8 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_LineToFunc)( FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_LineToFunc)( const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
|
||||
|
||||
@ -526,7 +526,7 @@ FT_BEGIN_HEADER
|
||||
/* A function pointer type use to describe the signature of a `conic */
|
||||
/* to' function during outline walking/decomposition. */
|
||||
/* */
|
||||
/* A `conic to' is emitted to indicate a second-order Bezier arc in */
|
||||
/* A `conic to' is emitted to indicate a second-order Bézier arc in */
|
||||
/* the outline. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -542,9 +542,9 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_ConicToFunc)( FT_Vector* control,
|
||||
FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_ConicToFunc)( const FT_Vector* control,
|
||||
const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
|
||||
|
||||
@ -557,12 +557,12 @@ FT_BEGIN_HEADER
|
||||
/* A function pointer type used to describe the signature of a `cubic */
|
||||
/* to' function during outline walking/decomposition. */
|
||||
/* */
|
||||
/* A `cubic to' is emitted to indicate a third-order Bezier arc. */
|
||||
/* A `cubic to' is emitted to indicate a third-order Bézier arc. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* control1 :: A pointer to the first Bezier control point. */
|
||||
/* control1 :: A pointer to the first Bézier control point. */
|
||||
/* */
|
||||
/* control2 :: A pointer to the second Bezier control point. */
|
||||
/* control2 :: A pointer to the second Bézier control point. */
|
||||
/* */
|
||||
/* to :: A pointer to the target end point. */
|
||||
/* */
|
||||
@ -573,10 +573,10 @@ FT_BEGIN_HEADER
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Outline_CubicToFunc)( FT_Vector* control1,
|
||||
FT_Vector* control2,
|
||||
FT_Vector* to,
|
||||
void* user );
|
||||
(*FT_Outline_CubicToFunc)( const FT_Vector* control1,
|
||||
const FT_Vector* control2,
|
||||
const FT_Vector* to,
|
||||
void* user );
|
||||
|
||||
#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
|
||||
|
||||
@ -588,7 +588,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure to hold various function pointers used during outline */
|
||||
/* decomposition in order to emit segments, conic, and cubic Beziers, */
|
||||
/* decomposition in order to emit segments, conic, and cubic Béziers, */
|
||||
/* as well as `move to' and `close to' operations. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
@ -596,9 +596,9 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* line_to :: The segment emitter. */
|
||||
/* */
|
||||
/* conic_to :: The second-order Bezier arc emitter. */
|
||||
/* conic_to :: The second-order Bézier arc emitter. */
|
||||
/* */
|
||||
/* cubic_to :: The third-order Bezier arc emitter. */
|
||||
/* cubic_to :: The third-order Bézier arc emitter. */
|
||||
/* */
|
||||
/* shift :: The shift that is applied to coordinates before they */
|
||||
/* are sent to the emitter. */
|
||||
@ -611,8 +611,10 @@ FT_BEGIN_HEADER
|
||||
/* version of the original coordinates (this is important for high */
|
||||
/* accuracy during scan-conversion). The transformation is simple: */
|
||||
/* */
|
||||
/* { */
|
||||
/* x' = (x << shift) - delta */
|
||||
/* y' = (y << shift) - delta */
|
||||
/* y' = (x << shift) - delta */
|
||||
/* } */
|
||||
/* */
|
||||
/* Set the value of `shift' and `delta' to 0 to get the original */
|
||||
/* point coordinates. */
|
||||
@ -644,14 +646,16 @@ FT_BEGIN_HEADER
|
||||
/* FT_IMAGE_TAG */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro converts four letter tags into an unsigned long. */
|
||||
/* This macro converts four-letter tags to an unsigned long type. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Since many 16bit compilers don't like 32bit enumerations, you */
|
||||
/* should redefine this macro in case of problems to something like */
|
||||
/* this: */
|
||||
/* */
|
||||
/* { */
|
||||
/* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
|
||||
/* } */
|
||||
/* */
|
||||
/* to get a simple enumeration without assigning special numbers. */
|
||||
/* */
|
||||
@ -677,7 +681,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* FT_GLYPH_FORMAT_NONE :: */
|
||||
/* The value 0 is reserved and does describe a glyph format. */
|
||||
/* The value 0 is reserved. */
|
||||
/* */
|
||||
/* FT_GLYPH_FORMAT_COMPOSITE :: */
|
||||
/* The glyph image is a composite of several other images. This */
|
||||
@ -690,13 +694,13 @@ FT_BEGIN_HEADER
|
||||
/* the @FT_GlyphSlotRec structure to read it. */
|
||||
/* */
|
||||
/* FT_GLYPH_FORMAT_OUTLINE :: */
|
||||
/* The glyph image is a vertorial outline made of line segments */
|
||||
/* and Bezier arcs; it can be described as an @FT_Outline; you */
|
||||
/* The glyph image is a vectorial outline made of line segments */
|
||||
/* and Bézier arcs; it can be described as an @FT_Outline; you */
|
||||
/* generally want to access the `outline' field of the */
|
||||
/* @FT_GlyphSlotRec structure to read it. */
|
||||
/* */
|
||||
/* FT_GLYPH_FORMAT_PLOTTER :: */
|
||||
/* The glyph image is a vectorial path with no inside/outside */
|
||||
/* The glyph image is a vectorial path with no inside and outside */
|
||||
/* contours. Some Type 1 fonts, like those in the Hershey family, */
|
||||
/* contain glyphs in this format. These are described as */
|
||||
/* @FT_Outline, but FreeType isn't currently capable of rendering */
|
||||
@ -724,11 +728,11 @@ FT_BEGIN_HEADER
|
||||
/* @FT_Glyph_Format values instead. */
|
||||
/* */
|
||||
/* <Values> */
|
||||
/* ft_glyph_format_none :: see @FT_GLYPH_FORMAT_NONE */
|
||||
/* ft_glyph_format_composite :: see @FT_GLYPH_FORMAT_COMPOSITE */
|
||||
/* ft_glyph_format_bitmap :: see @FT_GLYPH_FORMAT_BITMAP */
|
||||
/* ft_glyph_format_outline :: see @FT_GLYPH_FORMAT_OUTLINE */
|
||||
/* ft_glyph_format_plotter :: see @FT_GLYPH_FORMAT_PLOTTER */
|
||||
/* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */
|
||||
/* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */
|
||||
/* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */
|
||||
/* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */
|
||||
/* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */
|
||||
/* */
|
||||
#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
|
||||
#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
|
||||
@ -809,11 +813,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This structure is used by the span drawing callback type named */
|
||||
/* FT_SpanFunc which takes the y-coordinate of the span as a */
|
||||
/* @FT_SpanFunc which takes the y-coordinate of the span as a */
|
||||
/* a parameter. */
|
||||
/* */
|
||||
/* The coverage value is always between 0 and 255, even if the number */
|
||||
/* of gray levels have been set through FT_Set_Gray_Levels(). */
|
||||
/* The coverage value is always between 0 and 255. */
|
||||
/* */
|
||||
typedef struct FT_Span_
|
||||
{
|
||||
@ -851,20 +854,20 @@ FT_BEGIN_HEADER
|
||||
/* given background bitmap, and even perform translucency. */
|
||||
/* */
|
||||
/* Note that the `count' field cannot be greater than a fixed value */
|
||||
/* defined by the FT_MAX_GRAY_SPANS configuration macro in */
|
||||
/* ftoption.h. By default, this value is set to 32, which means that */
|
||||
/* if there are more than 32 spans on a given scanline, the callback */
|
||||
/* will be called several times with the same `y' parameter in order */
|
||||
/* to draw all callbacks. */
|
||||
/* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
|
||||
/* `ftoption.h'. By default, this value is set to 32, which means */
|
||||
/* that if there are more than 32 spans on a given scanline, the */
|
||||
/* callback is called several times with the same `y' parameter in */
|
||||
/* order to draw all callbacks. */
|
||||
/* */
|
||||
/* Otherwise, the callback is only called once per scan-line, and */
|
||||
/* only for those scanlines that do have `gray' pixels on them. */
|
||||
/* */
|
||||
typedef void
|
||||
(*FT_SpanFunc)( int y,
|
||||
int count,
|
||||
FT_Span* spans,
|
||||
void* user );
|
||||
(*FT_SpanFunc)( int y,
|
||||
int count,
|
||||
const FT_Span* spans,
|
||||
void* user );
|
||||
|
||||
#define FT_Raster_Span_Func FT_SpanFunc
|
||||
|
||||
@ -958,8 +961,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
|
||||
/* rendering mode. If set, the output will */
|
||||
/* be clipped to a box specified in the */
|
||||
/* "clip_box" field of the FT_Raster_Params */
|
||||
/* structure. */
|
||||
/* `clip_box' field of the */
|
||||
/* @FT_Raster_Params structure. */
|
||||
/* */
|
||||
/* Note that by default, the glyph bitmap */
|
||||
/* is clipped to the target pixmap, except */
|
||||
@ -990,8 +993,8 @@ FT_BEGIN_HEADER
|
||||
/* <Fields> */
|
||||
/* target :: The target bitmap. */
|
||||
/* */
|
||||
/* source :: A pointer to the source glyph image (e.g. an */
|
||||
/* FT_Outline). */
|
||||
/* source :: A pointer to the source glyph image (e.g., an */
|
||||
/* @FT_Outline). */
|
||||
/* */
|
||||
/* flags :: The rendering flags. */
|
||||
/* */
|
||||
@ -1012,11 +1015,11 @@ FT_BEGIN_HEADER
|
||||
/* 26.6 fixed-point units). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* An anti-aliased glyph bitmap is drawn if the FT_RASTER_FLAG_AA bit */
|
||||
/* flag is set in the `flags' field, otherwise a monochrome bitmap */
|
||||
/* will be generated. */
|
||||
/* An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA */
|
||||
/* bit flag is set in the `flags' field, otherwise a monochrome */
|
||||
/* bitmap is generated. */
|
||||
/* */
|
||||
/* If the FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
|
||||
/* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
|
||||
/* raster will call the `gray_spans' callback to draw gray pixel */
|
||||
/* spans, in the case of an aa glyph bitmap, it will call */
|
||||
/* `black_spans', and `bit_test' and `bit_set' in the case of a */
|
||||
@ -1063,9 +1066,9 @@ FT_BEGIN_HEADER
|
||||
/* <Note> */
|
||||
/* The `memory' parameter is a typeless pointer in order to avoid */
|
||||
/* un-wanted dependencies on the rest of the FreeType code. In */
|
||||
/* practice, it is a FT_Memory, i.e., a handle to the standard */
|
||||
/* FreeType memory allocator. However, this field can be completely */
|
||||
/* ignored by a given raster implementation. */
|
||||
/* practice, it is an @FT_Memory object, i.e., a handle to the */
|
||||
/* standard FreeType memory allocator. However, this field can be */
|
||||
/* completely ignored by a given raster implementation. */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Raster_NewFunc)( void* memory,
|
||||
@ -1160,31 +1163,31 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* raster :: A handle to the raster object. */
|
||||
/* */
|
||||
/* params :: A pointer to a FT_Raster_Params structure used to store */
|
||||
/* the rendering parameters. */
|
||||
/* params :: A pointer to an @FT_Raster_Params structure used to */
|
||||
/* store the rendering parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The exact format of the source image depends on the raster's glyph */
|
||||
/* format defined in its FT_Raster_Funcs structure. It can be an */
|
||||
/* FT_Outline or anything else in order to support a large array of */
|
||||
/* format defined in its @FT_Raster_Funcs structure. It can be an */
|
||||
/* @FT_Outline or anything else in order to support a large array of */
|
||||
/* glyph formats. */
|
||||
/* */
|
||||
/* Note also that the render function can fail and return a */
|
||||
/* FT_Err_Unimplemented_Feature error code if the raster used does */
|
||||
/* `FT_Err_Unimplemented_Feature' error code if the raster used does */
|
||||
/* not support direct composition. */
|
||||
/* */
|
||||
/* XXX: For now, the standard raster doesn't support direct */
|
||||
/* composition but this should change for the final release (see */
|
||||
/* the files demos/src/ftgrays.c and demos/src/ftgrays2.c for */
|
||||
/* examples of distinct implementations which support direct */
|
||||
/* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
|
||||
/* for examples of distinct implementations which support direct */
|
||||
/* composition). */
|
||||
/* */
|
||||
typedef int
|
||||
(*FT_Raster_RenderFunc)( FT_Raster raster,
|
||||
FT_Raster_Params* params );
|
||||
(*FT_Raster_RenderFunc)( FT_Raster raster,
|
||||
const FT_Raster_Params* params );
|
||||
|
||||
#define FT_Raster_Render_Func FT_Raster_RenderFunc
|
||||
|
||||
@ -1228,3 +1231,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType incremental loading (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* Copyright 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -31,6 +31,33 @@
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* incremental
|
||||
*
|
||||
* @title:
|
||||
* Incremental Loading
|
||||
*
|
||||
* @abstract:
|
||||
* Custom Glyph Loading.
|
||||
*
|
||||
* @description:
|
||||
* This section contains various functions used to perform so-called
|
||||
* `incremental' glyph loading. This is a mode where all glyphs loaded
|
||||
* from a given @FT_Face are provided by the client application,
|
||||
*
|
||||
* Apart from that, all other tables are loaded normally from the font
|
||||
* file. This mode is useful when FreeType is used within another
|
||||
* engine, e.g., a Postscript Imaging Processor.
|
||||
*
|
||||
* To enable this mode, you must use @FT_Open_Face, passing an
|
||||
* @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
|
||||
* @FT_Incremental_Interface value. See the comments for
|
||||
* @FT_Incremental_InterfaceRec for an example.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
@ -39,8 +66,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* An opaque type describing a user-provided object used to implement
|
||||
* "incremental" glyph loading within FreeType. This is used to support
|
||||
* embedded fonts in certain environments (e.g. Postscript interpreters),
|
||||
* `incremental' glyph loading within FreeType. This is used to support
|
||||
* embedded fonts in certain environments (e.g., Postscript interpreters),
|
||||
* where the glyph data isn't in the font file, or must be overridden by
|
||||
* different values.
|
||||
*
|
||||
@ -77,7 +104,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* 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.
|
||||
*/
|
||||
typedef struct FT_Incremental_MetricsRec_
|
||||
@ -101,8 +128,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* Note that the format of the glyph's data bytes depends on the font
|
||||
* file format. For TrueType, it must correspond to the raw bytes within
|
||||
* the 'glyf' table. For Postscript formats, it must correspond to the
|
||||
* *unencrypted* charstring bytes, without any 'lenIV' header. It is
|
||||
* the `glyf' table. For Postscript formats, it must correspond to the
|
||||
* *unencrypted* charstring bytes, without any `lenIV' header. It is
|
||||
* undefined for any other format.
|
||||
*
|
||||
* @input:
|
||||
@ -270,6 +297,18 @@ FT_BEGIN_HEADER
|
||||
} FT_Incremental_InterfaceRec;
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Incremental_Interface
|
||||
*
|
||||
* @description:
|
||||
* A pointer to an @FT_Incremental_InterfaceRec structure.
|
||||
*
|
||||
*/
|
||||
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* @constant:
|
||||
|
@ -174,12 +174,12 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An FT_List iterator function which is called during a list parse */
|
||||
/* by FT_List_Iterate(). */
|
||||
/* by @FT_List_Iterate. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* node :: The current iteration list node. */
|
||||
/* */
|
||||
/* user :: A typeless pointer passed to FT_List_Iterate(). */
|
||||
/* user :: A typeless pointer passed to @FT_List_Iterate. */
|
||||
/* Can be used to point to the iteration's state. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
@ -219,8 +219,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_List_Destructor */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An FT_List iterator function which is called during a list */
|
||||
/* finalization by FT_List_Finalize() to destroy all elements in a */
|
||||
/* An @FT_List iterator function which is called during a list */
|
||||
/* finalization by @FT_List_Finalize to destroy all elements in a */
|
||||
/* given list. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -228,7 +228,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* data :: The current object to destroy. */
|
||||
/* */
|
||||
/* user :: A typeless pointer passed to FT_List_Iterate(). It can */
|
||||
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */
|
||||
/* be used to point to the iteration's state. */
|
||||
/* */
|
||||
typedef void
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* LZW-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -54,7 +54,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse LZW-compressed font files. This is
|
||||
* mainly used to support the compressed *.pcf.Z fonts that come
|
||||
* mainly used to support the compressed `*.pcf.Z' fonts that come
|
||||
* with XFree86.
|
||||
*
|
||||
* @input:
|
||||
@ -68,8 +68,8 @@ FT_BEGIN_HEADER
|
||||
* @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
|
||||
* *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
|
||||
@ -81,8 +81,8 @@ FT_BEGIN_HEADER
|
||||
* 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" 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_Stream_OpenLZW( FT_Stream stream,
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Additional Mac-specific API. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2004 by */
|
||||
/* Copyright 1996-2001, 2004, 2006 by */
|
||||
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -59,13 +59,13 @@ FT_BEGIN_HEADER
|
||||
/* FT_New_Face_From_FOND */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new face object from an FOND resource. */
|
||||
/* Create a new face object from a FOND resource. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to the library resource. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* fond :: An FOND resource. */
|
||||
/* fond :: A FOND resource. */
|
||||
/* */
|
||||
/* face_index :: Only supported for the -1 `sanity check' special */
|
||||
/* case. */
|
||||
@ -77,8 +77,8 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Notes> */
|
||||
/* This function can be used to create FT_Face abjects from fonts */
|
||||
/* that are installed in the system like so: */
|
||||
/* This function can be used to create @FT_Face objects from fonts */
|
||||
/* that are installed in the system as follows. */
|
||||
/* */
|
||||
/* { */
|
||||
/* fond = GetResource( 'FOND', fontName ); */
|
||||
@ -98,10 +98,11 @@ FT_BEGIN_HEADER
|
||||
/* FT_GetFile_From_Mac_Name */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns an FSSpec for the disk file containing the named font. */
|
||||
/* Return an FSSpec for the disk file containing the named font. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* fontName :: Mac OS name of the font (eg. Times New Roman Bold). */
|
||||
/* fontName :: Mac OS name of the font (e.g., Times New Roman */
|
||||
/* Bold). */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* pathSpec :: FSSpec to the file. For passing to @FT_New_Face. */
|
||||
@ -112,18 +113,43 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GetFile_From_Mac_Name( const char* fontName,
|
||||
FT_GetFile_From_Mac_Name( const char* fontName,
|
||||
FSSpec* pathSpec,
|
||||
FT_Long* face_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_GetFile_From_Mac_ATS_Name */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return an FSSpec for the disk file containing the named font. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* fontName :: Mac OS name of the font in ATS framework. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* pathSpec :: FSSpec to the file. For passing to @FT_New_Face. */
|
||||
/* */
|
||||
/* face_index :: Index of the face. For passing to @FT_New_Face. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
|
||||
FSSpec* pathSpec,
|
||||
FT_Long* face_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Face_From_FSSpec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates 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. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
@ -150,6 +176,40 @@ FT_BEGIN_HEADER
|
||||
FT_Long face_index,
|
||||
FT_Face *aface );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Face_From_FSRef */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Create a new face object from a given resource and typeface index */
|
||||
/* using an FSRef to the font file. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to the library resource. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* spec :: FSRef to the font file. */
|
||||
/* */
|
||||
/* face_index :: The index of the face within the resource. The */
|
||||
/* first face has index 0. */
|
||||
/* <Output> */
|
||||
/* aface :: A handle to a new face object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* 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_New_Face_From_FSRef( FT_Library library,
|
||||
const FSRef *ref,
|
||||
FT_Long face_index,
|
||||
FT_Face *aface );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType Multiple Master font interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -40,11 +40,11 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The following types and functions are used to manage Multiple */
|
||||
/* Master fonts, i.e. the selection of specific design instances by */
|
||||
/* Master fonts, i.e., the selection of specific design instances by */
|
||||
/* setting design axis coordinates. */
|
||||
/* */
|
||||
/* George Williams has extended this interface to make it work with */
|
||||
/* both Type 1 Multiple Masters fonts, and GX distortable (var) */
|
||||
/* both Type 1 Multiple Masters fonts and GX distortable (var) */
|
||||
/* fonts. Some of these routines only work with MM fonts, others */
|
||||
/* will work with both types. They are similar enough that a */
|
||||
/* consistent interface makes sense. */
|
||||
@ -93,7 +93,7 @@ FT_BEGIN_HEADER
|
||||
/* <Fields> */
|
||||
/* num_axis :: Number of axes. Cannot exceed 4. */
|
||||
/* */
|
||||
/* num_designs :: Number of designs; should ne normally 2^num_axis */
|
||||
/* num_designs :: Number of designs; should be normally 2^num_axis */
|
||||
/* even though the Type 1 specification strangely */
|
||||
/* allows for intermediate designs to be present. This */
|
||||
/* number cannot exceed 16. */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType modules public interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -84,7 +84,7 @@ FT_BEGIN_HEADER
|
||||
typedef void
|
||||
(*FT_Module_Destructor)( FT_Module module );
|
||||
|
||||
typedef FT_Module_Interface
|
||||
typedef FT_Module_Interface
|
||||
(*FT_Module_Requester)( FT_Module module,
|
||||
const char* name );
|
||||
|
||||
@ -98,27 +98,28 @@ FT_BEGIN_HEADER
|
||||
/* The module class descriptor. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* module_flags :: Bit flags describing the module. */
|
||||
/* module_flags :: Bit flags describing the module. */
|
||||
/* */
|
||||
/* module_size :: The size of one module object/instance in */
|
||||
/* bytes. */
|
||||
/* module_size :: The size of one module object/instance in */
|
||||
/* bytes. */
|
||||
/* */
|
||||
/* module_name :: The name of the module. */
|
||||
/* module_name :: The name of the module. */
|
||||
/* */
|
||||
/* module_version :: The version, as a 16.16 fixed number */
|
||||
/* (major.minor). */
|
||||
/* module_version :: The version, as a 16.16 fixed number */
|
||||
/* (major.minor). */
|
||||
/* */
|
||||
/* module_requires :: The version of FreeType this module requires */
|
||||
/* (starts at version 2.0, i.e 0x20000) */
|
||||
/* module_requires :: The version of FreeType this module requires, */
|
||||
/* as a 16.16 fixed number (major.minor). Starts */
|
||||
/* at version 2.0, i.e., 0x20000. */
|
||||
/* */
|
||||
/* module_init :: A function used to initialize (not create) a */
|
||||
/* new module object. */
|
||||
/* module_init :: A function used to initialize (not create) a */
|
||||
/* new module object. */
|
||||
/* */
|
||||
/* module_done :: A function used to finalize (not destroy) a */
|
||||
/* given module object */
|
||||
/* module_done :: A function used to finalize (not destroy) a */
|
||||
/* given module object */
|
||||
/* */
|
||||
/* get_interface :: Queries a given module for a specific */
|
||||
/* interface by name. */
|
||||
/* get_interface :: Queries a given module for a specific */
|
||||
/* interface by name. */
|
||||
/* */
|
||||
typedef struct FT_Module_Class_
|
||||
{
|
||||
@ -180,8 +181,8 @@ FT_BEGIN_HEADER
|
||||
/* A module handle. 0 if none was found. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should better be familiar with FreeType internals to know */
|
||||
/* which module to look for :-) */
|
||||
/* FreeType's internal modules aren't documented very well, and you */
|
||||
/* should look up the source code for details. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Module )
|
||||
FT_Get_Module( FT_Library library,
|
||||
@ -255,7 +256,7 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Done_Library( FT_Library library );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
typedef void
|
||||
(*FT_DebugHook_Func)( void* arg );
|
||||
@ -275,8 +276,8 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hook_index :: The index of the debug hook. You should use the */
|
||||
/* values defined in ftobjs.h, e.g. */
|
||||
/* FT_DEBUG_HOOK_TRUETYPE. */
|
||||
/* values defined in `ftobjs.h', e.g., */
|
||||
/* `FT_DEBUG_HOOK_TRUETYPE'. */
|
||||
/* */
|
||||
/* debug_hook :: The function used to debug the interpreter. */
|
||||
/* */
|
||||
@ -284,13 +285,16 @@ FT_BEGIN_HEADER
|
||||
/* Currently, four debug hook slots are available, but only two (for */
|
||||
/* the TrueType and the Type 1 interpreter) are defined. */
|
||||
/* */
|
||||
/* Since the internal headers of FreeType are no longer installed, */
|
||||
/* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
|
||||
/* This is a bug and will be fixed in a forthcoming release. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Set_Debug_Hook( FT_Library library,
|
||||
FT_UInt hook_index,
|
||||
FT_DebugHook_Func debug_hook );
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
@ -299,7 +303,7 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* Adds the set of default drivers to a given library object. */
|
||||
/* This is only useful when you create a library object with */
|
||||
/* FT_New_Library() (usually to plug a custom memory manager). */
|
||||
/* @FT_New_Library (usually to plug a custom memory manager). */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to a new library object. */
|
||||
@ -308,6 +312,89 @@ FT_BEGIN_HEADER
|
||||
FT_Add_Default_Modules( FT_Library library );
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* ttengine
|
||||
*
|
||||
* @title:
|
||||
* The TrueType Engine
|
||||
*
|
||||
* @abstract:
|
||||
* TrueType bytecode support.
|
||||
*
|
||||
* @description:
|
||||
* This section contains a function used to query the level of TrueType
|
||||
* bytecode support compiled in this version of the library.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_TrueTypeEngineType
|
||||
*
|
||||
* @description:
|
||||
* A list of values describing which kind of TrueType bytecode
|
||||
* engine is implemented in a given FT_Library instance. It is used
|
||||
* by the @FT_Get_TrueType_Engine_Type function.
|
||||
*
|
||||
* @values:
|
||||
* FT_TRUETYPE_ENGINE_TYPE_NONE ::
|
||||
* The library doesn't implement any kind of bytecode interpreter.
|
||||
*
|
||||
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
|
||||
* The library implements a bytecode interpreter that doesn't
|
||||
* support the patented operations of the TrueType virtual machine.
|
||||
*
|
||||
* Its main use is to load certain Asian fonts which position and
|
||||
* scale glyph components with bytecode instructions. It produces
|
||||
* bad output for most other fonts.
|
||||
*
|
||||
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
|
||||
* The library implements a bytecode interpreter that covers
|
||||
* the full instruction set of the TrueType virtual machine.
|
||||
* See the file `docs/PATENTS' for legal aspects.
|
||||
*
|
||||
* @since:
|
||||
* 2.2
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
|
||||
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
|
||||
FT_TRUETYPE_ENGINE_TYPE_PATENTED
|
||||
|
||||
} FT_TrueTypeEngineType;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @func:
|
||||
* FT_Get_TrueType_Engine_Type
|
||||
*
|
||||
* @description:
|
||||
* Return a @FT_TrueTypeEngineType value to indicate which level of
|
||||
* the TrueType virtual machine a given library instance supports.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A library instance.
|
||||
*
|
||||
* @return:
|
||||
* A value indicating which level is supported.
|
||||
*
|
||||
* @since:
|
||||
* 2.2
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_TrueTypeEngineType )
|
||||
FT_Get_TrueType_Engine_Type( FT_Library library );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for validating OpenType tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005 by */
|
||||
/* Copyright 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -64,7 +64,7 @@ FT_BEGIN_HEADER
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_VALIDATE_XXX
|
||||
* FT_VALIDATE_OTXXX
|
||||
*
|
||||
* @description:
|
||||
* A list of bit-field constants used with @FT_OpenType_Validate to
|
||||
@ -121,7 +121,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* validation_flags ::
|
||||
* A bit field which specifies the tables to be validated. See
|
||||
* @FT_VALIDATE_XXX for possible values.
|
||||
* @FT_VALIDATE_OTXXX for possible values.
|
||||
*
|
||||
* @output:
|
||||
* BASE_table ::
|
||||
@ -147,8 +147,9 @@ FT_BEGIN_HEADER
|
||||
* otherwise.
|
||||
*
|
||||
* After use, the application should deallocate the five tables with
|
||||
* `free'. A NULL value indicates that the table either doesn't exist
|
||||
* in the font, or the application hasn't asked for validation.
|
||||
* @FT_OpenType_Free. A NULL value indicates that the table either
|
||||
* doesn't exist in the font, or the application hasn't asked for
|
||||
* validation.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_OpenType_Validate( FT_Face face,
|
||||
@ -159,6 +160,33 @@ FT_BEGIN_HEADER
|
||||
FT_Bytes *GSUB_table,
|
||||
FT_Bytes *JSTF_table );
|
||||
|
||||
/* */
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_OpenType_Free
|
||||
*
|
||||
* @description:
|
||||
* Free the buffer allocated by OpenType validator.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* table ::
|
||||
* The pointer to the buffer that is allocated by
|
||||
* @FT_OpenType_Validate.
|
||||
*
|
||||
* @note:
|
||||
* This function must be used to free the buffer allocated by
|
||||
* @FT_OpenType_Validate only.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_OpenType_Free( FT_Face face,
|
||||
FT_Bytes table );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* Support for the FT_Outline type used to store glyph shapes of */
|
||||
/* most scalable font formats (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -85,7 +85,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Walks over an outline's structure to decompose it into individual */
|
||||
/* segments and Bezier arcs. This function is also able to emit */
|
||||
/* segments and Bézier arcs. This function is also able to emit */
|
||||
/* `move to' and `close to' operations to indicate the start and end */
|
||||
/* of new contours in the outline. */
|
||||
/* */
|
||||
@ -122,8 +122,8 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object from where the */
|
||||
/* outline is allocated. Note however that the new */
|
||||
/* outline will NOT necessarily be FREED, when */
|
||||
/* destroying the library, by FT_Done_FreeType(). */
|
||||
/* outline will *not* necessarily be *freed*, when */
|
||||
/* destroying the library, by @FT_Done_FreeType. */
|
||||
/* */
|
||||
/* numPoints :: The maximal number of points within the outline. */
|
||||
/* */
|
||||
@ -160,7 +160,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Outline_Done */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys an outline created with FT_Outline_New(). */
|
||||
/* Destroys an outline created with @FT_Outline_New. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle of the library object used to allocate the */
|
||||
@ -176,7 +176,7 @@ FT_BEGIN_HEADER
|
||||
/* descriptor will be released. */
|
||||
/* */
|
||||
/* The reason why this function takes an `library' parameter is */
|
||||
/* simply to use FT_Free(). */
|
||||
/* simply to use ft_mem_free(). */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Done( FT_Library library,
|
||||
@ -213,10 +213,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns an outline's `control box'. The control box encloses all */
|
||||
/* the outline's points, including Bezier control points. Though it */
|
||||
/* the outline's points, including Bézier control points. Though it */
|
||||
/* coincides with the exact bounding box for most glyphs, it can be */
|
||||
/* slightly larger in some situations (like when rotating an outline */
|
||||
/* which contains Bezier outside arcs). */
|
||||
/* which contains Bézier outside arcs). */
|
||||
/* */
|
||||
/* Computing the control box is very fast, while getting the bounding */
|
||||
/* box can take much more time as it needs to walk over all segments */
|
||||
@ -296,7 +296,7 @@ FT_BEGIN_HEADER
|
||||
/* matrix :: A pointer to the transformation matrix. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You can use FT_Outline_Translate() if you need to translate the */
|
||||
/* You can use @FT_Outline_Translate if you need to translate the */
|
||||
/* outline's points. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
@ -314,6 +314,9 @@ FT_BEGIN_HEADER
|
||||
/* `strength' pixels wider and higher. You may think of the left and */
|
||||
/* bottom borders as unchanged. */
|
||||
/* */
|
||||
/* Negative `strength' values to reduce the outline thickness are */
|
||||
/* possible also. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* outline :: A handle to the target outline. */
|
||||
/* */
|
||||
@ -324,7 +327,21 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
/* <Note> */
|
||||
/* The used algorithm to increase or decrease the thickness of the */
|
||||
/* glyph doesn't change the number of points; this means that certain */
|
||||
/* situations like acute angles or intersections are sometimes */
|
||||
/* handled incorrectly. */
|
||||
/* */
|
||||
/* Example call: */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
|
||||
/* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
|
||||
/* FT_Outline_Embolden( &face->slot->outline, strength ); */
|
||||
/* } */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Embolden( FT_Outline* outline,
|
||||
FT_Pos strength );
|
||||
|
||||
@ -342,7 +359,7 @@ FT_BEGIN_HEADER
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This functions toggles the bit flag `FT_OUTLINE_REVERSE_FILL' in */
|
||||
/* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
|
||||
/* the outline's `flags' field. */
|
||||
/* */
|
||||
/* It shouldn't be used by a normal client application, unless it */
|
||||
@ -366,7 +383,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* <InOut> */
|
||||
/* abitmap :: A pointer to the target bitmap descriptor. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
@ -391,7 +408,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Renders an outline within a bitmap using the current scan-convert. */
|
||||
/* This functions uses an FT_Raster_Params structure as an argument, */
|
||||
/* This functions uses an @FT_Raster_Params structure as an argument, */
|
||||
/* allowing advanced features like direct composition, translucency, */
|
||||
/* etc. */
|
||||
/* */
|
||||
@ -401,14 +418,14 @@ FT_BEGIN_HEADER
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* params :: A pointer to a FT_Raster_Params structure used to */
|
||||
/* params :: A pointer to an @FT_Raster_Params structure used to */
|
||||
/* describe the rendering operation. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should know what you are doing and how FT_Raster_Params works */
|
||||
/* You should know what you are doing and how @FT_Raster_Params works */
|
||||
/* to use this function. */
|
||||
/* */
|
||||
/* The field `params.source' will be set to `outline' before the scan */
|
||||
@ -450,13 +467,19 @@ FT_BEGIN_HEADER
|
||||
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
|
||||
* remember that in Postscript, everything that is to the left of
|
||||
* the drawing direction of a contour must be filled.
|
||||
*
|
||||
* FT_ORIENTATION_NONE ::
|
||||
* The orientation cannot be determined. That is, different parts of
|
||||
* the glyph have different orientation.
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_ORIENTATION_TRUETYPE = 0,
|
||||
FT_ORIENTATION_POSTSCRIPT = 1,
|
||||
FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
|
||||
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT
|
||||
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT,
|
||||
FT_ORIENTATION_NONE
|
||||
|
||||
} FT_Orientation;
|
||||
|
||||
@ -496,3 +519,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType API for accessing PFR-specific data (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -154,7 +154,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
|
||||
* to convert the advance to device sub-pixels (i.e. 1/64th of pixels).
|
||||
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_PFR_Advance( FT_Face face,
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType renderer modules public interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2005 by */
|
||||
/* Copyright 1996-2001, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -46,9 +46,9 @@ FT_BEGIN_HEADER
|
||||
(*FT_Glyph_DoneFunc)( FT_Glyph glyph );
|
||||
|
||||
typedef void
|
||||
(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta );
|
||||
(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
|
||||
const FT_Matrix* matrix,
|
||||
const FT_Vector* delta );
|
||||
|
||||
typedef void
|
||||
(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
|
||||
@ -85,16 +85,16 @@ FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt mode,
|
||||
FT_Vector* origin );
|
||||
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt mode,
|
||||
const FT_Vector* origin );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta );
|
||||
(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
const FT_Matrix* matrix,
|
||||
const FT_Vector* delta );
|
||||
|
||||
|
||||
typedef void
|
||||
@ -124,7 +124,7 @@ FT_BEGIN_HEADER
|
||||
/* The renderer module class descriptor. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The root FT_Module_Class fields. */
|
||||
/* root :: The root @FT_Module_Class fields. */
|
||||
/* */
|
||||
/* glyph_format :: The glyph image format this renderer handles. */
|
||||
/* */
|
||||
@ -133,10 +133,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* set_mode :: A method used to pass additional parameters. */
|
||||
/* */
|
||||
/* raster_class :: For `FT_GLYPH_FORMAT_OUTLINE' renderers only, this */
|
||||
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
|
||||
/* is a pointer to its raster's class. */
|
||||
/* */
|
||||
/* raster :: For `FT_GLYPH_FORMAT_OUTLINE' renderers only. this */
|
||||
/* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
|
||||
/* is a pointer to the corresponding raster object, */
|
||||
/* if any. */
|
||||
/* */
|
||||
@ -176,8 +176,8 @@ FT_BEGIN_HEADER
|
||||
/* An error will be returned if a module already exists by that name, */
|
||||
/* or if the module requires a version of FreeType that is too great. */
|
||||
/* */
|
||||
/* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
|
||||
/* renderer by its name, use FT_Get_Module(). */
|
||||
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
|
||||
/* renderer by its name, use @FT_Get_Module. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Renderer )
|
||||
FT_Get_Renderer( FT_Library library,
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType size objects management (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -54,9 +54,9 @@ FT_BEGIN_HEADER
|
||||
/* Managing multiple sizes per face. */
|
||||
/* */
|
||||
/* <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 object is automatically created and used to store all */
|
||||
/* pixel-size dependent information, available in the "face->size" */
|
||||
/* pixel-size dependent information, available in the `face->size' */
|
||||
/* field. */
|
||||
/* */
|
||||
/* It is however possible to create more sizes for a given face, */
|
||||
@ -64,7 +64,7 @@ FT_BEGIN_HEADER
|
||||
/* same font family and style. See @FT_New_Size and @FT_Done_Size. */
|
||||
/* */
|
||||
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
|
||||
/* modify the contents of the current "active" size; you thus need */
|
||||
/* modify the contents of the current `active' size; you thus need */
|
||||
/* to use @FT_Activate_Size to change it. */
|
||||
/* */
|
||||
/* 99% of applications won't need the functions provided here, */
|
||||
@ -80,7 +80,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_New_Size */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new size object from a given face object. */
|
||||
/* Create a new size object from a given face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to a parent face object. */
|
||||
@ -107,7 +107,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Done_Size */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Discards a given size object. Note that @FT_Done_Face */
|
||||
/* Discard a given size object. Note that @FT_Done_Face */
|
||||
/* automatically discards all size objects allocated with */
|
||||
/* @FT_New_Size. */
|
||||
/* */
|
||||
@ -130,9 +130,9 @@ FT_BEGIN_HEADER
|
||||
/* Even though it is possible to create several size objects for a */
|
||||
/* given face (see @FT_New_Size for details), functions like */
|
||||
/* @FT_Load_Glyph or @FT_Load_Char only use the last-created one 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. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -142,8 +142,8 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* If "face" is the size's parent face object, this function changes */
|
||||
/* 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_Activate_Size( FT_Size size );
|
||||
|
@ -7,7 +7,7 @@
|
||||
/* */
|
||||
/* This is _not_ used to retrieve glyph names! */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -78,12 +78,12 @@ FT_BEGIN_HEADER
|
||||
/* name_id :: An identifier for `string'. */
|
||||
/* */
|
||||
/* string :: The `name' string. Note that its format differs */
|
||||
/* depending on the (platform,encoding) pair. It can */
|
||||
/* be a Pascal String, a UTF-16 one, etc.. */
|
||||
/* depending on the (platform,encoding) pair. It can */
|
||||
/* be a Pascal String, a UTF-16 one, etc. */
|
||||
/* */
|
||||
/* Generally speaking, the string is not */
|
||||
/* zero-terminated. Please refer to the TrueType */
|
||||
/* specification for details.. */
|
||||
/* zero-terminated. Please refer to the TrueType */
|
||||
/* specification for details. */
|
||||
/* */
|
||||
/* string_len :: The length of `string' in bytes. */
|
||||
/* */
|
||||
@ -92,6 +92,9 @@ FT_BEGIN_HEADER
|
||||
/* and `name_id' are given in the file `ttnameid.h'. For details */
|
||||
/* please refer to the TrueType or OpenType specification. */
|
||||
/* */
|
||||
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
|
||||
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
|
||||
/* */
|
||||
typedef struct FT_SfntName_
|
||||
{
|
||||
FT_UShort platform_id;
|
||||
@ -137,7 +140,7 @@ FT_BEGIN_HEADER
|
||||
/* idx :: The index of the `name' string. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aname :: The indexed FT_SfntName structure. */
|
||||
/* aname :: The indexed @FT_SfntName structure. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
@ -146,7 +149,7 @@ FT_BEGIN_HEADER
|
||||
/* The `string' array returned in the `aname' structure is not */
|
||||
/* null-terminated. */
|
||||
/* */
|
||||
/* Use FT_Get_Sfnt_Name_Count() to get the total number of available */
|
||||
/* 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. */
|
||||
/* */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType path stroker (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* Copyright 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -29,16 +29,16 @@ FT_BEGIN_HEADER
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* <Section>
|
||||
* @section:
|
||||
* glyph_stroker
|
||||
*
|
||||
* <Title>
|
||||
* @title:
|
||||
* Glyph Stroker
|
||||
*
|
||||
* <Abstract>
|
||||
* @abstract:
|
||||
* Generating bordered and stroked glyphs.
|
||||
*
|
||||
* <Description>
|
||||
* @description:
|
||||
* This component generates stroked outlines of a given vectorial
|
||||
* glyph. It also allows you to retrieve the `outside' and/or the
|
||||
* `inside' borders of the stroke.
|
||||
@ -142,8 +142,8 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* Applications are generally interested in the `inside' and `outside'
|
||||
* borders. However, there is no direct mapping between these and
|
||||
* the `left' / `right' ones, since this really depends on the glyph's
|
||||
* borders. However, there is no direct mapping between these and the
|
||||
* `left' and `right' ones, since this really depends on the glyph's
|
||||
* drawing orientation, which varies between font formats.
|
||||
*
|
||||
* You can however use @FT_Outline_GetInsideBorder and
|
||||
@ -208,17 +208,18 @@ FT_BEGIN_HEADER
|
||||
* Create a new stroker object.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* The memory manager handle.
|
||||
* library ::
|
||||
* FreeType library handle.
|
||||
*
|
||||
* @output:
|
||||
* A new stroker object handle. NULL in case of error.
|
||||
* astroker ::
|
||||
* A new stroker object handle. NULL in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_New( FT_Memory memory,
|
||||
FT_Stroker_New( FT_Library library,
|
||||
FT_Stroker *astroker );
|
||||
|
||||
|
||||
@ -340,7 +341,7 @@ FT_BEGIN_HEADER
|
||||
*
|
||||
* @note:
|
||||
* This function is useful when you need to stroke a path that is
|
||||
* not stored as a @FT_Outline object.
|
||||
* not stored as an @FT_Outline object.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_BeginSubPath( FT_Stroker stroker,
|
||||
@ -406,7 +407,7 @@ FT_BEGIN_HEADER
|
||||
* FT_Stroker_ConicTo
|
||||
*
|
||||
* @description:
|
||||
* `Draw; a single quadratic bezier in the stroker's current sub-path,
|
||||
* `Draw' a single quadratic Bézier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
@ -414,7 +415,7 @@ FT_BEGIN_HEADER
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control ::
|
||||
* A pointer to a Bézier control point.
|
||||
* A pointer to a Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
@ -438,7 +439,7 @@ FT_BEGIN_HEADER
|
||||
* FT_Stroker_CubicTo
|
||||
*
|
||||
* @description:
|
||||
* `Draw' a single cubic Bézier in the stroker's current sub-path,
|
||||
* `Draw' a single cubic Bézier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
@ -446,10 +447,10 @@ FT_BEGIN_HEADER
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control1 ::
|
||||
* A pointer to the first Bézier control point.
|
||||
* A pointer to the first Bézier control point.
|
||||
*
|
||||
* control2 ::
|
||||
* A pointer to second Bézier control point.
|
||||
* A pointer to second Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
@ -474,7 +475,7 @@ FT_BEGIN_HEADER
|
||||
* FT_Stroker_GetBorderCounts
|
||||
*
|
||||
* @description:
|
||||
* Vall this function once you have finished parsing your paths
|
||||
* Call this function once you have finished parsing your paths
|
||||
* with the stroker. It will return the number of points and
|
||||
* contours necessary to export one of the `border' or `stroke'
|
||||
* outlines generated by the stroker.
|
||||
@ -640,8 +641,8 @@ FT_BEGIN_HEADER
|
||||
* Stroke a given outline glyph object with a given stroker.
|
||||
*
|
||||
* @inout:
|
||||
* pglyph :: Source glyph handle on input, new glyph handle
|
||||
* on output.
|
||||
* pglyph ::
|
||||
* Source glyph handle on input, new glyph handle on output.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
@ -708,3 +709,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* FreeType synthesizing code for emboldening and slanting */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* Copyright 2000-2001, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -50,10 +50,12 @@
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/* Make sure slot owns slot->bitmap. */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
|
||||
|
||||
/* This code is completely experimental -- use with care! */
|
||||
/* It will probably be completely rewritten in the future */
|
||||
/* or even integrated into the library. */
|
||||
/* Do not use this function directly! Copy the code to */
|
||||
/* your application and modify it to suit your need. */
|
||||
FT_EXPORT( void )
|
||||
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
||||
|
||||
|
@ -1,195 +0,0 @@
|
||||
#ifndef __FT_SYSTEM_IO_H__
|
||||
#define __FT_SYSTEM_IO_H__
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/***** *****/
|
||||
/***** NOTE: THE CONTENT OF THIS FILE IS NOT CURRENTLY USED *****/
|
||||
/***** IN NORMAL BUILDS. CONSIDER IT EXPERIMENTAL. *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
* designing custom streams is a bit different now
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECT_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @type: FT_Stream
|
||||
*
|
||||
* @description:
|
||||
* handle to an input stream object. These are also @FT_Object handles
|
||||
*/
|
||||
typedef struct FT_StreamRec_* FT_Stream;
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @type: FT_Stream_Class
|
||||
*
|
||||
* @description:
|
||||
* opaque handle to a @FT_Stream_ClassRec class structure describing
|
||||
* the methods of input streams
|
||||
*/
|
||||
typedef const struct FT_Stream_ClassRec_* FT_Stream_Class;
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @functype: FT_Stream_ReadFunc
|
||||
*
|
||||
* @description:
|
||||
* a method used to read bytes from an input stream into memory
|
||||
*
|
||||
* @input:
|
||||
* stream :: target stream handle
|
||||
* buffer :: target buffer address
|
||||
* size :: number of bytes to read
|
||||
*
|
||||
* @return:
|
||||
* number of bytes effectively read. Must be <= 'size'.
|
||||
*/
|
||||
typedef FT_ULong (*FT_Stream_ReadFunc)( FT_Stream stream,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong size );
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @functype: FT_Stream_SeekFunc
|
||||
*
|
||||
* @description:
|
||||
* a method used to seek to a new position within a stream
|
||||
*
|
||||
* @input:
|
||||
* stream :: target stream handle
|
||||
* pos :: new read position, from start of stream
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*/
|
||||
typedef FT_Error (*FT_Stream_SeekFunc)( FT_Stream stream,
|
||||
FT_ULong pos );
|
||||
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @struct: FT_Stream_ClassRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to describe an input stream class
|
||||
*
|
||||
* @input:
|
||||
* clazz :: root @FT_ClassRec fields
|
||||
* stream_read :: stream byte read method
|
||||
* stream_seek :: stream seek method
|
||||
*/
|
||||
typedef struct FT_Stream_ClassRec_
|
||||
{
|
||||
FT_ClassRec clazz;
|
||||
FT_Stream_ReadFunc stream_read;
|
||||
FT_Stream_SeekFunc stream_seek;
|
||||
|
||||
} FT_Stream_ClassRec;
|
||||
|
||||
/* */
|
||||
|
||||
#define FT_STREAM_CLASS(x) ((FT_Stream_Class)(x))
|
||||
#define FT_STREAM_CLASS__READ(x) FT_STREAM_CLASS(x)->stream_read
|
||||
#define FT_STREAM_CLASS__SEEK(x) FT_STREAM_CLASS(x)->stream_seek;
|
||||
|
||||
/*@*******************************************************************
|
||||
*
|
||||
* @struct: FT_StreamRec
|
||||
*
|
||||
* @description:
|
||||
* the input stream object structure. See @FT_Stream_ClassRec for
|
||||
* its class descriptor
|
||||
*
|
||||
* @fields:
|
||||
* object :: root @FT_ObjectRec fields
|
||||
* size :: size of stream in bytes (0 if unknown)
|
||||
* pos :: current position within stream
|
||||
* base :: for memory-based streams, the address of the stream's
|
||||
* first data byte in memory. NULL otherwise
|
||||
*
|
||||
* cursor :: the current cursor position within an input stream
|
||||
* frame. Only valid within a FT_FRAME_ENTER .. FT_FRAME_EXIT
|
||||
* block; NULL otherwise
|
||||
*
|
||||
* limit :: the current frame limit within a FT_FRAME_ENTER ..
|
||||
* FT_FRAME_EXIT block. NULL otherwise
|
||||
*/
|
||||
typedef struct FT_StreamRec_
|
||||
{
|
||||
FT_ObjectRec object;
|
||||
FT_ULong size;
|
||||
FT_ULong pos;
|
||||
const FT_Byte* base;
|
||||
const FT_Byte* cursor;
|
||||
const FT_Byte* limit;
|
||||
|
||||
} FT_StreamRec;
|
||||
|
||||
/* some useful macros */
|
||||
#define FT_STREAM(x) ((FT_Stream)(x))
|
||||
#define FT_STREAM_P(x) ((FT_Stream*)(x))
|
||||
|
||||
#define FT_STREAM__READ(x) FT_STREAM_CLASS__READ(FT_OBJECT__CLASS(x))
|
||||
#define FT_STREAM__SEEK(x) FT_STREAM_CLASS__SEEK(FT_OBJECT__CLASS(x))
|
||||
|
||||
#define FT_STREAM_IS_BASED(x) ( FT_STREAM(x)->base != NULL )
|
||||
|
||||
/* */
|
||||
|
||||
/* create new memory-based stream */
|
||||
FT_BASE( FT_Error ) ft_stream_new_memory( const FT_Byte* stream_base,
|
||||
FT_ULong stream_size,
|
||||
FT_Memory memory,
|
||||
FT_Stream *astream );
|
||||
|
||||
FT_BASE( FT_Error ) ft_stream_new_iso( const char* pathanme,
|
||||
FT_Memory memory,
|
||||
FT_Stream *astream );
|
||||
|
||||
|
||||
/* handle to default stream class implementation for a given build */
|
||||
/* this is used by "FT_New_Face" */
|
||||
/* */
|
||||
FT_APIVAR( FT_Type ) ft_stream_default_type;
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_SYSTEM_STREAM_H__ */
|
@ -1,202 +0,0 @@
|
||||
#ifndef __FT_SYSTEM_MEMORY_H__
|
||||
#define __FT_SYSTEM_MEMORY_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/***** *****/
|
||||
/***** NOTE: THE CONTENT OF THIS FILE IS NOT CURRENTLY USED *****/
|
||||
/***** IN NORMAL BUILDS. CONSIDER IT EXPERIMENTAL. *****/
|
||||
/***** *****/
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @type: FT_Memory
|
||||
*
|
||||
* @description:
|
||||
* opaque handle to a memory manager handle. Note that since FreeType
|
||||
* 2.2, the memory manager structure FT_MemoryRec is hidden to client
|
||||
* applications.
|
||||
*
|
||||
* however, you can still define custom allocators easily using the
|
||||
* @ft_memory_new API
|
||||
*/
|
||||
typedef struct FT_MemoryRec_* FT_Memory;
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_AllocFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to allocate a block of memory.
|
||||
*
|
||||
* @input:
|
||||
* size :: size of blocks in bytes. Always > 0 !!
|
||||
* mem_data :: memory-manager specific optional argument
|
||||
* (see @ft_memory_new)
|
||||
*
|
||||
* @return:
|
||||
* address of new block. NULL in case of memory exhaustion
|
||||
*/
|
||||
typedef FT_Pointer (*FT_Memory_AllocFunc)( FT_ULong size,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_FreeFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to release a block of memory created through
|
||||
* @FT_Memory_AllocFunc or @FT_Memory_ReallocFunc
|
||||
*
|
||||
* @input:
|
||||
* block :: address of target memory block. cannot be NULL !!
|
||||
* mem_data :: memory-manager specific optional argument
|
||||
* (see @ft_memory_new)
|
||||
*/
|
||||
typedef void (*FT_Memory_FreeFunc) ( FT_Pointer block,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_ReallocFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to reallocate a memory block.
|
||||
*
|
||||
* @input:
|
||||
* block :: address of target memory block. cannot be NULL !!
|
||||
* new_size :: new requested size in bytes
|
||||
* cur_size :: current block size in bytes
|
||||
* mem_data :: memory-manager specific optional argument
|
||||
* (see @ft_memory_new)
|
||||
*/
|
||||
typedef FT_Pointer (*FT_Memory_ReallocFunc)( FT_Pointer block,
|
||||
FT_ULong new_size,
|
||||
FT_ULong cur_size,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_CreateFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to create a @FT_Memory object to model a
|
||||
* memory manager
|
||||
*
|
||||
* @input:
|
||||
* size :: size of memory manager structure in bytes
|
||||
* init_data :: optional initialisation argument
|
||||
*
|
||||
* @output:
|
||||
* amem_data :: memory-manager specific argument to block management
|
||||
* routines.
|
||||
*
|
||||
* @return:
|
||||
* handle to new memory manager object. NULL in case of failure
|
||||
*/
|
||||
typedef FT_Pointer (*FT_Memory_CreateFunc)( FT_UInt size,
|
||||
FT_Pointer init_data,
|
||||
FT_Pointer *amem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @functype: FT_Memory_DestroyFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to destroy a given @FT_Memory manager
|
||||
*
|
||||
* @input:
|
||||
* memory :: target memory manager handle
|
||||
* mem_data :: option manager-specific argument
|
||||
*/
|
||||
typedef void (*FT_Memory_DestroyFunc)( FT_Memory memory,
|
||||
FT_Pointer mem_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @struct: FT_Memory_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* a function used to hold all methods of a given memory manager
|
||||
* implementation.
|
||||
*
|
||||
* @fields:
|
||||
* mem_alloc :: block allocation routine
|
||||
* mem_free :: block release routine
|
||||
* mem_realloc :: block re-allocation routine
|
||||
* mem_create :: manager creation routine
|
||||
* mem_destroy :: manager destruction routine
|
||||
*/
|
||||
typedef struct FT_Memory_FuncsRec_
|
||||
{
|
||||
FT_Memory_AllocFunc mem_alloc;
|
||||
FT_Memory_FreeFunc mem_free;
|
||||
FT_Memory_ReallocFunc mem_realloc;
|
||||
FT_Memory_CreateFunc mem_create;
|
||||
FT_Memory_DestroyFunc mem_destroy;
|
||||
|
||||
} FT_Memory_FuncsRec, *FT_Memory_Funcs;
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @type: FT_Memory_Funcs
|
||||
*
|
||||
* @description:
|
||||
* a pointer to a constant @FT_Memory_FuncsRec structure used to
|
||||
* describe a given memory manager implementation.
|
||||
*/
|
||||
typedef const FT_Memory_FuncsRec* FT_Memory_Funcs;
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @function: ft_memory_new
|
||||
*
|
||||
* @description:
|
||||
* create a new memory manager, given a set of memory methods
|
||||
*
|
||||
* @input:
|
||||
* mem_funcs :: handle to memory manager implementation descriptor
|
||||
* mem_init_data :: optional initialisation argument, passed to
|
||||
* @FT_Memory_CreateFunc
|
||||
*
|
||||
* @return:
|
||||
* new memory manager handle. NULL in case of failure
|
||||
*/
|
||||
FT_BASE( FT_Memory )
|
||||
ft_memory_new( FT_Memory_Funcs mem_funcs,
|
||||
FT_Pointer mem_init_data );
|
||||
|
||||
|
||||
/*@**********************************************************************
|
||||
*
|
||||
* @function: ft_memory_destroy
|
||||
*
|
||||
* @description:
|
||||
* destroy a given memory manager
|
||||
*
|
||||
* @input:
|
||||
* memory :: handle to target memory manager
|
||||
*/
|
||||
FT_BASE( void )
|
||||
ft_memory_destroy( FT_Memory memory );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_SYSTEM_MEMORY_H__ */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType low-level system interface definition (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -29,19 +29,19 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* system_interface */
|
||||
/* system_interface */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* System Interface */
|
||||
/* System Interface */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* How FreeType manages memory and i/o. */
|
||||
/* How FreeType manages memory and i/o. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains various definitions related to memory */
|
||||
/* management and i/o access. You need to understand this */
|
||||
/* information if you want to use a custom memory manager or you own */
|
||||
/* input i/o streams. */
|
||||
/* This section contains various definitions related to memory */
|
||||
/* management and i/o access. You need to understand this */
|
||||
/* information if you want to use a custom memory manager or you own */
|
||||
/* i/o streams. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -53,80 +53,92 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Memory */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to a given memory manager object, defined with a */
|
||||
/* @FT_MemoryRec structure. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Memory
|
||||
*
|
||||
* @description:
|
||||
* A handle to a given memory manager object, defined with an
|
||||
* @FT_MemoryRec structure.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_MemoryRec_* FT_Memory;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Alloc_Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to allocate `size' bytes from `memory'. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* memory :: A handle to the source memory manager. */
|
||||
/* */
|
||||
/* size :: The size in bytes to allocate. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Address of new memory block. 0 in case of failure. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Alloc_Func
|
||||
*
|
||||
* @description:
|
||||
* A function used to allocate `size' bytes from `memory'.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* A handle to the source memory manager.
|
||||
*
|
||||
* size ::
|
||||
* The size in bytes to allocate.
|
||||
*
|
||||
* @return:
|
||||
* Address of new memory block. 0 in case of failure.
|
||||
*
|
||||
*/
|
||||
typedef void*
|
||||
(*FT_Alloc_Func)( FT_Memory memory,
|
||||
long size );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Free_Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to release a given block of memory. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* memory :: A handle to the source memory manager. */
|
||||
/* */
|
||||
/* block :: The address of the target memory block. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Free_Func
|
||||
*
|
||||
* @description:
|
||||
* A function used to release a given block of memory.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* A handle to the source memory manager.
|
||||
*
|
||||
* block ::
|
||||
* The address of the target memory block.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*FT_Free_Func)( FT_Memory memory,
|
||||
void* block );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Realloc_Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* a function used to re-allocate a given block of memory. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* memory :: A handle to the source memory manager. */
|
||||
/* */
|
||||
/* cur_size :: The block's current size in bytes. */
|
||||
/* */
|
||||
/* new_size :: The block's requested new size. */
|
||||
/* */
|
||||
/* block :: The block's current address. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* New block address. 0 in case of memory shortage. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* In case of error, the old block must still be available. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Realloc_Func
|
||||
*
|
||||
* @description:
|
||||
* A function used to re-allocate a given block of memory.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* A handle to the source memory manager.
|
||||
*
|
||||
* cur_size ::
|
||||
* The block's current size in bytes.
|
||||
*
|
||||
* new_size ::
|
||||
* The block's requested new size.
|
||||
*
|
||||
* block ::
|
||||
* The block's current address.
|
||||
*
|
||||
* @return:
|
||||
* New block address. 0 in case of memory shortage.
|
||||
*
|
||||
* @note:
|
||||
* In case of error, the old block must still be available.
|
||||
*
|
||||
*/
|
||||
typedef void*
|
||||
(*FT_Realloc_Func)( FT_Memory memory,
|
||||
long cur_size,
|
||||
@ -134,23 +146,28 @@ FT_BEGIN_HEADER
|
||||
void* block );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FT_MemoryRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure used to describe a given memory manager to FreeType 2. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* user :: A generic typeless pointer for user data. */
|
||||
/* */
|
||||
/* alloc :: A pointer type to an allocation function. */
|
||||
/* */
|
||||
/* free :: A pointer type to an memory freeing function. */
|
||||
/* */
|
||||
/* realloc :: A pointer type to a reallocation function. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_MemoryRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used to describe a given memory manager to FreeType 2.
|
||||
*
|
||||
* @fields:
|
||||
* user ::
|
||||
* A generic typeless pointer for user data.
|
||||
*
|
||||
* alloc ::
|
||||
* A pointer type to an allocation function.
|
||||
*
|
||||
* free ::
|
||||
* A pointer type to an memory freeing function.
|
||||
*
|
||||
* realloc ::
|
||||
* A pointer type to a reallocation function.
|
||||
*
|
||||
*/
|
||||
struct FT_MemoryRec_
|
||||
{
|
||||
void* user;
|
||||
@ -167,26 +184,28 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Stream */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A handle to an input stream. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Stream
|
||||
*
|
||||
* @description:
|
||||
* A handle to an input stream.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_StreamRec_* FT_Stream;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FT_StreamDesc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* 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. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_StreamDesc
|
||||
*
|
||||
* @description:
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
typedef union FT_StreamDesc_
|
||||
{
|
||||
long value;
|
||||
@ -195,30 +214,35 @@ FT_BEGIN_HEADER
|
||||
} FT_StreamDesc;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Stream_IoFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to seek and read data from a given input stream. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* stream :: A handle to the source stream. */
|
||||
/* */
|
||||
/* offset :: The offset of read in stream (always from start). */
|
||||
/* */
|
||||
/* buffer :: The address of the read buffer. */
|
||||
/* */
|
||||
/* count :: The number of bytes to read from the stream. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The number of bytes effectively read by the stream. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* This function might be called to perform a seek or skip operation */
|
||||
/* with a `count' of 0. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Stream_IoFunc
|
||||
*
|
||||
* @description:
|
||||
* A function used to seek and read data from a given input stream.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* A handle to the source stream.
|
||||
*
|
||||
* offset ::
|
||||
* The offset of read in stream (always from start).
|
||||
*
|
||||
* buffer ::
|
||||
* The address of the read buffer.
|
||||
*
|
||||
* count ::
|
||||
* The number of bytes to read from the stream.
|
||||
*
|
||||
* @return:
|
||||
* The number of bytes effectively read by the stream.
|
||||
*
|
||||
* @note:
|
||||
* This function might be called to perform a seek or skip operation
|
||||
* with a `count' of 0.
|
||||
*
|
||||
*/
|
||||
typedef unsigned long
|
||||
(*FT_Stream_IoFunc)( FT_Stream stream,
|
||||
unsigned long offset,
|
||||
@ -226,60 +250,73 @@ FT_BEGIN_HEADER
|
||||
unsigned long count );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* FT_Stream_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A function used to close a given input stream. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* stream :: A handle to the target stream. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_Stream_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* A function used to close a given input stream.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* A handle to the target stream.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*FT_Stream_CloseFunc)( FT_Stream stream );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* FT_StreamRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A structure used to describe an input stream. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* base :: For memory-based streams, this is the address of the */
|
||||
/* first stream byte in memory. This field should */
|
||||
/* always be set to NULL for disk-based streams. */
|
||||
/* */
|
||||
/* size :: The stream size in bytes. */
|
||||
/* */
|
||||
/* pos :: The current position within the stream. */
|
||||
/* */
|
||||
/* descriptor :: This field is a union that can hold an integer or a */
|
||||
/* pointer. It is used by stream implementations to */
|
||||
/* store file descriptors or FILE* pointers. */
|
||||
/* */
|
||||
/* pathname :: This field is completely ignored by FreeType. */
|
||||
/* However, it is often useful during debugging to use */
|
||||
/* it to store the stream's filename (where available). */
|
||||
/* */
|
||||
/* read :: The stream's input function. */
|
||||
/* */
|
||||
/* close :: The stream;s close function. */
|
||||
/* */
|
||||
/* memory :: The memory manager to use to preload frames. This is */
|
||||
/* set internally by FreeType and shouldn't be touched */
|
||||
/* by stream implementations. */
|
||||
/* */
|
||||
/* cursor :: This field is set and used internally by FreeType */
|
||||
/* when parsing frames. */
|
||||
/* */
|
||||
/* limit :: This field is set and used internally by FreeType */
|
||||
/* when parsing frames. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_StreamRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used to describe an input stream.
|
||||
*
|
||||
* @input:
|
||||
* base ::
|
||||
* For memory-based streams, this is the address of the first stream
|
||||
* byte in memory. This field should always be set to NULL for
|
||||
* disk-based streams.
|
||||
*
|
||||
* size ::
|
||||
* The stream size in bytes.
|
||||
*
|
||||
* pos ::
|
||||
* The current position within the stream.
|
||||
*
|
||||
* descriptor ::
|
||||
* This field is a union that can hold an integer or a pointer. It is
|
||||
* used by stream implementations to store file descriptors or `FILE*'
|
||||
* pointers.
|
||||
*
|
||||
* pathname ::
|
||||
* This field is completely ignored by FreeType. However, it is often
|
||||
* useful during debugging to use it to store the stream's filename
|
||||
* (where available).
|
||||
*
|
||||
* read ::
|
||||
* The stream's input function.
|
||||
*
|
||||
* close ::
|
||||
* The stream;s close function.
|
||||
*
|
||||
* memory ::
|
||||
* The memory manager to use to preload frames. This is set
|
||||
* internally by FreeType and shouldn't be touched by stream
|
||||
* implementations.
|
||||
*
|
||||
* cursor ::
|
||||
* This field is set and used internally by FreeType when parsing
|
||||
* frames.
|
||||
*
|
||||
* limit ::
|
||||
* This field is set and used internally by FreeType when parsing
|
||||
* frames.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_StreamRec_
|
||||
{
|
||||
unsigned char* base;
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType trigonometric functions (specification). */
|
||||
/* */
|
||||
/* Copyright 2001, 2003 by */
|
||||
/* Copyright 2001, 2003, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -33,272 +33,307 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @section: */
|
||||
/* <Section> */
|
||||
/* computations */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* FT_Angle */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This type is used to model angle values in FreeType. Note that */
|
||||
/* the angle is a 16.16 fixed float value expressed in degrees. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Angle
|
||||
*
|
||||
* @description:
|
||||
* This type is used to model angle values in FreeType. Note that the
|
||||
* angle is a 16.16 fixed float value expressed in degrees.
|
||||
*
|
||||
*/
|
||||
typedef FT_Fixed FT_Angle;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_PI */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle pi expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_PI
|
||||
*
|
||||
* @description:
|
||||
* The angle pi expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_PI ( 180L << 16 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_2PI */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle 2*pi expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_2PI
|
||||
*
|
||||
* @description:
|
||||
* The angle 2*pi expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_PI2 */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle pi/2 expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_PI2
|
||||
*
|
||||
* @description:
|
||||
* The angle pi/2 expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_ANGLE_PI4 */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The angle pi/4 expressed in @FT_Angle units. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ANGLE_PI4
|
||||
*
|
||||
* @description:
|
||||
* The angle pi/4 expressed in @FT_Angle units.
|
||||
*
|
||||
*/
|
||||
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Sin */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the sinus of a given angle in fixed point format. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The input angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The sinus value. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If you need both the sinus and cosinus for a given angle, use the */
|
||||
/* function @FT_Vector_Unit. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Sin
|
||||
*
|
||||
* @description:
|
||||
* Return the sinus of a given angle in fixed point format.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The input angle.
|
||||
*
|
||||
* @return:
|
||||
* The sinus value.
|
||||
*
|
||||
* @note:
|
||||
* If you need both the sinus and cosinus for a given angle, use the
|
||||
* function @FT_Vector_Unit.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Sin( FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Cos */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the cosinus of a given angle in fixed point format. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The input angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The cosinus value. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If you need both the sinus and cosinus for a given angle, use the */
|
||||
/* function @FT_Vector_Unit. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Cos
|
||||
*
|
||||
* @description:
|
||||
* Return the cosinus of a given angle in fixed point format.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The input angle.
|
||||
*
|
||||
* @return:
|
||||
* The cosinus value.
|
||||
*
|
||||
* @note:
|
||||
* If you need both the sinus and cosinus for a given angle, use the
|
||||
* function @FT_Vector_Unit.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Cos( FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Tan */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the tangent of a given angle in fixed point format. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The input angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The tangent value. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Tan
|
||||
*
|
||||
* @description:
|
||||
* Return the tangent of a given angle in fixed point format.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The input angle.
|
||||
*
|
||||
* @return:
|
||||
* The tangent value.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Tan( FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Atan2 */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the arc-tangent corresponding to a given vector (x,y) in */
|
||||
/* the 2d plane. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* x :: The horizontal vector coordinate. */
|
||||
/* */
|
||||
/* y :: The vertical vector coordinate. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The arc-tangent value (i.e. angle). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Atan2
|
||||
*
|
||||
* @description:
|
||||
* Return the arc-tangent corresponding to a given vector (x,y) in
|
||||
* the 2d plane.
|
||||
*
|
||||
* @input:
|
||||
* x ::
|
||||
* The horizontal vector coordinate.
|
||||
*
|
||||
* y ::
|
||||
* The vertical vector coordinate.
|
||||
*
|
||||
* @return:
|
||||
* The arc-tangent value (i.e. angle).
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Angle )
|
||||
FT_Atan2( FT_Fixed x,
|
||||
FT_Fixed y );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Angle_Diff */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the difference between two angles. The result is always */
|
||||
/* constrained to the ]-PI..PI] interval. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle1 :: First angle. */
|
||||
/* */
|
||||
/* angle2 :: Second angle. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Contrainted value of `value2-value1'. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Angle_Diff
|
||||
*
|
||||
* @description:
|
||||
* Return the difference between two angles. The result is always
|
||||
* constrained to the ]-PI..PI] interval.
|
||||
*
|
||||
* @input:
|
||||
* angle1 ::
|
||||
* First angle.
|
||||
*
|
||||
* angle2 ::
|
||||
* Second angle.
|
||||
*
|
||||
* @return:
|
||||
* Contrainted value of `value2-value1'.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Angle )
|
||||
FT_Angle_Diff( FT_Angle angle1,
|
||||
FT_Angle angle2 );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Unit */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* 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 */
|
||||
/* `vec.y' will be `cos(angle)'. */
|
||||
/* */
|
||||
/* This function is useful to retrieve both the sinus and cosinus of */
|
||||
/* a given angle quickly. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* vec :: The address of target vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The address of angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Unit
|
||||
*
|
||||
* @description:
|
||||
* 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
|
||||
* `vec.y' will be `cos(angle)'.
|
||||
*
|
||||
* This function is useful to retrieve both the sinus and cosinus of a
|
||||
* given angle quickly.
|
||||
*
|
||||
* @output:
|
||||
* vec ::
|
||||
* The address of target vector.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The address of angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_Unit( FT_Vector* vec,
|
||||
FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Rotate */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Rotate a vector by a given angle. */
|
||||
/* */
|
||||
/* @inout: */
|
||||
/* vec :: The address of target vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* angle :: The address of angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Rotate
|
||||
*
|
||||
* @description:
|
||||
* Rotate a vector by a given angle.
|
||||
*
|
||||
* @inout:
|
||||
* vec ::
|
||||
* The address of target vector.
|
||||
*
|
||||
* @input:
|
||||
* angle ::
|
||||
* The address of angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_Rotate( FT_Vector* vec,
|
||||
FT_Angle angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Length */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Return the length of a given vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* vec :: The address of target vector. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* The vector length, expressed in the same units that the original */
|
||||
/* vector coordinates. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Length
|
||||
*
|
||||
* @description:
|
||||
* Return the length of a given vector.
|
||||
*
|
||||
* @input:
|
||||
* vec ::
|
||||
* The address of target vector.
|
||||
*
|
||||
* @return:
|
||||
* The vector length, expressed in the same units that the original
|
||||
* vector coordinates.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Fixed )
|
||||
FT_Vector_Length( FT_Vector* vec );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_Polarize */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Compute both the length and angle of a given vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* vec :: The address of source vector. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* length :: The vector length. */
|
||||
/* angle :: The vector angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_Polarize
|
||||
*
|
||||
* @description:
|
||||
* Compute both the length and angle of a given vector.
|
||||
*
|
||||
* @input:
|
||||
* vec ::
|
||||
* The address of source vector.
|
||||
*
|
||||
* @output:
|
||||
* length ::
|
||||
* The vector length.
|
||||
*
|
||||
* angle ::
|
||||
* The vector angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_Polarize( FT_Vector* vec,
|
||||
FT_Fixed *length,
|
||||
FT_Angle *angle );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FT_Vector_From_Polar */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Compute vector coordinates from a length and angle. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* vec :: The address of source vector. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* length :: The vector length. */
|
||||
/* angle :: The vector angle. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Vector_From_Polar
|
||||
*
|
||||
* @description:
|
||||
* Compute vector coordinates from a length and angle.
|
||||
*
|
||||
* @output:
|
||||
* vec ::
|
||||
* The address of source vector.
|
||||
*
|
||||
* @input:
|
||||
* length ::
|
||||
* The vector length.
|
||||
*
|
||||
* angle ::
|
||||
* The vector angle.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Vector_From_Polar( FT_Vector* vec,
|
||||
FT_Fixed length,
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType simple types definitions (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -273,8 +273,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_Fixed */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This type is used to store 16.16 fixed float values, like scales */
|
||||
/* or matrix coefficients. */
|
||||
/* This type is used to store 16.16 fixed float values, like scaling */
|
||||
/* values or matrix coefficients. */
|
||||
/* */
|
||||
typedef signed long FT_Fixed;
|
||||
|
||||
@ -308,7 +308,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_Offset */
|
||||
/* */
|
||||
/* <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, */
|
||||
/* or a memory block size. */
|
||||
/* */
|
||||
@ -321,7 +321,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_PtrDist */
|
||||
/* */
|
||||
/* <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 _signed_ integer type used to express the distance */
|
||||
/* between two pointers. */
|
||||
/* */
|
||||
@ -409,7 +409,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Describes a function used to destroy the `client' data of any */
|
||||
/* FreeType object. See the description of the FT_Generic type for */
|
||||
/* FreeType object. See the description of the @FT_Generic type for */
|
||||
/* details of usage. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -461,7 +461,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_MAKE_TAG */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro converts four letter tags which are used to label */
|
||||
/* This macro converts four-letter tags which are used to label */
|
||||
/* TrueType tables into an unsigned long to be used within FreeType. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
@ -498,8 +498,8 @@ FT_BEGIN_HEADER
|
||||
/* FT_ListNode */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Many elements and objects in FreeType are listed through a */
|
||||
/* FT_List record (see FT_ListRec). As its name suggests, a */
|
||||
/* Many elements and objects in FreeType are listed through an */
|
||||
/* @FT_List record (see @FT_ListRec). As its name suggests, an */
|
||||
/* FT_ListNode is a handle to a single list element. */
|
||||
/* */
|
||||
typedef struct FT_ListNodeRec_* FT_ListNode;
|
||||
@ -511,7 +511,7 @@ FT_BEGIN_HEADER
|
||||
/* FT_List */
|
||||
/* */
|
||||
/* <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;
|
||||
|
||||
|
@ -77,7 +77,8 @@ FT_BEGIN_HEADER
|
||||
* Mac Roman encoding.
|
||||
*
|
||||
* FT_WinFNT_ID_OEM ::
|
||||
* From Michael Pöttgen <michael@poettgen.de>:
|
||||
* From Michael Pöttgen <michael@poettgen.de>:
|
||||
*
|
||||
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
|
||||
* is used for the charset of vector fonts, like `modern.fon',
|
||||
* `roman.fon', and `script.fon' on Windows.
|
||||
@ -255,3 +256,8 @@ FT_END_HEADER
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Arithmetic computations (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -44,12 +44,11 @@ FT_BEGIN_HEADER
|
||||
/* <Note> */
|
||||
/* This function is not very fast. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_BASE( FT_Int32 )
|
||||
FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
|
||||
#define SQRT_32( x ) FT_Sqrt32( x )
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@ -69,6 +68,8 @@ FT_BEGIN_HEADER
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_Sqrt32( FT_Int32 x );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Debugging and logging component (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -15,7 +15,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* IMPORTANT: A description of FreeType's debugging support can be */
|
||||
/* found in "docs/DEBUG.TXT". Read it if you need to use or */
|
||||
/* found in `docs/DEBUG.TXT'. Read it if you need to use or */
|
||||
/* understand this code. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
@ -113,7 +113,7 @@ FT_BEGIN_HEADER
|
||||
/* This function may be useful if you want to access elements of */
|
||||
/* the internal `ft_trace_levels' array by an index. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int )
|
||||
FT_BASE( FT_Int )
|
||||
FT_Trace_Get_Count( void );
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ FT_BEGIN_HEADER
|
||||
/* This function may be useful if you want to control FreeType 2's */
|
||||
/* debug level in your appliaciton. */
|
||||
/* */
|
||||
FT_EXPORT( const char * )
|
||||
FT_BASE( const char * )
|
||||
FT_Trace_Get_Name( FT_Int idx );
|
||||
|
||||
|
||||
@ -204,7 +204,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define 'FT_Message' and 'FT_Panic' when needed */
|
||||
/* Define `FT_Message' and `FT_Panic' when needed */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -213,11 +213,11 @@ FT_BEGIN_HEADER
|
||||
#include "stdio.h" /* for vprintf() */
|
||||
|
||||
/* print a message */
|
||||
FT_EXPORT( void )
|
||||
FT_BASE( void )
|
||||
FT_Message( const char* fmt, ... );
|
||||
|
||||
/* print a message and exit */
|
||||
FT_EXPORT( void )
|
||||
FT_BASE( void )
|
||||
FT_Panic( const char* fmt, ... );
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_ERROR */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* FreeType font driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -52,6 +52,16 @@ FT_BEGIN_HEADER
|
||||
(*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_RequestFunc)( FT_Size size,
|
||||
FT_Size_Request req );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_SelectFunc)( FT_Size size,
|
||||
FT_ULong size_index );
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_ResetPointsFunc)( FT_Size size,
|
||||
FT_F26Dot6 char_width,
|
||||
@ -64,6 +74,8 @@ FT_BEGIN_HEADER
|
||||
FT_UInt pixel_width,
|
||||
FT_UInt pixel_height );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
@ -129,16 +141,9 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* done_slot :: The format-specific slot destructor. */
|
||||
/* */
|
||||
/* set_char_sizes :: A handle to a function used to set the new */
|
||||
/* character size in points + resolution. Can be */
|
||||
/* set to 0 to indicate default behaviour. */
|
||||
/* */
|
||||
/* set_pixel_sizes :: A handle to a function used to set the new */
|
||||
/* character size in pixels. Can be set to 0 to */
|
||||
/* indicate default behaviour. */
|
||||
/* */
|
||||
/* load_glyph :: A function handle to load a given glyph image */
|
||||
/* in a slot. This field is mandatory! */
|
||||
/* load_glyph :: A function handle to load a glyph to a slot. */
|
||||
/* This field is mandatory! */
|
||||
/* */
|
||||
/* get_char_index :: A function handle to return the glyph index of */
|
||||
/* a given character for a given charmap. This */
|
||||
@ -156,7 +161,7 @@ FT_BEGIN_HEADER
|
||||
/* face, or a CIDMap on a CID-keyed face. */
|
||||
/* */
|
||||
/* get_advances :: A function handle used to return advance */
|
||||
/* widths of 'count' glyphs (in font units), */
|
||||
/* widths of `count' glyphs (in font units), */
|
||||
/* starting at `first'. The `vertical' flag must */
|
||||
/* be set to get vertical advance heights. The */
|
||||
/* `advances' buffer is caller-allocated. */
|
||||
@ -165,6 +170,15 @@ FT_BEGIN_HEADER
|
||||
/* device-independent text layout without loading */
|
||||
/* a single glyph image. */
|
||||
/* */
|
||||
/* request_size :: A handle to a function used to request the new */
|
||||
/* character size. Can be set to 0 if the */
|
||||
/* scaling done in the base layer suffices. */
|
||||
/* */
|
||||
/* select_size :: A handle to a function used to select a new */
|
||||
/* fixed size. It is used only if */
|
||||
/* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
|
||||
/* to 0 if the scaling done in the base layer */
|
||||
/* suffices. */
|
||||
/* <Note> */
|
||||
/* Most function pointers, with the exception of `load_glyph' and */
|
||||
/* `get_char_index' can be set to 0 to indicate a default behaviour. */
|
||||
@ -186,18 +200,50 @@ FT_BEGIN_HEADER
|
||||
FT_Slot_InitFunc init_slot;
|
||||
FT_Slot_DoneFunc done_slot;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_Size_ResetPointsFunc set_char_sizes;
|
||||
FT_Size_ResetPixelsFunc set_pixel_sizes;
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
FT_Slot_LoadFunc load_glyph;
|
||||
|
||||
FT_Face_GetKerningFunc get_kerning;
|
||||
FT_Face_AttachFunc attach_file;
|
||||
FT_Face_GetAdvancesFunc get_advances;
|
||||
|
||||
/* since version 2.2 */
|
||||
FT_Size_RequestFunc request_size;
|
||||
FT_Size_SelectFunc select_size;
|
||||
|
||||
} FT_Driver_ClassRec, *FT_Driver_Class;
|
||||
|
||||
|
||||
/*
|
||||
* The following functions are used as stubs for `set_char_sizes' and
|
||||
* `set_pixel_sizes'; the code uses `request_size' and `select_size'
|
||||
* functions instead.
|
||||
*
|
||||
* Implementation is in `src/base/ftobjs.c'.
|
||||
*/
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
ft_stub_set_char_sizes( FT_Size size,
|
||||
FT_F26Dot6 width,
|
||||
FT_F26Dot6 height,
|
||||
FT_UInt horz_res,
|
||||
FT_UInt vert_res );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
ft_stub_set_pixel_sizes( FT_Size size,
|
||||
FT_UInt width,
|
||||
FT_UInt height );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTDRIVER_H__ */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType glyph loader (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* Copyright 2002, 2003, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -43,6 +43,7 @@ FT_BEGIN_HEADER
|
||||
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
|
||||
|
||||
|
||||
#if 0 /* moved to freetype.h in version 2.2 */
|
||||
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
|
||||
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
|
||||
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
|
||||
@ -50,6 +51,7 @@ FT_BEGIN_HEADER
|
||||
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
|
||||
#define FT_SUBGLYPH_FLAG_2X2 0x80
|
||||
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct FT_SubGlyphRec_
|
||||
@ -59,7 +61,7 @@ FT_BEGIN_HEADER
|
||||
FT_Int arg1;
|
||||
FT_Int arg2;
|
||||
FT_Matrix transform;
|
||||
|
||||
|
||||
} FT_SubGlyphRec;
|
||||
|
||||
|
||||
@ -117,6 +119,24 @@ FT_BEGIN_HEADER
|
||||
FT_UInt n_points,
|
||||
FT_UInt n_contours );
|
||||
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
|
||||
( (_count) == 0 || (int)((_loader)->base.outline.n_points + \
|
||||
(_loader)->current.outline.n_points + \
|
||||
(_count)) <= (int)(_loader)->max_points )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
|
||||
( (_count) == 0 || (int)((_loader)->base.outline.n_contours + \
|
||||
(_loader)->current.outline.n_contours + \
|
||||
(_count)) <= (int)(_loader)->max_contours )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \
|
||||
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
|
||||
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
|
||||
? 0 \
|
||||
: FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
|
||||
|
||||
|
||||
/* check that there is enough space to add `n_subs' sub-glyphs to */
|
||||
/* a glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType memory management macros (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -56,198 +56,134 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Alloc_Debug( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_QAlloc_Debug( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_Realloc_Debug( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
|
||||
FT_BASE( FT_Error )
|
||||
FT_QRealloc_Debug( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Free_Debug( FT_Memory memory,
|
||||
FT_Pointer block,
|
||||
const char* file_name,
|
||||
FT_Long line_no );
|
||||
/*
|
||||
* C++ refuses to handle statements like p = (void*)anything; where `p'
|
||||
* is a typed pointer. Since we don't have a `typeof' operator in
|
||||
* standard C++, we have to use ugly casts.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_ASSIGNP( p, val ) *((void**)&(p)) = (val)
|
||||
#else
|
||||
#define FT_ASSIGNP( p, val ) (p) = (val)
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Alloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Allocates a new block of memory. The returned area is always */
|
||||
/* zero-filled; this is a strong convention in many FreeType parts. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* allocation. */
|
||||
/* */
|
||||
/* size :: The size in bytes of the block to allocate. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* P :: A pointer to the fresh new block. It should be set to */
|
||||
/* NULL if `size' is 0, or in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
FT_BASE( const char* ) _ft_debug_file;
|
||||
FT_BASE( long ) _ft_debug_lineno;
|
||||
|
||||
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
(exp) )
|
||||
|
||||
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
FT_ASSIGNP( p, exp ) )
|
||||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
||||
#define FT_DEBUG_INNER( exp ) (exp)
|
||||
#define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp )
|
||||
|
||||
#endif /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_QAlloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Allocates a new block of memory. The returned area is *not* */
|
||||
/* zero-filled, making allocation quicker. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* allocation. */
|
||||
/* */
|
||||
/* size :: The size in bytes of the block to allocate. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* P :: A pointer to the fresh new block. It should be set to */
|
||||
/* NULL if `size' is 0, or in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_QAlloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
/*
|
||||
* The allocation functions return a pointer, and the error code
|
||||
* is written to through the `p_error' parameter. See below for
|
||||
* for documentation.
|
||||
*/
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
FT_Error *p_error );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Realloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Reallocates a block of memory pointed to by `*P' to `Size' bytes */
|
||||
/* from the heap, possibly changing `*P'. The returned area is */
|
||||
/* zero-filled. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* reallocation. */
|
||||
/* */
|
||||
/* current :: The current block size in bytes. */
|
||||
/* */
|
||||
/* size :: The new block size in bytes. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* P :: A pointer to the fresh new block. It should be set to */
|
||||
/* NULL if `size' is 0, or in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* All callers of FT_Realloc() _must_ provide the current block size */
|
||||
/* as well as the new one. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Realloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_qalloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
FT_Error *p_error );
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_realloc( FT_Memory memory,
|
||||
FT_Long item_size,
|
||||
FT_Long cur_count,
|
||||
FT_Long new_count,
|
||||
void* block,
|
||||
FT_Error *p_error );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_QRealloc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Reallocates a block of memory pointed to by `*P' to `Size' bytes */
|
||||
/* from the heap, possibly changing `*P'. The returned area is *not* */
|
||||
/* zero-filled, making reallocation quicker. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* reallocation. */
|
||||
/* */
|
||||
/* current :: The current block size in bytes. */
|
||||
/* */
|
||||
/* size :: The new block size in bytes. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* P :: A pointer to the fresh new block. It should be set to */
|
||||
/* NULL if `size' is 0, or in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* All callers of FT_Realloc() _must_ provide the current block size */
|
||||
/* as well as the new one. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_QRealloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_qrealloc( FT_Memory memory,
|
||||
FT_Long item_size,
|
||||
FT_Long cur_count,
|
||||
FT_Long new_count,
|
||||
void* block,
|
||||
FT_Error *p_error );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Free */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Releases a given block of memory allocated through FT_Alloc(). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to a given `memory object' which handles */
|
||||
/* memory deallocation */
|
||||
/* */
|
||||
/* P :: This is the _address_ of a _pointer_ which points to the */
|
||||
/* allocated block. It is always set to NULL on exit. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* If P or *P is NULL, this function should return successfully. */
|
||||
/* This is a strong convention within all of FreeType and its */
|
||||
/* drivers. */
|
||||
/* */
|
||||
FT_BASE( void )
|
||||
FT_Free( FT_Memory memory,
|
||||
void* *P );
|
||||
ft_mem_free( FT_Memory memory,
|
||||
const void* P );
|
||||
|
||||
|
||||
#define FT_MEM_ALLOC( ptr, size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )
|
||||
|
||||
#define FT_MEM_FREE( ptr ) \
|
||||
FT_BEGIN_STMNT \
|
||||
ft_mem_free( memory, (ptr) ); \
|
||||
(ptr) = NULL; \
|
||||
FT_END_STMNT
|
||||
|
||||
#define FT_MEM_NEW( ptr ) \
|
||||
FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
|
||||
|
||||
#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1, \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_QALLOC( ptr, size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )
|
||||
|
||||
#define FT_MEM_QNEW( ptr ) \
|
||||
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
|
||||
|
||||
#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1, \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz), \
|
||||
(oldcnt), (newcnt), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz), \
|
||||
(oldcnt), (newcnt), \
|
||||
(ptr), &error ) )
|
||||
|
||||
|
||||
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
|
||||
|
||||
|
||||
#define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count )
|
||||
@ -261,6 +197,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
|
||||
|
||||
|
||||
#define FT_ARRAY_ZERO( dest, count ) \
|
||||
FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )
|
||||
|
||||
@ -281,157 +218,108 @@ FT_BEGIN_HEADER
|
||||
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* We first define FT_MEM_ALLOC, FT_MEM_REALLOC, and FT_MEM_FREE. All */
|
||||
/* macros use an _implicit_ `memory' parameter to access the current */
|
||||
/* memory allocator. */
|
||||
/* */
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
#define FT_MEM_ALLOC( _pointer_, _size_ ) \
|
||||
FT_Alloc_Debug( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc_Debug( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_QALLOC( _pointer_, _size_ ) \
|
||||
FT_QAlloc_Debug( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_QRealloc_Debug( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
#define FT_MEM_FREE( _pointer_ ) \
|
||||
FT_Free_Debug( memory, (void**)(void*)&(_pointer_), \
|
||||
__FILE__, __LINE__ )
|
||||
|
||||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
#define FT_MEM_ALLOC( _pointer_, _size_ ) \
|
||||
FT_Alloc( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_FREE( _pointer_ ) \
|
||||
FT_Free( memory, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_QALLOC( _pointer_, _size_ ) \
|
||||
FT_QAlloc( memory, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#define FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_QRealloc( memory, _current_, _size_, \
|
||||
(void**)(void*)&(_pointer_) )
|
||||
|
||||
#endif /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The following functions macros expect that their pointer argument is */
|
||||
/* _typed_ in order to automatically compute array element sizes. */
|
||||
/* */
|
||||
|
||||
#define FT_MEM_NEW( _pointer_ ) \
|
||||
FT_MEM_ALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_NEW_ARRAY( ptr, count ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_NEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_MEM_ALLOC( _pointer_, (_count_) * sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
#define FT_MEM_RENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_MEM_REALLOC( _pointer_, (_old_) * sizeof ( *(_pointer_) ), \
|
||||
(_new_) * sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_QNEW_ARRAY( ptr, count ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
|
||||
0, (count), \
|
||||
NULL, &error ) )
|
||||
|
||||
#define FT_MEM_QNEW( _pointer_ ) \
|
||||
FT_MEM_QALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_MEM_QNEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_MEM_QALLOC( _pointer_, (_count_) * sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_MEM_QRENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_MEM_QREALLOC( _pointer_, (_old_) * sizeof ( *(_pointer_) ), \
|
||||
(_new_) * sizeof ( *(_pointer_) ) )
|
||||
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
|
||||
(cursz), (newsz), \
|
||||
(ptr), &error ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* the following macros are obsolete but kept for compatibility reasons */
|
||||
/* */
|
||||
#define FT_ALLOC( ptr, size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
|
||||
|
||||
#define FT_MEM_ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
|
||||
FT_MEM_ALLOC( _pointer_, (_count_) * sizeof ( _type_ ) )
|
||||
#define FT_REALLOC( ptr, cursz, newsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
|
||||
|
||||
#define FT_MEM_REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) \
|
||||
FT_MEM_REALLOC( _pointer_, (_old_) * sizeof ( _type ), \
|
||||
(_new_) * sizeof ( _type_ ) )
|
||||
#define FT_ALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
|
||||
|
||||
#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
|
||||
newcnt, itmsz ) )
|
||||
|
||||
#define FT_QALLOC( ptr, size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
|
||||
|
||||
#define FT_QREALLOC( ptr, cursz, newsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
|
||||
|
||||
#define FT_QALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
|
||||
|
||||
#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
|
||||
newcnt, itmsz ) )
|
||||
|
||||
#define FT_FREE( ptr ) FT_MEM_FREE( ptr )
|
||||
|
||||
#define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
|
||||
|
||||
#define FT_NEW_ARRAY( ptr, count ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
|
||||
|
||||
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||
|
||||
#define FT_QNEW( ptr ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
|
||||
|
||||
#define FT_QNEW_ARRAY( ptr, count ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
|
||||
|
||||
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The following macros are variants of their FT_MEM_XXXX equivalents; */
|
||||
/* they are used to set an _implicit_ `error' variable and return TRUE */
|
||||
/* if an error occured (i.e. if 'error != 0'). */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
#define FT_ALLOC( _pointer_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_ALLOC( _pointer_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_Alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
#define FT_REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_REALLOC( _pointer_, _current_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_QAlloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
|
||||
#define FT_QALLOC( _pointer_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_QALLOC( _pointer_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_Realloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *P );
|
||||
|
||||
#define FT_QREALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_SET_ERROR( FT_MEM_QREALLOC( _pointer_, _current_, _size_ ) )
|
||||
FT_BASE( FT_Error )
|
||||
FT_QRealloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void* *p );
|
||||
|
||||
FT_BASE( void )
|
||||
FT_Free( FT_Memory memory,
|
||||
void* *P );
|
||||
|
||||
#define FT_FREE( _pointer_ ) \
|
||||
FT_MEM_FREE( _pointer_ )
|
||||
|
||||
|
||||
#define FT_NEW( _pointer_ ) \
|
||||
FT_ALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_NEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_ALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_count_) )
|
||||
|
||||
#define FT_RENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_REALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_old_), \
|
||||
sizeof ( *(_pointer_) ) * (_new_) )
|
||||
|
||||
#define FT_QNEW( _pointer_ ) \
|
||||
FT_QALLOC( _pointer_, sizeof ( *(_pointer_) ) )
|
||||
|
||||
#define FT_QNEW_ARRAY( _pointer_, _count_ ) \
|
||||
FT_QALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_count_) )
|
||||
|
||||
#define FT_QRENEW_ARRAY( _pointer_, _old_, _new_ ) \
|
||||
FT_QREALLOC( _pointer_, sizeof ( *(_pointer_) ) * (_old_), \
|
||||
sizeof ( *(_pointer_) ) * (_new_) )
|
||||
|
||||
|
||||
#define FT_ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
|
||||
FT_ALLOC( _pointer_, (_count_) * sizeof ( _type_ ) )
|
||||
|
||||
#define FT_REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) \
|
||||
FT_REALLOC( _pointer, (_old_) * sizeof ( _type_ ), \
|
||||
(_new_) * sizeof ( _type_ ) )
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/* */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType private base classes (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -213,9 +213,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
typedef struct FT_Face_InternalRec_
|
||||
{
|
||||
FT_UShort max_points;
|
||||
FT_Short max_contours;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_UShort reserved1;
|
||||
FT_Short reserved2;
|
||||
#endif
|
||||
FT_Matrix transform_matrix;
|
||||
FT_Vector transform_delta;
|
||||
FT_Int transform_flags;
|
||||
@ -451,26 +452,58 @@ FT_BEGIN_HEADER
|
||||
|
||||
/* */
|
||||
|
||||
/*
|
||||
* Free the bitmap of a given glyphslot when needed
|
||||
* (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).
|
||||
*/
|
||||
#define FT_REQUEST_WIDTH( req ) \
|
||||
( (req)->horiResolution \
|
||||
? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
|
||||
: (req)->width )
|
||||
|
||||
#define FT_REQUEST_HEIGHT( req ) \
|
||||
( (req)->vertResolution \
|
||||
? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
|
||||
: (req)->height )
|
||||
|
||||
|
||||
/* Set the metrics according to a bitmap strike. */
|
||||
FT_BASE( void )
|
||||
FT_Select_Metrics( FT_Face face,
|
||||
FT_ULong strike_index );
|
||||
|
||||
|
||||
/* Set the metrics according to a size request. */
|
||||
FT_BASE( void )
|
||||
FT_Request_Metrics( FT_Face face,
|
||||
FT_Size_Request req );
|
||||
|
||||
|
||||
/* Match a size request against `available_sizes'. */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Match_Size( FT_Face face,
|
||||
FT_Size_Request req,
|
||||
FT_Bool ignore_width,
|
||||
FT_ULong* size_index );
|
||||
|
||||
|
||||
/* Use the horizontal metrics to synthesize the vertical metrics. */
|
||||
/* If `advance' is zero, it is also synthesized. */
|
||||
FT_BASE( void )
|
||||
ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
|
||||
FT_Pos advance );
|
||||
|
||||
|
||||
/* Free the bitmap of a given glyphslot when needed (i.e., only when it */
|
||||
/* was allocated with ft_glyphslot_alloc_bitmap). */
|
||||
FT_BASE( void )
|
||||
ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a new bitmap buffer in a glyph slot.
|
||||
*/
|
||||
/* Allocate a new bitmap buffer in a glyph slot. */
|
||||
FT_BASE( FT_Error )
|
||||
ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
|
||||
FT_ULong size );
|
||||
|
||||
|
||||
/*
|
||||
* Set the bitmap buffer in a glyph slot to a given pointer.
|
||||
* The buffer will not be freed by a later call to ft_glyphslot_free_bitmap.
|
||||
*/
|
||||
/* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
|
||||
/* will not be freed by a later call to ft_glyphslot_free_bitmap. */
|
||||
FT_BASE( void )
|
||||
ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
|
||||
FT_Byte* buffer );
|
||||
@ -582,17 +615,15 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* this hook is used by the TrueType debugger. It must be set to an alternate
|
||||
* truetype bytecode interpreter function
|
||||
*/
|
||||
/* This hook is used by the TrueType debugger. It must be set to an */
|
||||
/* alternate truetype bytecode interpreter function. */
|
||||
#define FT_DEBUG_HOOK_TRUETYPE 0
|
||||
|
||||
|
||||
/* set this debug hook to a non-null pointer to force unpatented hinting
|
||||
* for all faces when both TT_CONFIG_OPTION_BYTECODE_INTERPRETER and
|
||||
* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. this is only used
|
||||
* during debugging
|
||||
*/
|
||||
/* Set this debug hook to a non-null pointer to force unpatented hinting */
|
||||
/* for all faces when both TT_CONFIG_OPTION_BYTECODE_INTERPRETER and */
|
||||
/* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. this is only used */
|
||||
/* during debugging. */
|
||||
#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
|
||||
|
||||
|
||||
@ -709,7 +740,7 @@ FT_BEGIN_HEADER
|
||||
/* <Return> */
|
||||
/* A pointer to the new memory object. 0 in case of error. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Memory )
|
||||
FT_BASE( FT_Memory )
|
||||
FT_New_Memory( void );
|
||||
|
||||
|
||||
@ -724,7 +755,7 @@ FT_BEGIN_HEADER
|
||||
/* <Input> */
|
||||
/* memory :: A handle to the memory manager. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_BASE( void )
|
||||
FT_Done_Memory( FT_Memory memory );
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Embedded resource forks accessor (specification). */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* Masatake YAMATO and Redhat K.K. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -154,7 +154,7 @@ FT_BEGIN_HEADER
|
||||
/* offsets :: */
|
||||
/* The stream offsets for the resource data specified by `tag'. */
|
||||
/* This array is allocated by the function, so you have to call */
|
||||
/* @FT_Free after use. */
|
||||
/* @ft_mem_free after use. */
|
||||
/* */
|
||||
/* count :: */
|
||||
/* The length of offsets array. */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType services (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -302,6 +302,8 @@ FT_BEGIN_HEADER
|
||||
|
||||
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
|
||||
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
|
||||
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
|
||||
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
|
||||
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
|
||||
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
|
||||
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
|
||||
@ -309,6 +311,7 @@ FT_BEGIN_HEADER
|
||||
#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
|
||||
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
|
||||
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
|
||||
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
|
||||
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
|
||||
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Stream handling (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -328,7 +328,7 @@ FT_BEGIN_HEADER
|
||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||
|
||||
/* initialize a stream for reading a regular system stream */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Open( FT_Stream stream,
|
||||
const char* filepathname );
|
||||
|
||||
@ -514,18 +514,21 @@ FT_BEGIN_HEADER
|
||||
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
|
||||
|
||||
|
||||
#define FT_FRAME_ENTER( size ) \
|
||||
FT_SET_ERROR( FT_Stream_EnterFrame( stream, size ) )
|
||||
#define FT_FRAME_ENTER( size ) \
|
||||
FT_SET_ERROR( \
|
||||
FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )
|
||||
|
||||
#define FT_FRAME_EXIT() \
|
||||
FT_Stream_ExitFrame( stream )
|
||||
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
|
||||
|
||||
#define FT_FRAME_EXTRACT( size, bytes ) \
|
||||
FT_SET_ERROR( FT_Stream_ExtractFrame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
#define FT_FRAME_EXTRACT( size, bytes ) \
|
||||
FT_SET_ERROR( \
|
||||
FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) ) )
|
||||
|
||||
#define FT_FRAME_RELEASE( bytes ) \
|
||||
FT_Stream_ReleaseFrame( stream, (FT_Byte**)&(bytes) )
|
||||
#define FT_FRAME_RELEASE( bytes ) \
|
||||
FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Tracing handling (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002, 2004, 2005 by */
|
||||
/* Copyright 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -45,6 +45,7 @@ FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
|
||||
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
|
||||
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
|
||||
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
|
||||
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
|
||||
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
|
||||
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
|
||||
|
||||
@ -114,5 +115,19 @@ FT_TRACE_DEF( otvgpos )
|
||||
FT_TRACE_DEF( otvgsub )
|
||||
FT_TRACE_DEF( otvjstf )
|
||||
|
||||
/* TrueTypeGX/AAT validation components */
|
||||
FT_TRACE_DEF( gxvmodule )
|
||||
FT_TRACE_DEF( gxvcommon )
|
||||
FT_TRACE_DEF( gxvfeat )
|
||||
FT_TRACE_DEF( gxvmort )
|
||||
FT_TRACE_DEF( gxvmorx )
|
||||
FT_TRACE_DEF( gxvbsln )
|
||||
FT_TRACE_DEF( gxvjust )
|
||||
FT_TRACE_DEF( gxvkern )
|
||||
FT_TRACE_DEF( gxvopbd )
|
||||
FT_TRACE_DEF( gxvtrak )
|
||||
FT_TRACE_DEF( gxvprop )
|
||||
FT_TRACE_DEF( gxvlcar )
|
||||
|
||||
|
||||
/* END */
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* Auxiliary functions and data structures related to PostScript fonts */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -516,9 +516,10 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* last :: The last point position. */
|
||||
/* */
|
||||
/* scale_x :: The horizontal scale (FUnits to sub-pixels). */
|
||||
/* scale_x :: The horizontal scaling value (FUnits to */
|
||||
/* sub-pixels). */
|
||||
/* */
|
||||
/* scale_y :: The vertical scale (FUnits to sub-pixels). */
|
||||
/* scale_y :: The vertical scaling value (FUnits to sub-pixels). */
|
||||
/* */
|
||||
/* pos_x :: The horizontal translation (if composite glyph). */
|
||||
/* */
|
||||
@ -685,6 +686,70 @@ FT_BEGIN_HEADER
|
||||
} T1_DecoderRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** AFM PARSER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct AFM_ParserRec_* AFM_Parser;
|
||||
|
||||
typedef struct AFM_Parser_FuncsRec_
|
||||
{
|
||||
FT_Error
|
||||
(*init)( AFM_Parser parser,
|
||||
FT_Memory memory,
|
||||
FT_Byte* base,
|
||||
FT_Byte* limit );
|
||||
|
||||
void
|
||||
(*done)( AFM_Parser parser );
|
||||
|
||||
FT_Error
|
||||
(*parse)( AFM_Parser parser );
|
||||
|
||||
} AFM_Parser_FuncsRec;
|
||||
|
||||
typedef struct AFM_StreamRec_* AFM_Stream;
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* AFM_ParserRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An AFM_Parser is a parser for the AFM files. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* memory :: The object used for memory operations (alloc and */
|
||||
/* realloc). */
|
||||
/* */
|
||||
/* stream :: This is an opaque object. */
|
||||
/* */
|
||||
/* FontInfo :: The result will be stored here. */
|
||||
/* */
|
||||
/* get_index :: A user provided function to get a glyph index by its */
|
||||
/* name. */
|
||||
/* */
|
||||
typedef struct AFM_ParserRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
AFM_Stream stream;
|
||||
|
||||
AFM_FontInfo FontInfo;
|
||||
|
||||
FT_Int
|
||||
(*get_index)( const char* name,
|
||||
FT_UInt len,
|
||||
void* user_data );
|
||||
|
||||
void* user_data;
|
||||
|
||||
} AFM_ParserRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
@ -728,6 +793,9 @@ FT_BEGIN_HEADER
|
||||
|
||||
T1_CMap_Classes t1_cmap_classes;
|
||||
|
||||
/* fields after this comment line were added after version 2.1.10 */
|
||||
const AFM_Parser_FuncsRec* afm_parser_funcs;
|
||||
|
||||
} PSAux_ServiceRec, *PSAux_Service;
|
||||
|
||||
/* backwards-compatible type definition */
|
||||
|
@ -4,9 +4,9 @@
|
||||
/* */
|
||||
/* Interface to Postscript-specific (Type 1 and Type 2) hints */
|
||||
/* recorders (specification only). These are used to support native */
|
||||
/* T1/T2 hints in the "type1", "cid" and "cff" font drivers. */
|
||||
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
|
||||
/* */
|
||||
/* Copyright 2001, 2002, 2003 by */
|
||||
/* Copyright 2001, 2002, 2003, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -73,212 +73,233 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T1_Hints */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This is a handle to an opaque structure used to record glyph hints */
|
||||
/* from a Type 1 character glyph character string. */
|
||||
/* */
|
||||
/* The methods used to operate on this object are defined by the */
|
||||
/* @T1_Hints_FuncsRec structure. Recording glyph hints is normally */
|
||||
/* achieved through the following scheme: */
|
||||
/* */
|
||||
/* - Open a new hint recording session by calling the "open" method. */
|
||||
/* This will rewind the recorder and prepare it for new input. */
|
||||
/* */
|
||||
/* - For each hint found in the glyph charstring, call the */
|
||||
/* corresponding method ("stem", "stem3", or "reset"). Note that */
|
||||
/* these functions do not return an error code. */
|
||||
/* */
|
||||
/* - Close the recording session by calling the "close" method. It */
|
||||
/* will return an error code if the hints were invalid or something */
|
||||
/* strange happened (e.g. memory shortage). */
|
||||
/* */
|
||||
/* The hints accumulated in the object can later be used by the */
|
||||
/* PostScript hinter. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T1_Hints
|
||||
*
|
||||
* @description:
|
||||
* This is a handle to an opaque structure used to record glyph hints
|
||||
* from a Type 1 character glyph character string.
|
||||
*
|
||||
* The methods used to operate on this object are defined by the
|
||||
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally
|
||||
* achieved through the following scheme:
|
||||
*
|
||||
* - Open a new hint recording session by calling the `open' method.
|
||||
* This rewinds the recorder and prepare it for new input.
|
||||
*
|
||||
* - For each hint found in the glyph charstring, call the corresponding
|
||||
* method (`stem', `stem3', or `reset'). Note that these functions do
|
||||
* not return an error code.
|
||||
*
|
||||
* - Close the recording session by calling the `close' method. It
|
||||
* returns an error code if the hints were invalid or something
|
||||
* strange happened (e.g., memory shortage).
|
||||
*
|
||||
* The hints accumulated in the object can later be used by the
|
||||
* PostScript hinter.
|
||||
*
|
||||
*/
|
||||
typedef struct T1_HintsRec_* T1_Hints;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T1_Hints_Funcs */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A pointer to the @T1_Hints_FuncsRec structure that defines the */
|
||||
/* API of a given @T1_Hints object. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T1_Hints_Funcs
|
||||
*
|
||||
* @description:
|
||||
* A pointer to the @T1_Hints_FuncsRec structure that defines the API of
|
||||
* a given @T1_Hints object.
|
||||
*
|
||||
*/
|
||||
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_OpenFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to prepare it for a new */
|
||||
/* Type 1 hints recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* You should always call the @T1_Hints_CloseFunc method in order to */
|
||||
/* close an opened recording session. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_OpenFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to prepare it for a new Type 1
|
||||
* hints recording session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* @note:
|
||||
* You should always call the @T1_Hints_CloseFunc method in order to
|
||||
* close an opened recording session.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_OpenFunc)( T1_Hints hints );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_SetStemFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to record a new horizontal or */
|
||||
/* vertical stem. This corresponds to the Type 1 "hstem" and "vstem" */
|
||||
/* operators. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */
|
||||
/* (vstem). */
|
||||
/* */
|
||||
/* coords :: Array of 2 integers, used as (position,length) stem */
|
||||
/* descriptor. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* "coords[0]" is the absolute stem position (lowest coordinate); */
|
||||
/* "coords[1]" is the length. */
|
||||
/* */
|
||||
/* The length can be negative, in which case it must be either -20 or */
|
||||
/* -21. It will be interpreted as a "ghost" stem, according to */
|
||||
/* Type 1 specification. */
|
||||
/* */
|
||||
/* If the length is -21 (corresponding to a bottom ghost stem), then */
|
||||
/* the real stem position is "coords[0]+coords[1]". */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_SetStemFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to record a new horizontal or
|
||||
* vertical stem. This corresponds to the Type 1 `hstem' and `vstem'
|
||||
* operators.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* dimension ::
|
||||
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
|
||||
*
|
||||
* coords ::
|
||||
* Array of 2 integers, used as (position,length) stem descriptor.
|
||||
*
|
||||
* @note:
|
||||
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
|
||||
* horizontal coordinates (x) for vertical stems (dim=1).
|
||||
*
|
||||
* `coords[0]' is the absolute stem position (lowest coordinate);
|
||||
* `coords[1]' is the length.
|
||||
*
|
||||
* The length can be negative, in which case it must be either -20 or
|
||||
* -21. It is interpreted as a `ghost' stem, according to the Type 1
|
||||
* specification.
|
||||
*
|
||||
* If the length is -21 (corresponding to a bottom ghost stem), then
|
||||
* the real stem position is `coords[0]+coords[1]'.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_SetStemFunc)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Long* coords );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_SetStem3Func */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to record three */
|
||||
/* counter-controlled horizontal or vertical stems at once. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems, 1 for vertical ones. */
|
||||
/* */
|
||||
/* coords :: An array of 6 integers, holding 3 (position,length) */
|
||||
/* pairs for the counter-controlled stems. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* The lengths cannot be negative (ghost stems are never */
|
||||
/* counter-controlled). */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_SetStem3Func
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to record three
|
||||
* counter-controlled horizontal or vertical stems at once.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* dimension ::
|
||||
* 0 for horizontal stems, 1 for vertical ones.
|
||||
*
|
||||
* coords ::
|
||||
* An array of 6 integers, holding 3 (position,length) pairs for the
|
||||
* counter-controlled stems.
|
||||
*
|
||||
* @note:
|
||||
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
|
||||
* horizontal coordinates (x) for vertical stems (dim=1).
|
||||
*
|
||||
* The lengths cannot be negative (ghost stems are never
|
||||
* counter-controlled).
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_SetStem3Func)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Long* coords );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_ResetFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to reset the stems hints in a */
|
||||
/* recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The index of the last point in the input glyph in */
|
||||
/* which the previously defined hints apply. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_ResetFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to reset the stems hints in a
|
||||
* recording session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The index of the last point in the input glyph in which the
|
||||
* previously defined hints apply.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_ResetFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to close a hint recording */
|
||||
/* session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The index of the last point in the input glyph. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* The error code will be set to indicate that an error occured */
|
||||
/* during the recording session. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to close a hint recording
|
||||
* session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The index of the last point in the input glyph.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The error code is set to indicate that an error occurred during the
|
||||
* recording session.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T1_Hints_CloseFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T1_Hints_ApplyFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T1_Hints class used to apply hints to the */
|
||||
/* corresponding glyph outline. Must be called once all hints have */
|
||||
/* been recorded. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 1 hints recorder. */
|
||||
/* */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* globals :: The hinter globals for this font. */
|
||||
/* */
|
||||
/* hint_mode :: Hinting information. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* On input, all points within the outline are in font coordinates. */
|
||||
/* On output, they are in 1/64th of pixels. */
|
||||
/* */
|
||||
/* The scaling transformation is taken from the "globals" object */
|
||||
/* which must correspond to the same font as the glyph. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_ApplyFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to apply hints to the
|
||||
* corresponding glyph outline. Must be called once all hints have been
|
||||
* recorded.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* outline ::
|
||||
* A pointer to the target outline descriptor.
|
||||
*
|
||||
* globals ::
|
||||
* The hinter globals for this font.
|
||||
*
|
||||
* hint_mode ::
|
||||
* Hinting information.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* On input, all points within the outline are in font coordinates. On
|
||||
* output, they are in 1/64th of pixels.
|
||||
*
|
||||
* The scaling transformation is taken from the `globals' object which
|
||||
* must correspond to the same font as the glyph.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T1_Hints_ApplyFunc)( T1_Hints hints,
|
||||
FT_Outline* outline,
|
||||
@ -286,30 +307,37 @@ FT_BEGIN_HEADER
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* T1_Hints_FuncsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The structure used to provide the API to @T1_Hints objects. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* hints :: A handle to the T1 Hints recorder. */
|
||||
/* */
|
||||
/* open :: The function to open a recording session. */
|
||||
/* */
|
||||
/* close :: The function to close a recording session. */
|
||||
/* */
|
||||
/* stem :: The function to set a simple stem. */
|
||||
/* */
|
||||
/* stem3 :: The function to set counter-controlled stems. */
|
||||
/* */
|
||||
/* reset :: The function to reset stem hints. */
|
||||
/* */
|
||||
/* apply :: The function to apply the hints to the corresponding */
|
||||
/* glyph outline. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* T1_Hints_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* The structure used to provide the API to @T1_Hints objects.
|
||||
*
|
||||
* @fields:
|
||||
* hints ::
|
||||
* A handle to the T1 Hints recorder.
|
||||
*
|
||||
* open ::
|
||||
* The function to open a recording session.
|
||||
*
|
||||
* close ::
|
||||
* The function to close a recording session.
|
||||
*
|
||||
* stem ::
|
||||
* The function to set a simple stem.
|
||||
*
|
||||
* stem3 ::
|
||||
* The function to set counter-controlled stems.
|
||||
*
|
||||
* reset ::
|
||||
* The function to reset stem hints.
|
||||
*
|
||||
* apply ::
|
||||
* The function to apply the hints to the corresponding glyph outline.
|
||||
*
|
||||
*/
|
||||
typedef struct T1_Hints_FuncsRec_
|
||||
{
|
||||
T1_Hints hints;
|
||||
@ -331,100 +359,108 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T2_Hints */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* This is a handle to an opaque structure used to record glyph hints */
|
||||
/* from a Type 2 character glyph character string. */
|
||||
/* */
|
||||
/* The methods used to operate on this object are defined by the */
|
||||
/* @T2_Hints_FuncsRec structure. Recording glyph hints is normally */
|
||||
/* achieved through the following scheme: */
|
||||
/* */
|
||||
/* - Open a new hint recording session by calling the "open" method. */
|
||||
/* This will rewind the recorder and prepare it for new input. */
|
||||
/* */
|
||||
/* - For each hint found in the glyph charstring, call the */
|
||||
/* corresponding method ("stems", "hintmask", "counters"). Note */
|
||||
/* that these functions do not return an error code. */
|
||||
/* */
|
||||
/* - Close the recording session by calling the "close" method. It */
|
||||
/* will return an error code if the hints were invalid or something */
|
||||
/* strange happened (e.g. memory shortage). */
|
||||
/* */
|
||||
/* The hints accumulated in the object can later be used by the */
|
||||
/* Postscript hinter. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T2_Hints
|
||||
*
|
||||
* @description:
|
||||
* This is a handle to an opaque structure used to record glyph hints
|
||||
* from a Type 2 character glyph character string.
|
||||
*
|
||||
* The methods used to operate on this object are defined by the
|
||||
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally
|
||||
* achieved through the following scheme:
|
||||
*
|
||||
* - Open a new hint recording session by calling the `open' method.
|
||||
* This rewinds the recorder and prepare it for new input.
|
||||
*
|
||||
* - For each hint found in the glyph charstring, call the corresponding
|
||||
* method (`stems', `hintmask', `counters'). Note that these
|
||||
* functions do not return an error code.
|
||||
*
|
||||
* - Close the recording session by calling the `close' method. It
|
||||
* returns an error code if the hints were invalid or something
|
||||
* strange happened (e.g., memory shortage).
|
||||
*
|
||||
* The hints accumulated in the object can later be used by the
|
||||
* Postscript hinter.
|
||||
*
|
||||
*/
|
||||
typedef struct T2_HintsRec_* T2_Hints;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @type: */
|
||||
/* T2_Hints_Funcs */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A pointer to the @T2_Hints_FuncsRec structure that defines the API */
|
||||
/* of a given @T2_Hints object. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T2_Hints_Funcs
|
||||
*
|
||||
* @description:
|
||||
* A pointer to the @T2_Hints_FuncsRec structure that defines the API of
|
||||
* a given @T2_Hints object.
|
||||
*
|
||||
*/
|
||||
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_OpenFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to prepare it for a new */
|
||||
/* Type 2 hints recording session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* You should always call the @T2_Hints_CloseFunc method in order to */
|
||||
/* close an opened recording session. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_OpenFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to prepare it for a new Type 2
|
||||
* hints recording session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* @note:
|
||||
* You should always call the @T2_Hints_CloseFunc method in order to
|
||||
* close an opened recording session.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_OpenFunc)( T2_Hints hints );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_StemsFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set the table of stems in */
|
||||
/* either the vertical or horizontal dimension. Equivalent to the */
|
||||
/* "hstem", "vstem", "hstemhm", and "vstemhm" Type 2 operators. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* dimension :: 0 for horizontal stems (hstem), 1 for vertical ones */
|
||||
/* (vstem). */
|
||||
/* */
|
||||
/* count :: The number of stems. */
|
||||
/* */
|
||||
/* coords :: An array of "count" (position,length) pairs. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Use vertical coordinates (y) for horizontal stems (dim=0). Use */
|
||||
/* horizontal coordinates (x) for vertical stems (dim=1). */
|
||||
/* */
|
||||
/* There are "2*count" elements in the "coords" aray. Each even */
|
||||
/* element is an absolute position in font units, each odd element is */
|
||||
/* a length in font units. */
|
||||
/* */
|
||||
/* A length can be negative, in which case it must be either -20 or */
|
||||
/* -21. It will be interpreted as a "ghost" stem, according to the */
|
||||
/* Type 1 specification. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_StemsFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to set the table of stems in
|
||||
* either the vertical or horizontal dimension. Equivalent to the
|
||||
* `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* dimension ::
|
||||
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
|
||||
*
|
||||
* count ::
|
||||
* The number of stems.
|
||||
*
|
||||
* coords ::
|
||||
* An array of `count' (position,length) pairs.
|
||||
*
|
||||
* @note:
|
||||
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
|
||||
* horizontal coordinates (x) for vertical stems (dim=1).
|
||||
*
|
||||
* There are `2*count' elements in the `coords' aray. Each even element
|
||||
* is an absolute position in font units, each odd element is a length
|
||||
* in font units.
|
||||
*
|
||||
* A length can be negative, in which case it must be either -20 or
|
||||
* -21. It is interpreted as a `ghost' stem, according to the Type 1
|
||||
* specification.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_StemsFunc)( T2_Hints hints,
|
||||
FT_UInt dimension,
|
||||
@ -432,36 +468,41 @@ FT_BEGIN_HEADER
|
||||
FT_Fixed* coordinates );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_MaskFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set a given hintmask */
|
||||
/* (this corresponds to the "hintmask" Type 2 operator). */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The glyph index of the last point to which the */
|
||||
/* previously defined/activated hints apply. */
|
||||
/* */
|
||||
/* bit_count :: The number of bits in the hint mask. */
|
||||
/* */
|
||||
/* bytes :: An array of bytes modelling the hint mask. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If the hintmask starts the charstring (before any glyph point */
|
||||
/* definition), the value of "end_point" should be 0. */
|
||||
/* */
|
||||
/* "bit_count" is the number of meaningful bits in the "bytes" array; */
|
||||
/* it must be equal to the total number of hints defined so far */
|
||||
/* (i.e. horizontal+verticals). */
|
||||
/* */
|
||||
/* The "bytes" array can come directly from the Type 2 charstring and */
|
||||
/* respects the same format. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_MaskFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to set a given hintmask (this
|
||||
* corresponds to the `hintmask' Type 2 operator).
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The glyph index of the last point to which the previously defined
|
||||
* or activated hints apply.
|
||||
*
|
||||
* bit_count ::
|
||||
* The number of bits in the hint mask.
|
||||
*
|
||||
* bytes ::
|
||||
* An array of bytes modelling the hint mask.
|
||||
*
|
||||
* @note:
|
||||
* If the hintmask starts the charstring (before any glyph point
|
||||
* definition), the value of `end_point' should be 0.
|
||||
*
|
||||
* `bit_count' is the number of meaningful bits in the `bytes' array; it
|
||||
* must be equal to the total number of hints defined so far (i.e.,
|
||||
* horizontal+verticals).
|
||||
*
|
||||
* The `bytes' array can come directly from the Type 2 charstring and
|
||||
* respects the same format.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_MaskFunc)( T2_Hints hints,
|
||||
FT_UInt end_point,
|
||||
@ -469,97 +510,110 @@ FT_BEGIN_HEADER
|
||||
const FT_Byte* bytes );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_CounterFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to set a given counter mask */
|
||||
/* (this corresponds to the "hintmask" Type 2 operator). */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: A glyph index of the last point to which the */
|
||||
/* previously defined/active hints apply. */
|
||||
/* */
|
||||
/* bit_count :: The number of bits in the hint mask. */
|
||||
/* */
|
||||
/* bytes :: An array of bytes modelling the hint mask. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* If the hintmask starts the charstring (before any glyph point */
|
||||
/* definition), the value of "end_point" should be 0. */
|
||||
/* */
|
||||
/* "bit_count" is the number of meaningful bits in the "bytes" array; */
|
||||
/* it must be equal to the total number of hints defined so far */
|
||||
/* (i.e. horizontal+verticals). */
|
||||
/* */
|
||||
/* The "bytes" array can come directly from the Type 2 charstring and */
|
||||
/* respects the same format. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_CounterFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to set a given counter mask
|
||||
* (this corresponds to the `hintmask' Type 2 operator).
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* A glyph index of the last point to which the previously defined or
|
||||
* active hints apply.
|
||||
*
|
||||
* bit_count ::
|
||||
* The number of bits in the hint mask.
|
||||
*
|
||||
* bytes ::
|
||||
* An array of bytes modelling the hint mask.
|
||||
*
|
||||
* @note:
|
||||
* If the hintmask starts the charstring (before any glyph point
|
||||
* definition), the value of `end_point' should be 0.
|
||||
*
|
||||
* `bit_count' is the number of meaningful bits in the `bytes' array; it
|
||||
* must be equal to the total number of hints defined so far (i.e.,
|
||||
* horizontal+verticals).
|
||||
*
|
||||
* The `bytes' array can come directly from the Type 2 charstring and
|
||||
* respects the same format.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_CounterFunc)( T2_Hints hints,
|
||||
FT_UInt bit_count,
|
||||
const FT_Byte* bytes );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_CloseFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to close a hint recording */
|
||||
/* session. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* end_point :: The index of the last point in the input glyph. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* The error code will be set to indicate that an error occured */
|
||||
/* during the recording session. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to close a hint recording
|
||||
* session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The index of the last point in the input glyph.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The error code is set to indicate that an error occurred during the
|
||||
* recording session.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T2_Hints_CloseFunc)( T2_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @functype: */
|
||||
/* T2_Hints_ApplyFunc */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A method of the @T2_Hints class used to apply hints to the */
|
||||
/* corresponding glyph outline. Must be called after the "close" */
|
||||
/* method. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* hints :: A handle to the Type 2 hints recorder. */
|
||||
/* */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* globals :: The hinter globals for this font. */
|
||||
/* */
|
||||
/* hint_mode :: Hinting information. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* On input, all points within the outline are in font coordinates. */
|
||||
/* On output, they are in 1/64th of pixels. */
|
||||
/* */
|
||||
/* The scaling transformation is taken from the "globals" object */
|
||||
/* which must correspond to the same font than the glyph. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_ApplyFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to apply hints to the
|
||||
* corresponding glyph outline. Must be called after the `close'
|
||||
* method.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* outline ::
|
||||
* A pointer to the target outline descriptor.
|
||||
*
|
||||
* globals ::
|
||||
* The hinter globals for this font.
|
||||
*
|
||||
* hint_mode ::
|
||||
* Hinting information.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* On input, all points within the outline are in font coordinates. On
|
||||
* output, they are in 1/64th of pixels.
|
||||
*
|
||||
* The scaling transformation is taken from the `globals' object which
|
||||
* must correspond to the same font than the glyph.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T2_Hints_ApplyFunc)( T2_Hints hints,
|
||||
FT_Outline* outline,
|
||||
@ -567,30 +621,37 @@ FT_BEGIN_HEADER
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @struct: */
|
||||
/* T2_Hints_FuncsRec */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* The structure used to provide the API to @T2_Hints objects. */
|
||||
/* */
|
||||
/* @fields: */
|
||||
/* hints :: A handle to the T2 hints recorder object. */
|
||||
/* */
|
||||
/* open :: The function to open a recording session. */
|
||||
/* */
|
||||
/* close :: The function to close a recording session. */
|
||||
/* */
|
||||
/* stems :: The function to set the dimension's stems table. */
|
||||
/* */
|
||||
/* hintmask :: The function to set hint masks. */
|
||||
/* */
|
||||
/* counter :: The function to set counter masks. */
|
||||
/* */
|
||||
/* apply :: The function to apply the hints on the corresponding */
|
||||
/* glyph outline. */
|
||||
/* */
|
||||
/*************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* T2_Hints_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* The structure used to provide the API to @T2_Hints objects.
|
||||
*
|
||||
* @fields:
|
||||
* hints ::
|
||||
* A handle to the T2 hints recorder object.
|
||||
*
|
||||
* open ::
|
||||
* The function to open a recording session.
|
||||
*
|
||||
* close ::
|
||||
* The function to close a recording session.
|
||||
*
|
||||
* stems ::
|
||||
* The function to set the dimension's stems table.
|
||||
*
|
||||
* hintmask ::
|
||||
* The function to set hint masks.
|
||||
*
|
||||
* counter ::
|
||||
* The function to set counter masks.
|
||||
*
|
||||
* apply ::
|
||||
* The function to apply the hints on the corresponding glyph outline.
|
||||
*
|
||||
*/
|
||||
typedef struct T2_Hints_FuncsRec_
|
||||
{
|
||||
T2_Hints hints;
|
||||
|
72
headers/libs/freetype2/freetype/internal/services/svgxval.h
Normal file
72
headers/libs/freetype2/freetype/internal/services/svgxval.h
Normal file
@ -0,0 +1,72 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* svgxval.h */
|
||||
/* */
|
||||
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005 by */
|
||||
/* Masatake YAMATO, Red Hat K.K., */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* gxvalid is derived from both gxlayout module and otvalid module. */
|
||||
/* Development of gxlayout is supported by the Information-technology */
|
||||
/* Promotion Agency(IPA), Japan. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __SVGXVAL_H__
|
||||
#define __SVGXVAL_H__
|
||||
|
||||
#include FT_GX_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate"
|
||||
#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
|
||||
|
||||
typedef FT_Error
|
||||
(*gxv_validate_func)( FT_Face face,
|
||||
FT_UInt gx_flags,
|
||||
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
|
||||
FT_UInt table_length );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*ckern_validate_func)( FT_Face face,
|
||||
FT_UInt ckern_flags,
|
||||
FT_Bytes *ckern_table );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( GXvalidate )
|
||||
{
|
||||
gxv_validate_func validate;
|
||||
};
|
||||
|
||||
FT_DEFINE_SERVICE( CKERNvalidate )
|
||||
{
|
||||
ckern_validate_func validate;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVGXVAL_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,10 +1,10 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* aherrors.h */
|
||||
/* svkern.h */
|
||||
/* */
|
||||
/* Autohinter error codes (specification only). */
|
||||
/* The FreeType Kerning service (specification). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,25 +16,36 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file is used to define the Autohinter error enumeration */
|
||||
/* constants. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
#ifndef __SVKERN_H__
|
||||
#define __SVKERN_H__
|
||||
|
||||
#ifndef __AHERRORS_H__
|
||||
#define __AHERRORS_H__
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
#include FT_MODULE_ERRORS_H
|
||||
|
||||
#undef __FTERRORS_H__
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#define FT_ERR_PREFIX AH_Err_
|
||||
#define FT_ERR_BASE FT_Mod_Err_Autohint
|
||||
#define FT_SERVICE_ID_KERNING "kerning"
|
||||
|
||||
#include FT_ERRORS_H
|
||||
|
||||
#endif /* __AHERRORS_H__ */
|
||||
typedef FT_Error
|
||||
(*FT_Kerning_TrackGetFunc)( FT_Face face,
|
||||
FT_Fixed point_size,
|
||||
FT_Int degree,
|
||||
FT_Fixed* akerning );
|
||||
|
||||
FT_DEFINE_SERVICE( Kerning )
|
||||
{
|
||||
FT_Kerning_TrackGetFunc get_track;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVKERN_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType OpenType validation service (specification). */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* Copyright 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -19,6 +19,8 @@
|
||||
#ifndef __SVOTVAL_H__
|
||||
#define __SVOTVAL_H__
|
||||
|
||||
#include FT_OPENTYPE_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Internal PFR service functions (specification). */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -19,6 +19,7 @@
|
||||
#ifndef __SVPFR_H__
|
||||
#define __SVPFR_H__
|
||||
|
||||
#include FT_PFR_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* The FreeType PostScript charmap service (specification). */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -19,6 +19,8 @@
|
||||
#ifndef __SVPSCMAP_H__
|
||||
#define __SVPSCMAP_H__
|
||||
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
@ -27,30 +29,23 @@ FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* Adobe glyph name to unicode value
|
||||
* Adobe glyph name to unicode value.
|
||||
*/
|
||||
typedef FT_UInt32
|
||||
(*PS_Unicode_ValueFunc)( const char* glyph_name );
|
||||
|
||||
/*
|
||||
* Unicode value to Adobe glyph name index. 0xFFFF if not found.
|
||||
*/
|
||||
typedef FT_UInt
|
||||
(*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
FT_ULong unicode );
|
||||
|
||||
/*
|
||||
* Macintosh name id to glyph name. NULL if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Macintosh_Name_Func)( FT_UInt name_index );
|
||||
(*PS_Macintosh_NameFunc)( FT_UInt name_index );
|
||||
|
||||
/*
|
||||
* Adobe standard string ID to glyph name. NULL if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
|
||||
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
|
||||
|
||||
|
||||
/*
|
||||
* Simple unicode -> glyph index charmap built from font glyph names
|
||||
@ -58,33 +53,45 @@ FT_BEGIN_HEADER
|
||||
*/
|
||||
typedef struct PS_UniMap_
|
||||
{
|
||||
FT_UInt unicode;
|
||||
FT_UInt glyph_index;
|
||||
FT_UInt32 unicode; /* bit 31 set: is glyph variant */
|
||||
FT_UInt glyph_index;
|
||||
|
||||
} PS_UniMap;
|
||||
|
||||
|
||||
typedef struct PS_Unicodes_
|
||||
typedef struct PS_UnicodesRec_* PS_Unicodes;
|
||||
|
||||
typedef struct PS_UnicodesRec_
|
||||
{
|
||||
FT_CMapRec cmap;
|
||||
FT_UInt num_maps;
|
||||
PS_UniMap* maps;
|
||||
|
||||
} PS_Unicodes;
|
||||
} PS_UnicodesRec;
|
||||
|
||||
|
||||
/*
|
||||
* A function which returns a glyph name for a given index. Returns
|
||||
* NULL if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Glyph_NameFunc)( FT_Pointer data,
|
||||
FT_UInt string_index );
|
||||
|
||||
typedef FT_Error
|
||||
(*PS_Unicodes_InitFunc)( FT_Memory memory,
|
||||
FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
PS_Unicodes* unicodes );
|
||||
(*PS_Unicodes_InitFunc)( FT_Memory memory,
|
||||
PS_Unicodes unicodes,
|
||||
FT_UInt num_glyphs,
|
||||
PS_Glyph_NameFunc get_glyph_name,
|
||||
FT_Pointer glyph_data );
|
||||
|
||||
typedef FT_UInt
|
||||
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes* unicodes,
|
||||
FT_UInt unicode );
|
||||
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
|
||||
FT_UInt32 unicode );
|
||||
|
||||
typedef FT_ULong
|
||||
(*PS_Unicodes_CharNextFunc)( PS_Unicodes* unicodes,
|
||||
FT_ULong unicode );
|
||||
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
|
||||
FT_UInt32 *unicode );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( PsCMaps )
|
||||
@ -95,8 +102,8 @@ FT_BEGIN_HEADER
|
||||
PS_Unicodes_CharIndexFunc unicodes_char_index;
|
||||
PS_Unicodes_CharNextFunc unicodes_char_next;
|
||||
|
||||
PS_Macintosh_Name_Func macintosh_name;
|
||||
PS_Adobe_Std_Strings_Func adobe_std_strings;
|
||||
PS_Macintosh_NameFunc macintosh_name;
|
||||
PS_Adobe_Std_StringsFunc adobe_std_strings;
|
||||
const unsigned short* adobe_std_encoding;
|
||||
const unsigned short* adobe_expert_encoding;
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
|
53
headers/libs/freetype2/freetype/internal/services/svtteng.h
Normal file
53
headers/libs/freetype2/freetype/internal/services/svtteng.h
Normal file
@ -0,0 +1,53 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* svtteng.h */
|
||||
/* */
|
||||
/* The FreeType TrueType engine query service (specification). */
|
||||
/* */
|
||||
/* Copyright 2006 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 __SVTTENG_H__
|
||||
#define __SVTTENG_H__
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* SFNT table loading service.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
|
||||
|
||||
/*
|
||||
* Used to implement FT_Get_TrueType_Engine_Type
|
||||
*/
|
||||
|
||||
FT_DEFINE_SERVICE( TrueTypeEngine )
|
||||
{
|
||||
FT_TrueTypeEngineType engine_type;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __SVTTENG_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* High-level `sfnt' driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -34,7 +34,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Init_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* First part of the SFNT face object initialization. This will find */
|
||||
/* First part of the SFNT face object initialization. This finds */
|
||||
/* the face in a SFNT file or collection, and load its format tag in */
|
||||
/* face->format_tag. */
|
||||
/* */
|
||||
@ -77,9 +77,9 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Second part of the SFNT face object initialization. This will */
|
||||
/* load the common SFNT tables (head, OS/2, maxp, metrics, etc.) in */
|
||||
/* the face object. */
|
||||
/* Second part of the SFNT face object initialization. This loads */
|
||||
/* the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the */
|
||||
/* face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
@ -125,6 +125,8 @@ FT_BEGIN_HEADER
|
||||
(*TT_Done_Face_Func)( TT_Face face );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
@ -172,11 +174,11 @@ FT_BEGIN_HEADER
|
||||
/* Loads the table directory into a face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
@ -191,6 +193,8 @@ FT_BEGIN_HEADER
|
||||
FT_Stream stream,
|
||||
SFNT_Header sfnt );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@ -198,7 +202,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_Any_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads any font table into client memory. */
|
||||
/* Load any font table into client memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The face object to look for. */
|
||||
@ -246,7 +250,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Find_SBit_Image_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Checks whether an embedded bitmap (an `sbit') exists for a given */
|
||||
/* Check whether an embedded bitmap (an `sbit') exists for a given */
|
||||
/* glyph, at a given strike. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -283,7 +287,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_SBit_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Gets the big metrics for a given embedded bitmap. */
|
||||
/* Get the big metrics for a given embedded bitmap. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
@ -316,7 +320,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_SBit_Image_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given glyph sbit image from the font resource. This also */
|
||||
/* Load a given glyph sbit image from the font resource. This also */
|
||||
/* returns its metrics. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
@ -359,21 +363,20 @@ FT_BEGIN_HEADER
|
||||
TT_SBit_MetricsRec *ametrics );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Set_SBit_Strike_Func */
|
||||
/* TT_Set_SBit_Strike_OldFunc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Selects an sbit strike for given horizontal and vertical ppem */
|
||||
/* values. */
|
||||
/* Select an sbit strike for a given size request. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* x_ppem :: The horizontal resolution in points per EM. */
|
||||
/* */
|
||||
/* y_ppem :: The vertical resolution in points per EM. */
|
||||
/* req :: The size request. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* astrike_index :: The index of the sbit strike. */
|
||||
@ -383,10 +386,115 @@ FT_BEGIN_HEADER
|
||||
/* sbit strike exists for the selected ppem values. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Set_SBit_Strike_Func)( TT_Face face,
|
||||
FT_UInt x_ppem,
|
||||
FT_UInt y_ppem,
|
||||
FT_ULong *astrike_index );
|
||||
(*TT_Set_SBit_Strike_OldFunc)( TT_Face face,
|
||||
FT_UInt x_ppem,
|
||||
FT_UInt y_ppem,
|
||||
FT_ULong* astrike_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_CharMap_Load_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given TrueType character map into memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the current stream object. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* cmap :: A pointer to a cmap object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The function assumes that the stream is already in use (i.e., */
|
||||
/* opened). In case of error, all partially allocated tables are */
|
||||
/* released. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_CharMap_Load_Func)( TT_Face face,
|
||||
void* cmap,
|
||||
FT_Stream input );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_CharMap_Free_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys a character mapping table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* cmap :: A handle to a cmap object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_CharMap_Free_Func)( TT_Face face,
|
||||
void* cmap );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Set_SBit_Strike_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Select an sbit strike for a given size request. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* req :: The size request. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* astrike_index :: The index of the sbit strike. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. Returns an error if no */
|
||||
/* sbit strike exists for the selected ppem values. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Set_SBit_Strike_Func)( TT_Face face,
|
||||
FT_Size_Request req,
|
||||
FT_ULong* astrike_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Strike_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Load the metrics of a given strike. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* strike_index :: The strike index. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* metrics :: the metrics of the strike. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. Returns an error if no */
|
||||
/* such sbit strike exists. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Strike_Metrics_Func)( TT_Face face,
|
||||
FT_ULong strike_index,
|
||||
FT_Size_Metrics* metrics );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -395,7 +503,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Get_PS_Name_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Gets the PostScript glyph name of a glyph. */
|
||||
/* Get the PostScript glyph name of a glyph. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* idx :: The glyph index. */
|
||||
@ -420,14 +528,15 @@ FT_BEGIN_HEADER
|
||||
/* TT_Load_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the horizontal or vertical header in a face object. */
|
||||
/* Load a metrics table, which is a table with a horizontal and a */
|
||||
/* vertical version. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */
|
||||
/* vertical :: A boolean flag. If set, load the vertical one. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
@ -438,13 +547,39 @@ FT_BEGIN_HEADER
|
||||
FT_Bool vertical );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Get_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Load the horizontal or vertical header in a face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Get_Metrics_Func)( TT_Face face,
|
||||
FT_Bool vertical,
|
||||
FT_UInt gindex,
|
||||
FT_Short* abearing,
|
||||
FT_UShort* aadvance );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given TrueType table. */
|
||||
/* Load a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
@ -455,8 +590,8 @@ FT_BEGIN_HEADER
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The function will use `face->goto_table' to seek the stream to */
|
||||
/* the start of the table. */
|
||||
/* The function uses `face->goto_table' to seek the stream to the */
|
||||
/* start of the table, except while loading the font directory. */
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*TT_Load_Table_Func)( TT_Face face,
|
||||
@ -469,7 +604,7 @@ FT_BEGIN_HEADER
|
||||
/* TT_Free_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Frees a given TrueType table. */
|
||||
/* Free a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
@ -521,47 +656,97 @@ FT_BEGIN_HEADER
|
||||
FT_Module_Requester get_interface;
|
||||
|
||||
TT_Load_Any_Func load_any;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Load_SFNT_HeaderRec_Func load_sfnt_header;
|
||||
TT_Load_Directory_Func load_directory;
|
||||
#endif
|
||||
|
||||
/* these functions are called by `load_face' but they can also */
|
||||
/* be called from external modules, if there is a need to do so */
|
||||
TT_Load_Table_Func load_header;
|
||||
TT_Load_Metrics_Func load_metrics;
|
||||
TT_Load_Table_Func load_charmaps;
|
||||
TT_Load_Table_Func load_max_profile;
|
||||
TT_Load_Table_Func load_head;
|
||||
TT_Load_Metrics_Func load_hhea;
|
||||
TT_Load_Table_Func load_cmap;
|
||||
TT_Load_Table_Func load_maxp;
|
||||
TT_Load_Table_Func load_os2;
|
||||
TT_Load_Table_Func load_psnames;
|
||||
TT_Load_Table_Func load_post;
|
||||
|
||||
TT_Load_Table_Func load_names;
|
||||
TT_Free_Table_Func free_names;
|
||||
TT_Load_Table_Func load_name;
|
||||
TT_Free_Table_Func free_name;
|
||||
|
||||
/* optional tables */
|
||||
TT_Load_Table_Func load_hdmx;
|
||||
TT_Free_Table_Func free_hdmx;
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Load_Table_Func load_hdmx_stub;
|
||||
TT_Free_Table_Func free_hdmx_stub;
|
||||
#endif
|
||||
|
||||
/* this field was called `load_kerning' up to version 2.1.10 */
|
||||
TT_Load_Table_Func load_kern;
|
||||
|
||||
TT_Load_Table_Func load_kerning;
|
||||
TT_Load_Table_Func load_gasp;
|
||||
TT_Load_Table_Func load_pclt;
|
||||
|
||||
/* see `ttload.h' */
|
||||
TT_Load_Table_Func load_bitmap_header;
|
||||
/* see `ttload.h'; this field was called `load_bitmap_header' up to */
|
||||
/* version 2.1.10 */
|
||||
TT_Load_Table_Func load_bhed;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/* see `ttsbit.h' */
|
||||
TT_Set_SBit_Strike_Func set_sbit_strike;
|
||||
TT_Load_Table_Func load_sbits;
|
||||
TT_Set_SBit_Strike_OldFunc set_sbit_strike_stub;
|
||||
TT_Load_Table_Func load_sbits_stub;
|
||||
|
||||
/*
|
||||
* The following two fields appeared in version 2.1.8, and were placed
|
||||
* between `load_sbits' and `load_sbit_image'. We support them as a
|
||||
* special exception since they are used by Xfont library within the
|
||||
* X.Org xserver, and because the probability that other rogue clients
|
||||
* use the other version 2.1.7 fields below is _extremely_ low.
|
||||
*
|
||||
* Note that this forces us to disable an interesting memory-saving
|
||||
* optimization though...
|
||||
*/
|
||||
|
||||
TT_Find_SBit_Image_Func find_sbit_image;
|
||||
TT_Load_SBit_Metrics_Func load_sbit_metrics;
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
TT_Free_Table_Func free_sbits;
|
||||
|
||||
/* see `ttkern.h' */
|
||||
TT_Face_GetKerningFunc get_kerning;
|
||||
|
||||
#endif
|
||||
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_Free_Table_Func free_sbits_stub;
|
||||
#endif
|
||||
|
||||
/* see `ttpost.h' */
|
||||
TT_Get_PS_Name_Func get_psname;
|
||||
TT_Free_Table_Func free_psnames;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_CharMap_Load_Func load_charmap_stub;
|
||||
TT_CharMap_Free_Func free_charmap_stub;
|
||||
#endif
|
||||
|
||||
/* starting here, the structure differs from version 2.1.7 */
|
||||
|
||||
/* this field was introduced in version 2.1.8, named `get_psname' */
|
||||
TT_Face_GetKerningFunc get_kerning;
|
||||
|
||||
/* new elements introduced after version 2.1.10 */
|
||||
|
||||
/* load the font directory, i.e., the offset table and */
|
||||
/* the table directory */
|
||||
TT_Load_Table_Func load_font_dir;
|
||||
TT_Load_Metrics_Func load_hmtx;
|
||||
|
||||
TT_Load_Table_Func load_eblc;
|
||||
TT_Free_Table_Func free_eblc;
|
||||
|
||||
TT_Set_SBit_Strike_Func set_sbit_strike;
|
||||
TT_Load_Strike_Metrics_Func load_strike_metrics;
|
||||
|
||||
TT_Get_Metrics_Func get_metrics;
|
||||
|
||||
} SFNT_Interface;
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* Basic Type1/Type2 type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -129,6 +129,51 @@ FT_BEGIN_HEADER
|
||||
} CID_SubrsRec, *CID_Subrs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** AFM FONT INFORMATION STRUCTURES ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct AFM_TrackKernRec_
|
||||
{
|
||||
FT_Int degree;
|
||||
FT_Fixed min_ptsize;
|
||||
FT_Fixed min_kern;
|
||||
FT_Fixed max_ptsize;
|
||||
FT_Fixed max_kern;
|
||||
|
||||
} AFM_TrackKernRec, *AFM_TrackKern;
|
||||
|
||||
typedef struct AFM_KernPairRec_
|
||||
{
|
||||
FT_Int index1;
|
||||
FT_Int index2;
|
||||
FT_Int x;
|
||||
FT_Int y;
|
||||
|
||||
} AFM_KernPairRec, *AFM_KernPair;
|
||||
|
||||
typedef struct AFM_FontInfoRec_
|
||||
{
|
||||
FT_Bool IsCIDFont;
|
||||
FT_BBox FontBBox;
|
||||
FT_Fixed Ascender;
|
||||
FT_Fixed Descender;
|
||||
AFM_TrackKern TrackKerns; /* free if non-NULL */
|
||||
FT_Int NumTrackKern;
|
||||
AFM_KernPair KernPairs; /* free if non-NULL */
|
||||
FT_Int NumKernPair;
|
||||
|
||||
} AFM_FontInfoRec, *AFM_FontInfo;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
@ -148,20 +193,23 @@ FT_BEGIN_HEADER
|
||||
|
||||
typedef struct T1_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
T1_FontRec type1;
|
||||
const void* psnames;
|
||||
const void* psaux;
|
||||
const void* afm_data;
|
||||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
PS_Unicodes unicode_map;
|
||||
FT_FaceRec root;
|
||||
T1_FontRec type1;
|
||||
const void* psnames;
|
||||
const void* psaux;
|
||||
const void* afm_data;
|
||||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
PS_Unicodes unicode_map;
|
||||
#endif
|
||||
|
||||
/* support for Multiple Masters fonts */
|
||||
PS_Blend blend;
|
||||
PS_Blend blend;
|
||||
|
||||
/* since FT 2.1 - interface to PostScript hinter */
|
||||
const void* pshinter;
|
||||
/* since version 2.1 - interface to PostScript hinter */
|
||||
const void* pshinter;
|
||||
|
||||
} T1_FaceRec;
|
||||
|
||||
@ -173,13 +221,15 @@ FT_BEGIN_HEADER
|
||||
void* psaux;
|
||||
CID_FaceInfoRec cid;
|
||||
void* afm_data;
|
||||
FT_Byte* binary_data; /* used if hex data has been converted */
|
||||
FT_Stream cid_stream;
|
||||
CID_Subrs subrs;
|
||||
|
||||
/* since FT 2.1 - interface to PostScript hinter */
|
||||
/* since version 2.1 - interface to PostScript hinter */
|
||||
void* pshinter;
|
||||
|
||||
/* since version 2.1.8, but was originally positioned after `afm_data' */
|
||||
FT_Byte* binary_data; /* used if hex data has been converted */
|
||||
FT_Stream cid_stream;
|
||||
|
||||
} CID_FaceRec;
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* Basic SFNT/TrueType type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005 by */
|
||||
/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -311,7 +311,7 @@ FT_BEGIN_HEADER
|
||||
} TT_GaspRec;
|
||||
|
||||
|
||||
#ifndef FT_OPTIMIZE_MEMORY
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
@ -389,7 +389,7 @@ FT_BEGIN_HEADER
|
||||
|
||||
} TT_Kern0_PairRec, *TT_Kern0_Pair;
|
||||
|
||||
#endif /* !OPTIMIZE_MEMORY */
|
||||
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -843,6 +843,72 @@ FT_BEGIN_HEADER
|
||||
typedef struct GX_BlendRec_ *GX_Blend;
|
||||
#endif
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* These types are used to support a `BDF ' table that isn't part of the
|
||||
* official TrueType specification. It is mainly used in SFNT-based
|
||||
* bitmap fonts that were generated from a set of BDF fonts.
|
||||
*
|
||||
* The format of the table is as follows.
|
||||
*
|
||||
* USHORT version `BDF ' table version number, should be 0x0001.
|
||||
* USHORT strikeCount Number of strikes (bitmap sizes) in this table.
|
||||
* ULONG stringTable Offset (froms start of BDF table) to string
|
||||
* table.
|
||||
*
|
||||
* This is followed by an array of `strikeCount' descriptors, having the
|
||||
* following format.
|
||||
*
|
||||
* USHORT ppem Vertical pixels per EM for this strike.
|
||||
* USHORT numItems Number of items for this strike (properties and
|
||||
* atoms). Maximum is 255.
|
||||
*
|
||||
* This array in turn is followed by `strikeCount' value sets. Each
|
||||
* `value set' is an array of `numItems' items with the following format.
|
||||
*
|
||||
* ULONG item_name Offset in string table to item name.
|
||||
* USHORT item_type The item type. Possible values are
|
||||
* 0 => string (e.g., COMMENT)
|
||||
* 1 => atom (e.g., FONT or even SIZE)
|
||||
* 2 => int32
|
||||
* 3 => uint32
|
||||
* 0x10 => A flag to indicate a properties. This
|
||||
* is ORed with the above values.
|
||||
* ULONG item_value For strings => Offset into string table without
|
||||
* the corresponding double quotes.
|
||||
* For atoms => Offset into string table.
|
||||
* For integers => Direct value.
|
||||
*
|
||||
* All strings in the string table consist of bytes and are
|
||||
* zero-terminated.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_BDF
|
||||
|
||||
typedef struct TT_BDFRec_
|
||||
{
|
||||
FT_Byte* table;
|
||||
FT_Byte* table_end;
|
||||
FT_Byte* strings;
|
||||
FT_UInt32 strings_size;
|
||||
FT_UInt num_strikes;
|
||||
FT_Bool loaded;
|
||||
|
||||
} TT_BDFRec, *TT_BDF;
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_BDF */
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
@ -1036,10 +1102,6 @@ FT_BEGIN_HEADER
|
||||
/* table. We thus define additional fields */
|
||||
/* below to hold the computed maxima. */
|
||||
/* */
|
||||
/* max_components :: The maximum number of glyph components */
|
||||
/* required to load any composite glyph from */
|
||||
/* this font. Used to size the load stack. */
|
||||
/* */
|
||||
/* vertical_info :: A boolean which is set when the font file */
|
||||
/* contains vertical metrics. If not, the */
|
||||
/* value of the `vertical' field is */
|
||||
@ -1205,20 +1267,14 @@ FT_BEGIN_HEADER
|
||||
|
||||
TT_Header header; /* TrueType header table */
|
||||
TT_HoriHeader horizontal; /* TrueType horizontal header */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* horz_metrics;
|
||||
FT_ULong horz_metrics_size;
|
||||
#endif
|
||||
|
||||
TT_MaxProfile max_profile;
|
||||
FT_ULong max_components;
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_ULong max_components; /* stubbed to 0 */
|
||||
#endif
|
||||
|
||||
FT_Bool vertical_info;
|
||||
TT_VertHeader vertical; /* TT Vertical header, if present */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* vert_metrics;
|
||||
FT_ULong vert_metrics_size;
|
||||
#endif
|
||||
|
||||
FT_UShort num_names; /* number of name records */
|
||||
TT_NameTableRec name_table; /* name table */
|
||||
@ -1226,7 +1282,7 @@ FT_BEGIN_HEADER
|
||||
TT_OS2 os2; /* TrueType OS/2 table */
|
||||
TT_Postscript postscript; /* TrueType Postscript table */
|
||||
|
||||
FT_Byte* cmap_table; /* extracted 'cmap' table */
|
||||
FT_Byte* cmap_table; /* extracted `cmap' table */
|
||||
FT_ULong cmap_size;
|
||||
|
||||
TT_Loader_GotoTableFunc goto_table;
|
||||
@ -1253,13 +1309,7 @@ FT_BEGIN_HEADER
|
||||
/***********************************************************************/
|
||||
|
||||
/* horizontal device metrics */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* hdmx_table;
|
||||
FT_ULong hdmx_table_size;
|
||||
FT_UInt hdmx_record_count;
|
||||
FT_ULong hdmx_record_size;
|
||||
FT_Byte* hdmx_record_sizes;
|
||||
#else
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
TT_HdmxRec hdmx;
|
||||
#endif
|
||||
|
||||
@ -1270,11 +1320,7 @@ FT_BEGIN_HEADER
|
||||
TT_PCLT pclt;
|
||||
|
||||
/* embedded bitmaps support */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* sbit_table;
|
||||
FT_ULong sbit_table_size;
|
||||
FT_UInt sbit_num_strikes;
|
||||
#else
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_ULong num_sbit_strikes;
|
||||
TT_SBit_Strike sbit_strikes;
|
||||
#endif
|
||||
@ -1293,16 +1339,11 @@ FT_BEGIN_HEADER
|
||||
/***********************************************************************/
|
||||
|
||||
/* the glyph locations */
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_UInt num_locations;
|
||||
FT_Byte* glyph_locations;
|
||||
#else
|
||||
FT_UShort num_locations;
|
||||
FT_Long* glyph_locations;
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
FT_UShort num_locations_stub;
|
||||
FT_Long* glyph_locations_stub;
|
||||
#endif
|
||||
|
||||
FT_ULong glyf_len;
|
||||
|
||||
/* the font program, if any */
|
||||
FT_ULong font_program_size;
|
||||
FT_Byte* font_program;
|
||||
@ -1315,13 +1356,7 @@ FT_BEGIN_HEADER
|
||||
FT_ULong cvt_size;
|
||||
FT_Short* cvt;
|
||||
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* kern_table;
|
||||
FT_ULong kern_table_size;
|
||||
FT_UInt num_kern_tables;
|
||||
FT_UInt32 kern_avail_bits;
|
||||
FT_UInt32 kern_order_bits;
|
||||
#else
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
/* the format 0 kerning table, if any */
|
||||
FT_Int num_kern_pairs;
|
||||
FT_Int kern_table_index;
|
||||
@ -1337,11 +1372,6 @@ FT_BEGIN_HEADER
|
||||
FT_Bool unpatented_hinting;
|
||||
#endif
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
FT_Bool doblend;
|
||||
GX_Blend blend;
|
||||
#endif
|
||||
|
||||
/***********************************************************************/
|
||||
/* */
|
||||
/* Other tables or fields. This is used by derivative formats like */
|
||||
@ -1353,6 +1383,49 @@ FT_BEGIN_HEADER
|
||||
|
||||
const char* postscript_name;
|
||||
|
||||
/* since version 2.1.8, but was originally placed after */
|
||||
/* `glyph_locations_stub' */
|
||||
FT_ULong glyf_len;
|
||||
|
||||
/* since version 2.1.8, but was originally placed before `extra' */
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
FT_Bool doblend;
|
||||
GX_Blend blend;
|
||||
#endif
|
||||
|
||||
/* since version 2.2 */
|
||||
|
||||
#ifdef FT_OPTIMIZE_MEMORY
|
||||
FT_Byte* horz_metrics;
|
||||
FT_ULong horz_metrics_size;
|
||||
|
||||
FT_Byte* vert_metrics;
|
||||
FT_ULong vert_metrics_size;
|
||||
|
||||
FT_UInt num_locations;
|
||||
FT_Byte* glyph_locations;
|
||||
|
||||
FT_Byte* hdmx_table;
|
||||
FT_ULong hdmx_table_size;
|
||||
FT_UInt hdmx_record_count;
|
||||
FT_ULong hdmx_record_size;
|
||||
FT_Byte* hdmx_record_sizes;
|
||||
|
||||
FT_Byte* sbit_table;
|
||||
FT_ULong sbit_table_size;
|
||||
FT_UInt sbit_num_strikes;
|
||||
|
||||
FT_Byte* kern_table;
|
||||
FT_ULong kern_table_size;
|
||||
FT_UInt num_kern_tables;
|
||||
FT_UInt32 kern_avail_bits;
|
||||
FT_UInt32 kern_order_bits;
|
||||
#endif
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_BDF
|
||||
TT_BDFRec bdf;
|
||||
#endif /* TT_CONFIG_OPTION_BDF */
|
||||
|
||||
} TT_FaceRec;
|
||||
|
||||
|
||||
@ -1423,15 +1496,11 @@ FT_BEGIN_HEADER
|
||||
FT_BBox bbox;
|
||||
FT_Int left_bearing;
|
||||
FT_Int advance;
|
||||
FT_Int top_bearing;
|
||||
FT_Int vadvance;
|
||||
FT_Int linear;
|
||||
FT_Bool linear_def;
|
||||
FT_Bool preserve_pps;
|
||||
FT_Vector pp1;
|
||||
FT_Vector pp2;
|
||||
FT_Vector pp3;
|
||||
FT_Vector pp4;
|
||||
|
||||
FT_ULong glyf_offset;
|
||||
|
||||
@ -1446,6 +1515,12 @@ FT_BEGIN_HEADER
|
||||
/* for possible extensibility in other formats */
|
||||
void* other;
|
||||
|
||||
/* since version 2.1.8 */
|
||||
FT_Int top_bearing;
|
||||
FT_Int vadvance;
|
||||
FT_Vector pp3;
|
||||
FT_Vector pp4;
|
||||
|
||||
} TT_LoaderRec;
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ FT_BEGIN_HEADER
|
||||
/* <Description> */
|
||||
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
|
||||
/* that for Multiple Master fonts, each instance has its own */
|
||||
/* FontInfo. */
|
||||
/* FontInfo dictionary. */
|
||||
/* */
|
||||
typedef struct PS_FontInfoRec
|
||||
{
|
||||
@ -193,6 +193,8 @@ FT_BEGIN_HEADER
|
||||
|
||||
} T1_Blend_Flags;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*# backwards compatible definitions */
|
||||
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
|
||||
@ -286,6 +288,14 @@ FT_BEGIN_HEADER
|
||||
typedef CID_FaceDictRec CID_FontDict;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* CID_FaceInfoRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to represent CID Face information. */
|
||||
/* */
|
||||
typedef struct CID_FaceInfoRec_
|
||||
{
|
||||
FT_String* cid_font_name;
|
||||
@ -322,7 +332,7 @@ FT_BEGIN_HEADER
|
||||
/* CID_Info */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This type is equivalent to CID_FaceInfoRec. It is deprecated but */
|
||||
/* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
|
||||
/* kept to maintain source compatibility between various versions of */
|
||||
/* FreeType. */
|
||||
/* */
|
||||
@ -381,7 +391,7 @@ FT_BEGIN_HEADER
|
||||
* the face and don't need to be freed by the caller.
|
||||
*
|
||||
* If the font's format is not Postscript-based, this function will
|
||||
* return the FT_Err_Invalid_Argument error code.
|
||||
* return the `FT_Err_Invalid_Argument' error code.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_PS_Font_Info( FT_Face face,
|
||||
@ -413,7 +423,7 @@ FT_BEGIN_HEADER
|
||||
* the face and don't need to be freed by the caller.
|
||||
*
|
||||
* If the font's format is not Postscript-based, this function will
|
||||
* return the FT_Err_Invalid_Argument error code.
|
||||
* return the `FT_Err_Invalid_Argument' error code.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_PS_Font_Private( FT_Face face,
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* TrueType name ID definitions (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2002, 2003, 2004, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -65,7 +65,7 @@ FT_BEGIN_HEADER
|
||||
* Used by Microsoft to indicate Windows-specific charmaps. See
|
||||
* @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.
|
||||
* Note that most fonts contain a Unicode charmap using
|
||||
* (@TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
|
||||
* (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).
|
||||
*
|
||||
* TT_PLATFORM_CUSTOM ::
|
||||
* Used to indicate application-specific charmaps.
|
||||
@ -96,14 +96,18 @@ FT_BEGIN_HEADER
|
||||
* @values:
|
||||
* TT_APPLE_ID_DEFAULT ::
|
||||
* Unicode version 1.0.
|
||||
*
|
||||
* TT_APPLE_ID_UNICODE_1_1 ::
|
||||
* Unicode 1.1; specifies Hangul characters starting at U+34xx.
|
||||
*
|
||||
* TT_APPLE_ID_ISO_10646 ::
|
||||
* Deprecated (identical to preceding.)
|
||||
* Deprecated (identical to preceding).
|
||||
*
|
||||
* TT_APPLE_ID_UNICODE_2_0 ::
|
||||
* Unicode 2.0 and beyond (UTF-16 BMP only.)
|
||||
* Unicode 2.0 and beyond (UTF-16 BMP only).
|
||||
*
|
||||
* TT_APPLE_ID_UNICODE_32 ::
|
||||
* Unicode 3.1 and beyond, using UTF-32
|
||||
* Unicode 3.1 and beyond, using UTF-32.
|
||||
*/
|
||||
|
||||
#define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */
|
||||
@ -491,7 +495,7 @@ FT_BEGIN_HEADER
|
||||
#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG
|
||||
#endif
|
||||
|
||||
#if 0 /* used only with .NET "cultures"; commented out */
|
||||
#if 0 /* used only with .NET `cultures'; commented out */
|
||||
#define TT_MS_LANGID_CHINESE_TRADITIONAL 0x7C04
|
||||
#endif
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* Basic SFNT/TrueType tables definitions and interface */
|
||||
/* (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -407,9 +407,9 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType Postscript table. All fields */
|
||||
/* comply to the TrueType table. This structure does not reference */
|
||||
/* the Postscript glyph names, which can be nevertheless accessed */
|
||||
/* with the `ttpost' module. */
|
||||
/* comply to the TrueType specification. This structure does not */
|
||||
/* reference the Postscript glyph names, which can be nevertheless */
|
||||
/* accessed with the `ttpost' module. */
|
||||
/* */
|
||||
typedef struct TT_Postscript_
|
||||
{
|
||||
@ -436,7 +436,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType PCLT table. All fields */
|
||||
/* comply to the TrueType table. */
|
||||
/* comply to the TrueType specification. */
|
||||
/* */
|
||||
typedef struct TT_PCLT_
|
||||
{
|
||||
@ -594,8 +594,8 @@ FT_BEGIN_HEADER
|
||||
/* The table is owned by the face object and disappears with it. */
|
||||
/* */
|
||||
/* This function is only useful to access SFNT tables that are loaded */
|
||||
/* by the sfnt/truetype/opentype drivers. See @FT_Sfnt_Tag for a */
|
||||
/* list. */
|
||||
/* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
|
||||
/* a list. */
|
||||
/* */
|
||||
FT_EXPORT( void* )
|
||||
FT_Get_Sfnt_Table( FT_Face face,
|
||||
@ -604,56 +604,61 @@ FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* <Function>
|
||||
* FT_Load_Sfnt_Table
|
||||
* @function:
|
||||
* FT_Load_Sfnt_Table
|
||||
*
|
||||
* <Description>
|
||||
* @description:
|
||||
* Loads any font table into client memory.
|
||||
*
|
||||
* <Input>
|
||||
* face :: A handle to the source face.
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the source face.
|
||||
*
|
||||
* tag :: The 4-byte tag of the table to load. Use the value 0 if
|
||||
* you want to access the whole font file. Otherwise, you can
|
||||
* use one of the definitions found in the @FT_TRUETYPE_TAGS_H
|
||||
* file, or forge a new one with @FT_MAKE_TAG.
|
||||
* tag ::
|
||||
* The four-byte tag of the table to load. Use the value 0 if you want
|
||||
* to access the whole font file. Otherwise, you can use one of the
|
||||
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
|
||||
* one with @FT_MAKE_TAG.
|
||||
*
|
||||
* offset :: The starting offset in the table (or file if tag == 0).
|
||||
* offset ::
|
||||
* The starting offset in the table (or file if tag == 0).
|
||||
*
|
||||
* <Output>
|
||||
* buffer :: The target buffer address. The client must ensure that
|
||||
* the memory array is big enough to hold the data.
|
||||
* @output:
|
||||
* buffer ::
|
||||
* The target buffer address. The client must ensure that the memory
|
||||
* array is big enough to hold the data.
|
||||
*
|
||||
* <InOut>
|
||||
* length :: If the `length' parameter is NULL, then try to load the whole
|
||||
* table. Return an error code if it fails.
|
||||
* @inout:
|
||||
* length ::
|
||||
* If the `length' parameter is NULL, then try to load the whole table.
|
||||
* Return an error code if it fails.
|
||||
*
|
||||
* Else, if `*length' is 0, exit immediately while returning
|
||||
* the table's (or file) full size in it.
|
||||
* Else, if `*length' is 0, exit immediately while returning the
|
||||
* table's (or file) full size in it.
|
||||
*
|
||||
* Else the number of bytes to read from the table or file,
|
||||
* from the starting offset.
|
||||
* Else the number of bytes to read from the table or file, from the
|
||||
* starting offset.
|
||||
*
|
||||
* <Return>
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* <Note>
|
||||
* @note:
|
||||
* If you need to determine the table's length you should first call this
|
||||
* function with `*length' set to 0, as in the following example:
|
||||
*
|
||||
* {
|
||||
* FT_ULong length = 0;
|
||||
* {
|
||||
* FT_ULong length = 0;
|
||||
*
|
||||
*
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
|
||||
* if ( error ) { ... table does not exist ... }
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
|
||||
* if ( error ) { ... table does not exist ... }
|
||||
*
|
||||
* buffer = malloc( length );
|
||||
* if ( buffer == NULL ) { ... not enough memory ... }
|
||||
* buffer = malloc( length );
|
||||
* if ( buffer == NULL ) { ... not enough memory ... }
|
||||
*
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
|
||||
* if ( error ) { ... could not load table ... }
|
||||
* }
|
||||
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
|
||||
* if ( error ) { ... could not load table ... }
|
||||
* }
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Load_Sfnt_Table( FT_Face face,
|
||||
@ -665,13 +670,13 @@ FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* <Function>
|
||||
* FT_Sfnt_Table_Info
|
||||
* @function:
|
||||
* FT_Sfnt_Table_Info
|
||||
*
|
||||
* <Description>
|
||||
* @description:
|
||||
* Returns information on an SFNT table.
|
||||
*
|
||||
* <Input>
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the source face.
|
||||
*
|
||||
@ -679,17 +684,17 @@ FT_BEGIN_HEADER
|
||||
* The index of an SFNT table. The function returns
|
||||
* FT_Err_Table_Missing for an invalid value.
|
||||
*
|
||||
* <Output>
|
||||
* @output:
|
||||
* tag ::
|
||||
* The name tag of the SFNT table.
|
||||
*
|
||||
* length ::
|
||||
* The length of the SFNT table.
|
||||
*
|
||||
* <Return>
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* <Note>
|
||||
* @note:
|
||||
* SFNT tables with length zero are treated as missing by Windows.
|
||||
*
|
||||
*/
|
||||
@ -707,7 +712,7 @@ FT_BEGIN_HEADER
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return TrueType/sfnt specific cmap language ID. Definitions of */
|
||||
/* language ID values are in freetype/ttnameid.h. */
|
||||
/* language ID values are in `freetype/ttnameid.h'. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* charmap :: */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Tags for TrueType and OpenType tables (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2004 by */
|
||||
/* Copyright 1996-2001, 2004, 2005 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -36,8 +36,10 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
|
||||
#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
|
||||
#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
|
||||
#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
|
||||
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
|
||||
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
|
||||
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
|
||||
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
|
||||
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
|
||||
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
|
||||
@ -46,6 +48,7 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
|
||||
#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
|
||||
#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
|
||||
#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
|
||||
#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
|
||||
#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
|
||||
#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
|
||||
@ -59,18 +62,27 @@ FT_BEGIN_HEADER
|
||||
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
|
||||
#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
|
||||
#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
|
||||
#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' )
|
||||
#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
|
||||
#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
|
||||
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
|
||||
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
|
||||
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
|
||||
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
|
||||
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
|
||||
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
|
||||
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
|
||||
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
|
||||
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
|
||||
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
|
||||
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
|
||||
#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
|
||||
#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
|
||||
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
|
||||
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
|
||||
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
|
||||
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
|
||||
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
|
||||
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
|
||||
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
|
||||
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Definitions for the unpatented TrueType hinting system */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* Copyright 2003, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* Written by Graham Asher <graham.asher@btinternet.com> */
|
||||
@ -43,7 +43,7 @@ FT_BEGIN_HEADER
|
||||
* @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.
|
||||
* interpreter for a typeface opened by @FT_Open_Face.
|
||||
*
|
||||
*/
|
||||
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
|
||||
|
@ -5,7 +5,7 @@
|
||||
/* FreeType 2 build and setup macros. */
|
||||
/* (Generic version) */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file corresponds to the default "ft2build.h" file for */
|
||||
/* FreeType 2. It uses the "freetype" include root. */
|
||||
/* This file corresponds to the default `ft2build.h' file for */
|
||||
/* FreeType 2. It uses the `freetype' include root. */
|
||||
/* */
|
||||
/* Note that specific platforms might use a different configuration. */
|
||||
/* See builds/unix/ft2unix.h for an example. */
|
||||
|
@ -1,5 +1,13 @@
|
||||
# FreeType 2 src Jamfile (c) 2001, 2002 David Turner
|
||||
# FreeType 2 src Jamfile
|
||||
#
|
||||
# Copyright 2001, 2002 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.
|
||||
|
||||
SubDir HAIKU_TOP src libs freetype2 ;
|
||||
|
||||
|
@ -1,5 +1,13 @@
|
||||
# FreeType 2 src/autofit Jamfile (c) 2001 David Turner
|
||||
# FreeType 2 src/autofit Jamfile
|
||||
#
|
||||
# Copyright 2003, 2004, 2005, 2006 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.
|
||||
|
||||
SubDir HAIKU_TOP src libs freetype2 autofit ;
|
||||
|
||||
@ -13,7 +21,7 @@ UseFreeTypeHeaders ;
|
||||
|
||||
if $(FT2_MULTI)
|
||||
{
|
||||
_sources = afangles afglobal afhints aflatin afloader afmodule afdummy ;
|
||||
_sources = afangles afglobal afhints aflatin afloader afmodule afdummy afwarp ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -24,4 +32,3 @@ UseFreeTypeHeaders ;
|
||||
}
|
||||
|
||||
# end of src/autofit Jamfile
|
||||
|
||||
|
@ -20,6 +20,112 @@
|
||||
#include "aftypes.h"
|
||||
|
||||
|
||||
#if 1
|
||||
|
||||
/* the following table has been automatically generated with */
|
||||
/* the `mather.py' Python script */
|
||||
|
||||
#define AF_ATAN_BITS 8
|
||||
|
||||
static const FT_Byte af_arctan[1L << AF_ATAN_BITS] =
|
||||
{
|
||||
0, 0, 1, 1, 1, 2, 2, 2,
|
||||
3, 3, 3, 3, 4, 4, 4, 5,
|
||||
5, 5, 6, 6, 6, 7, 7, 7,
|
||||
8, 8, 8, 9, 9, 9, 10, 10,
|
||||
10, 10, 11, 11, 11, 12, 12, 12,
|
||||
13, 13, 13, 14, 14, 14, 14, 15,
|
||||
15, 15, 16, 16, 16, 17, 17, 17,
|
||||
18, 18, 18, 18, 19, 19, 19, 20,
|
||||
20, 20, 21, 21, 21, 21, 22, 22,
|
||||
22, 23, 23, 23, 24, 24, 24, 24,
|
||||
25, 25, 25, 26, 26, 26, 26, 27,
|
||||
27, 27, 28, 28, 28, 28, 29, 29,
|
||||
29, 30, 30, 30, 30, 31, 31, 31,
|
||||
31, 32, 32, 32, 33, 33, 33, 33,
|
||||
34, 34, 34, 34, 35, 35, 35, 35,
|
||||
36, 36, 36, 36, 37, 37, 37, 38,
|
||||
38, 38, 38, 39, 39, 39, 39, 40,
|
||||
40, 40, 40, 41, 41, 41, 41, 42,
|
||||
42, 42, 42, 42, 43, 43, 43, 43,
|
||||
44, 44, 44, 44, 45, 45, 45, 45,
|
||||
46, 46, 46, 46, 46, 47, 47, 47,
|
||||
47, 48, 48, 48, 48, 48, 49, 49,
|
||||
49, 49, 50, 50, 50, 50, 50, 51,
|
||||
51, 51, 51, 51, 52, 52, 52, 52,
|
||||
52, 53, 53, 53, 53, 53, 54, 54,
|
||||
54, 54, 54, 55, 55, 55, 55, 55,
|
||||
56, 56, 56, 56, 56, 57, 57, 57,
|
||||
57, 57, 57, 58, 58, 58, 58, 58,
|
||||
59, 59, 59, 59, 59, 59, 60, 60,
|
||||
60, 60, 60, 61, 61, 61, 61, 61,
|
||||
61, 62, 62, 62, 62, 62, 62, 63,
|
||||
63, 63, 63, 63, 63, 64, 64, 64
|
||||
};
|
||||
|
||||
|
||||
FT_LOCAL_DEF( AF_Angle )
|
||||
af_angle_atan( FT_Fixed dx,
|
||||
FT_Fixed dy )
|
||||
{
|
||||
AF_Angle angle;
|
||||
|
||||
|
||||
/* check trivial cases */
|
||||
if ( dy == 0 )
|
||||
{
|
||||
angle = 0;
|
||||
if ( dx < 0 )
|
||||
angle = AF_ANGLE_PI;
|
||||
return angle;
|
||||
}
|
||||
else if ( dx == 0 )
|
||||
{
|
||||
angle = AF_ANGLE_PI2;
|
||||
if ( dy < 0 )
|
||||
angle = -AF_ANGLE_PI2;
|
||||
return angle;
|
||||
}
|
||||
|
||||
angle = 0;
|
||||
if ( dx < 0 )
|
||||
{
|
||||
dx = -dx;
|
||||
dy = -dy;
|
||||
angle = AF_ANGLE_PI;
|
||||
}
|
||||
|
||||
if ( dy < 0 )
|
||||
{
|
||||
FT_Pos tmp;
|
||||
|
||||
|
||||
tmp = dx;
|
||||
dx = -dy;
|
||||
dy = tmp;
|
||||
angle -= AF_ANGLE_PI2;
|
||||
}
|
||||
|
||||
if ( dx == 0 && dy == 0 )
|
||||
return 0;
|
||||
|
||||
if ( dx == dy )
|
||||
angle += AF_ANGLE_PI4;
|
||||
else if ( dx > dy )
|
||||
angle += af_arctan[FT_DivFix( dy, dx ) >> ( 16 - AF_ATAN_BITS )];
|
||||
else
|
||||
angle += AF_ANGLE_PI2 -
|
||||
af_arctan[FT_DivFix( dx, dy ) >> ( 16 - AF_ATAN_BITS )];
|
||||
|
||||
if ( angle > AF_ANGLE_PI )
|
||||
angle -= AF_ANGLE_2PI;
|
||||
|
||||
return angle;
|
||||
}
|
||||
|
||||
|
||||
#else /* 0 */
|
||||
|
||||
/*
|
||||
* a python script used to generate the following table
|
||||
*
|
||||
@ -234,6 +340,8 @@ for n in r:
|
||||
return delta;
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
FT_LOCAL_DEF( void )
|
||||
af_sort_pos( FT_UInt count,
|
||||
|
1508
src/libs/freetype2/autofit/afcjk.c
Normal file
1508
src/libs/freetype2/autofit/afcjk.c
Normal file
File diff suppressed because it is too large
Load Diff
41
src/libs/freetype2/autofit/afcjk.h
Normal file
41
src/libs/freetype2/autofit/afcjk.h
Normal file
@ -0,0 +1,41 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afcjk.h */
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for CJK script (specification). */
|
||||
/* */
|
||||
/* Copyright 2006 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 __AFCJK_H__
|
||||
#define __AFCJK_H__
|
||||
|
||||
#include "afhints.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* the CJK-specific script class */
|
||||
|
||||
FT_CALLBACK_TABLE const AF_ScriptClassRec
|
||||
af_cjk_script_class;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AFCJK_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter routines to compute global hinting values (body). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -19,6 +19,7 @@
|
||||
#include "afglobal.h"
|
||||
#include "afdummy.h"
|
||||
#include "aflatin.h"
|
||||
#include "afcjk.h"
|
||||
#include "aferrors.h"
|
||||
|
||||
|
||||
@ -27,6 +28,7 @@
|
||||
{
|
||||
&af_dummy_script_class,
|
||||
&af_latin_script_class,
|
||||
&af_cjk_script_class,
|
||||
|
||||
NULL /* do not remove */
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter hinting routines (body). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -265,11 +265,61 @@
|
||||
#endif /* AF_DEBUG */
|
||||
|
||||
|
||||
|
||||
/* compute the direction value of a given vector */
|
||||
FT_LOCAL_DEF( AF_Direction )
|
||||
af_direction_compute( FT_Pos dx,
|
||||
FT_Pos dy )
|
||||
{
|
||||
#if 1
|
||||
AF_Direction dir = AF_DIR_NONE;
|
||||
|
||||
|
||||
/* atan(1/12) == 4.7 degrees */
|
||||
|
||||
if ( dx < 0 )
|
||||
{
|
||||
if ( dy < 0 )
|
||||
{
|
||||
if ( -dx * 12 < -dy )
|
||||
dir = AF_DIR_DOWN;
|
||||
|
||||
else if ( -dy * 12 < -dx )
|
||||
dir = AF_DIR_LEFT;
|
||||
}
|
||||
else /* dy >= 0 */
|
||||
{
|
||||
if ( -dx * 12 < dy )
|
||||
dir = AF_DIR_UP;
|
||||
|
||||
else if ( dy * 12 < -dx )
|
||||
dir = AF_DIR_LEFT;
|
||||
}
|
||||
}
|
||||
else /* dx >= 0 */
|
||||
{
|
||||
if ( dy < 0 )
|
||||
{
|
||||
if ( dx * 12 < -dy )
|
||||
dir = AF_DIR_DOWN;
|
||||
|
||||
else if ( -dy * 12 < dx )
|
||||
dir = AF_DIR_RIGHT;
|
||||
}
|
||||
else /* dy >= 0 */
|
||||
{
|
||||
if ( dx * 12 < dy )
|
||||
dir = AF_DIR_UP;
|
||||
|
||||
else if ( dy * 12 < dx )
|
||||
dir = AF_DIR_RIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
return dir;
|
||||
|
||||
#else /* 0 */
|
||||
|
||||
AF_Direction dir;
|
||||
FT_Pos ax = FT_ABS( dx );
|
||||
FT_Pos ay = FT_ABS( dy );
|
||||
@ -291,6 +341,9 @@
|
||||
}
|
||||
|
||||
return dir;
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -349,8 +402,9 @@
|
||||
|
||||
} while ( angle_in == angle_seg );
|
||||
|
||||
first = start;
|
||||
diff_in = af_angle_diff( angle_in, angle_seg );
|
||||
first = start;
|
||||
|
||||
AF_ANGLE_DIFF( diff_in, angle_in, angle_seg );
|
||||
|
||||
/* now, process all segments in the contour */
|
||||
do
|
||||
@ -373,7 +427,7 @@
|
||||
|
||||
} while ( angle_out == angle_seg );
|
||||
|
||||
diff_out = af_angle_diff( angle_seg, angle_out );
|
||||
AF_ANGLE_DIFF( diff_out, angle_seg, angle_out );
|
||||
|
||||
if ( ( diff_in ^ diff_out ) < 0 )
|
||||
{
|
||||
@ -455,7 +509,8 @@
|
||||
af_glyph_hints_rescale( AF_GlyphHints hints,
|
||||
AF_ScriptMetrics metrics )
|
||||
{
|
||||
hints->metrics = metrics;
|
||||
hints->metrics = metrics;
|
||||
hints->scaler_flags = metrics->scaler.flags;
|
||||
}
|
||||
|
||||
|
||||
@ -466,7 +521,6 @@
|
||||
FT_Error error = AF_Err_Ok;
|
||||
AF_Point points;
|
||||
FT_UInt old_max, new_max;
|
||||
AF_Scaler scaler = &hints->metrics->scaler;
|
||||
FT_Fixed x_scale = hints->x_scale;
|
||||
FT_Fixed y_scale = hints->y_scale;
|
||||
FT_Pos x_delta = hints->x_delta;
|
||||
@ -474,7 +528,6 @@
|
||||
FT_Memory memory = hints->memory;
|
||||
|
||||
|
||||
hints->scaler_flags = scaler->flags;
|
||||
hints->num_points = 0;
|
||||
hints->num_contours = 0;
|
||||
|
||||
@ -657,7 +710,8 @@
|
||||
|
||||
angle_in = af_angle_atan( in_x, in_y );
|
||||
angle_out = af_angle_atan( out_x, out_y );
|
||||
delta = af_angle_diff( angle_in, angle_out );
|
||||
|
||||
AF_ANGLE_DIFF( delta, angle_in, angle_out );
|
||||
|
||||
if ( delta < 2 && delta > -2 )
|
||||
goto Is_Weak_Point;
|
||||
@ -1087,4 +1141,31 @@
|
||||
}
|
||||
|
||||
|
||||
#ifdef AF_USE_WARPER
|
||||
|
||||
FT_LOCAL_DEF( void )
|
||||
af_glyph_hints_scale_dim( AF_GlyphHints hints,
|
||||
AF_Dimension dim,
|
||||
FT_Fixed scale,
|
||||
FT_Pos delta )
|
||||
{
|
||||
AF_Point points = hints->points;
|
||||
AF_Point points_limit = points + hints->num_points;
|
||||
AF_Point point;
|
||||
|
||||
|
||||
if ( dim == AF_DIMENSION_HORZ )
|
||||
{
|
||||
for ( point = points; point < points_limit; point++ )
|
||||
point->x = FT_MulFix( point->fx, scale ) + delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( point = points; point < points_limit; point++ )
|
||||
point->y = FT_MulFix( point->fy, scale ) + delta;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* AF_USE_WARPER */
|
||||
|
||||
/* END */
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter hinting routines (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -133,6 +133,7 @@ FT_BEGIN_HEADER
|
||||
AF_Segment serif; /* primary segment for serifs */
|
||||
FT_Pos num_linked; /* number of linked segments */
|
||||
FT_Pos score; /* used during stem matching */
|
||||
FT_Pos len; /* used during stem matching */
|
||||
|
||||
AF_Point first; /* first point in edge segment */
|
||||
AF_Point last; /* last point in edge segment */
|
||||
@ -272,11 +273,25 @@ FT_BEGIN_HEADER
|
||||
af_glyph_hints_align_weak_points( AF_GlyphHints hints,
|
||||
AF_Dimension dim );
|
||||
|
||||
#ifdef AF_USE_WARPER
|
||||
FT_LOCAL( void )
|
||||
af_glyph_hints_scale_dim( AF_GlyphHints hints,
|
||||
AF_Dimension dim,
|
||||
FT_Fixed scale,
|
||||
FT_Pos delta );
|
||||
#endif
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_glyph_hints_done( AF_GlyphHints hints );
|
||||
|
||||
/* */
|
||||
|
||||
#define AF_SEGMENT_LEN( seg ) ( (seg)->max_coord - (seg)->min_coord )
|
||||
|
||||
#define AF_SEGMENT_DIST( seg1, seg2 ) ( ( (seg1)->pos > (seg2)->pos ) \
|
||||
? (seg1)->pos - (seg2)->pos \
|
||||
: (seg2)->pos - (seg1)->pos )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for latin script (body). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -20,6 +20,11 @@
|
||||
#include "aferrors.h"
|
||||
|
||||
|
||||
#ifdef AF_USE_WARPER
|
||||
#include "afwarp.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
@ -28,9 +33,10 @@
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
static void
|
||||
FT_LOCAL_DEF( void )
|
||||
af_latin_metrics_init_widths( AF_LatinMetrics metrics,
|
||||
FT_Face face )
|
||||
FT_Face face,
|
||||
FT_ULong charcode )
|
||||
{
|
||||
/* scan the array of segments in each direction */
|
||||
AF_GlyphHintsRec hints[1];
|
||||
@ -41,16 +47,15 @@
|
||||
metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
|
||||
metrics->axis[AF_DIMENSION_VERT].width_count = 0;
|
||||
|
||||
/* For now, compute the standard width and height from the `o'. */
|
||||
{
|
||||
FT_Error error;
|
||||
FT_UInt glyph_index;
|
||||
int dim;
|
||||
AF_ScriptMetricsRec dummy[1];
|
||||
AF_Scaler scaler = &dummy->scaler;
|
||||
AF_LatinMetricsRec dummy[1];
|
||||
AF_Scaler scaler = &dummy->root.scaler;
|
||||
|
||||
|
||||
glyph_index = FT_Get_Char_Index( face, 'o' );
|
||||
glyph_index = FT_Get_Char_Index( face, charcode );
|
||||
if ( glyph_index == 0 )
|
||||
goto Exit;
|
||||
|
||||
@ -60,13 +65,14 @@
|
||||
|
||||
FT_ZERO( dummy );
|
||||
|
||||
dummy->units_per_em = metrics->units_per_em;
|
||||
scaler->x_scale = scaler->y_scale = 0x10000L;
|
||||
scaler->x_delta = scaler->y_delta = 0;
|
||||
scaler->face = face;
|
||||
scaler->render_mode = FT_RENDER_MODE_NORMAL;
|
||||
scaler->flags = 0;
|
||||
|
||||
af_glyph_hints_rescale( hints, dummy );
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
|
||||
|
||||
error = af_glyph_hints_reload( hints, &face->glyph->outline );
|
||||
if ( error )
|
||||
@ -77,9 +83,7 @@
|
||||
AF_LatinAxis axis = &metrics->axis[dim];
|
||||
AF_AxisHints axhints = &hints->axis[dim];
|
||||
AF_Segment seg, limit, link;
|
||||
|
||||
FT_UInt num_widths = 0;
|
||||
FT_Pos edge_distance_threshold = 32000;
|
||||
FT_UInt num_widths = 0;
|
||||
|
||||
|
||||
error = af_latin_hints_compute_segments( hints,
|
||||
@ -114,22 +118,24 @@
|
||||
|
||||
af_sort_widths( num_widths, axis->widths );
|
||||
axis->width_count = num_widths;
|
||||
}
|
||||
|
||||
/* we will now try to find the smallest width */
|
||||
if ( num_widths > 0 && axis->widths[0].org < edge_distance_threshold )
|
||||
edge_distance_threshold = axis->widths[0].org;
|
||||
Exit:
|
||||
for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
|
||||
{
|
||||
AF_LatinAxis axis = &metrics->axis[dim];
|
||||
FT_Pos stdw;
|
||||
|
||||
/* Now, compute the edge distance threshold as a fraction of the */
|
||||
/* smallest width in the font. Set it in `hinter->glyph' too! */
|
||||
if ( edge_distance_threshold == 32000 )
|
||||
edge_distance_threshold = 50;
|
||||
|
||||
/* let's try 20% */
|
||||
axis->edge_distance_threshold = edge_distance_threshold / 5;
|
||||
stdw = ( axis->width_count > 0 )
|
||||
? axis->widths[0].org
|
||||
: AF_LATIN_CONSTANT( metrics, 50 );
|
||||
|
||||
/* let's try 20% of the smallest width */
|
||||
axis->edge_distance_threshold = stdw / 5;
|
||||
}
|
||||
}
|
||||
|
||||
Exit:
|
||||
af_glyph_hints_done( hints );
|
||||
}
|
||||
|
||||
@ -404,7 +410,8 @@
|
||||
|
||||
if ( !error )
|
||||
{
|
||||
af_latin_metrics_init_widths( metrics, face );
|
||||
/* For now, compute the standard width and height from the `o'. */
|
||||
af_latin_metrics_init_widths( metrics, face, 'o' );
|
||||
af_latin_metrics_init_blues( metrics, face );
|
||||
}
|
||||
|
||||
@ -559,6 +566,9 @@
|
||||
af_latin_metrics_scale( AF_LatinMetrics metrics,
|
||||
AF_Scaler scaler )
|
||||
{
|
||||
metrics->root.scaler.render_mode = scaler->render_mode;
|
||||
metrics->root.scaler.face = scaler->face;
|
||||
|
||||
af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
|
||||
af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
|
||||
}
|
||||
@ -739,6 +749,7 @@
|
||||
segment->last = point;
|
||||
segment->contour = contour;
|
||||
segment->score = 32000;
|
||||
segment->len = 0;
|
||||
segment->link = NULL;
|
||||
on_edge = 1;
|
||||
|
||||
@ -805,6 +816,7 @@
|
||||
segment->last = min_point;
|
||||
segment->pos = min_pos;
|
||||
segment->score = 32000;
|
||||
segment->len = 0;
|
||||
segment->link = NULL;
|
||||
|
||||
segment = NULL;
|
||||
@ -824,6 +836,7 @@
|
||||
segment->last = max_point;
|
||||
segment->pos = max_pos;
|
||||
segment->score = 32000;
|
||||
segment->len = 0;
|
||||
segment->link = NULL;
|
||||
|
||||
segment = NULL;
|
||||
@ -844,9 +857,16 @@
|
||||
AF_Segment segments = axis->segments;
|
||||
AF_Segment segment_limit = segments + axis->num_segments;
|
||||
AF_Direction major_dir = axis->major_dir;
|
||||
FT_Pos len_threshold, len_score;
|
||||
AF_Segment seg1, seg2;
|
||||
|
||||
|
||||
|
||||
len_threshold = AF_LATIN_CONSTANT( hints->metrics, 8 );
|
||||
if ( len_threshold == 0 )
|
||||
len_threshold = 1;
|
||||
|
||||
len_score = AF_LATIN_CONSTANT( hints->metrics, 3000 );
|
||||
|
||||
/* now compare each segment to the others */
|
||||
for ( seg1 = segments; seg1 < segment_limit; seg1++ )
|
||||
{
|
||||
@ -879,9 +899,9 @@
|
||||
max = seg2->max_coord;
|
||||
|
||||
len = max - min;
|
||||
if ( len >= 8 )
|
||||
if ( len >= len_threshold )
|
||||
{
|
||||
score = dist + 3000 / len;
|
||||
score = dist + len_score / len;
|
||||
|
||||
if ( score < seg1->score )
|
||||
{
|
||||
@ -1292,6 +1312,8 @@
|
||||
AF_LatinMetrics metrics )
|
||||
{
|
||||
FT_Render_Mode mode;
|
||||
FT_UInt32 scaler_flags, other_flags;
|
||||
FT_Face face = metrics->root.scaler.face;
|
||||
|
||||
|
||||
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
|
||||
@ -1305,32 +1327,52 @@
|
||||
hints->y_scale = metrics->axis[AF_DIMENSION_VERT].scale;
|
||||
hints->y_delta = metrics->axis[AF_DIMENSION_VERT].delta;
|
||||
|
||||
/* compute flags depending on render mode, etc... */
|
||||
|
||||
/* compute flags depending on render mode, etc. */
|
||||
mode = metrics->root.scaler.render_mode;
|
||||
|
||||
#ifdef AF_USE_WARPER
|
||||
if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
|
||||
{
|
||||
metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
scaler_flags = hints->scaler_flags;
|
||||
other_flags = 0;
|
||||
|
||||
/*
|
||||
* We snap the width of vertical stems for the monochrome and
|
||||
* horizontal LCD rendering targets only.
|
||||
*/
|
||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
|
||||
hints->other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
||||
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
|
||||
|
||||
/*
|
||||
* We snap the width of horizontal stems for the monochrome and
|
||||
* vertical LCD rendering targets only.
|
||||
*/
|
||||
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
|
||||
hints->other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
||||
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
|
||||
|
||||
/*
|
||||
* We adjust stems to full pixels only if we don't use the `light' mode.
|
||||
*/
|
||||
if ( mode != FT_RENDER_MODE_LIGHT )
|
||||
hints->other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
||||
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
|
||||
|
||||
if ( mode == FT_RENDER_MODE_MONO )
|
||||
hints->other_flags |= AF_LATIN_HINTS_MONO;
|
||||
other_flags |= AF_LATIN_HINTS_MONO;
|
||||
|
||||
/*
|
||||
* In `light' hinting mode we disable horizontal hinting completely.
|
||||
* We also do it if the face is italic.
|
||||
*/
|
||||
if ( mode == FT_RENDER_MODE_LIGHT ||
|
||||
(face->style_flags & FT_STYLE_FLAG_ITALIC) != 0 )
|
||||
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
|
||||
|
||||
hints->scaler_flags = scaler_flags;
|
||||
hints->other_flags = other_flags;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1405,7 +1447,7 @@
|
||||
AF_LatinAxis axis = & metrics->axis[dim];
|
||||
FT_Pos dist = width;
|
||||
FT_Int sign = 0;
|
||||
FT_Int vertical = AF_HINTS_DO_VERTICAL( hints );
|
||||
FT_Int vertical = ( dim == AF_DIMENSION_VERT );
|
||||
|
||||
|
||||
if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) )
|
||||
@ -1926,6 +1968,20 @@
|
||||
if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||
|
||||
( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) ) )
|
||||
{
|
||||
#ifdef AF_USE_WARPER
|
||||
if ( dim == AF_DIMENSION_HORZ &&
|
||||
metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL )
|
||||
{
|
||||
AF_WarperRec warper;
|
||||
FT_Fixed scale;
|
||||
FT_Pos delta;
|
||||
|
||||
|
||||
af_warper_compute( &warper, hints, dim, &scale, &delta );
|
||||
af_glyph_hints_scale_dim( hints, dim, scale, delta );
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
af_latin_hint_edges( hints, (AF_Dimension)dim );
|
||||
af_glyph_hints_align_edge_points( hints, (AF_Dimension)dim );
|
||||
af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim );
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter hinting routines for latin script (specification). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -31,6 +31,11 @@ FT_BEGIN_HEADER
|
||||
af_latin_script_class;
|
||||
|
||||
|
||||
/* constants are given with units_per_em == 2048 in mind */
|
||||
#define AF_LATIN_CONSTANT( metrics, c ) \
|
||||
( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
@ -126,6 +131,10 @@ FT_BEGIN_HEADER
|
||||
af_latin_metrics_scale( AF_LatinMetrics metrics,
|
||||
AF_Scaler scaler );
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_latin_metrics_init_widths( AF_LatinMetrics metrics,
|
||||
FT_Face face,
|
||||
FT_ULong charcode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter glyph loading routines (body). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -27,24 +27,11 @@
|
||||
af_loader_init( AF_Loader loader,
|
||||
FT_Memory memory )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
FT_ZERO( loader );
|
||||
|
||||
af_glyph_hints_init( &loader->hints, memory );
|
||||
|
||||
error = FT_GlyphLoader_New( memory, &loader->gloader );
|
||||
if ( !error )
|
||||
{
|
||||
error = FT_GlyphLoader_CreateExtra( loader->gloader );
|
||||
if ( error )
|
||||
{
|
||||
FT_GlyphLoader_Done( loader->gloader );
|
||||
loader->gloader = NULL;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
return FT_GlyphLoader_New( memory, &loader->gloader );
|
||||
}
|
||||
|
||||
|
||||
@ -138,9 +125,9 @@
|
||||
|
||||
/* copy the outline points in the loader's current */
|
||||
/* extra points which is used to keep original glyph coordinates */
|
||||
error = FT_GlyphLoader_CheckPoints( gloader,
|
||||
slot->outline.n_points + 4,
|
||||
slot->outline.n_contours );
|
||||
error = FT_GLYPHLOADER_CHECK_POINTS( gloader,
|
||||
slot->outline.n_points + 4,
|
||||
slot->outline.n_contours );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
@ -148,10 +135,6 @@
|
||||
slot->outline.points,
|
||||
slot->outline.n_points );
|
||||
|
||||
FT_ARRAY_COPY( gloader->current.extra_points,
|
||||
slot->outline.points,
|
||||
slot->outline.n_points );
|
||||
|
||||
FT_ARRAY_COPY( gloader->current.outline.contours,
|
||||
slot->outline.contours,
|
||||
slot->outline.n_contours );
|
||||
@ -184,6 +167,7 @@
|
||||
/* we now need to hint the metrics according to the change in */
|
||||
/* width/positioning that occured during the hinting process */
|
||||
{
|
||||
#ifndef AF_USE_WARPER
|
||||
FT_Pos old_advance, old_rsb, old_lsb, new_lsb;
|
||||
FT_Pos pp1x_uh, pp2x_uh;
|
||||
AF_AxisHints axis = &hints->axis[AF_DIMENSION_HORZ];
|
||||
@ -192,7 +176,7 @@
|
||||
axis->num_edges - 1; /* rightmost edge */
|
||||
|
||||
|
||||
if ( axis->num_edges > 1 )
|
||||
if ( axis->num_edges > 1 && AF_HINTS_DO_ADVANCE( hints ) )
|
||||
{
|
||||
old_advance = loader->pp2.x;
|
||||
old_rsb = old_advance - edge2->opos;
|
||||
@ -219,18 +203,18 @@
|
||||
|
||||
slot->lsb_delta = loader->pp1.x - pp1x_uh;
|
||||
slot->rsb_delta = loader->pp2.x - pp2x_uh;
|
||||
|
||||
#if 0
|
||||
/* try to fix certain bad advance computations */
|
||||
if ( loader->pp2.x + loader->pp1.x == edge2->pos && old_rsb > 4 )
|
||||
loader->pp2.x += 64;
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
#endif /* !AF_USE_WARPER */
|
||||
{
|
||||
FT_Pos pp1x = loader->pp1.x;
|
||||
FT_Pos pp2x = loader->pp2.x;
|
||||
|
||||
loader->pp1.x = FT_PIX_ROUND( loader->pp1.x );
|
||||
loader->pp2.x = FT_PIX_ROUND( loader->pp2.x );
|
||||
|
||||
slot->lsb_delta = loader->pp1.x - pp1x;
|
||||
slot->rsb_delta = loader->pp2.x - pp2x;
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,16 +291,11 @@
|
||||
{
|
||||
FT_Vector* cur = gloader->base.outline.points +
|
||||
num_base_points;
|
||||
FT_Vector* org = gloader->base.extra_points +
|
||||
num_base_points;
|
||||
FT_Vector* limit = cur + num_new_points;
|
||||
|
||||
|
||||
for ( ; cur < limit; cur++, org++ )
|
||||
{
|
||||
for ( ; cur < limit; cur++ )
|
||||
FT_Vector_Transform( cur, &subglyph->transform );
|
||||
FT_Vector_Transform( org, &subglyph->transform );
|
||||
}
|
||||
}
|
||||
|
||||
/* apply offset */
|
||||
@ -376,12 +355,21 @@
|
||||
Hint_Metrics:
|
||||
if ( depth == 0 )
|
||||
{
|
||||
FT_BBox bbox;
|
||||
FT_BBox bbox;
|
||||
FT_Vector vvector;
|
||||
|
||||
|
||||
vvector.x = slot->metrics.vertBearingX - slot->metrics.horiBearingX;
|
||||
vvector.y = slot->metrics.vertBearingY - slot->metrics.horiBearingY;
|
||||
vvector.x = FT_MulFix( vvector.x, metrics->scaler.x_scale );
|
||||
vvector.y = FT_MulFix( vvector.y, metrics->scaler.y_scale );
|
||||
|
||||
/* transform the hinted outline if needed */
|
||||
if ( loader->transformed )
|
||||
{
|
||||
FT_Outline_Transform( &gloader->base.outline, &loader->trans_matrix );
|
||||
FT_Vector_Transform( &vvector, &loader->trans_matrix );
|
||||
}
|
||||
|
||||
/* we must translate our final outline by -pp1.x and compute */
|
||||
/* the new metrics */
|
||||
@ -400,6 +388,9 @@
|
||||
slot->metrics.horiBearingX = bbox.xMin;
|
||||
slot->metrics.horiBearingY = bbox.yMax;
|
||||
|
||||
slot->metrics.vertBearingX = FT_PIX_FLOOR( bbox.xMin + vvector.x );
|
||||
slot->metrics.vertBearingY = FT_PIX_FLOOR( bbox.yMax + vvector.y );
|
||||
|
||||
/* for mono-width fonts (like Andale, Courier, etc.) we need */
|
||||
/* to keep the original rounded advance width */
|
||||
#if 0
|
||||
@ -416,7 +407,11 @@
|
||||
metrics->scaler.x_scale );
|
||||
#endif
|
||||
|
||||
slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
|
||||
metrics->scaler.y_scale );
|
||||
|
||||
slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
|
||||
slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
|
||||
|
||||
/* now copy outline into glyph slot */
|
||||
FT_GlyphLoader_Rewind( internal->loader );
|
||||
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter types (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -16,20 +16,20 @@
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* The auto-fitter is a complete rewrite of the old auto-hinter.
|
||||
* Its main feature is the ability to differentiate between different
|
||||
* scripts in order to apply language-specific rules.
|
||||
*
|
||||
* The code has also been compartimentized into several entities that
|
||||
* should make algorithmic experimentation easier than with the old
|
||||
* code.
|
||||
*
|
||||
* Finally, we get rid of the Catharon license, since this code is
|
||||
* released under the FreeType one.
|
||||
*
|
||||
***************************************************************************/
|
||||
/*************************************************************************
|
||||
*
|
||||
* The auto-fitter is a complete rewrite of the old auto-hinter.
|
||||
* Its main feature is the ability to differentiate between different
|
||||
* scripts in order to apply language-specific rules.
|
||||
*
|
||||
* The code has also been compartimentized into several entities that
|
||||
* should make algorithmic experimentation easier than with the old
|
||||
* code.
|
||||
*
|
||||
* Finally, we get rid of the Catharon license, since this code is
|
||||
* released under the FreeType one.
|
||||
*
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AFTYPES_H__
|
||||
@ -53,6 +53,7 @@ FT_BEGIN_HEADER
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
#define xxAF_USE_WARPER /* only define to use warp hinting */
|
||||
#define xxAF_DEBUG
|
||||
|
||||
#ifdef AF_DEBUG
|
||||
@ -125,6 +126,7 @@ FT_BEGIN_HEADER
|
||||
FT_Pos dy );
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* compute `angle2 - angle1'; the result is always within
|
||||
* the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]
|
||||
@ -132,6 +134,23 @@ FT_BEGIN_HEADER
|
||||
FT_LOCAL( AF_Angle )
|
||||
af_angle_diff( AF_Angle angle1,
|
||||
AF_Angle angle2 );
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
#define AF_ANGLE_DIFF( result, angle1, angle2 ) \
|
||||
FT_BEGIN_STMNT \
|
||||
AF_Angle _delta = (angle2) - (angle1); \
|
||||
\
|
||||
\
|
||||
_delta %= AF_ANGLE_2PI; \
|
||||
if ( _delta < 0 ) \
|
||||
_delta += AF_ANGLE_2PI; \
|
||||
\
|
||||
if ( _delta > AF_ANGLE_PI ) \
|
||||
_delta -= AF_ANGLE_2PI; \
|
||||
\
|
||||
result = _delta; \
|
||||
FT_END_STMNT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@ -240,6 +259,7 @@ FT_BEGIN_HEADER
|
||||
{
|
||||
AF_SCRIPT_NONE = 0,
|
||||
AF_SCRIPT_LATIN = 1,
|
||||
AF_SCRIPT_CJK = 2,
|
||||
/* add new scripts here. Don't forget to update the list in */
|
||||
/* `afglobal.c'. */
|
||||
|
||||
|
313
src/libs/freetype2/autofit/afwarp.c
Normal file
313
src/libs/freetype2/autofit/afwarp.c
Normal file
@ -0,0 +1,313 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afwarp.c */
|
||||
/* */
|
||||
/* Auto-fitter warping algorithm (body). */
|
||||
/* */
|
||||
/* Copyright 2006 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include "afwarp.h"
|
||||
|
||||
#ifdef AF_USE_WARPER
|
||||
|
||||
#if 1
|
||||
static const AF_WarpScore
|
||||
af_warper_weights[64] =
|
||||
{
|
||||
35, 20, 20, 20, 15, 12, 10, 5, 2, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, -1, -2, -5, -8,-10,-10,-20,-20,-30,-30,
|
||||
|
||||
-30,-30,-20,-20,-10,-10, -8, -5, -2, -1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 10, 12, 15, 20, 20, 20,
|
||||
};
|
||||
#else
|
||||
static const AF_WarpScore
|
||||
af_warper_weights[64] =
|
||||
{
|
||||
30, 20, 10, 5, 4, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -1, -2, -2, -5, -5,-10,-10,-15,-20,
|
||||
|
||||
-20,-15,-15,-10,-10, -5, -5, -2, -2, -1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 5, 10, 20,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
af_warper_compute_line_best( AF_Warper warper,
|
||||
FT_Fixed scale,
|
||||
FT_Pos delta,
|
||||
FT_Pos xx1,
|
||||
FT_Pos xx2,
|
||||
AF_WarpScore base_distort,
|
||||
AF_Segment segments,
|
||||
FT_UInt num_segments )
|
||||
{
|
||||
FT_Int idx_min, idx_max, idx0;
|
||||
FT_UInt nn;
|
||||
AF_WarpScore scores[64];
|
||||
|
||||
|
||||
for ( nn = 0; nn < 64; nn++ )
|
||||
scores[nn] = 0;
|
||||
|
||||
idx0 = xx1 - warper->t1;
|
||||
|
||||
/* compute minimum and maximum indices */
|
||||
{
|
||||
FT_Pos xx1min = warper->x1min;
|
||||
FT_Pos xx1max = warper->x1max;
|
||||
FT_Pos w = xx2 - xx1;
|
||||
|
||||
|
||||
if ( xx1min + w < warper->x2min )
|
||||
xx1min = warper->x2min - ( xx2 - xx1 );
|
||||
|
||||
xx1max = warper->x1max;
|
||||
if ( xx1max + w > warper->x2max )
|
||||
xx1max = warper->x2max - ( xx2 - xx1 );
|
||||
|
||||
idx_min = xx1min - warper->t1;
|
||||
idx_max = xx1max - warper->t1;
|
||||
|
||||
if ( idx_min > idx_max )
|
||||
{
|
||||
AF_LOG(( "invalid indices:\n"
|
||||
" min=%d max=%d, xx1=%ld xx2=%ld,\n"
|
||||
" x1min=%ld x1max=%ld, x2min=%ld x2max=%ld\n",
|
||||
idx_min, idx_max, xx1, xx2,
|
||||
warper->x1min, warper->x1max,
|
||||
warper->x2min, warper->x2max ));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for ( nn = 0; nn < num_segments; nn++ )
|
||||
{
|
||||
FT_Pos len = segments[nn].max_coord - segments[nn].min_coord;
|
||||
FT_Pos y0 = FT_MulFix( segments[nn].pos, scale ) + delta;
|
||||
FT_Pos y = y0 + ( idx_min - idx0 );
|
||||
|
||||
FT_Int idx;
|
||||
|
||||
|
||||
for ( idx = idx_min; idx <= idx_max; idx++, y++ )
|
||||
scores[idx] += af_warper_weights[y & 63] * len;
|
||||
}
|
||||
|
||||
/* find best score */
|
||||
{
|
||||
FT_Int idx;
|
||||
|
||||
|
||||
for ( idx = idx_min; idx <= idx_max; idx++ )
|
||||
{
|
||||
AF_WarpScore score = scores[idx];
|
||||
AF_WarpScore distort = base_distort + ( idx - idx0 );
|
||||
|
||||
|
||||
if ( score > warper->best_score ||
|
||||
( score == warper->best_score &&
|
||||
distort < warper->best_distort ) )
|
||||
{
|
||||
warper->best_score = score;
|
||||
warper->best_distort = distort;
|
||||
warper->best_scale = scale;
|
||||
warper->best_delta = delta + ( idx - idx0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF( void )
|
||||
af_warper_compute( AF_Warper warper,
|
||||
AF_GlyphHints hints,
|
||||
AF_Dimension dim,
|
||||
FT_Fixed *a_scale,
|
||||
FT_Pos *a_delta )
|
||||
{
|
||||
AF_AxisHints axis;
|
||||
AF_Point points;
|
||||
|
||||
FT_Fixed org_scale;
|
||||
FT_Pos org_delta;
|
||||
|
||||
FT_UInt nn, num_points, num_segments;
|
||||
FT_Int X1, X2;
|
||||
FT_Int w;
|
||||
|
||||
AF_WarpScore base_distort;
|
||||
AF_Segment segments;
|
||||
|
||||
|
||||
/* get original scaling transformation */
|
||||
if ( dim == AF_DIMENSION_VERT )
|
||||
{
|
||||
org_scale = hints->y_scale;
|
||||
org_delta = hints->y_delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
org_scale = hints->x_scale;
|
||||
org_delta = hints->x_delta;
|
||||
}
|
||||
|
||||
warper->best_scale = org_scale;
|
||||
warper->best_delta = org_delta;
|
||||
warper->best_score = 0;
|
||||
warper->best_distort = 0;
|
||||
|
||||
axis = &hints->axis[dim];
|
||||
segments = axis->segments;
|
||||
num_segments = axis->num_segments;
|
||||
points = hints->points;
|
||||
num_points = hints->num_points;
|
||||
|
||||
*a_scale = org_scale;
|
||||
*a_delta = org_delta;
|
||||
|
||||
/* get X1 and X2, minimum and maximum in original coordinates */
|
||||
if ( axis->num_segments < 1 )
|
||||
return;
|
||||
|
||||
#if 1
|
||||
X1 = X2 = points[0].fx;
|
||||
for ( nn = 1; nn < num_points; nn++ )
|
||||
{
|
||||
FT_Int X = points[nn].fx;
|
||||
|
||||
|
||||
if ( X < X1 )
|
||||
X1 = X;
|
||||
if ( X > X2 )
|
||||
X2 = X;
|
||||
}
|
||||
#else
|
||||
X1 = X2 = segments[0].pos;
|
||||
for ( nn = 1; nn < num_segments; nn++ )
|
||||
{
|
||||
FT_Int X = segments[nn].pos;
|
||||
|
||||
|
||||
if ( X < X1 )
|
||||
X1 = X;
|
||||
if ( X > X2 )
|
||||
X2 = X;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( X1 >= X2 )
|
||||
return;
|
||||
|
||||
warper->x1 = FT_MulFix( X1, org_scale ) + org_delta;
|
||||
warper->x2 = FT_MulFix( X2, org_scale ) + org_delta;
|
||||
|
||||
warper->t1 = AF_WARPER_FLOOR( warper->x1 );
|
||||
warper->t2 = AF_WARPER_CEIL( warper->x2 );
|
||||
|
||||
warper->x1min = warper->x1 & ~31;
|
||||
warper->x1max = warper->x1min + 32;
|
||||
warper->x2min = warper->x2 & ~31;
|
||||
warper->x2max = warper->x2min + 32;
|
||||
|
||||
if ( warper->x1max > warper->x2 )
|
||||
warper->x1max = warper->x2;
|
||||
|
||||
if ( warper->x2min < warper->x1 )
|
||||
warper->x2min = warper->x1;
|
||||
|
||||
warper->w0 = warper->x2 - warper->x1;
|
||||
|
||||
if ( warper->w0 <= 64 )
|
||||
{
|
||||
warper->x1max = warper->x1;
|
||||
warper->x2min = warper->x2;
|
||||
}
|
||||
|
||||
warper->wmin = warper->x2min - warper->x1max;
|
||||
warper->wmax = warper->x2max - warper->x1min;
|
||||
|
||||
if ( warper->wmin < warper->w0 - 32 )
|
||||
warper->wmin = warper->w0 - 32;
|
||||
|
||||
if ( warper->wmax > warper->w0 + 32 )
|
||||
warper->wmax = warper->w0 + 32;
|
||||
|
||||
if ( warper->wmin < warper->w0 * 3 / 4 )
|
||||
warper->wmin = warper->w0 * 3 / 4;
|
||||
|
||||
if ( warper->wmax > warper->w0 * 5 / 4 )
|
||||
warper->wmax = warper->w0 * 5 / 4;
|
||||
|
||||
/* warper->wmin = warper->wmax = warper->w0; */
|
||||
|
||||
for ( w = warper->wmin; w <= warper->wmax; w++ )
|
||||
{
|
||||
FT_Fixed new_scale;
|
||||
FT_Pos new_delta;
|
||||
FT_Pos xx1, xx2;
|
||||
|
||||
|
||||
xx1 = warper->x1;
|
||||
xx2 = warper->x2;
|
||||
if ( w >= warper->w0 )
|
||||
{
|
||||
xx1 -= w - warper->w0;
|
||||
if ( xx1 < warper->x1min )
|
||||
{
|
||||
xx2 += warper->x1min - xx1;
|
||||
xx1 = warper->x1min;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xx1 -= w - warper->w0;
|
||||
if ( xx1 > warper->x1max )
|
||||
{
|
||||
xx2 -= xx1 - warper->x1max;
|
||||
xx1 = warper->x1max;
|
||||
}
|
||||
}
|
||||
|
||||
if ( xx1 < warper->x1 )
|
||||
base_distort = warper->x1 - xx1;
|
||||
else
|
||||
base_distort = xx1 - warper->x1;
|
||||
|
||||
if ( xx2 < warper->x2 )
|
||||
base_distort += warper->x2 - xx2;
|
||||
else
|
||||
base_distort += xx2 - warper->x2;
|
||||
|
||||
base_distort *= 10;
|
||||
|
||||
new_scale = org_scale + FT_DivFix( w - warper->w0, X2 - X1 );
|
||||
new_delta = xx1 - FT_MulFix( X1, new_scale );
|
||||
|
||||
af_warper_compute_line_best( warper, new_scale, new_delta, xx1, xx2,
|
||||
base_distort,
|
||||
segments, num_segments );
|
||||
}
|
||||
|
||||
*a_scale = warper->best_scale;
|
||||
*a_delta = warper->best_delta;
|
||||
}
|
||||
|
||||
#else /* !AF_USE_WARPER */
|
||||
|
||||
char af_warper_dummy = 0; /* make compiler happy */
|
||||
|
||||
#endif /* !AF_USE_WARPER */
|
||||
|
||||
/* END */
|
65
src/libs/freetype2/autofit/afwarp.h
Normal file
65
src/libs/freetype2/autofit/afwarp.h
Normal file
@ -0,0 +1,65 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afwarp.h */
|
||||
/* */
|
||||
/* Auto-fitter warping algorithm (specification). */
|
||||
/* */
|
||||
/* Copyright 2006 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 __AFWARP_H__
|
||||
#define __AFWARP_H__
|
||||
|
||||
#include "afhints.h"
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#define AF_WARPER_SCALE
|
||||
|
||||
#define AF_WARPER_FLOOR( x ) ( (x) & ~63 )
|
||||
#define AF_WARPER_CEIL( x ) AF_WARPER_FLOOR( (x) + 63 )
|
||||
|
||||
|
||||
typedef FT_Int32 AF_WarpScore;
|
||||
|
||||
typedef struct AF_WarperRec_
|
||||
{
|
||||
FT_Int X1, X2;
|
||||
FT_Pos x1, x2;
|
||||
FT_Pos t1, t2;
|
||||
FT_Pos x1min, x1max;
|
||||
FT_Pos x2min, x2max;
|
||||
FT_Pos w0, wmin, wmax;
|
||||
|
||||
FT_Fixed best_scale;
|
||||
FT_Pos best_delta;
|
||||
AF_WarpScore best_score;
|
||||
AF_WarpScore best_distort;
|
||||
|
||||
} AF_WarperRec, *AF_Warper;
|
||||
|
||||
|
||||
FT_LOCAL( void )
|
||||
af_warper_compute( AF_Warper warper,
|
||||
AF_GlyphHints hints,
|
||||
AF_Dimension dim,
|
||||
FT_Fixed *a_scale,
|
||||
FT_Fixed *a_delta );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __AFWARP_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -4,7 +4,7 @@
|
||||
/* */
|
||||
/* Auto-fitter module (body). */
|
||||
/* */
|
||||
/* Copyright 2003, 2004, 2005 by */
|
||||
/* Copyright 2003, 2004, 2005, 2006 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
@ -23,8 +23,12 @@
|
||||
#include "afhints.c"
|
||||
#include "afdummy.c"
|
||||
#include "aflatin.c"
|
||||
#include "afcjk.c"
|
||||
#include "afloader.c"
|
||||
#include "afmodule.c"
|
||||
|
||||
#ifdef AF_USE_WARPER
|
||||
#include "afwarp.c"
|
||||
#endif
|
||||
|
||||
/* END */
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2003, 2004, 2005 by
|
||||
# Copyright 2003, 2004, 2005, 2006 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
@ -13,10 +13,11 @@
|
||||
# fully.
|
||||
|
||||
|
||||
make_module_list: add_autofit_module
|
||||
FTMODULE_H_COMMANDS += AUTOFIT_MODULE
|
||||
|
||||
add_autofit_module:
|
||||
$(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
|
||||
define AUTOFIT_MODULE
|
||||
$(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)
|
||||
$(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
|
||||
endef
|
||||
|
||||
# EOF
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2003, 2004, 2005 by
|
||||
# Copyright 2003, 2004, 2005, 2006 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
@ -30,8 +30,10 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
|
||||
$(AUTOF_DIR)/afglobal.c \
|
||||
$(AUTOF_DIR)/afhints.c \
|
||||
$(AUTOF_DIR)/aflatin.c \
|
||||
$(AUTOF_DIR)/afcjk.c \
|
||||
$(AUTOF_DIR)/afloader.c \
|
||||
$(AUTOF_DIR)/afmodule.c
|
||||
$(AUTOF_DIR)/afmodule.c \
|
||||
$(AUTOF_DIR)/afwarp.c
|
||||
|
||||
# AUTOF driver headers
|
||||
#
|
||||
|
@ -1,123 +0,0 @@
|
||||
The Catharon Open Source LICENSE
|
||||
----------------------------
|
||||
|
||||
2000-Jul-04
|
||||
|
||||
Copyright (C) 2000 by Catharon Productions, Inc.
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
This license applies to source files distributed by Catharon
|
||||
Productions, Inc. in several archive packages. This license
|
||||
applies to all files found in such packages which do not fall
|
||||
under their own explicit license.
|
||||
|
||||
This license was inspired by the BSD, Artistic, and IJG
|
||||
(Independent JPEG Group) licenses, which all encourage inclusion
|
||||
and use of free software in commercial and freeware products
|
||||
alike. As a consequence, its main points are that:
|
||||
|
||||
o We don't promise that this software works. However, we are
|
||||
interested in any kind of bug reports. (`as is' distribution)
|
||||
|
||||
o You can use this software for whatever you want, in parts or
|
||||
full form, without having to pay us. (`royalty-free' usage)
|
||||
|
||||
o You may not pretend that you wrote this software. If you use
|
||||
it, or only parts of it, in a program, you must acknowledge
|
||||
somewhere in your documentation that you have used the
|
||||
Catharon Code. (`credits')
|
||||
|
||||
We specifically permit and encourage the inclusion of this
|
||||
software, with or without modifications, in commercial products.
|
||||
We disclaim all warranties covering the packages distributed by
|
||||
Catharon Productions, Inc. and assume no liability related to
|
||||
their use.
|
||||
|
||||
|
||||
Legal Terms
|
||||
===========
|
||||
|
||||
0. Definitions
|
||||
--------------
|
||||
|
||||
Throughout this license, the terms `Catharon Package', `package',
|
||||
and `Catharon Code' refer to the set of files originally
|
||||
distributed by Catharon Productions, Inc.
|
||||
|
||||
`You' refers to the licensee, or person using the project, where
|
||||
`using' is a generic term including compiling the project's source
|
||||
code as well as linking it to form a `program' or `executable'.
|
||||
This program is referred to as `a program using one of the
|
||||
Catharon Packages'.
|
||||
|
||||
This license applies to all files distributed in the original
|
||||
Catharon Package(s), including all source code, binaries and
|
||||
documentation, unless otherwise stated in the file in its
|
||||
original, unmodified form as distributed in the original archive.
|
||||
If you are unsure whether or not a particular file is covered by
|
||||
this license, you must contact us to verify this.
|
||||
|
||||
The Catharon Packages are copyright (C) 2000 by Catharon
|
||||
Productions, Inc. All rights reserved except as specified below.
|
||||
|
||||
1. No Warranty
|
||||
--------------
|
||||
|
||||
THE CATHARON PACKAGES ARE PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OF OR THE INABILITY TO
|
||||
USE THE CATHARON PACKAGE.
|
||||
|
||||
2. Redistribution
|
||||
-----------------
|
||||
|
||||
This license grants a worldwide, royalty-free, perpetual and
|
||||
irrevocable right and license to use, execute, perform, compile,
|
||||
display, copy, create derivative works of, distribute and
|
||||
sublicense the Catharon Packages (in both source and object code
|
||||
forms) and derivative works thereof for any purpose; and to
|
||||
authorize others to exercise some or all of the rights granted
|
||||
herein, subject to the following conditions:
|
||||
|
||||
o Redistribution of source code must retain this license file
|
||||
(`license.txt') unaltered; any additions, deletions or changes
|
||||
to the original files must be clearly indicated in
|
||||
accompanying documentation. The copyright notices of the
|
||||
unaltered, original files must be preserved in all copies of
|
||||
source files.
|
||||
|
||||
o Redistribution in binary form must provide a disclaimer that
|
||||
states that the software is based in part on the work of
|
||||
Catharon Productions, Inc. in the distribution documentation.
|
||||
|
||||
These conditions apply to any software derived from or based on
|
||||
the Catharon Packages, not just the unmodified files. If you use
|
||||
our work, you must acknowledge us. However, no fee need be paid
|
||||
to us.
|
||||
|
||||
3. Advertising
|
||||
--------------
|
||||
|
||||
Neither Catharon Productions, Inc. and contributors nor you shall
|
||||
use the name of the other for commercial, advertising, or
|
||||
promotional purposes without specific prior written permission.
|
||||
|
||||
We suggest, but do not require, that you use the following phrase
|
||||
to refer to this software in your documentation: 'this software is
|
||||
based in part on the Catharon Typography Project'.
|
||||
|
||||
As you have not signed this license, you are not required to
|
||||
accept it. However, as the Catharon Packages are copyrighted
|
||||
material, only this license, or another one contracted with the
|
||||
authors, grants you the right to use, distribute, and modify it.
|
||||
Therefore, by using, distributing, or modifying the Catharon
|
||||
Packages, you indicate that you understand and accept all the
|
||||
terms of this license.
|
||||
|
||||
--- end of license.txt ---
|
@ -1,27 +0,0 @@
|
||||
# FreeType 2 src/autohint Jamfile (c) 2001 David Turner
|
||||
#
|
||||
|
||||
SubDir HAIKU_TOP src libs freetype2 autohint ;
|
||||
|
||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||
AddSubDirSupportedPlatforms libbe_test ;
|
||||
|
||||
UseFreeTypeHeaders ;
|
||||
|
||||
{
|
||||
local _sources ;
|
||||
|
||||
if $(FT2_MULTI)
|
||||
{
|
||||
_sources = ahangles ahglobal ahglyph ahhint ahmodule ;
|
||||
}
|
||||
else
|
||||
{
|
||||
_sources = autohint ;
|
||||
}
|
||||
|
||||
FT2_Library $(FT2_LIB) : $(_sources).c ;
|
||||
}
|
||||
|
||||
# end of src/autohint Jamfile
|
||||
|
@ -1,147 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahangles.h */
|
||||
/* */
|
||||
/* A routine used to compute vector angles with limited accuracy */
|
||||
/* and very high speed (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include "ahangles.h"
|
||||
|
||||
|
||||
/* the following table has been automatically generated with */
|
||||
/* the `mather.py' Python script */
|
||||
|
||||
const AH_Angle ah_arctan[1L << AH_ATAN_BITS] =
|
||||
{
|
||||
0, 0, 1, 1, 1, 2, 2, 2,
|
||||
3, 3, 3, 3, 4, 4, 4, 5,
|
||||
5, 5, 6, 6, 6, 7, 7, 7,
|
||||
8, 8, 8, 9, 9, 9, 10, 10,
|
||||
10, 10, 11, 11, 11, 12, 12, 12,
|
||||
13, 13, 13, 14, 14, 14, 14, 15,
|
||||
15, 15, 16, 16, 16, 17, 17, 17,
|
||||
18, 18, 18, 18, 19, 19, 19, 20,
|
||||
20, 20, 21, 21, 21, 21, 22, 22,
|
||||
22, 23, 23, 23, 24, 24, 24, 24,
|
||||
25, 25, 25, 26, 26, 26, 26, 27,
|
||||
27, 27, 28, 28, 28, 28, 29, 29,
|
||||
29, 30, 30, 30, 30, 31, 31, 31,
|
||||
31, 32, 32, 32, 33, 33, 33, 33,
|
||||
34, 34, 34, 34, 35, 35, 35, 35,
|
||||
36, 36, 36, 36, 37, 37, 37, 38,
|
||||
38, 38, 38, 39, 39, 39, 39, 40,
|
||||
40, 40, 40, 41, 41, 41, 41, 42,
|
||||
42, 42, 42, 42, 43, 43, 43, 43,
|
||||
44, 44, 44, 44, 45, 45, 45, 45,
|
||||
46, 46, 46, 46, 46, 47, 47, 47,
|
||||
47, 48, 48, 48, 48, 48, 49, 49,
|
||||
49, 49, 50, 50, 50, 50, 50, 51,
|
||||
51, 51, 51, 51, 52, 52, 52, 52,
|
||||
52, 53, 53, 53, 53, 53, 54, 54,
|
||||
54, 54, 54, 55, 55, 55, 55, 55,
|
||||
56, 56, 56, 56, 56, 57, 57, 57,
|
||||
57, 57, 57, 58, 58, 58, 58, 58,
|
||||
59, 59, 59, 59, 59, 59, 60, 60,
|
||||
60, 60, 60, 61, 61, 61, 61, 61,
|
||||
61, 62, 62, 62, 62, 62, 62, 63,
|
||||
63, 63, 63, 63, 63, 64, 64, 64
|
||||
};
|
||||
|
||||
|
||||
FT_LOCAL_DEF( AH_Angle )
|
||||
ah_angle( FT_Vector* v )
|
||||
{
|
||||
FT_Pos dx, dy;
|
||||
AH_Angle angle;
|
||||
|
||||
|
||||
dx = v->x;
|
||||
dy = v->y;
|
||||
|
||||
/* check trivial cases */
|
||||
if ( dy == 0 )
|
||||
{
|
||||
angle = 0;
|
||||
if ( dx < 0 )
|
||||
angle = AH_PI;
|
||||
return angle;
|
||||
}
|
||||
else if ( dx == 0 )
|
||||
{
|
||||
angle = AH_HALF_PI;
|
||||
if ( dy < 0 )
|
||||
angle = -AH_HALF_PI;
|
||||
return angle;
|
||||
}
|
||||
|
||||
angle = 0;
|
||||
if ( dx < 0 )
|
||||
{
|
||||
dx = -v->x;
|
||||
dy = -v->y;
|
||||
angle = AH_PI;
|
||||
}
|
||||
|
||||
if ( dy < 0 )
|
||||
{
|
||||
FT_Pos tmp;
|
||||
|
||||
|
||||
tmp = dx;
|
||||
dx = -dy;
|
||||
dy = tmp;
|
||||
angle -= AH_HALF_PI;
|
||||
}
|
||||
|
||||
if ( dx == 0 && dy == 0 )
|
||||
return 0;
|
||||
|
||||
if ( dx == dy )
|
||||
angle += AH_PI / 4;
|
||||
else if ( dx > dy )
|
||||
angle += ah_arctan[FT_DivFix( dy, dx ) >> ( 16 - AH_ATAN_BITS )];
|
||||
else
|
||||
angle += AH_HALF_PI -
|
||||
ah_arctan[FT_DivFix( dx, dy ) >> ( 16 - AH_ATAN_BITS )];
|
||||
|
||||
if ( angle > AH_PI )
|
||||
angle -= AH_2PI;
|
||||
|
||||
return angle;
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF( AH_Angle )
|
||||
ah_angle_diff( AH_Angle angle1,
|
||||
AH_Angle angle2 )
|
||||
{
|
||||
AH_Angle delta;
|
||||
|
||||
|
||||
delta = ( angle2 - angle1 );
|
||||
if ( delta < 0 )
|
||||
delta += AH_2PI;
|
||||
|
||||
if ( delta > AH_PI )
|
||||
delta -= AH_2PI;
|
||||
|
||||
return delta;
|
||||
}
|
||||
|
||||
/* END */
|
@ -1,64 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahangles.h */
|
||||
/* */
|
||||
/* A routine used to compute vector angles with limited accuracy */
|
||||
/* and very high speed (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AHANGLES_H__
|
||||
#define __AHANGLES_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include "ahtypes.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* PI expressed in ah_angles -- we don't really need an important */
|
||||
/* precision, so 256 should be enough */
|
||||
#define AH_PI 256
|
||||
#define AH_2PI ( AH_PI * 2 )
|
||||
#define AH_HALF_PI ( AH_PI / 2 )
|
||||
#define AH_2PIMASK ( AH_2PI - 1 )
|
||||
|
||||
/* the number of bits used to express an arc tangent; */
|
||||
/* see the structure of the lookup table */
|
||||
#define AH_ATAN_BITS 8
|
||||
|
||||
extern
|
||||
const AH_Angle ah_arctan[1L << AH_ATAN_BITS];
|
||||
|
||||
|
||||
FT_LOCAL( AH_Angle )
|
||||
ah_angle( FT_Vector* v );
|
||||
|
||||
|
||||
FT_LOCAL( AH_Angle )
|
||||
ah_angle_diff( AH_Angle angle1,
|
||||
AH_Angle angle2 );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AHANGLES_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,402 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahglobal.c */
|
||||
/* */
|
||||
/* Routines used to compute global metrics automatically (body). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_DEBUG_H
|
||||
#include "ahglobal.h"
|
||||
#include "ahglyph.h"
|
||||
|
||||
|
||||
#define MAX_TEST_CHARACTERS 12
|
||||
|
||||
/* cf. AH_BLUE_XXX constants in ahtypes.h */
|
||||
|
||||
static
|
||||
const char* const blue_chars[AH_BLUE_MAX] =
|
||||
{
|
||||
"THEZOCQS",
|
||||
"HEZLOCUS",
|
||||
#ifdef FT_CONFIG_CHESTER_SMALL_F
|
||||
"fijkdbh",
|
||||
#endif
|
||||
"xzroesc",
|
||||
"xzroesc",
|
||||
"pqgjy"
|
||||
};
|
||||
|
||||
|
||||
/* simple insertion sort */
|
||||
static void
|
||||
sort_values( FT_Int count,
|
||||
FT_Pos* table )
|
||||
{
|
||||
FT_Int i, j;
|
||||
FT_Pos swap;
|
||||
|
||||
|
||||
for ( i = 1; i < count; i++ )
|
||||
{
|
||||
for ( j = i; j > 0; j-- )
|
||||
{
|
||||
if ( table[j] > table[j - 1] )
|
||||
break;
|
||||
|
||||
swap = table[j];
|
||||
table[j] = table[j - 1];
|
||||
table[j - 1] = swap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static FT_Error
|
||||
ah_hinter_compute_blues( AH_Hinter hinter )
|
||||
{
|
||||
AH_Blue blue;
|
||||
AH_Globals globals = &hinter->globals->design;
|
||||
FT_Pos flats [MAX_TEST_CHARACTERS];
|
||||
FT_Pos rounds[MAX_TEST_CHARACTERS];
|
||||
FT_Int num_flats;
|
||||
FT_Int num_rounds;
|
||||
|
||||
FT_Face face;
|
||||
FT_GlyphSlot glyph;
|
||||
FT_Error error;
|
||||
FT_CharMap charmap;
|
||||
|
||||
|
||||
face = hinter->face;
|
||||
glyph = face->glyph;
|
||||
|
||||
/* save current charmap */
|
||||
charmap = face->charmap;
|
||||
|
||||
/* do we have a Unicode charmap in there? */
|
||||
error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
/* we compute the blues simply by loading each character from the */
|
||||
/* `blue_chars[blues]' string, then compute its top-most or */
|
||||
/* bottom-most points (depending on `AH_IS_TOP_BLUE') */
|
||||
|
||||
AH_LOG(( "blue zones computation\n" ));
|
||||
AH_LOG(( "------------------------------------------------\n" ));
|
||||
|
||||
for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ )
|
||||
{
|
||||
const char* p = blue_chars[blue];
|
||||
const char* limit = p + MAX_TEST_CHARACTERS;
|
||||
|
||||
FT_Pos *blue_ref, *blue_shoot;
|
||||
|
||||
|
||||
AH_LOG(( "blue %3d: ", blue ));
|
||||
|
||||
num_flats = 0;
|
||||
num_rounds = 0;
|
||||
|
||||
for ( ; p < limit; p++ )
|
||||
{
|
||||
FT_UInt glyph_index;
|
||||
FT_Vector* extremum;
|
||||
FT_Vector* points;
|
||||
FT_Vector* point_limit;
|
||||
FT_Vector* point;
|
||||
FT_Bool round;
|
||||
|
||||
|
||||
/* exit if we reach the end of the string */
|
||||
if ( !*p )
|
||||
break;
|
||||
|
||||
AH_LOG(( "`%c'", *p ));
|
||||
|
||||
/* load the character in the face -- skip unknown or empty ones */
|
||||
glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
|
||||
if ( glyph_index == 0 )
|
||||
continue;
|
||||
|
||||
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
|
||||
if ( error || glyph->outline.n_points <= 0 )
|
||||
continue;
|
||||
|
||||
/* now compute min or max point indices and coordinates */
|
||||
points = glyph->outline.points;
|
||||
point_limit = points + glyph->outline.n_points;
|
||||
point = points;
|
||||
extremum = point;
|
||||
point++;
|
||||
|
||||
if ( AH_IS_TOP_BLUE( blue ) )
|
||||
{
|
||||
for ( ; point < point_limit; point++ )
|
||||
if ( point->y > extremum->y )
|
||||
extremum = point;
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( ; point < point_limit; point++ )
|
||||
if ( point->y < extremum->y )
|
||||
extremum = point;
|
||||
}
|
||||
|
||||
AH_LOG(( "%5d", (int)extremum->y ));
|
||||
|
||||
/* now, check whether the point belongs to a straight or round */
|
||||
/* segment; we first need to find in which contour the extremum */
|
||||
/* lies, then see its previous and next points */
|
||||
{
|
||||
FT_Int idx = (FT_Int)( extremum - points );
|
||||
FT_Int n;
|
||||
FT_Int first, last, prev, next, end;
|
||||
FT_Pos dist;
|
||||
|
||||
|
||||
last = -1;
|
||||
first = 0;
|
||||
|
||||
for ( n = 0; n < glyph->outline.n_contours; n++ )
|
||||
{
|
||||
end = glyph->outline.contours[n];
|
||||
if ( end >= idx )
|
||||
{
|
||||
last = end;
|
||||
break;
|
||||
}
|
||||
first = end + 1;
|
||||
}
|
||||
|
||||
/* XXX: should never happen! */
|
||||
if ( last < 0 )
|
||||
continue;
|
||||
|
||||
/* now look for the previous and next points that are not on the */
|
||||
/* same Y coordinate. Threshold the `closeness'... */
|
||||
|
||||
prev = idx;
|
||||
next = prev;
|
||||
|
||||
do
|
||||
{
|
||||
if ( prev > first )
|
||||
prev--;
|
||||
else
|
||||
prev = last;
|
||||
|
||||
dist = points[prev].y - extremum->y;
|
||||
if ( dist < -5 || dist > 5 )
|
||||
break;
|
||||
|
||||
} while ( prev != idx );
|
||||
|
||||
do
|
||||
{
|
||||
if ( next < last )
|
||||
next++;
|
||||
else
|
||||
next = first;
|
||||
|
||||
dist = points[next].y - extremum->y;
|
||||
if ( dist < -5 || dist > 5 )
|
||||
break;
|
||||
|
||||
} while ( next != idx );
|
||||
|
||||
/* now, set the `round' flag depending on the segment's kind */
|
||||
round = FT_BOOL(
|
||||
FT_CURVE_TAG( glyph->outline.tags[prev] ) != FT_CURVE_TAG_ON ||
|
||||
FT_CURVE_TAG( glyph->outline.tags[next] ) != FT_CURVE_TAG_ON );
|
||||
|
||||
AH_LOG(( "%c ", round ? 'r' : 'f' ));
|
||||
}
|
||||
|
||||
if ( round )
|
||||
rounds[num_rounds++] = extremum->y;
|
||||
else
|
||||
flats[num_flats++] = extremum->y;
|
||||
}
|
||||
|
||||
AH_LOG(( "\n" ));
|
||||
|
||||
/* we have computed the contents of the `rounds' and `flats' tables, */
|
||||
/* now determine the reference and overshoot position of the blue -- */
|
||||
/* we simply take the median value after a simple sort */
|
||||
sort_values( num_rounds, rounds );
|
||||
sort_values( num_flats, flats );
|
||||
|
||||
blue_ref = globals->blue_refs + blue;
|
||||
blue_shoot = globals->blue_shoots + blue;
|
||||
if ( num_flats == 0 && num_rounds == 0 )
|
||||
{
|
||||
*blue_ref = -10000;
|
||||
*blue_shoot = -10000;
|
||||
}
|
||||
else if ( num_flats == 0 )
|
||||
{
|
||||
*blue_ref =
|
||||
*blue_shoot = rounds[num_rounds / 2];
|
||||
}
|
||||
else if ( num_rounds == 0 )
|
||||
{
|
||||
*blue_ref =
|
||||
*blue_shoot = flats[num_flats / 2];
|
||||
}
|
||||
else
|
||||
{
|
||||
*blue_ref = flats[num_flats / 2];
|
||||
*blue_shoot = rounds[num_rounds / 2];
|
||||
}
|
||||
|
||||
/* there are sometimes problems: if the overshoot position of top */
|
||||
/* zones is under its reference position, or the opposite for bottom */
|
||||
/* zones. We must thus check everything there and correct the errors */
|
||||
if ( *blue_shoot != *blue_ref )
|
||||
{
|
||||
FT_Pos ref = *blue_ref;
|
||||
FT_Pos shoot = *blue_shoot;
|
||||
FT_Bool over_ref = FT_BOOL( shoot > ref );
|
||||
|
||||
|
||||
if ( AH_IS_TOP_BLUE( blue ) ^ over_ref )
|
||||
*blue_shoot = *blue_ref = ( shoot + ref ) / 2;
|
||||
}
|
||||
|
||||
AH_LOG(( "-- ref = %ld, shoot = %ld\n", *blue_ref, *blue_shoot ));
|
||||
}
|
||||
|
||||
/* reset original face charmap */
|
||||
FT_Set_Charmap( face, charmap );
|
||||
error = 0;
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
static FT_Error
|
||||
ah_hinter_compute_widths( AH_Hinter hinter )
|
||||
{
|
||||
/* scan the array of segments in each direction */
|
||||
AH_Outline outline = hinter->glyph;
|
||||
AH_Segment segments;
|
||||
AH_Segment limit;
|
||||
AH_Globals globals = &hinter->globals->design;
|
||||
FT_Pos* widths;
|
||||
FT_Int dimension;
|
||||
FT_Int* p_num_widths;
|
||||
FT_Error error = 0;
|
||||
FT_Pos edge_distance_threshold = 32000;
|
||||
|
||||
|
||||
globals->num_widths = 0;
|
||||
globals->num_heights = 0;
|
||||
|
||||
/* For now, compute the standard width and height from the `o' */
|
||||
/* character. I started computing the stem width of the `i' and the */
|
||||
/* stem height of the "-", but it wasn't too good. Moreover, we now */
|
||||
/* have a single character that gives us standard width and height. */
|
||||
{
|
||||
FT_UInt glyph_index;
|
||||
|
||||
|
||||
glyph_index = FT_Get_Char_Index( hinter->face, 'o' );
|
||||
if ( glyph_index == 0 )
|
||||
return 0;
|
||||
|
||||
error = FT_Load_Glyph( hinter->face, glyph_index, FT_LOAD_NO_SCALE );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L,
|
||||
hinter->face );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
ah_outline_compute_segments( hinter->glyph );
|
||||
ah_outline_link_segments( hinter->glyph );
|
||||
}
|
||||
|
||||
segments = outline->horz_segments;
|
||||
limit = segments + outline->num_hsegments;
|
||||
widths = globals->heights;
|
||||
p_num_widths = &globals->num_heights;
|
||||
|
||||
for ( dimension = 1; dimension >= 0; dimension-- )
|
||||
{
|
||||
AH_Segment seg = segments;
|
||||
AH_Segment link;
|
||||
FT_Int num_widths = 0;
|
||||
|
||||
|
||||
for ( ; seg < limit; seg++ )
|
||||
{
|
||||
link = seg->link;
|
||||
/* we only consider stem segments there! */
|
||||
if ( link && link->link == seg && link > seg )
|
||||
{
|
||||
FT_Pos dist;
|
||||
|
||||
|
||||
dist = seg->pos - link->pos;
|
||||
if ( dist < 0 )
|
||||
dist = -dist;
|
||||
|
||||
if ( num_widths < AH_MAX_WIDTHS )
|
||||
widths[num_widths++] = dist;
|
||||
}
|
||||
}
|
||||
|
||||
sort_values( num_widths, widths );
|
||||
*p_num_widths = num_widths;
|
||||
|
||||
/* we will now try to find the smallest width */
|
||||
if ( num_widths > 0 && widths[0] < edge_distance_threshold )
|
||||
edge_distance_threshold = widths[0];
|
||||
|
||||
segments = outline->vert_segments;
|
||||
limit = segments + outline->num_vsegments;
|
||||
widths = globals->widths;
|
||||
p_num_widths = &globals->num_widths;
|
||||
}
|
||||
|
||||
/* Now, compute the edge distance threshold as a fraction of the */
|
||||
/* smallest width in the font. Set it in `hinter->glyph' too! */
|
||||
if ( edge_distance_threshold == 32000 )
|
||||
edge_distance_threshold = 50;
|
||||
|
||||
/* let's try 20% */
|
||||
hinter->glyph->edge_distance_threshold = edge_distance_threshold / 5;
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
ah_hinter_compute_globals( AH_Hinter hinter )
|
||||
{
|
||||
return ah_hinter_compute_widths( hinter ) ||
|
||||
ah_hinter_compute_blues ( hinter );
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
@ -1,59 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahglobal.h */
|
||||
/* */
|
||||
/* Routines used to compute global metrics automatically */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AHGLOBAL_H__
|
||||
#define __AHGLOBAL_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include "ahtypes.h"
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_CHESTER_SMALL_F
|
||||
|
||||
#define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \
|
||||
(b) == AH_BLUE_SMALL_F_TOP || \
|
||||
(b) == AH_BLUE_SMALL_TOP )
|
||||
|
||||
#else /* !FT_CONFIG_CHESTER_SMALL_F */
|
||||
|
||||
#define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \
|
||||
(b) == AH_BLUE_SMALL_TOP )
|
||||
|
||||
#endif /* !FT_CONFIG_CHESTER_SMALL_F */
|
||||
|
||||
|
||||
/* compute global metrics automatically */
|
||||
FT_LOCAL( FT_Error )
|
||||
ah_hinter_compute_globals( AH_Hinter hinter );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AHGLOBAL_H__ */
|
||||
|
||||
|
||||
/* END */
|
File diff suppressed because it is too large
Load Diff
@ -1,95 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahglyph.h */
|
||||
/* */
|
||||
/* Routines used to load and analyze a given glyph before hinting */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AHGLYPH_H__
|
||||
#define __AHGLYPH_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include "ahtypes.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef enum AH_UV_
|
||||
{
|
||||
AH_UV_FXY,
|
||||
AH_UV_FYX,
|
||||
AH_UV_OXY,
|
||||
AH_UV_OYX,
|
||||
AH_UV_OX,
|
||||
AH_UV_OY,
|
||||
AH_UV_YX,
|
||||
AH_UV_XY /* should always be last! */
|
||||
|
||||
} AH_UV;
|
||||
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_setup_uv( AH_Outline outline,
|
||||
AH_UV source );
|
||||
|
||||
|
||||
/* AH_OutlineRec functions - they should be typically called in this order */
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
ah_outline_new( FT_Memory memory,
|
||||
AH_Outline* aoutline );
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
ah_outline_load( AH_Outline outline,
|
||||
FT_Fixed x_scale,
|
||||
FT_Fixed y_scale,
|
||||
FT_Face face );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_outline_compute_segments( AH_Outline outline );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_outline_link_segments( AH_Outline outline );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_outline_detect_features( AH_Outline outline );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_outline_compute_blue_edges( AH_Outline outline,
|
||||
AH_Face_Globals globals );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_outline_scale_blue_edges( AH_Outline outline,
|
||||
AH_Face_Globals globals );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_outline_save( AH_Outline outline,
|
||||
AH_Loader loader );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_outline_done( AH_Outline outline );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AHGLYPH_H__ */
|
||||
|
||||
|
||||
/* END */
|
File diff suppressed because it is too large
Load Diff
@ -1,75 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahhint.h */
|
||||
/* */
|
||||
/* Glyph hinter (declaration). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AHHINT_H__
|
||||
#define __AHHINT_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include "ahglobal.h"
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define AH_HINT_DEFAULT 0
|
||||
#define AH_HINT_NO_ALIGNMENT 1
|
||||
#define AH_HINT_NO_HORZ_EDGES 0x200000L /* temporary hack */
|
||||
#define AH_HINT_NO_VERT_EDGES 0x400000L /* temporary hack */
|
||||
|
||||
|
||||
/* create a new empty hinter object */
|
||||
FT_LOCAL( FT_Error )
|
||||
ah_hinter_new( FT_Library library,
|
||||
AH_Hinter* ahinter );
|
||||
|
||||
/* Load a hinted glyph in the hinter */
|
||||
FT_LOCAL( FT_Error )
|
||||
ah_hinter_load_glyph( AH_Hinter hinter,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int32 load_flags );
|
||||
|
||||
/* finalize a hinter object */
|
||||
FT_LOCAL( void )
|
||||
ah_hinter_done( AH_Hinter hinter );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_hinter_done_face_globals( AH_Face_Globals globals );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_hinter_get_global_hints( AH_Hinter hinter,
|
||||
FT_Face face,
|
||||
void** global_hints,
|
||||
long* global_len );
|
||||
|
||||
FT_LOCAL( void )
|
||||
ah_hinter_done_global_hints( AH_Hinter hinter,
|
||||
void* global_hints );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AHHINT_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,61 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahloader.h */
|
||||
/* */
|
||||
/* Glyph loader for the auto-hinting module (declaration only). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This defines the AH_GlyphLoader type; it is simply a typedef to */
|
||||
/* FT_GlyphLoader. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AHLOADER_H__
|
||||
#define __AHLOADER_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#include FT_INTERNAL_GLYPH_LOADER_H
|
||||
|
||||
#define AH_Load FT_GlyphLoad
|
||||
#define AH_Loader FT_GlyphLoader
|
||||
|
||||
#define ah_loader_new FT_GlyphLoader_New
|
||||
#define ah_loader_done FT_GlyphLoader_Done
|
||||
#define ah_loader_reset FT_GlyphLoader_Reset
|
||||
#define ah_loader_rewind FT_GlyphLoader_Rewind
|
||||
#define ah_loader_create_extra FT_GlyphLoader_CreateExtra
|
||||
#define ah_loader_check_points FT_GlyphLoader_CheckPoints
|
||||
#define ah_loader_check_subglyphs FT_GlyphLoader_CheckSubGlyphs
|
||||
#define ah_loader_prepare FT_GlyphLoader_Prepare
|
||||
#define ah_loader_add FT_GlyphLoader_Add
|
||||
#define ah_loader_copy_points FT_GlyphLoader_CopyPoints
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AHLOADER_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,137 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahmodule.c */
|
||||
/* */
|
||||
/* Auto-hinting module implementation (declaration). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_MODULE_H
|
||||
#include "ahhint.h"
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
AH_Hinter ah_debug_hinter = NULL;
|
||||
FT_Bool ah_debug_disable_horz = 0;
|
||||
FT_Bool ah_debug_disable_vert = 0;
|
||||
#endif
|
||||
|
||||
typedef struct FT_AutoHinterRec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
AH_Hinter hinter;
|
||||
|
||||
} FT_AutoHinterRec;
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ft_autohinter_init( FT_AutoHinter module )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = ah_hinter_new( module->root.library, &module->hinter );
|
||||
#ifdef DEBUG_HINTER
|
||||
if ( !error )
|
||||
ah_debug_hinter = module->hinter;
|
||||
#endif
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
ft_autohinter_done( FT_AutoHinter module )
|
||||
{
|
||||
ah_hinter_done( module->hinter );
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
ah_debug_hinter = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
ft_autohinter_load_glyph( FT_AutoHinter module,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int32 load_flags )
|
||||
{
|
||||
return ah_hinter_load_glyph( module->hinter,
|
||||
slot, size, glyph_index, load_flags );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
ft_autohinter_reset_globals( FT_AutoHinter module,
|
||||
FT_Face face )
|
||||
{
|
||||
FT_UNUSED( module );
|
||||
|
||||
if ( face->autohint.data )
|
||||
ah_hinter_done_face_globals( (AH_Face_Globals)(face->autohint.data) );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
ft_autohinter_get_globals( FT_AutoHinter module,
|
||||
FT_Face face,
|
||||
void** global_hints,
|
||||
long* global_len )
|
||||
{
|
||||
ah_hinter_get_global_hints( module->hinter, face,
|
||||
global_hints, global_len );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( void )
|
||||
ft_autohinter_done_globals( FT_AutoHinter module,
|
||||
void* global_hints )
|
||||
{
|
||||
ah_hinter_done_global_hints( module->hinter, global_hints );
|
||||
}
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE_DEF
|
||||
const FT_AutoHinter_ServiceRec ft_autohinter_service =
|
||||
{
|
||||
ft_autohinter_reset_globals,
|
||||
ft_autohinter_get_globals,
|
||||
ft_autohinter_done_globals,
|
||||
ft_autohinter_load_glyph
|
||||
};
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE_DEF
|
||||
const FT_Module_Class autohint_module_class =
|
||||
{
|
||||
FT_MODULE_HINTER,
|
||||
sizeof ( FT_AutoHinterRec ),
|
||||
|
||||
"autohinter",
|
||||
0x10000L, /* version 1.0 of the autohinter */
|
||||
0x20000L, /* requires FreeType 2.0 or above */
|
||||
|
||||
(const void*) &ft_autohinter_service,
|
||||
|
||||
(FT_Module_Constructor)ft_autohinter_init,
|
||||
(FT_Module_Destructor) ft_autohinter_done,
|
||||
(FT_Module_Requester) 0
|
||||
};
|
||||
|
||||
|
||||
/* END */
|
@ -1,42 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahmodule.h */
|
||||
/* */
|
||||
/* Auto-hinting module (declaration). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AHMODULE_H__
|
||||
#define __AHMODULE_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
FT_CALLBACK_TABLE
|
||||
const FT_Module_Class autohint_module_class;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AHMODULE_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,527 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ahtypes.h */
|
||||
/* */
|
||||
/* General types and definitions for the auto-hint module */
|
||||
/* (specification only). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003, 2004 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __AHTYPES_H__
|
||||
#define __AHTYPES_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
#include <../src/autohint/ahloader.h>
|
||||
#else
|
||||
#include "ahloader.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define xxAH_DEBUG
|
||||
|
||||
|
||||
#ifdef AH_DEBUG
|
||||
|
||||
#include <stdio.h>
|
||||
#define AH_LOG( x ) printf ## x
|
||||
|
||||
#else
|
||||
|
||||
#define AH_LOG( x ) do ; while ( 0 ) /* nothing */
|
||||
|
||||
#endif /* AH_DEBUG */
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** COMPILE-TIME BUILD OPTIONS ****/
|
||||
/**** ****/
|
||||
/**** Toggle these configuration macros to experiment with `features' ****/
|
||||
/**** of the auto-hinter. ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* If this option is defined, only strong interpolation will be used to */
|
||||
/* place the points between edges. Otherwise, `smooth' points are */
|
||||
/* detected and later hinted through weak interpolation to correct some */
|
||||
/* unpleasant artefacts. */
|
||||
/* */
|
||||
#undef AH_OPTION_NO_WEAK_INTERPOLATION
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Undefine this macro if you don't want to hint the metrics. There is */
|
||||
/* no reason to do this (at least for non-CJK scripts), except for */
|
||||
/* experimentation. */
|
||||
/* */
|
||||
#undef AH_HINT_METRICS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define this macro if you do not want to insert extra edges at a */
|
||||
/* glyph's x and y extremum (if there isn't one already available). */
|
||||
/* This helps to reduce a number of artefacts and allows hinting of */
|
||||
/* metrics. */
|
||||
/* */
|
||||
#undef AH_OPTION_NO_EXTREMUM_EDGES
|
||||
|
||||
|
||||
/* don't touch for now */
|
||||
#define AH_MAX_WIDTHS 12
|
||||
#define AH_MAX_HEIGHTS 12
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** TYPE DEFINITIONS ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* see ahangles.h */
|
||||
typedef FT_Int AH_Angle;
|
||||
|
||||
|
||||
/* hint flags */
|
||||
#define AH_FLAG_NONE 0
|
||||
|
||||
/* bezier control points flags */
|
||||
#define AH_FLAG_CONIC 1
|
||||
#define AH_FLAG_CUBIC 2
|
||||
#define AH_FLAG_CONTROL ( AH_FLAG_CONIC | AH_FLAG_CUBIC )
|
||||
|
||||
/* extrema flags */
|
||||
#define AH_FLAG_EXTREMA_X 4
|
||||
#define AH_FLAG_EXTREMA_Y 8
|
||||
|
||||
/* roundness */
|
||||
#define AH_FLAG_ROUND_X 16
|
||||
#define AH_FLAG_ROUND_Y 32
|
||||
|
||||
/* touched */
|
||||
#define AH_FLAG_TOUCH_X 64
|
||||
#define AH_FLAG_TOUCH_Y 128
|
||||
|
||||
/* weak interpolation */
|
||||
#define AH_FLAG_WEAK_INTERPOLATION 256
|
||||
#define AH_FLAG_INFLECTION 512
|
||||
|
||||
typedef FT_Int AH_Flags;
|
||||
|
||||
|
||||
/* edge hint flags */
|
||||
#define AH_EDGE_NORMAL 0
|
||||
#define AH_EDGE_ROUND 1
|
||||
#define AH_EDGE_SERIF 2
|
||||
#define AH_EDGE_DONE 4
|
||||
|
||||
typedef FT_Int AH_Edge_Flags;
|
||||
|
||||
|
||||
/* hint directions -- the values are computed so that two vectors are */
|
||||
/* in opposite directions iff `dir1+dir2 == 0' */
|
||||
#define AH_DIR_NONE 4
|
||||
#define AH_DIR_RIGHT 1
|
||||
#define AH_DIR_LEFT -1
|
||||
#define AH_DIR_UP 2
|
||||
#define AH_DIR_DOWN -2
|
||||
|
||||
typedef FT_Int AH_Direction;
|
||||
|
||||
|
||||
typedef struct AH_PointRec_* AH_Point;
|
||||
typedef struct AH_SegmentRec_* AH_Segment;
|
||||
typedef struct AH_EdgeRec_* AH_Edge;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* AH_PointRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model an outline point to the AH_OutlineRec */
|
||||
/* type. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* flags :: The current point hint flags. */
|
||||
/* */
|
||||
/* ox, oy :: The current original scaled coordinates. */
|
||||
/* */
|
||||
/* fx, fy :: The current coordinates in font units. */
|
||||
/* */
|
||||
/* x, y :: The current hinted coordinates. */
|
||||
/* */
|
||||
/* u, v :: Point coordinates -- meaning varies with context. */
|
||||
/* */
|
||||
/* in_dir :: The direction of the inwards vector (prev->point). */
|
||||
/* */
|
||||
/* out_dir :: The direction of the outwards vector (point->next). */
|
||||
/* */
|
||||
/* next :: The next point in same contour. */
|
||||
/* */
|
||||
/* prev :: The previous point in same contour. */
|
||||
/* */
|
||||
typedef struct AH_PointRec_
|
||||
{
|
||||
AH_Flags flags; /* point flags used by hinter */
|
||||
FT_Pos ox, oy;
|
||||
FT_Pos fx, fy;
|
||||
FT_Pos x, y;
|
||||
FT_Pos u, v;
|
||||
|
||||
AH_Direction in_dir; /* direction of inwards vector */
|
||||
AH_Direction out_dir; /* direction of outwards vector */
|
||||
|
||||
AH_Point next; /* next point in contour */
|
||||
AH_Point prev; /* previous point in contour */
|
||||
|
||||
} AH_PointRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* AH_SegmentRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to describe an edge segment to the auto-hinter. */
|
||||
/* A segment is simply a sequence of successive points located on the */
|
||||
/* same horizontal or vertical `position', in a given direction. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* flags :: The segment edge flags (straight, rounded, etc.). */
|
||||
/* */
|
||||
/* dir :: The segment direction. */
|
||||
/* */
|
||||
/* min_coord :: The minimum coordinate of the segment. */
|
||||
/* */
|
||||
/* max_coord :: The maximum coordinate of the segment. */
|
||||
/* */
|
||||
/* edge :: The edge of the current segment. */
|
||||
/* */
|
||||
/* edge_next :: The next segment on the same edge. */
|
||||
/* */
|
||||
/* link :: The pairing segment for this edge. */
|
||||
/* */
|
||||
/* serif :: The primary segment for serifs. */
|
||||
/* */
|
||||
/* num_linked :: The number of other segments that link to this one. */
|
||||
/* */
|
||||
/* score :: Used to score the segment when selecting them. */
|
||||
/* */
|
||||
/* first :: The first point in the segment. */
|
||||
/* */
|
||||
/* last :: The last point in the segment. */
|
||||
/* */
|
||||
/* contour :: A pointer to the first point of the segment's */
|
||||
/* contour. */
|
||||
/* */
|
||||
typedef struct AH_SegmentRec_
|
||||
{
|
||||
AH_Edge_Flags flags;
|
||||
AH_Direction dir;
|
||||
FT_Pos pos; /* position of segment */
|
||||
FT_Pos min_coord; /* minimum coordinate of segment */
|
||||
FT_Pos max_coord; /* maximum coordinate of segment */
|
||||
|
||||
AH_Edge edge;
|
||||
AH_Segment edge_next;
|
||||
|
||||
AH_Segment link; /* link segment */
|
||||
AH_Segment serif; /* primary segment for serifs */
|
||||
FT_Pos num_linked; /* number of linked segments */
|
||||
FT_Pos score;
|
||||
|
||||
AH_Point first; /* first point in edge segment */
|
||||
AH_Point last; /* last point in edge segment */
|
||||
AH_Point* contour; /* ptr to first point of segment's contour */
|
||||
|
||||
} AH_SegmentRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* AH_EdgeRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to describe an edge, which really is a horizontal */
|
||||
/* or vertical coordinate to be hinted depending on the segments */
|
||||
/* located on it. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* fpos :: The original edge position in font units. */
|
||||
/* */
|
||||
/* opos :: The original scaled edge position. */
|
||||
/* */
|
||||
/* pos :: The hinted edge position. */
|
||||
/* */
|
||||
/* flags :: The segment edge flags (straight, rounded, etc.). */
|
||||
/* */
|
||||
/* dir :: The main segment direction on this edge. */
|
||||
/* */
|
||||
/* scale :: Scaling factor between original and hinted edge */
|
||||
/* positions. */
|
||||
/* */
|
||||
/* blue_edge :: Indicate the blue zone edge this edge is related to. */
|
||||
/* Only set for some of the horizontal edges in a latin */
|
||||
/* font. */
|
||||
/* */
|
||||
/* link :: The linked edge. */
|
||||
/* */
|
||||
/* serif :: The serif edge. */
|
||||
/* */
|
||||
/* num_linked :: The number of other edges that pair to this one. */
|
||||
/* */
|
||||
/* score :: Used to score the edge when selecting them. */
|
||||
/* */
|
||||
/* first :: The first edge segment. */
|
||||
/* */
|
||||
/* last :: The last edge segment. */
|
||||
/* */
|
||||
typedef struct AH_EdgeRec_
|
||||
{
|
||||
FT_Pos fpos;
|
||||
FT_Pos opos;
|
||||
FT_Pos pos;
|
||||
|
||||
AH_Edge_Flags flags;
|
||||
AH_Direction dir;
|
||||
FT_Fixed scale;
|
||||
FT_Pos* blue_edge;
|
||||
|
||||
AH_Edge link;
|
||||
AH_Edge serif;
|
||||
FT_Int num_linked;
|
||||
|
||||
FT_Int score;
|
||||
|
||||
AH_Segment first;
|
||||
AH_Segment last;
|
||||
|
||||
|
||||
} AH_EdgeRec;
|
||||
|
||||
|
||||
/* an outline as seen by the hinter */
|
||||
typedef struct AH_OutlineRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
|
||||
AH_Direction vert_major_dir; /* vertical major direction */
|
||||
AH_Direction horz_major_dir; /* horizontal major direction */
|
||||
|
||||
FT_Fixed x_scale;
|
||||
FT_Fixed y_scale;
|
||||
FT_Pos edge_distance_threshold;
|
||||
|
||||
FT_Int max_points;
|
||||
FT_Int num_points;
|
||||
AH_Point points;
|
||||
|
||||
FT_Int max_contours;
|
||||
FT_Int num_contours;
|
||||
AH_Point* contours;
|
||||
|
||||
FT_Int num_hedges;
|
||||
AH_Edge horz_edges;
|
||||
|
||||
FT_Int num_vedges;
|
||||
AH_Edge vert_edges;
|
||||
|
||||
FT_Int num_hsegments;
|
||||
AH_Segment horz_segments;
|
||||
|
||||
FT_Int num_vsegments;
|
||||
AH_Segment vert_segments;
|
||||
|
||||
} AH_OutlineRec, *AH_Outline;
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_CHESTER_SMALL_F
|
||||
|
||||
#define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */
|
||||
#define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */
|
||||
#define AH_BLUE_SMALL_F_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* fijkdbh */
|
||||
#define AH_BLUE_SMALL_TOP ( AH_BLUE_SMALL_F_TOP + 1 ) /* xzroesc */
|
||||
#define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */
|
||||
#define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */
|
||||
#define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 )
|
||||
|
||||
#else /* !FT_CONFIG_CHESTER_SMALL_F */
|
||||
|
||||
#define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */
|
||||
#define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */
|
||||
#define AH_BLUE_SMALL_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* xzroesc */
|
||||
#define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */
|
||||
#define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */
|
||||
#define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 )
|
||||
|
||||
#endif /* !FT_CONFIG_CHESTER_SMALL_F */
|
||||
|
||||
typedef FT_Int AH_Blue;
|
||||
|
||||
|
||||
#define AH_HINTER_MONOCHROME 1
|
||||
#define AH_HINTER_OPTIMIZE 2
|
||||
|
||||
typedef FT_Int AH_Hinter_Flags;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* AH_GlobalsRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Holds the global metrics for a given font face (be it in design */
|
||||
/* units or scaled pixel values). */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* num_widths :: The number of widths. */
|
||||
/* */
|
||||
/* num_heights :: The number of heights. */
|
||||
/* */
|
||||
/* stds :: A two-element array giving the default stem width */
|
||||
/* and height. */
|
||||
/* */
|
||||
/* widths :: Snap widths, including standard one. */
|
||||
/* */
|
||||
/* heights :: Snap height, including standard one. */
|
||||
/* */
|
||||
/* blue_refs :: The reference positions of blue zones. */
|
||||
/* */
|
||||
/* blue_shoots :: The overshoot positions of blue zones. */
|
||||
/* */
|
||||
typedef struct AH_GlobalsRec_
|
||||
{
|
||||
FT_Int num_widths;
|
||||
FT_Int num_heights;
|
||||
|
||||
FT_Pos stds[2];
|
||||
|
||||
FT_Pos widths [AH_MAX_WIDTHS];
|
||||
FT_Pos heights[AH_MAX_HEIGHTS];
|
||||
|
||||
FT_Pos blue_refs [AH_BLUE_MAX];
|
||||
FT_Pos blue_shoots[AH_BLUE_MAX];
|
||||
|
||||
} AH_GlobalsRec, *AH_Globals;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* AH_Face_GlobalsRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Holds the complete global metrics for a given font face (i.e., the */
|
||||
/* design units version + a scaled version + the current scales */
|
||||
/* used). */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* face :: A handle to the source face object */
|
||||
/* */
|
||||
/* design :: The globals in font design units. */
|
||||
/* */
|
||||
/* scaled :: Scaled globals in sub-pixel values. */
|
||||
/* */
|
||||
/* x_scale :: The current horizontal scale. */
|
||||
/* */
|
||||
/* y_scale :: The current vertical scale. */
|
||||
/* */
|
||||
/* control_overshoot :: */
|
||||
/* Currently unused. */
|
||||
/* */
|
||||
typedef struct AH_Face_GlobalsRec_
|
||||
{
|
||||
FT_Face face;
|
||||
AH_GlobalsRec design;
|
||||
AH_GlobalsRec scaled;
|
||||
FT_Fixed x_scale;
|
||||
FT_Fixed y_scale;
|
||||
FT_Bool control_overshoot;
|
||||
|
||||
} AH_Face_GlobalsRec, *AH_Face_Globals;
|
||||
|
||||
|
||||
typedef struct AH_HinterRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
AH_Hinter_Flags flags;
|
||||
|
||||
FT_Int algorithm;
|
||||
FT_Face face;
|
||||
|
||||
AH_Face_Globals globals;
|
||||
|
||||
AH_Outline glyph;
|
||||
|
||||
AH_Loader loader;
|
||||
FT_Vector pp1; /* horizontal phantom points */
|
||||
FT_Vector pp2;
|
||||
/* we ignore vertical phantom points */
|
||||
|
||||
FT_Bool transformed;
|
||||
FT_Vector trans_delta;
|
||||
FT_Matrix trans_matrix;
|
||||
|
||||
FT_Bool do_horz_hints; /* disable X hinting */
|
||||
FT_Bool do_vert_hints; /* disable Y hinting */
|
||||
FT_Bool do_horz_snapping; /* disable X stem size snapping */
|
||||
FT_Bool do_vert_snapping; /* disable Y stem size snapping */
|
||||
FT_Bool do_stem_adjust; /* disable light stem snapping */
|
||||
|
||||
} AH_HinterRec, *AH_Hinter;
|
||||
|
||||
|
||||
#ifdef DEBUG_HINTER
|
||||
extern AH_Hinter ah_debug_hinter;
|
||||
extern FT_Bool ah_debug_disable_horz;
|
||||
extern FT_Bool ah_debug_disable_vert;
|
||||
#else
|
||||
#define ah_debug_disable_horz 0
|
||||
#define ah_debug_disable_vert 0
|
||||
#endif /* DEBUG_HINTER */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __AHTYPES_H__ */
|
||||
|
||||
|
||||
/* END */
|
@ -1,32 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* autohint.c */
|
||||
/* */
|
||||
/* Automatic Hinting wrapper (body only). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 Catharon Productions Inc. */
|
||||
/* Author: David Turner */
|
||||
/* */
|
||||
/* This file is part of the Catharon Typography Project and shall only */
|
||||
/* be used, modified, and distributed under the terms of the Catharon */
|
||||
/* Open Source License that should come with this file under the name */
|
||||
/* `CatharonLicense.txt'. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/* Note that this license is compatible with the FreeType license. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#include <ft2build.h>
|
||||
#include "ahangles.c"
|
||||
#include "ahglyph.c"
|
||||
#include "ahglobal.c"
|
||||
#include "ahhint.c"
|
||||
#include "ahmodule.c"
|
||||
|
||||
|
||||
/* END */
|
@ -1,25 +0,0 @@
|
||||
#
|
||||
# FreeType 2 auto-hinter module compilation rules for VMS
|
||||
#
|
||||
|
||||
|
||||
# Copyright 2001, 2002 Catharon Productions Inc.
|
||||
#
|
||||
# This file is part of the Catharon Typography Project and shall only
|
||||
# be used, modified, and distributed under the terms of the Catharon
|
||||
# Open Source License that should come with this file under the name
|
||||
# `CatharonLicense.txt'. By continuing to use, modify, or distribute
|
||||
# this file you indicate that you have read the license and
|
||||
# understand and accept it fully.
|
||||
#
|
||||
# Note that this license is compatible with the FreeType license.
|
||||
|
||||
|
||||
CFLAGS=$(COMP_FLAGS)$(DEBUG)/incl=([--.include],[--.src.autohint])
|
||||
|
||||
OBJS=autohint.obj
|
||||
|
||||
all : $(OBJS)
|
||||
library [--.lib]freetype.olb $(OBJS)
|
||||
|
||||
# EOF
|
@ -1,78 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
|
||||
#
|
||||
# autohint math table builder
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000 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.
|
||||
|
||||
|
||||
import math
|
||||
|
||||
ag_pi = 256
|
||||
|
||||
def print_arctan( atan_bits ):
|
||||
atan_base = 1 << atan_bits
|
||||
|
||||
print " static AH_Angle ag_arctan[1L << AG_ATAN_BITS] ="
|
||||
print " {"
|
||||
|
||||
count = 0
|
||||
line = " "
|
||||
|
||||
for n in range( atan_base ):
|
||||
comma = ","
|
||||
if ( n == atan_base - 1 ):
|
||||
comma = ""
|
||||
|
||||
angle = math.atan( n * 1.0 / atan_base ) / math.pi * ag_pi
|
||||
line = line + " " + repr( int( angle + 0.5 ) ) + comma
|
||||
count = count + 1;
|
||||
if ( count == 8 ):
|
||||
count = 0
|
||||
print line
|
||||
line = " "
|
||||
|
||||
if ( count > 0 ):
|
||||
print line
|
||||
print " };"
|
||||
|
||||
|
||||
# This routine is not used currently.
|
||||
#
|
||||
def print_sines():
|
||||
print " static FT_Fixed ah_sines[AG_HALF_PI + 1] ="
|
||||
print " {"
|
||||
|
||||
count = 0
|
||||
line = " "
|
||||
|
||||
for n in range( ag_pi / 2 ):
|
||||
sinus = math.sin( n * math.pi / ag_pi )
|
||||
line = line + " " + repr( int( 65536.0 * sinus ) ) + ","
|
||||
count = count + 1
|
||||
if ( count == 8 ):
|
||||
count = 0
|
||||
print line
|
||||
line = " "
|
||||
|
||||
if ( count > 0 ):
|
||||
print line
|
||||
print " 65536"
|
||||
print " };"
|
||||
|
||||
|
||||
print_arctan( 8 )
|
||||
print
|
||||
|
||||
|
||||
# END
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user