mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
Freetype 2 includes
svn path=/trunk/; revision=1855
This commit is contained in:
@@ -0,0 +1,187 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftconfig.h */
|
||||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This header file contains a number of macro definitions that are used */
|
||||
/* by the rest of the engine. Most of the macros here are automatically */
|
||||
/* determined at compile time, and you should not need to change it to */
|
||||
/* port FreeType, except to compile the library with a non-ANSI */
|
||||
/* compiler. */
|
||||
/* */
|
||||
/* Note however that if some specific modifications are needed, we */
|
||||
/* advise you to place a modified copy in your build directory. */
|
||||
/* */
|
||||
/* The build directory is usually `freetype/builds/<system>', and */
|
||||
/* contains system-specific files that are always included first when */
|
||||
/* building the library. */
|
||||
/* */
|
||||
/* This ANSI version should stay in `include/freetype/config'. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTCONFIG_H
|
||||
#define FTCONFIG_H
|
||||
|
||||
|
||||
/* Include the header file containing all developer build options */
|
||||
#include <freetype/config/ftoption.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* These macros can be toggled to suit a specific system. The current */
|
||||
/* ones are defaults used to compile FreeType in an ANSI C environment */
|
||||
/* (16bit compilers are also supported). Copy this file to your own */
|
||||
/* `freetype/builds/<system>' directory, and edit it to port the engine. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* We use <limits.h> values to know the sizes of the types. */
|
||||
#include <limits.h>
|
||||
|
||||
/* The number of bytes in an `int' type. */
|
||||
#if UINT_MAX == 0xFFFFFFFF
|
||||
#define FT_SIZEOF_INT 4
|
||||
#elif UINT_MAX == 0xFFFF
|
||||
#define FT_SIZEOF_INT 2
|
||||
#elif UINT_MAX > 0xFFFFFFFF && UINT_MAX == 0xFFFFFFFFFFFFFFFF
|
||||
#define FT_SIZEOF_INT 8
|
||||
#else
|
||||
#error "Unsupported number of bytes in `int' type!"
|
||||
#endif
|
||||
|
||||
/* The number of bytes in a `long' type. */
|
||||
#if ULONG_MAX == 0xFFFFFFFF
|
||||
#define FT_SIZEOF_LONG 4
|
||||
#elif ULONG_MAX > 0xFFFFFFFF && ULONG_MAX == 0xFFFFFFFFFFFFFFFF
|
||||
#define FT_SIZEOF_LONG 8
|
||||
#else
|
||||
#error "Unsupported number of bytes in `long' type!"
|
||||
#endif
|
||||
|
||||
|
||||
/* Preferred alignment of data */
|
||||
#define FT_ALIGNMENT 8
|
||||
|
||||
|
||||
/* UNUSED is a macro used to indicate that a given parameter is not used */
|
||||
/* -- this is only used to get rid of unpleasant compiler warnings */
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* AUTOMATIC CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* These macros are computed from the ones defined above. Don't touch */
|
||||
/* their definition, unless you know precisely what you are doing. No */
|
||||
/* porter should need to mess with them. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* IntN types */
|
||||
/* */
|
||||
/* Used to guarantee the size of some specific integers. */
|
||||
/* */
|
||||
typedef signed short FT_Int16;
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == 4
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
#if FT_SIZEOF_LONG == 8
|
||||
|
||||
/* FT_LONG64 must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
|
||||
#else
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Many compilers provide the non-ANSI `long long' 64-bit type. You can */
|
||||
/* activate it by defining the FTCALC_USE_LONG_LONG macro in */
|
||||
/* `ftoption.h'. */
|
||||
/* */
|
||||
/* Note that this will produce many -ansi warnings during library */
|
||||
/* compilation, and that in many cases, the generated code will be */
|
||||
/* neither smaller nor faster! */
|
||||
/* */
|
||||
#ifdef FTCALC_USE_LONG_LONG
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long
|
||||
|
||||
#endif /* FTCALC_USE_LONG_LONG */
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
|
||||
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
#define LOCAL_DEF static
|
||||
#define LOCAL_FUNC static
|
||||
#else
|
||||
#define LOCAL_DEF extern
|
||||
#define LOCAL_FUNC /* nothing */
|
||||
#endif
|
||||
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_LIBRARY_OBJECT
|
||||
#define BASE_DEF( x ) static x
|
||||
#define BASE_FUNC( x ) static x
|
||||
#else
|
||||
#define BASE_DEF( x ) extern x
|
||||
#define BASE_FUNC( x ) extern x
|
||||
#endif
|
||||
|
||||
#ifndef FT_EXPORT_DEF
|
||||
#define FT_EXPORT_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#ifndef FT_EXPORT_FUNC
|
||||
#define FT_EXPORT_FUNC( x ) extern x
|
||||
#endif
|
||||
|
||||
#ifndef FT_EXPORT_VAR
|
||||
#define FT_EXPORT_VAR( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* FTCONFIG_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,10 @@
|
||||
FT_USE_MODULE(autohint_module_class)
|
||||
FT_USE_MODULE(cff_driver_class)
|
||||
FT_USE_MODULE(t1cid_driver_class)
|
||||
FT_USE_MODULE(psnames_module_class)
|
||||
FT_USE_MODULE(ft_raster1_renderer_class)
|
||||
FT_USE_MODULE(sfnt_module_class)
|
||||
FT_USE_MODULE(ft_smooth_renderer_class)
|
||||
FT_USE_MODULE(tt_driver_class)
|
||||
FT_USE_MODULE(t1_driver_class)
|
||||
FT_USE_MODULE(winfnt_driver_class)
|
||||
@@ -0,0 +1,395 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftoption.h */
|
||||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTOPTION_H
|
||||
#define FTOPTION_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* USER-SELECTABLE CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* These macros can be toggled by developers to enable or disable */
|
||||
/* certain aspects of FreeType. This is a default file, where all major */
|
||||
/* options are enabled. */
|
||||
/* */
|
||||
/* Note that if some modifications are required for your build, we */
|
||||
/* advise you to put a modified copy of this file in your build */
|
||||
/* directory, rather than modifying it in-place. */
|
||||
/* */
|
||||
/* The build directory is normally `freetype/builds/<system>' and */
|
||||
/* contains build or system-specific files that are included in */
|
||||
/* priority when building the library. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Convenience functions support */
|
||||
/* */
|
||||
/* Some functions of the FreeType 2 API are provided as a convenience */
|
||||
/* for client applications and developers. However, they are not */
|
||||
/* required to build and run the library itself. */
|
||||
/* */
|
||||
/* By defining this configuration macro, you'll disable the */
|
||||
/* compilation of these functions at build time. This can be useful */
|
||||
/* to reduce the library's code size when you don't need any of */
|
||||
/* these functions. */
|
||||
/* */
|
||||
/* All convenience functions are declared as such in their */
|
||||
/* documentation. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Alternate Glyph Image Format support */
|
||||
/* */
|
||||
/* By default, the glyph images returned by the FreeType glyph loader */
|
||||
/* can either be a pixmap or a vectorial outline defined through */
|
||||
/* Bezier control points. When defining the following configuration */
|
||||
/* macro, some font drivers will be able to register alternate */
|
||||
/* glyph image formats. */
|
||||
/* */
|
||||
/* Unset this macro if you are sure that you will never use a font */
|
||||
/* driver with an alternate glyph format; this will reduce the size of */
|
||||
/* the base layer code. */
|
||||
/* */
|
||||
/* Note that a few Type 1 fonts, as well as Windows `vector' fonts */
|
||||
/* use a vector `plotter' format that isn't supported when this */
|
||||
/* macro is undefined. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Glyph Postscript Names handling */
|
||||
/* */
|
||||
/* By default, FreeType 2 is compiled with the `PSNames' module. This */
|
||||
/* This module is in charge of converting a glyph name string into a */
|
||||
/* Unicode value, or return a Macintosh standard glyph name for the */
|
||||
/* use with the TrueType `post' table. */
|
||||
/* */
|
||||
/* Undefine this macro if you do not want `PSNames' compiled in your */
|
||||
/* build of FreeType. This has the following effects: */
|
||||
/* */
|
||||
/* - The TrueType driver will provide its own set of glyph names, */
|
||||
/* if you build it to support postscript names in the TrueType */
|
||||
/* `post' table. */
|
||||
/* */
|
||||
/* - The Type 1 driver will not be able to synthetize a Unicode */
|
||||
/* charmap out of the glyphs found in the fonts. */
|
||||
/* */
|
||||
/* You would normally undefine this configuration macro when building */
|
||||
/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Postscript Names to Unicode Values support */
|
||||
/* */
|
||||
/* By default, FreeType 2 is built with the `PSNames' module compiled */
|
||||
/* in. Among other things, the module is used to convert a glyph name */
|
||||
/* into a Unicode value. This is especially useful in order to */
|
||||
/* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
|
||||
/* through a big table named the `Adobe Glyph List' (AGL). */
|
||||
/* */
|
||||
/* Undefine this macro if you do not want the Adobe Glyph List */
|
||||
/* compiled in your `PSNames' module. The Type 1 driver will not be */
|
||||
/* able to synthetize a Unicode charmap out of the glyphs found in the */
|
||||
/* fonts. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Many compilers provide the non-ANSI `long long' 64-bit type. You can */
|
||||
/* activate it by defining the FTCALC_USE_LONG_LONG macro. Note that */
|
||||
/* this will produce many -ansi warnings during library compilation, and */
|
||||
/* that in many cases the generated code will not be smaller or faster! */
|
||||
/* */
|
||||
#undef FTCALC_USE_LONG_LONG
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* DLL export compilation */
|
||||
/* */
|
||||
/* When compiling FreeType as a DLL, some systems/compilers need a */
|
||||
/* special keyword in front OR after the return type of function */
|
||||
/* declarations. */
|
||||
/* */
|
||||
/* Two macros are used within the FreeType source code to define */
|
||||
/* exported library functions: FT_EXPORT_DEF and FT_EXPORT_FUNC. */
|
||||
/* */
|
||||
/* FT_EXPORT_DEF( return_type ) */
|
||||
/* */
|
||||
/* is used in a function declaration, as in */
|
||||
/* */
|
||||
/* FT_EXPORT_DEF( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_EXPORT_FUNC( return_type ) */
|
||||
/* */
|
||||
/* is used in a function definition, as in */
|
||||
/* */
|
||||
/* FT_EXPORT_FUNC( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
||||
/* { */
|
||||
/* ... some code ... */
|
||||
/* return FT_Err_Ok; */
|
||||
/* } */
|
||||
/* */
|
||||
/* You can provide your own implementation of FT_EXPORT_DEF and */
|
||||
/* FT_EXPORT_FUNC here if you want. If you leave them undefined, they */
|
||||
/* will be later automatically defined as `extern return_type' to */
|
||||
/* allow normal compilation. */
|
||||
/* */
|
||||
#undef FT_EXPORT_DEF
|
||||
#undef FT_EXPORT_FUNC
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Debug level */
|
||||
/* */
|
||||
/* FreeType can be compiled in debug or trace mode. In debug mode, */
|
||||
/* errors are reported through the `ftdebug' component. In trace */
|
||||
/* mode, additional messages are sent to the standard output during */
|
||||
/* execution. */
|
||||
/* */
|
||||
/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
|
||||
/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
|
||||
/* */
|
||||
/* Don't define any of these macros to compile in `release' mode! */
|
||||
/* */
|
||||
#define FT_DEBUG_LEVEL_ERROR
|
||||
#define FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Computation Algorithms */
|
||||
/* */
|
||||
/* Used for debugging, this configuration macro should disappear */
|
||||
/* soon. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The size in bytes of the render pool used by the scan-line converter */
|
||||
/* to do all of its work. */
|
||||
/* */
|
||||
/* This must be greater than 4kByte. */
|
||||
/* */
|
||||
#define FT_RENDER_POOL_SIZE 16384
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MAX_MODULES */
|
||||
/* */
|
||||
/* The maximum number of modules that can be registered in a single */
|
||||
/* FreeType library object. 16 is the default. */
|
||||
/* */
|
||||
#define FT_MAX_MODULES 16
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MAX_EXTENSIONS */
|
||||
/* */
|
||||
/* The maximum number of extensions that can be registered in a single */
|
||||
/* font driver. 8 is the default. */
|
||||
/* */
|
||||
/* If you don't know what this means, you certainly do not need to */
|
||||
/* change this value. */
|
||||
/* */
|
||||
#define FT_MAX_EXTENSIONS 8
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
|
||||
/* embedded bitmaps in all formats using the SFNT module (namely */
|
||||
/* TrueType & OpenType). */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
|
||||
/* load and enumerate the glyph Postscript names in a TrueType or */
|
||||
/* OpenType file. */
|
||||
/* */
|
||||
/* Note that when you do not compile the `PSNames' module by undefining */
|
||||
/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
|
||||
/* contain additional code used to read the PS Names table from a font. */
|
||||
/* */
|
||||
/* (By default, the module uses `PSNames' to extract glyph names.) */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
|
||||
/* access the internal name table in a SFNT-based format like TrueType */
|
||||
/* or OpenType. The name table contains various strings used to */
|
||||
/* describe the font, like family name, copyright, version, etc. It */
|
||||
/* does not contain any glyph name though. */
|
||||
/* */
|
||||
/* Accessing SFNT names is done through the functions declared in */
|
||||
/* `freetype/ftnames.h'. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_SFNT_NAMES
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
|
||||
/* a bytecode interpreter in the TrueType driver. Note that there are */
|
||||
/* important patent issues related to the use of the interpreter. */
|
||||
/* */
|
||||
/* By undefining this, you will only compile the code necessary to load */
|
||||
/* TrueType glyphs without hinting. */
|
||||
/* */
|
||||
#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
|
||||
/* bytecode interpreter with a huge switch statement, rather than a call */
|
||||
/* table. This results in smaller and faster code for a number of */
|
||||
/* architectures. */
|
||||
/* */
|
||||
/* Note however that on some compiler/processor combinations, undefining */
|
||||
/* this macro will generate faster, though larger, code. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_STACK_DEPTH is the maximal depth of the token stack used by */
|
||||
/* the Type 1 parser (see t1load.c). A minimum of 16 is required. */
|
||||
/* */
|
||||
#define T1_MAX_STACK_DEPTH 16
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
|
||||
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
|
||||
/* required. */
|
||||
/* */
|
||||
#define T1_MAX_DICT_DEPTH 5
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
|
||||
/* calls during glyph loading. */
|
||||
/* */
|
||||
#define T1_MAX_SUBRS_CALLS 8
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. */
|
||||
/* */
|
||||
#define T1_MAX_CHARSTRINGS_OPERANDS 32
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate a */
|
||||
/* driver with no hinter. This can be useful to debug the parser. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_DISABLE_HINTER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define this configuration macro if you want to prevent the */
|
||||
/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
|
||||
/* files into an existing face. Note that if set, the T1 driver will be */
|
||||
/* unable to produce kerning distances. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_AFM
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define this configuration macro if you want to prevent the */
|
||||
/* compilation of the Multiple Masters font support in the Type 1 */
|
||||
/* driver. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
|
||||
|
||||
|
||||
#endif /* FTOPTION_H */
|
||||
|
||||
|
||||
/* END */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftbbox.h */
|
||||
/* */
|
||||
/* FreeType bbox computation (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This component has a _single_ role: to compute exact outline bounding */
|
||||
/* boxes. */
|
||||
/* */
|
||||
/* It is separated from the rest of the engine for various technical */
|
||||
/* reasons. It may well be integrated in `ftoutln' later. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTBBOX_H
|
||||
#define FTBBOX_H
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Raster_GetBBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* 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 */
|
||||
/* extract their extrema. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* outline :: A pointer to the source outline. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* bbox :: The outline's exact bounding box. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF(FT_Error) FT_Raster_GetBBox( FT_Outline* outline,
|
||||
FT_BBox* abbox );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FTBBOX_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,166 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* fterrors.h */
|
||||
/* */
|
||||
/* FreeType error codes (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file is used to define the FreeType error enumeration constants */
|
||||
/* It can also be used to create an error message table easily with */
|
||||
/* something like: */
|
||||
/* */
|
||||
/* { */
|
||||
/* #undef FTERRORS_H */
|
||||
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
|
||||
/* #define FT_ERROR_START_LIST { */
|
||||
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
|
||||
/* */
|
||||
/* const struct */
|
||||
/* { */
|
||||
/* int err_code; */
|
||||
/* const char* err_msg */
|
||||
/* } ft_errors[] = */
|
||||
/* */
|
||||
/* #include <freetype/fterrors.h> */
|
||||
/* } */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTERRORS_H
|
||||
#define FTERRORS_H
|
||||
|
||||
|
||||
#ifndef FT_ERRORDEF
|
||||
|
||||
#define FT_ERRORDEF( e, v, s ) e = v,
|
||||
#define FT_ERROR_START_LIST enum {
|
||||
#define FT_ERROR_END_LIST FT_Err_Max };
|
||||
|
||||
#endif /* !FT_ERRORDEF */
|
||||
|
||||
|
||||
#ifdef FT_ERROR_START_LIST
|
||||
FT_ERROR_START_LIST
|
||||
#endif
|
||||
|
||||
FT_ERRORDEF( FT_Err_Ok, 0x0000, \
|
||||
"no error" )
|
||||
FT_ERRORDEF( FT_Err_Cannot_Open_Resource, 0x0001, \
|
||||
"can't open stream" )
|
||||
FT_ERRORDEF( FT_Err_Unknown_File_Format, 0x0002, \
|
||||
"unknown file format" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_File_Format, 0x0003, \
|
||||
"broken file" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Invalid_Argument, 0x0010, \
|
||||
"invalid argument" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Handle, 0x0011, \
|
||||
"invalid object handle" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Glyph_Index, 0x0012, \
|
||||
"invalid glyph index" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Character_Code, 0x0013, \
|
||||
"invalid character code" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Unimplemented_Feature, 0x0020, \
|
||||
"unimplemented feature" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Glyph_Format, 0x0021, \
|
||||
"unsupported glyph image format" )
|
||||
FT_ERRORDEF( FT_Err_Cannot_Render_Glyph, 0x0022, \
|
||||
"cannot render this glyph format" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Invalid_Library_Handle, 0x0030, \
|
||||
"invalid library handle" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Driver_Handle, 0x0031, \
|
||||
"invalid module handle" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Face_Handle, 0x0032, \
|
||||
"invalid face handle" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Size_Handle, 0x0033, \
|
||||
"invalid size handle" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Slot_Handle, 0x0034, \
|
||||
"invalid glyph slot handle" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_CharMap_Handle, 0x0035, \
|
||||
"invalid charmap handle" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Outline, 0x0036, \
|
||||
"invalid outline" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Version, 0x0037, \
|
||||
"invalid FreeType version" )
|
||||
FT_ERRORDEF( FT_Err_Lower_Module_Version, 0x0038, \
|
||||
"module version is too low" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Too_Many_Drivers, 0x0040, \
|
||||
"too many modules" )
|
||||
FT_ERRORDEF( FT_Err_Too_Many_Extensions, 0x0041, \
|
||||
"too many extensions" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Out_Of_Memory, 0x0050, \
|
||||
"out of memory" )
|
||||
FT_ERRORDEF( FT_Err_Unlisted_Object, 0x0051, \
|
||||
"unlisted object" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Invalid_Stream_Handle, 0x0060, \
|
||||
"invalid stream handle" )
|
||||
FT_ERRORDEF( FT_Err_Cannot_Open_Stream, 0x0061, \
|
||||
"cannot open stream" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Stream_Seek, 0x0062, \
|
||||
"invalid stream seek" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Stream_Skip, 0x0063, \
|
||||
"invalid stream skip" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Stream_Read, 0x0064, \
|
||||
"invalid stream read" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Stream_Operation, 0x0065, \
|
||||
"invalid stream operation" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Frame_Operation, 0x0066, \
|
||||
"invalid frame operation" )
|
||||
FT_ERRORDEF( FT_Err_Nested_Frame_Access, 0x0067, \
|
||||
"nested frame access" )
|
||||
FT_ERRORDEF( FT_Err_Invalid_Frame_Read, 0x0068, \
|
||||
"invalid frame read" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Invalid_Composite, 0x0070, \
|
||||
"invalid composite glyph" )
|
||||
FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0071, \
|
||||
"too many hints" )
|
||||
|
||||
FT_ERRORDEF( FT_Err_Raster_Uninitialized, 0x0080, \
|
||||
"raster uninitialized" )
|
||||
FT_ERRORDEF( FT_Err_Raster_Corrupted, 0x0081, \
|
||||
"raster corrupted" )
|
||||
FT_ERRORDEF( FT_Err_Raster_Overflow, 0x0082, \
|
||||
"raster overflow" )
|
||||
FT_ERRORDEF( FT_Err_Raster_Negative_Height, 0x0083, \
|
||||
"negative height while rastering" )
|
||||
|
||||
/* range 0x400 - 0x4FF is reserved for TrueType specific stuff */
|
||||
|
||||
/* range 0x500 - 0x5FF is reserved for CFF specific stuff */
|
||||
|
||||
/* range 0x600 - 0x6FF is reserved for Type1 specific stuff */
|
||||
|
||||
#ifdef FT_ERROR_END_LIST
|
||||
FT_ERROR_END_LIST
|
||||
#endif
|
||||
|
||||
|
||||
#undef FT_ERROR_START_LIST
|
||||
#undef FT_ERROR_END_LIST
|
||||
#undef FT_ERRORDEF
|
||||
|
||||
|
||||
#endif /* FTERRORS_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,422 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftglyph.h */
|
||||
/* */
|
||||
/* FreeType convenience functions to handle glyphs (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file contains the definition of several convenience functions */
|
||||
/* that can be used by client applications to easily retrieve glyph */
|
||||
/* bitmaps and outlines from a given face. */
|
||||
/* */
|
||||
/* These functions should be optional if you are writing a font server */
|
||||
/* or text layout engine on top of FreeType. However, they are pretty */
|
||||
/* handy for many other simple uses of the library. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTGLYPH_H
|
||||
#define FTGLYPH_H
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* forward declaration to a private type */
|
||||
typedef struct FT_Glyph_Class_ FT_Glyph_Class;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_GlyphRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The root glyph structure contains a given glyph image plus its */
|
||||
/* advance width in 16.16 fixed float format. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* library :: A handle to the FreeType library object. */
|
||||
/* */
|
||||
/* clazz :: A pointer to the glyph's class. Private. */
|
||||
/* */
|
||||
/* format :: The format of the glyph's image. */
|
||||
/* */
|
||||
/* advance :: A 16.16 vector that gives the glyph's advance width. */
|
||||
/* */
|
||||
typedef struct FT_GlyphRec_
|
||||
{
|
||||
FT_Library library;
|
||||
const FT_Glyph_Class* clazz;
|
||||
FT_Glyph_Format format;
|
||||
FT_Vector advance;
|
||||
|
||||
} FT_GlyphRec, *FT_Glyph;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_BitmapGlyphRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used for bitmap glyph images. This really is a */
|
||||
/* `sub-class' of `FT_GlyphRec'. */
|
||||
/* */
|
||||
/* <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 */
|
||||
/* glyph bitmap. */
|
||||
/* */
|
||||
/* top :: The top-side bearing, i.e., the vertical distance from */
|
||||
/* the current pen position to the top border of the glyph */
|
||||
/* bitmap. This distance is positive for upwards-y! */
|
||||
/* */
|
||||
/* 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 */
|
||||
/* the bitmap's contents easily. */
|
||||
/* */
|
||||
/* The corresponding pixel buffer is always owned by the BitmapGlyph */
|
||||
/* and is thus created and destroyed with it. */
|
||||
/* */
|
||||
typedef struct FT_BitmapGlyphRec_
|
||||
{
|
||||
FT_GlyphRec root;
|
||||
FT_Int left;
|
||||
FT_Int top;
|
||||
FT_Bitmap bitmap;
|
||||
|
||||
} FT_BitmapGlyphRec, *FT_BitmapGlyph;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_OutlineGlyphRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used for outline (vectorial) glyph images. This */
|
||||
/* really is a `sub-class' of `FT_GlyphRec'. */
|
||||
/* */
|
||||
/* <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 */
|
||||
/* 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(). */
|
||||
/* */
|
||||
/* The outline's tables are always owned by the object and are */
|
||||
/* destroyed with it. */
|
||||
/* */
|
||||
typedef struct FT_OutlineGlyphRec_
|
||||
{
|
||||
FT_GlyphRec root;
|
||||
FT_Outline outline;
|
||||
|
||||
} FT_OutlineGlyphRec, *FT_OutlineGlyph;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Glyph */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to extract a glyph image from a slot. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* slot :: A handle to the source glyph slot. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aglyph :: A handle to the glyph object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Get_Glyph( FT_GlyphSlot slot,
|
||||
FT_Glyph* aglyph );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Glyph_Copy */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to copy a glyph image. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* source :: A handle to the source glyph object. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* target :: A handle to the target glyph object. 0 in case of */
|
||||
/* error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Glyph_Copy( FT_Glyph source,
|
||||
FT_Glyph* target );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Glyph_Transform */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Transforms a glyph image if its format is scalable. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* glyph :: A handle to the target glyph object. */
|
||||
/* */
|
||||
/* matrix :: A pointer to a 2x2 matrix to apply. */
|
||||
/* */
|
||||
/* delta :: A pointer to a 2d vector to apply. Coordinates are */
|
||||
/* expressed in 1/64th of a pixel. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code (the glyph format is not scalable if it is */
|
||||
/* not zero). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The 2x2 transformation matrix is also applied to the glyph's */
|
||||
/* advance vector. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Glyph_Transform( FT_Glyph glyph,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta );
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
ft_glyph_bbox_pixels = 0,
|
||||
ft_glyph_bbox_subpixels = 1,
|
||||
ft_glyph_bbox_gridfit = 2
|
||||
};
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Glyph_Get_CBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns the glyph image's bounding box. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* glyph :: A handle to the source glyph object. */
|
||||
/* */
|
||||
/* mode :: A set of bit flags that indicate how to interpret the */
|
||||
/* returned bounding box values. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* box :: The glyph bounding box. Coordinates are expressed in */
|
||||
/* 1/64th of pixels if it is grid-fitted. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Coordinates are relative to the glyph origin, using the Y-upwards */
|
||||
/* convention. */
|
||||
/* */
|
||||
/* If `ft_glyph_bbox_subpixels' is set in `mode', the bbox */
|
||||
/* coordinates are returned in 26.6 pixels (i.e. 1/64th of pixels). */
|
||||
/* Otherwise, coordinates are expressed in integer pixels. */
|
||||
/* */
|
||||
/* 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 the */
|
||||
/* `ft_glyph_bbox_gridfit' flag is set in `mode;, 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); */
|
||||
/* */
|
||||
/* The default value (0) for `bbox_mode' is `ft_glyph_bbox_pixels'. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Glyph_Get_CBox( FT_Glyph glyph,
|
||||
FT_UInt bbox_mode,
|
||||
FT_BBox* cbox );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Glyph_To_Bitmap */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Converts a given glyph object to a bitmap glyph object. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* glyph :: A pointer to a handle to the target glyph. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* render_mode :: A set of bit flags that describe how the data is */
|
||||
/* */
|
||||
/* */
|
||||
/* origin :: A pointer to a vector used to translate the glyph */
|
||||
/* image before rendering. Can be 0 (if no */
|
||||
/* translation). The origin is expressed in */
|
||||
/* 26.6 pixels. */
|
||||
/* */
|
||||
/* destroy :: A boolean that indicates that the original glyph */
|
||||
/* image should be destroyed by this function. It is */
|
||||
/* never destroyed in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The glyph image is translated with the `origin' vector before */
|
||||
/* rendering. In case of error, it it translated back to its */
|
||||
/* original position and the glyph is left untouched. */
|
||||
/* */
|
||||
/* The first parameter is a pointer to a FT_Glyph handle, that will */
|
||||
/* be replaced by this function. Typically, you would use (omitting */
|
||||
/* error handling): */
|
||||
/* */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_Glyph glyph; */
|
||||
/* FT_BitmapGlyph glyph_bitmap; */
|
||||
/* */
|
||||
/* */
|
||||
/* // load glyph */
|
||||
/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
|
||||
/* */
|
||||
/* // extract glyph image */
|
||||
/* error = FT_Get_Glyph( face->glyph, &glyph ); */
|
||||
/* */
|
||||
/* // convert to a bitmap (default render mode + destroy old) */
|
||||
/* if ( glyph->format != ft_glyph_format_bitmap ) */
|
||||
/* { */
|
||||
/* error = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_default, */
|
||||
/* 0, 1 ); */
|
||||
/* if ( error ) // glyph unchanged */
|
||||
/* ... */
|
||||
/* } */
|
||||
/* */
|
||||
/* // access bitmap content by typecasting */
|
||||
/* glyph_bitmap = (FT_BitmapGlyph)glyph; */
|
||||
/* */
|
||||
/* // do funny stuff with it, like blitting/drawing */
|
||||
/* ... */
|
||||
/* */
|
||||
/* // discard glyph image (bitmap or not) */
|
||||
/* FT_Done_Glyph( glyph ); */
|
||||
/* } */
|
||||
/* */
|
||||
/* */
|
||||
/* This function will always fail if the glyph's format isn't */
|
||||
/* scalable. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
|
||||
FT_ULong render_mode,
|
||||
FT_Vector* origin,
|
||||
FT_Bool destroy );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Done_Glyph */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys a given glyph. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* glyph :: A handle to the target glyph object. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Done_Glyph( FT_Glyph glyph );
|
||||
|
||||
|
||||
/* other helpful functions */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Matrix_Multiply */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Performs the matrix operation `b = a*b'. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* a :: A pointer to matrix `a'. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* b :: A pointer to matrix `b'. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* Yes. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The result is undefined if either `a' or `b' is zero. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Matrix_Multiply( FT_Matrix* a,
|
||||
FT_Matrix* b );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Matrix_Invert */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* matrix :: A pointer to the target matrix. Remains untouched in */
|
||||
/* case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* Yes. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Matrix_Invert( FT_Matrix* matrix );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FTGLYPH_H */
|
||||
|
||||
|
||||
/* END */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,175 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftmm.h */
|
||||
/* */
|
||||
/* FreeType Multiple Master font interface (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTMM_H
|
||||
#define FTMM_H
|
||||
|
||||
#include <freetype/t1tables.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_MM_Axis */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to model a given axis in design space for */
|
||||
/* Multiple Masters fonts. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* name :: The axis's name. */
|
||||
/* */
|
||||
/* minimum :: The axis's minimum design coordinate. */
|
||||
/* */
|
||||
/* maximum :: The axis's maximum design coordinate. */
|
||||
/* */
|
||||
typedef struct FT_MM_Axis_
|
||||
{
|
||||
FT_String* name;
|
||||
FT_Long minimum;
|
||||
FT_Long maximum;
|
||||
|
||||
} FT_MM_Axis;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Multi_Master */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model the axes and space of a Multiple Masters */
|
||||
/* font. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* num_axis :: Number of axes. Cannot exceed 4. */
|
||||
/* */
|
||||
/* num_designs :: Number of designs; should ne normally 2^num_axis */
|
||||
/* even though the Type 1 specification strangely */
|
||||
/* allows for intermediate designs to be present. This */
|
||||
/* number cannot exceed 16. */
|
||||
/* */
|
||||
/* axis :: A table of axis descriptors. */
|
||||
/* */
|
||||
typedef struct FT_Multi_Master_
|
||||
{
|
||||
FT_UInt num_axis;
|
||||
FT_UInt num_designs;
|
||||
FT_MM_Axis axis[T1_MAX_MM_AXIS];
|
||||
|
||||
} FT_Multi_Master;
|
||||
|
||||
|
||||
typedef FT_Error (*FT_Get_MM_Func)( FT_Face face,
|
||||
FT_Multi_Master* master );
|
||||
|
||||
typedef FT_Error (*FT_Set_MM_Design_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
typedef FT_Error (*FT_Set_MM_Blend_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Multi_Master */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the Multiple Master descriptor of a given font. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* master :: The Multiple Masters descriptor. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Get_Multi_Master( FT_Face face,
|
||||
FT_Multi_Master* master );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Set_MM_Design_Coordinates */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* For Multiple Masters fonts, choose an interpolated font design */
|
||||
/* through design coordinates. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* num_coords :: The number of design coordinates (must be equal to */
|
||||
/* the number of axes in the font). */
|
||||
/* */
|
||||
/* coords :: The design coordinates. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Set_MM_Design_Coordinates(
|
||||
FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Set_MM_Blend_Coordinates */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* For Multiple Masters fonts, choose an interpolated font design */
|
||||
/* through normalized blend coordinates. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the source face. */
|
||||
/* */
|
||||
/* num_coords :: The number of design coordinates (must be equal to */
|
||||
/* the number of axes in the font). */
|
||||
/* */
|
||||
/* coords :: The design coordinates (each one must be between 0 */
|
||||
/* and 1.0). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Set_MM_Blend_Coordinates(
|
||||
FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Fixed* coords );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FTMM_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,274 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftmodule.h */
|
||||
/* */
|
||||
/* FreeType modules public interface (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTMODULE_H
|
||||
#define FTMODULE_H
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* module bit flags */
|
||||
typedef enum FT_Module_Flags_
|
||||
{
|
||||
ft_module_font_driver = 1, /* this module is a font driver */
|
||||
ft_module_renderer = 2, /* this module is a renderer */
|
||||
ft_module_hinter = 4, /* this module is a glyph hinter */
|
||||
ft_module_styler = 8, /* this module is a styler */
|
||||
|
||||
ft_module_driver_scalable = 0x100, /* the driver supports scalable */
|
||||
/* fonts */
|
||||
ft_module_driver_no_outlines = 0x200, /* the driver does not support */
|
||||
/* vector outlines */
|
||||
ft_module_driver_has_hinter = 0x400 /* the driver provides its own */
|
||||
/* hinter */
|
||||
|
||||
} FT_Module_Flags;
|
||||
|
||||
|
||||
typedef void (*FT_Module_Interface)( void );
|
||||
|
||||
typedef FT_Error (*FT_Module_Constructor)( FT_Module module );
|
||||
|
||||
typedef void (*FT_Module_Destructor)( FT_Module module );
|
||||
|
||||
typedef FT_Module_Interface (*FT_Module_Requester)( FT_Module module,
|
||||
const char* name );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Module_Class */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The module class descriptor. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* module_flags :: Bit flags describing the module. */
|
||||
/* */
|
||||
/* module_size :: The size of one module object/instance in */
|
||||
/* bytes. */
|
||||
/* */
|
||||
/* module_name :: The name of the module. */
|
||||
/* */
|
||||
/* 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_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 */
|
||||
/* */
|
||||
/* get_interface :: Queries a given module for a specific */
|
||||
/* interface by name. */
|
||||
/* */
|
||||
typedef struct FT_Module_Class_
|
||||
{
|
||||
FT_ULong module_flags;
|
||||
FT_Int module_size;
|
||||
const FT_String* module_name;
|
||||
FT_Fixed module_version;
|
||||
FT_Fixed module_requires;
|
||||
|
||||
const void* module_interface;
|
||||
|
||||
FT_Module_Constructor module_init;
|
||||
FT_Module_Destructor module_done;
|
||||
FT_Module_Requester get_interface;
|
||||
|
||||
} FT_Module_Class;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Add_Module */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Adds a new module to a given library instance. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object. */
|
||||
/* */
|
||||
/* clazz :: A pointer to class descriptor for the module. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* 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. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Add_Module( FT_Library library,
|
||||
const FT_Module_Class* clazz );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Module */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Finds a module by its name. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object. */
|
||||
/* */
|
||||
/* module_name :: The module's name (as an ASCII string). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* A module handle. 0 if none was found. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should better be familiar with FreeType internals to know */
|
||||
/* which module to look for :-) */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Module ) FT_Get_Module( FT_Library library,
|
||||
const char* module_name );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Remove_Module */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Removes a given module from a library instance. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a library object. */
|
||||
/* */
|
||||
/* module :: A handle to a module object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The module object is destroyed by the function in case of success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Remove_Module( FT_Library library,
|
||||
FT_Module module );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Library */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This function is used to create a new FreeType library instance */
|
||||
/* from a given memory object. It is thus possible to use libraries */
|
||||
/* with distinct memory allocators within the same program. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* memory :: A handle to the original memory object. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* alibrary :: A pointer to handle of a new library object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_New_Library( FT_Memory memory,
|
||||
FT_Library* library );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Done_Library */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Discards a given library object. This closes all drivers and */
|
||||
/* discards all resource objects. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the target library. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Done_Library( FT_Library library );
|
||||
|
||||
|
||||
|
||||
typedef void (*FT_DebugHook_Func)( void* arg );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Set_Debug_Hook */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Sets a debug hook function for debugging the interpreter of a font */
|
||||
/* format. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object. */
|
||||
/* */
|
||||
/* hook_index :: The index of the debug hook. You should use the */
|
||||
/* values defined in ftobjs.h, e.g. */
|
||||
/* FT_DEBUG_HOOK_TRUETYPE */
|
||||
/* */
|
||||
/* debug_hook :: The function used to debug the interpreter. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Currently, four debug hook slots are available, but only two (for */
|
||||
/* the TrueType and the Type 1 interpreter) are defined. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Set_Debug_Hook( FT_Library library,
|
||||
FT_UInt hook_index,
|
||||
FT_DebugHook_Func debug_hook );
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Add_Default_Modules */
|
||||
/* */
|
||||
/* <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). */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to a new library object. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Add_Default_Modules( FT_Library library );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTMODULE_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,52 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftnames.h */
|
||||
/* */
|
||||
/* Simple interface to access SFNT name tables (which are used */
|
||||
/* to hold font names, copyright info, notices, etc.). */
|
||||
/* */
|
||||
/* This is _not_ used to retrieve glyph names! */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTNAMES_H
|
||||
#define FTNAMES_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
|
||||
typedef struct FT_SfntName_
|
||||
{
|
||||
FT_UShort platform_id;
|
||||
FT_UShort encoding_id;
|
||||
FT_UShort language_id;
|
||||
FT_UShort name_id;
|
||||
|
||||
FT_Byte* string;
|
||||
FT_UInt string_len; /* in bytes */
|
||||
|
||||
} FT_SfntName;
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_UInt ) FT_Get_Sfnt_Name_Count( FT_Face face );
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Get_Sfnt_Name( FT_Face face,
|
||||
FT_UInt index,
|
||||
FT_SfntName* aname );
|
||||
|
||||
|
||||
#endif /* FTNAMES_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,344 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftoutln.h */
|
||||
/* */
|
||||
/* Support for the FT_Outline type used to store glyph shapes of */
|
||||
/* most scalable font formats (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTOUTLN_H
|
||||
#define FTOUTLN_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Decompose */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Walks over an outline's structure to decompose it into individual */
|
||||
/* segments and Bezier 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. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* outline :: A pointer to the source target. */
|
||||
/* */
|
||||
/* interface :: A table of `emitters', i.e,. function pointers called */
|
||||
/* during decomposition to indicate path operations. */
|
||||
/* */
|
||||
/* user :: A typeless pointer which is passed to each emitter */
|
||||
/* during the decomposition. It can be used to store */
|
||||
/* the state during the decomposition. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means sucess. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_Decompose(
|
||||
FT_Outline* outline,
|
||||
FT_Outline_Funcs* interface,
|
||||
void* user );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new outline of a given size. */
|
||||
/* */
|
||||
/* <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(). */
|
||||
/* */
|
||||
/* numPoints :: The maximal number of points within the outline. */
|
||||
/* */
|
||||
/* numContours :: The maximal number of contours within the outline. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* outline :: A handle to the new outline. NULL in case of */
|
||||
/* error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* No. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The reason why this function takes a `library' parameter is simply */
|
||||
/* to use the library's memory allocator. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_New( FT_Library library,
|
||||
FT_UInt numPoints,
|
||||
FT_Int numContours,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_New_Internal(
|
||||
FT_Memory memory,
|
||||
FT_UInt numPoints,
|
||||
FT_Int numContours,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Done */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroys an outline created with FT_Outline_New(). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle of the library object used to allocate the */
|
||||
/* outline. */
|
||||
/* */
|
||||
/* outline :: A pointer to the outline object to be discarded. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* No. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* If the outline's `owner' field is not set, only the outline */
|
||||
/* descriptor will be released. */
|
||||
/* */
|
||||
/* The reason why this function takes an `outline' parameter is */
|
||||
/* simply to use FT_Free(). */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_Done( FT_Library library,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_Done_Internal( FT_Memory memory,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Get_CBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns an outline's `control box'. The control box encloses all */
|
||||
/* the outline's points, including Bezier control points. Though it */
|
||||
/* coincides with the exact bounding box for most glyphs, it can be */
|
||||
/* slightly larger in some situations (like when rotating an outline */
|
||||
/* which contains Bezier outside arcs). */
|
||||
/* */
|
||||
/* Computing the control box is very fast, while getting the bounding */
|
||||
/* box can take much more time as it needs to walk over all segments */
|
||||
/* and arcs in the outline. To get the latter, you can use the */
|
||||
/* `ftbbox' component which is dedicated to this single task. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* cbox :: The outline's control box. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* Yes. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Outline_Get_CBox( FT_Outline* outline,
|
||||
FT_BBox* cbox );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Translate */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Applies a simple translation to the points of an outline. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* xOffset :: The horizontal offset. */
|
||||
/* */
|
||||
/* yOffset :: The vertical offset. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* Yes. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Outline_Translate( FT_Outline* outline,
|
||||
FT_Pos xOffset,
|
||||
FT_Pos yOffset );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Copy */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Copies an outline into another one. Both objects must have the */
|
||||
/* same sizes (number of points & number of contours) when this */
|
||||
/* function is called. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* source :: A handle to the source outline. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* target :: A handle to the target outline. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_Copy( FT_Outline* source,
|
||||
FT_Outline* target );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Vector_Transform */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Transforms a single vector through a 2x2 matrix. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* vector :: The target vector to transform. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* matrix :: A pointer to the source 2x2 matrix. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* Yes. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The result is undefined if either `vector' or `matrix' is invalid. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Outline_Transform( FT_Outline* outline,
|
||||
FT_Matrix* matrix );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Reverse */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Reverses the drawing direction of an outline. This is used to */
|
||||
/* ensure consistent fill conventions for mirrored glyphs. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* outline :: A pointer to the target outline descriptor. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* 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 */
|
||||
/* knows what it is doing. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void ) FT_Outline_Reverse( FT_Outline* outline );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Get_Bitmap */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Renders an outline within a bitmap. The outline's image is simply */
|
||||
/* OR-ed to the target bitmap. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a FreeType library object. */
|
||||
/* */
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
/* */
|
||||
/* map :: A pointer to the target bitmap descriptor. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* YES. Rendering is synchronized, so that concurrent calls to the */
|
||||
/* scan-line converter will be serialized. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function does NOT CREATE the bitmap, it only renders an */
|
||||
/* outline image within the one you pass to it! */
|
||||
/* */
|
||||
/* It will use the raster correponding to the default glyph format. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_Get_Bitmap( FT_Library library,
|
||||
FT_Outline* outline,
|
||||
FT_Bitmap* bitmap );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Render */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Renders an outline within a bitmap using the current scan-convert. */
|
||||
/* This functions uses an FT_Raster_Params structure as an argument, */
|
||||
/* allowing advanced features like direct composition, translucency, */
|
||||
/* etc. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a FreeType library object. */
|
||||
/* */
|
||||
/* outline :: A pointer to the source outline descriptor. */
|
||||
/* */
|
||||
/* params :: A pointer to a FT_Raster_Params structure used to */
|
||||
/* describe the rendering operation. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <MT-Note> */
|
||||
/* YES. Rendering is synchronized, so that concurrent calls to the */
|
||||
/* scan-line converter will be serialized. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should know what you are doing and how FT_Raster_Params works */
|
||||
/* to use this function. */
|
||||
/* */
|
||||
/* The field `params.source' will be set to `outline' before the scan */
|
||||
/* converter is called, which means that the value you give to it is */
|
||||
/* actually ignored. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Outline_Render( FT_Library library,
|
||||
FT_Outline* outline,
|
||||
FT_Raster_Params* params );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTOUTLN_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,191 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftrender.h */
|
||||
/* */
|
||||
/* FreeType renderer modules public interface (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTRENDER_H
|
||||
#define FTRENDER_H
|
||||
|
||||
#include <freetype/ftmodule.h>
|
||||
#include <freetype/ftglyph.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* create a new glyph object */
|
||||
typedef FT_Error (*FT_Glyph_Init_Func)( FT_Glyph glyph,
|
||||
FT_GlyphSlot slot );
|
||||
|
||||
/* destroys a given glyph object */
|
||||
typedef void (*FT_Glyph_Done_Func)( FT_Glyph glyph );
|
||||
|
||||
typedef void (*FT_Glyph_Transform_Func)( FT_Glyph glyph,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta );
|
||||
|
||||
typedef void (*FT_Glyph_BBox_Func)( FT_Glyph glyph,
|
||||
FT_BBox* abbox );
|
||||
|
||||
typedef FT_Error (*FT_Glyph_Copy_Func)( FT_Glyph source,
|
||||
FT_Glyph target );
|
||||
|
||||
typedef FT_Error (*FT_Glyph_Prepare_Func)( FT_Glyph glyph,
|
||||
FT_GlyphSlot slot );
|
||||
|
||||
struct FT_Glyph_Class_
|
||||
{
|
||||
FT_UInt glyph_size;
|
||||
FT_Glyph_Format glyph_format;
|
||||
FT_Glyph_Init_Func glyph_init;
|
||||
FT_Glyph_Done_Func glyph_done;
|
||||
FT_Glyph_Copy_Func glyph_copy;
|
||||
FT_Glyph_Transform_Func glyph_transform;
|
||||
FT_Glyph_BBox_Func glyph_bbox;
|
||||
FT_Glyph_Prepare_Func glyph_prepare;
|
||||
};
|
||||
|
||||
|
||||
typedef FT_Error (*FTRenderer_render)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt mode,
|
||||
FT_Vector* origin );
|
||||
|
||||
typedef FT_Error (*FTRenderer_transform)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta );
|
||||
|
||||
typedef void (*FTRenderer_getCBox)( FT_Renderer renderer,
|
||||
FT_GlyphSlot slot,
|
||||
FT_BBox* cbox );
|
||||
|
||||
typedef FT_Error (*FTRenderer_setMode)( FT_Renderer renderer,
|
||||
FT_ULong mode_tag,
|
||||
FT_Pointer mode_ptr );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Renderer_Class */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The renderer module class descriptor. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The root FT_Module_Class fields. */
|
||||
/* */
|
||||
/* glyph_format :: The glyph image format this renderer handles. */
|
||||
/* */
|
||||
/* render_glyph :: A method used to render the image that is in a */
|
||||
/* given glyph slot into a bitmap. */
|
||||
/* */
|
||||
/* set_mode :: A method used to pass additional parameters. */
|
||||
/* */
|
||||
/* raster_class :: For `ft_glyph_format_outline' renderers only, this */
|
||||
/* is a pointer to its raster's class. */
|
||||
/* */
|
||||
/* raster :: For `ft_glyph_format_outline' renderers only. this */
|
||||
/* is a pointer to the corresponding raster object, */
|
||||
/* if any. */
|
||||
/* */
|
||||
typedef struct FT_Renderer_Class_
|
||||
{
|
||||
FT_Module_Class root;
|
||||
|
||||
FT_Glyph_Format glyph_format;
|
||||
|
||||
FTRenderer_render render_glyph;
|
||||
FTRenderer_transform transform_glyph;
|
||||
FTRenderer_getCBox get_glyph_cbox;
|
||||
FTRenderer_setMode set_mode;
|
||||
|
||||
FT_Raster_Funcs* raster_class;
|
||||
|
||||
} FT_Renderer_Class;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Renderer */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the current renderer for a given glyph format. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object. */
|
||||
/* */
|
||||
/* format :: The glyph format. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* A renderer handle. 0 if none found. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* An error will be returned if a module already exists by that name, */
|
||||
/* or if the module requires a version of FreeType that is too great. */
|
||||
/* */
|
||||
/* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
|
||||
/* renderer by its name, use FT_Get_Module(). */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Renderer ) FT_Get_Renderer( FT_Library library,
|
||||
FT_Glyph_Format format );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Set_Renderer */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Sets the current renderer to use, and set additional mode. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object. */
|
||||
/* */
|
||||
/* renderer :: A handle to the renderer object. */
|
||||
/* */
|
||||
/* num_params :: The number of additional parameters. */
|
||||
/* */
|
||||
/* parameters :: Additional parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* In case of success, the renderer will be used to convert glyph */
|
||||
/* images in the renderer's known format into bitmaps. */
|
||||
/* */
|
||||
/* This doesn't change the current renderer for other formats. */
|
||||
/* */
|
||||
FT_EXPORT_DEF(FT_Error) FT_Set_Renderer( FT_Library library,
|
||||
FT_Renderer renderer,
|
||||
FT_UInt num_params,
|
||||
FT_Parameter* parameters );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTRENDER_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,101 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftsystem.h */
|
||||
/* */
|
||||
/* FreeType low-level system interface definition (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTSYSTEM_H
|
||||
#define FTSYSTEM_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* M E M O R Y M A N A G E M E N T */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
typedef struct FT_MemoryRec_* FT_Memory;
|
||||
|
||||
|
||||
typedef void* (*FT_Alloc_Func)( FT_Memory memory,
|
||||
long size );
|
||||
|
||||
typedef void (*FT_Free_Func)( FT_Memory memory,
|
||||
void* block );
|
||||
|
||||
typedef void* (*FT_Realloc_Func)( FT_Memory memory,
|
||||
long cur_size,
|
||||
long new_size,
|
||||
void* block );
|
||||
|
||||
|
||||
struct FT_MemoryRec_
|
||||
{
|
||||
void* user;
|
||||
FT_Alloc_Func alloc;
|
||||
FT_Free_Func free;
|
||||
FT_Realloc_Func realloc;
|
||||
};
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* I / O M A N A G E M E N T */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
typedef union FT_StreamDesc_
|
||||
{
|
||||
long value;
|
||||
void* pointer;
|
||||
|
||||
} FT_StreamDesc;
|
||||
|
||||
|
||||
typedef struct FT_StreamRec_* FT_Stream;
|
||||
|
||||
|
||||
typedef unsigned long (*FT_Stream_IO)( FT_Stream stream,
|
||||
unsigned long offset,
|
||||
unsigned char* buffer,
|
||||
unsigned long count );
|
||||
|
||||
typedef void (*FT_Stream_Close)( FT_Stream stream );
|
||||
|
||||
|
||||
struct FT_StreamRec_
|
||||
{
|
||||
unsigned char* base;
|
||||
unsigned long size;
|
||||
unsigned long pos;
|
||||
|
||||
FT_StreamDesc descriptor;
|
||||
FT_StreamDesc pathname; /* ignored by FreeType -- */
|
||||
/* useful for debugging */
|
||||
FT_Stream_IO read;
|
||||
FT_Stream_Close close;
|
||||
|
||||
FT_Memory memory;
|
||||
unsigned char* cursor;
|
||||
unsigned char* limit;
|
||||
};
|
||||
|
||||
|
||||
#endif /* FTSYSTEM_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,400 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* fttypes.h */
|
||||
/* */
|
||||
/* FreeType simple types definitions (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTTYPES_H
|
||||
#define FTTYPES_H
|
||||
|
||||
|
||||
#include <freetype/ftsystem.h>
|
||||
#include <freetype/ftimage.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Bool */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef of unsigned char, used for simple booleans. */
|
||||
/* */
|
||||
typedef unsigned char FT_Bool;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_FWord */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A signed 16-bit integer used to store a distance in original font */
|
||||
/* units. */
|
||||
/* */
|
||||
typedef signed short FT_FWord; /* distance in FUnits */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_UFWord */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An unsigned 16-bit integer used to store a distance in original */
|
||||
/* font units. */
|
||||
/* */
|
||||
typedef unsigned short FT_UFWord; /* unsigned distance */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Char */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple typedef for the _signed_ char type. */
|
||||
/* */
|
||||
typedef signed char FT_Char;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Byte */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple typedef for the _unsigned_ char type. */
|
||||
/* */
|
||||
typedef unsigned char FT_Byte;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_String */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple typedef for the char type, usually used for strings. */
|
||||
/* */
|
||||
typedef char FT_String;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Short */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for signed short. */
|
||||
/* */
|
||||
typedef signed short FT_Short;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_UShort */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for unsigned short. */
|
||||
/* */
|
||||
typedef unsigned short FT_UShort;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Int */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for the int type. */
|
||||
/* */
|
||||
typedef int FT_Int;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_UInt */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for the unsigned int type. */
|
||||
/* */
|
||||
typedef unsigned int FT_UInt;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Long */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for signed long. */
|
||||
/* */
|
||||
typedef signed long FT_Long;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_ULong */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for unsigned long. */
|
||||
/* */
|
||||
typedef unsigned long FT_ULong;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_F2Dot14 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A signed 2.14 fixed float type used for unit vectors. */
|
||||
/* */
|
||||
typedef signed short FT_F2Dot14;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_F26Dot6 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A signed 26.6 fixed float type used for vectorial pixel */
|
||||
/* coordinates. */
|
||||
/* */
|
||||
typedef signed long FT_F26Dot6;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Fixed */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This type is used to store 16.16 fixed float values, like scales */
|
||||
/* or matrix coefficients. */
|
||||
/* */
|
||||
typedef signed long FT_Fixed;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Error */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The FreeType error code type. A value of 0 is always interpreted */
|
||||
/* as a successful operation. */
|
||||
/* */
|
||||
typedef int FT_Error;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Pointer */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple typedef for a typeless pointer. */
|
||||
/* */
|
||||
typedef void* FT_Pointer;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_UnitVector */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to store a 2D vector unit vector. Uses */
|
||||
/* FT_F2Dot14 types. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* x :: Horizontal coordinate. */
|
||||
/* */
|
||||
/* y :: Vertical coordinate. */
|
||||
/* */
|
||||
typedef struct FT_UnitVector_
|
||||
{
|
||||
FT_F2Dot14 x;
|
||||
FT_F2Dot14 y;
|
||||
|
||||
} FT_UnitVector;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Matrix */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to store a 2x2 matrix. Coefficients are */
|
||||
/* in 16.16 fixed float format. The computation performed is: */
|
||||
/* */
|
||||
/* { */
|
||||
/* x' = x*xx + y*xy */
|
||||
/* y' = x*yx + y*yy */
|
||||
/* } */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* xx :: Matrix coefficient. */
|
||||
/* */
|
||||
/* xy :: Matrix coefficient. */
|
||||
/* */
|
||||
/* yx :: Matrix coefficient. */
|
||||
/* */
|
||||
/* yy :: Matrix coefficient. */
|
||||
/* */
|
||||
typedef struct FT_Matrix_
|
||||
{
|
||||
FT_Fixed xx, xy;
|
||||
FT_Fixed yx, yy;
|
||||
|
||||
} FT_Matrix;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_BBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to hold an outline's bounding box, i.e., the */
|
||||
/* coordinates of its extrema in the horizontal and vertical */
|
||||
/* directions. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* xMin :: The horizontal minimum (left-most). */
|
||||
/* */
|
||||
/* yMin :: The vertical minimum (bottom-most). */
|
||||
/* */
|
||||
/* xMax :: The horizontal maximum (right-most). */
|
||||
/* */
|
||||
/* yMax :: The vertical maximum (top-most). */
|
||||
/* */
|
||||
typedef struct FT_BBox_
|
||||
{
|
||||
FT_Pos xMin, yMin;
|
||||
FT_Pos xMax, yMax;
|
||||
|
||||
} FT_BBox;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_MAKE_TAG */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro converts four letter tags which are used to label */
|
||||
/* TrueType tables into an unsigned long to be used within FreeType. */
|
||||
/* */
|
||||
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
|
||||
( ( (FT_ULong)_x1 << 24 ) | \
|
||||
( (FT_ULong)_x2 << 16 ) | \
|
||||
( (FT_ULong)_x3 << 8 ) | \
|
||||
(FT_ULong)_x4 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* L I S T M A N A G E M E N T */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_ListNode */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Many elements and objects in FreeType are listed through a */
|
||||
/* FT_List record (see FT_ListRec). As its name suggests, a */
|
||||
/* FT_ListNode is a handle to a single list element. */
|
||||
/* */
|
||||
typedef struct FT_ListNodeRec_* FT_ListNode;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_List */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to a list record (see FT_ListRec). */
|
||||
/* */
|
||||
typedef struct FT_ListRec_* FT_List;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_ListNodeRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to hold a single list element. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* prev :: The previous element in the list. NULL if first. */
|
||||
/* */
|
||||
/* next :: The next element in the list. NULL if last. */
|
||||
/* */
|
||||
/* data :: A typeless pointer to the listed object. */
|
||||
/* */
|
||||
typedef struct FT_ListNodeRec_
|
||||
{
|
||||
FT_ListNode prev;
|
||||
FT_ListNode next;
|
||||
void* data;
|
||||
|
||||
} FT_ListNodeRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_ListRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to hold a simple doubly-linked list. These are */
|
||||
/* used in many parts of FreeType. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* head :: The head (first element) of doubly-linked list. */
|
||||
/* */
|
||||
/* tail :: The tail (last element) of doubly-linked list. */
|
||||
/* */
|
||||
typedef struct FT_ListRec_
|
||||
{
|
||||
FT_ListNode head;
|
||||
FT_ListNode tail;
|
||||
|
||||
} FT_ListRec;
|
||||
|
||||
|
||||
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
|
||||
|
||||
|
||||
#endif /* FTTYPES_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,195 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* autohint.h */
|
||||
/* */
|
||||
/* High-level `autohint' module-specific interface (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The auto-hinter is used to load and automatically hint glyphs if a */
|
||||
/* format-specific hinter isn't available. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef AUTOHINT_H
|
||||
#define AUTOHINT_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A small technical note regarding automatic hinting in order to */
|
||||
/* clarify this module interface. */
|
||||
/* */
|
||||
/* An automatic hinter might compute two kinds of data for a given face: */
|
||||
/* */
|
||||
/* - global hints: Usually some metrics that describe global properties */
|
||||
/* of the face. It is computed by scanning more or less */
|
||||
/* agressively the glyphs in the face, and thus can be */
|
||||
/* very slow to compute (even if the size of global */
|
||||
/* hints is really small). */
|
||||
/* */
|
||||
/* - glyph hints: These describe some important features of the glyph */
|
||||
/* outline, as well as how to align them. They are */
|
||||
/* generally much faster to compute than global hints. */
|
||||
/* */
|
||||
/* The current FreeType auto-hinter does a pretty good job while */
|
||||
/* performing fast computations for both global and glyph hints. */
|
||||
/* However, we might be interested in introducing more complex and */
|
||||
/* powerful algorithms in the future, like the one described in the John */
|
||||
/* D. Hobby paper, which unfortunately requires a lot more horsepower. */
|
||||
/* */
|
||||
/* Because a sufficiently sophisticated font management system would */
|
||||
/* typically implement an LRU cache of opened face objects to reduce */
|
||||
/* memory usage, it is a good idea to be able to avoid recomputing */
|
||||
/* global hints every time the same face is re-opened. */
|
||||
/* */
|
||||
/* We thus provide the ability to cache global hints outside of the face */
|
||||
/* object, in order to speed up font re-opening time. Of course, this */
|
||||
/* feature is purely optional, so most client programs won't even notice */
|
||||
/* it. */
|
||||
/* */
|
||||
/* I initially thought that it would be a good idea to cache the glyph */
|
||||
/* hints too. However, my general idea now is that if you really need */
|
||||
/* to cache these too, you are simply in need of a new font format, */
|
||||
/* where all this information could be stored within the font file and */
|
||||
/* decoded on the fly. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
|
||||
typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Get_Global_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the global hints computed for a given face object the */
|
||||
/* resulting data is dissociated from the face and will survive a */
|
||||
/* call to FT_Done_Face(). It must be discarded through the API */
|
||||
/* FT_AutoHinter_Done_Global_Func(). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hinter :: A handle to the source auto-hinter. */
|
||||
/* */
|
||||
/* face :: A handle to the source face object. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* global_hints :: A typeless pointer to the global hints. */
|
||||
/* */
|
||||
/* global_len :: The size in bytes of the global hints. */
|
||||
/* */
|
||||
typedef void (*FT_AutoHinter_Get_Global_Func)(
|
||||
FT_AutoHinter hinter,
|
||||
FT_Face face,
|
||||
void** global_hints,
|
||||
long* global_len );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Done_Global_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Discards the global hints retrieved through */
|
||||
/* FT_AutoHinter_Get_Global_Func(). This is the only way these hints */
|
||||
/* are freed from memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hinter :: A handle to the auto-hinter module. */
|
||||
/* */
|
||||
/* global :: A pointer to retrieved global hints to discard. */
|
||||
/* */
|
||||
typedef void (*FT_AutoHinter_Done_Global_Func)( FT_AutoHinter hinter,
|
||||
void* global );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Reset_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This function is used to recompute the global metrics in a given */
|
||||
/* font. This is useful when global font data changes (e.g. Multiple */
|
||||
/* Masters fonts where blend coordinates change). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* hinter :: A handle to the source auto-hinter. */
|
||||
/* */
|
||||
/* face :: A handle to the face. */
|
||||
/* */
|
||||
typedef void (*FT_AutoHinter_Reset_Func)( FT_AutoHinter hinter,
|
||||
FT_Face face );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_AutoHinter_Load_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This function is used to load, scale, and automatically hint a */
|
||||
/* glyph from a given face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the face. */
|
||||
/* glyph_index :: The glyph index. */
|
||||
/* load_flags :: The load flags. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is capable of loading composite glyphs by hinting */
|
||||
/* each sub-glyph independently (which improves quality). */
|
||||
/* */
|
||||
/* It will call the font driver with FT_Load_Glyph(), with */
|
||||
/* FT_LOAD_NO_SCALE set. */
|
||||
/* */
|
||||
typedef FT_Error (*FT_AutoHinter_Load_Func)( FT_AutoHinter hinter,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_ULong load_flags );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_AutoHinter_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The auto-hinter module's interface. */
|
||||
/* */
|
||||
typedef struct FT_AutoHinter_Interface
|
||||
{
|
||||
FT_AutoHinter_Reset_Func reset_face;
|
||||
FT_AutoHinter_Load_Func load_glyph;
|
||||
|
||||
FT_AutoHinter_Get_Global_Func get_global_hints;
|
||||
FT_AutoHinter_Done_Global_Func done_global_hints;
|
||||
|
||||
} FT_AutoHinter_Interface;
|
||||
|
||||
|
||||
#endif /* AUTOHINT_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,123 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcalc.h */
|
||||
/* */
|
||||
/* Arithmetic computations (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTCALC_H
|
||||
#define FTCALC_H
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/config/ftconfig.h> /* for LONG64 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef LONG64
|
||||
|
||||
|
||||
typedef INT64 FT_Int64;
|
||||
|
||||
#define ADD_64( x, y, z ) z = (x) + (y)
|
||||
#define MUL_64( x, y, z ) z = (FT_Int64)(x) * (y)
|
||||
|
||||
#define DIV_64( x, y ) ( (x) / (y) )
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
#define SQRT_64( z ) FT_Sqrt64( z )
|
||||
|
||||
FT_EXPORT_DEF( FT_Int32 ) FT_Sqrt64( FT_Int64 l );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_CALCS */
|
||||
|
||||
|
||||
#else /* LONG64 */
|
||||
|
||||
|
||||
typedef struct FT_Int64_
|
||||
{
|
||||
FT_UInt32 lo;
|
||||
FT_UInt32 hi;
|
||||
|
||||
} FT_Int64;
|
||||
|
||||
|
||||
#define ADD_64( x, y, z ) FT_Add64( &x, &y, &z )
|
||||
#define MUL_64( x, y, z ) FT_MulTo64( x, y, &z )
|
||||
#define DIV_64( x, y ) FT_Div64by32( &x, y )
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_Add64( FT_Int64* x,
|
||||
FT_Int64* y,
|
||||
FT_Int64* z );
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_MulTo64( FT_Int32 x,
|
||||
FT_Int32 y,
|
||||
FT_Int64* z );
|
||||
|
||||
FT_EXPORT_DEF( FT_Int32 ) FT_Div64by32( FT_Int64* x,
|
||||
FT_Int32 y );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
#define SQRT_64( z ) FT_Sqrt64( &z )
|
||||
|
||||
FT_EXPORT_DEF( FT_Int32 ) FT_Sqrt64( FT_Int64* x );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_OLD_CALCS */
|
||||
|
||||
|
||||
#endif /* LONG64 */
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_OLD_CALCS
|
||||
|
||||
#define SQRT_32( x ) FT_Sqrt32( x )
|
||||
|
||||
BASE_DEF( FT_Int32 ) FT_Sqrt32( FT_Int32 x );
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_OLD_CALCS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
|
||||
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
|
||||
#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
|
||||
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
|
||||
#define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
|
||||
|
||||
#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
|
||||
: ( -( ( 32 - (x) ) & -64 ) ) )
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FTCALC_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,225 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftdebug.h */
|
||||
/* */
|
||||
/* Debugging and logging component (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTDEBUG_H
|
||||
#define FTDEBUG_H
|
||||
|
||||
#include <freetype/config/ftconfig.h> /* for FT_DEBUG_LEVEL_TRACE, */
|
||||
/* FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* A very stupid pre-processor trick. See K&R version 2 */
|
||||
/* section A12.3 for details... */
|
||||
/* */
|
||||
/* It is also described in the section `Separate */
|
||||
/* Expansion of Macro Arguments' in the info file */
|
||||
/* `cpp.info', describing GNU cpp. */
|
||||
/* */
|
||||
#define FT_CAT( x, y ) x ## y
|
||||
#define FT_XCAT( x, y ) FT_CAT( x, y )
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
|
||||
/* note that not all levels are used currently */
|
||||
|
||||
typedef enum FT_Trace_
|
||||
{
|
||||
/* the first level must always be `trace_any' */
|
||||
trace_any = 0,
|
||||
|
||||
/* base components */
|
||||
trace_aaraster, /* anti-aliasing raster (ftgrays.c) */
|
||||
trace_calc, /* calculations (ftcalc.c) */
|
||||
trace_extend, /* extension manager (ftextend.c) */
|
||||
trace_glyph, /* glyph manager (ftglyph.c) */
|
||||
trace_io, /* i/o monitoring (ftsystem.c) */
|
||||
trace_init, /* initialization (ftinit.c) */
|
||||
trace_list, /* list manager (ftlist.c) */
|
||||
trace_memory, /* memory manager (ftobjs.c) */
|
||||
trace_mm, /* MM interface (ftmm.c) */
|
||||
trace_objs, /* base objects (ftobjs.c) */
|
||||
trace_outline, /* outline management (ftoutln.c) */
|
||||
trace_raster, /* rasterizer (ftraster.c) */
|
||||
trace_stream, /* stream manager (ftstream.c) */
|
||||
|
||||
/* SFNT driver components */
|
||||
trace_sfobjs, /* SFNT object handler (sfobjs.c) */
|
||||
trace_ttcmap, /* charmap handler (ttcmap.c) */
|
||||
trace_ttload, /* basic TrueType tables (ttload.c) */
|
||||
trace_ttpost, /* PS table processing (ttpost.c) */
|
||||
trace_ttsbit, /* TrueType sbit handling (ttsbit.c) */
|
||||
|
||||
/* TrueType driver components */
|
||||
trace_ttdriver, /* TT font driver (ttdriver.c) */
|
||||
trace_ttgload, /* TT glyph loader (ttgload.c) */
|
||||
trace_ttinterp, /* bytecode interpreter (ttinterp.c) */
|
||||
trace_ttobjs, /* TT objects manager (ttobjs.c) */
|
||||
trace_ttpload, /* TT data/program loader (ttpload.c) */
|
||||
|
||||
/* Type 1 driver components */
|
||||
trace_t1driver,
|
||||
trace_t1gload,
|
||||
trace_t1hint,
|
||||
trace_t1load,
|
||||
trace_t1objs,
|
||||
|
||||
/* experimental Type 1 driver components */
|
||||
trace_z1driver,
|
||||
trace_z1gload,
|
||||
trace_z1hint,
|
||||
trace_z1load,
|
||||
trace_z1objs,
|
||||
trace_z1parse,
|
||||
|
||||
/* Type 2 driver components */
|
||||
trace_t2driver,
|
||||
trace_t2gload,
|
||||
trace_t2load,
|
||||
trace_t2objs,
|
||||
trace_t2parse,
|
||||
|
||||
/* CID driver components */
|
||||
trace_cidafm,
|
||||
trace_ciddriver,
|
||||
trace_cidgload,
|
||||
trace_cidload,
|
||||
trace_cidobjs,
|
||||
trace_cidparse,
|
||||
|
||||
/* Windows fonts component */
|
||||
trace_winfnt,
|
||||
|
||||
/* the last level must always be `trace_max' */
|
||||
trace_max
|
||||
|
||||
} FT_Trace;
|
||||
|
||||
|
||||
/* declared in ftdebug.c */
|
||||
extern char ft_trace_levels[trace_max];
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* IMPORTANT! */
|
||||
/* */
|
||||
/* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
|
||||
/* value before using any TRACE macro. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_TRACE( level, varformat ) \
|
||||
do \
|
||||
{ \
|
||||
if ( ft_trace_levels[FT_COMPONENT] >= level ) \
|
||||
FT_XCAT( FT_Message, varformat ); \
|
||||
} while ( 0 )
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_SetTraceLevel( FT_Trace component,
|
||||
char level );
|
||||
|
||||
|
||||
#elif defined( FT_DEBUG_LEVEL_ERROR )
|
||||
|
||||
|
||||
#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
|
||||
|
||||
|
||||
#else /* release mode */
|
||||
|
||||
|
||||
#define FT_Assert( condition ) do ; while ( 0 ) /* nothing */
|
||||
|
||||
#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
|
||||
#define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */
|
||||
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE, FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define macros and functions that are common to the debug and trace */
|
||||
/* modes. */
|
||||
/* */
|
||||
/* You need vprintf() to be able to compile ftdebug.c. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#if defined( FT_DEBUG_LEVEL_TRACE ) || defined( FT_DEBUG_LEVEL_ERROR )
|
||||
|
||||
|
||||
#include "stdio.h" /* for vprintf() */
|
||||
|
||||
|
||||
#define FT_Assert( condition ) \
|
||||
do \
|
||||
{ \
|
||||
if ( !( condition ) ) \
|
||||
FT_Panic( "assertion failed on line %d of file %s\n", \
|
||||
__LINE__, __FILE__ ); \
|
||||
} while ( 0 )
|
||||
|
||||
/* print a message */
|
||||
FT_EXPORT_DEF( void ) FT_Message( const char* fmt, ... );
|
||||
|
||||
/* print a message and exit */
|
||||
FT_EXPORT_DEF( void ) FT_Panic( const char* fmt, ... );
|
||||
|
||||
#define FT_ERROR( varformat ) FT_XCAT( FT_Message, varformat )
|
||||
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* You need two opening resp. closing parentheses! */
|
||||
/* */
|
||||
/* Example: FT_TRACE0(( "Value is %i", foo )) */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
|
||||
#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
|
||||
#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
|
||||
#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
|
||||
#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
|
||||
#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
|
||||
#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
|
||||
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTDEBUG_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,182 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftdriver.h */
|
||||
/* */
|
||||
/* FreeType font driver interface (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTDRIVER_H
|
||||
#define FTDRIVER_H
|
||||
|
||||
|
||||
#include <freetype/ftmodule.h>
|
||||
#include <freetype/config/ftconfig.h>
|
||||
|
||||
|
||||
typedef FT_Error (*FTDriver_initFace)( FT_Stream stream,
|
||||
FT_Face face,
|
||||
FT_Int typeface_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* parameters );
|
||||
|
||||
typedef void (*FTDriver_doneFace)( FT_Face face );
|
||||
|
||||
|
||||
typedef FT_Error (*FTDriver_initSize)( FT_Size size );
|
||||
|
||||
typedef void (*FTDriver_doneSize)( FT_Size size );
|
||||
|
||||
|
||||
typedef FT_Error (*FTDriver_initGlyphSlot)( FT_GlyphSlot slot );
|
||||
|
||||
typedef void (*FTDriver_doneGlyphSlot)( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
typedef FT_Error (*FTDriver_setCharSizes)( FT_Size size,
|
||||
FT_F26Dot6 char_width,
|
||||
FT_F26Dot6 char_height,
|
||||
FT_UInt horz_resolution,
|
||||
FT_UInt vert_resolution );
|
||||
|
||||
typedef FT_Error (*FTDriver_setPixelSizes)( FT_Size size,
|
||||
FT_UInt pixel_width,
|
||||
FT_UInt pixel_height );
|
||||
|
||||
typedef FT_Error (*FTDriver_loadGlyph)( FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int load_flags );
|
||||
|
||||
|
||||
typedef FT_UInt (*FTDriver_getCharIndex)( FT_CharMap charmap,
|
||||
FT_Long charcode );
|
||||
|
||||
typedef FT_Error (*FTDriver_getKerning)( FT_Face face,
|
||||
FT_UInt left_glyph,
|
||||
FT_UInt right_glyph,
|
||||
FT_Vector* kerning );
|
||||
|
||||
|
||||
typedef FT_Error (*FTDriver_attachFile)( FT_Face face,
|
||||
FT_Stream stream );
|
||||
|
||||
|
||||
typedef FT_Error (*FTDriver_getAdvances)( FT_Face face,
|
||||
FT_UInt first,
|
||||
FT_UInt count,
|
||||
FT_Bool vertical,
|
||||
FT_UShort* advances );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Driver_Class */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The font driver class. This structure mostly contains pointers to */
|
||||
/* driver methods. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: The parent module. */
|
||||
/* */
|
||||
/* face_object_size :: The size of a face object in bytes. */
|
||||
/* */
|
||||
/* size_object_size :: The size of a size object in bytes. */
|
||||
/* */
|
||||
/* slot_object_size :: The size of a glyph object in bytes. */
|
||||
/* */
|
||||
/* init_face :: The format-specific face constructor. */
|
||||
/* */
|
||||
/* done_face :: The format-specific face destructor. */
|
||||
/* */
|
||||
/* init_size :: The format-specific size constructor. */
|
||||
/* */
|
||||
/* done_size :: The format-specific size destructor. */
|
||||
/* */
|
||||
/* init_slot :: The format-specific slot constructor. */
|
||||
/* */
|
||||
/* done_slot :: The format-specific slot destructor. */
|
||||
/* */
|
||||
/* 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! */
|
||||
/* */
|
||||
/* get_char_index :: A function handle to return the glyph index of */
|
||||
/* a given character for a given charmap. This */
|
||||
/* field is mandatory! */
|
||||
/* */
|
||||
/* get_kerning :: A function handle to return the unscaled */
|
||||
/* kerning for a given pair of glyphs. Can be */
|
||||
/* set to 0 if the format doesn't support */
|
||||
/* kerning. */
|
||||
/* */
|
||||
/* attach_file :: This function handle is used to read */
|
||||
/* additional data for a face from another */
|
||||
/* file/stream. For example, this can be used to */
|
||||
/* add data from AFM or PFM files on a Type 1 */
|
||||
/* face, or a CIDMap on a CID-keyed face. */
|
||||
/* */
|
||||
/* get_advances :: A function handle used to return the advances */
|
||||
/* of 'count' glyphs, starting at `index'. the */
|
||||
/* `vertical' flags must be set when vertical */
|
||||
/* advances are queried. The advances buffer is */
|
||||
/* caller-allocated. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Most function pointers, with the exception of `load_glyph' and */
|
||||
/* `get_char_index' can be set to 0 to indicate a default behaviour. */
|
||||
/* */
|
||||
typedef struct FT_Driver_Class_
|
||||
{
|
||||
FT_Module_Class root;
|
||||
|
||||
FT_Int face_object_size;
|
||||
FT_Int size_object_size;
|
||||
FT_Int slot_object_size;
|
||||
|
||||
FTDriver_initFace init_face;
|
||||
FTDriver_doneFace done_face;
|
||||
|
||||
FTDriver_initSize init_size;
|
||||
FTDriver_doneSize done_size;
|
||||
|
||||
FTDriver_initGlyphSlot init_slot;
|
||||
FTDriver_doneGlyphSlot done_slot;
|
||||
|
||||
FTDriver_setCharSizes set_char_sizes;
|
||||
FTDriver_setPixelSizes set_pixel_sizes;
|
||||
|
||||
FTDriver_loadGlyph load_glyph;
|
||||
FTDriver_getCharIndex get_char_index;
|
||||
|
||||
FTDriver_getKerning get_kerning;
|
||||
FTDriver_attachFile attach_file;
|
||||
|
||||
FTDriver_getAdvances get_advances;
|
||||
|
||||
} FT_Driver_Class;
|
||||
|
||||
|
||||
#endif /* FTDRIVER_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,178 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftextend.h */
|
||||
/* */
|
||||
/* FreeType extensions implementation (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTEXTEND_H
|
||||
#define FTEXTEND_H
|
||||
|
||||
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The extensions don't need to be integrated at compile time into the */
|
||||
/* engine, only at link time. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_Extension_Initializer */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Each new face object can have several extensions associated with */
|
||||
/* it at creation time. This function is used to initialize given */
|
||||
/* extension data for a given face. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* ext :: A typeless pointer to the extension data. */
|
||||
/* */
|
||||
/* face :: A handle to the source face object the extension is */
|
||||
/* associated with. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* In case of error, the initializer should not destroy the extension */
|
||||
/* data, as the finalizer will get called later by the function's */
|
||||
/* caller. */
|
||||
/* */
|
||||
typedef FT_Error (*FT_Extension_Initializer)( void* ext,
|
||||
FT_Face face );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_Extension_Finalizer */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Each new face object can have several extensions associated with */
|
||||
/* it at creation time. This function is used to finalize given */
|
||||
/* extension data for a given face; it occurs before the face object */
|
||||
/* itself is finalized. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* ext :: A typeless pointer to the extension data. */
|
||||
/* */
|
||||
/* face :: A handle to the source face object the extension is */
|
||||
/* associated with. */
|
||||
/* */
|
||||
typedef void (*FT_Extension_Finalizer)( void* ext,
|
||||
FT_Face face );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_Extension_Class */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple structure used to describe a given extension to the */
|
||||
/* FreeType base layer. An FT_Extension_Class is used as a parameter */
|
||||
/* for FT_Register_Extension(). */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* id :: The extension's ID. This is a normal C string that */
|
||||
/* is used to uniquely reference the extension's */
|
||||
/* interface. */
|
||||
/* */
|
||||
/* size :: The size in bytes of the extension data that must be */
|
||||
/* associated with each face object. */
|
||||
/* */
|
||||
/* init :: A pointer to the extension data's initializer. */
|
||||
/* */
|
||||
/* finalize :: A pointer to the extension data's finalizer. */
|
||||
/* */
|
||||
/* interface :: This pointer can be anything, but should usually */
|
||||
/* point to a table of function pointers which implement */
|
||||
/* the extension's interface. */
|
||||
/* */
|
||||
/* offset :: This field is set and used within the base layer and */
|
||||
/* should be set to 0 when registering an extension */
|
||||
/* through FT_Register_Extension(). It contains an */
|
||||
/* offset within the face's extension block for the */
|
||||
/* current extension's data. */
|
||||
/* */
|
||||
typedef struct FT_Extension_Class_
|
||||
{
|
||||
const char* id;
|
||||
FT_ULong size;
|
||||
FT_Extension_Initializer init;
|
||||
FT_Extension_Finalizer finalize;
|
||||
void* interface;
|
||||
|
||||
FT_ULong offset;
|
||||
|
||||
} FT_Extension_Class;
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Register_Extension(
|
||||
FT_Driver driver,
|
||||
FT_Extension_Class* clazz );
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_EXTEND_ENGINE
|
||||
|
||||
|
||||
/* Initialize the extension component */
|
||||
LOCAL_DEF
|
||||
FT_Error FT_Init_Extensions( FT_Library library );
|
||||
|
||||
/* Finalize the extension component */
|
||||
LOCAL_DEF
|
||||
FT_Error FT_Done_Extensions( FT_Library library );
|
||||
|
||||
/* Create an extension within a face object. Called by the */
|
||||
/* face object constructor. */
|
||||
LOCAL_DEF
|
||||
FT_Error FT_Create_Extensions( FT_Face face );
|
||||
|
||||
/* Destroy all extensions within a face object. Called by the */
|
||||
/* face object destructor. */
|
||||
LOCAL_DEF
|
||||
FT_Error FT_Destroy_Extensions( FT_Face face );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* return an extension's data & interface according to its ID */
|
||||
FT_EXPORT_DEF( void* ) FT_Get_Extension(
|
||||
FT_Face face,
|
||||
const char* extension_id,
|
||||
void** extension_interface );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTEXTEND_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,113 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftlist.c */
|
||||
/* */
|
||||
/* Generic list support for FreeType (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file implements functions relative to list processing. Its */
|
||||
/* data structures are defined in `freetype.h'. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTLIST_H
|
||||
#define FTLIST_H
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_ListNode ) FT_List_Find( FT_List list,
|
||||
void* data );
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_List_Add( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_List_Insert( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_List_Remove( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_List_Up( FT_List list,
|
||||
FT_ListNode node );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* FT_List_Iterator */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* An FT_List iterator function which is called during a list parse */
|
||||
/* by FT_List_Iterate(). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* node :: The current iteration list node. */
|
||||
/* */
|
||||
/* user :: A typeless pointer passed to FT_List_Iterate(). */
|
||||
/* Can be used to point to the iteration's state. */
|
||||
/* */
|
||||
typedef FT_Error (*FT_List_Iterator)( FT_ListNode node,
|
||||
void* user );
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_List_Iterate( FT_List list,
|
||||
FT_List_Iterator iterator,
|
||||
void* user );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* 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 */
|
||||
/* given list. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* system :: The current system object. */
|
||||
/* */
|
||||
/* data :: The current object to destroy. */
|
||||
/* */
|
||||
/* user :: A typeless pointer passed to FT_List_Iterate(). It can */
|
||||
/* be used to point to the iteration's state. */
|
||||
/* */
|
||||
typedef void (*FT_List_Destructor)( FT_Memory memory,
|
||||
void* data,
|
||||
void* user );
|
||||
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_List_Finalize( FT_List list,
|
||||
FT_List_Destructor destroy,
|
||||
FT_Memory memory,
|
||||
void* user );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FTLIST_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,127 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftmemory.h */
|
||||
/* */
|
||||
/* The FreeType memory management macros (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTMEMORY_H
|
||||
#define FTMEMORY_H
|
||||
|
||||
|
||||
#include <freetype/config/ftconfig.h>
|
||||
#include <freetype/fttypes.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_SET_ERROR */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used to set an implicit `error' variable to a given */
|
||||
/* expression's value (usually a function call), and convert it to a */
|
||||
/* boolean which is set whenever the value is != 0. */
|
||||
/* */
|
||||
#undef FT_SET_ERROR
|
||||
#define FT_SET_ERROR( expression ) \
|
||||
( ( error = (expression) ) != 0 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** M E M O R Y ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
void** P );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Realloc( FT_Memory memory,
|
||||
FT_Long current,
|
||||
FT_Long size,
|
||||
void** P );
|
||||
|
||||
BASE_DEF( void ) FT_Free( FT_Memory memory,
|
||||
void** P );
|
||||
|
||||
|
||||
|
||||
/* This `#include' is needed by the MEM_xxx() macros; it should be */
|
||||
/* available on all platforms we know of. */
|
||||
#include <string.h>
|
||||
|
||||
#define MEM_Set( dest, byte, count ) memset( dest, byte, count )
|
||||
|
||||
#define MEM_Copy( dest, source, count ) memcpy( dest, source, count )
|
||||
|
||||
#define MEM_Move( dest, source, count ) memmove( dest, source, count )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* We now support closures to produce completely reentrant code. This */
|
||||
/* means the allocation functions now takes an additional argument */
|
||||
/* (`memory'). It is a handle to a given memory object, responsible for */
|
||||
/* all low-level operations, including memory management and */
|
||||
/* synchronisation. */
|
||||
/* */
|
||||
/* In order to keep our code readable and use the same macros in the */
|
||||
/* font drivers and the rest of the library, MEM_Alloc(), ALLOC(), and */
|
||||
/* ALLOC_ARRAY() now use an implicit variable, `memory'. It must be */
|
||||
/* defined at all locations where a memory operation is queried. */
|
||||
/* */
|
||||
#define MEM_Alloc( _pointer_, _size_ ) \
|
||||
FT_Alloc( memory, _size_, (void**)&(_pointer_) )
|
||||
|
||||
#define MEM_Alloc_Array( _pointer_, _count_, _type_ ) \
|
||||
FT_Alloc( memory, (_count_)*sizeof ( _type_ ), \
|
||||
(void**)&(_pointer_) )
|
||||
|
||||
#define MEM_Realloc( _pointer_, _current_, _size_ ) \
|
||||
FT_Realloc( memory, _current_, _size_, (void**)&(_pointer_) )
|
||||
|
||||
#define MEM_Realloc_Array( _pointer_, _current_, _new_, _type_ ) \
|
||||
FT_Realloc( memory, (_current_)*sizeof ( _type_ ), \
|
||||
(_new_)*sizeof ( _type_ ), (void**)&(_pointer_) )
|
||||
|
||||
#define ALLOC( _pointer_, _size_ ) \
|
||||
FT_SET_ERROR( MEM_Alloc( _pointer_, _size_ ) )
|
||||
|
||||
#define REALLOC( _pointer_, _current_, _size_ ) \
|
||||
FT_SET_ERROR( MEM_Realloc( _pointer_, _current_, _size_ ) )
|
||||
|
||||
#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
|
||||
FT_SET_ERROR( MEM_Alloc( _pointer_, \
|
||||
(_count_)*sizeof ( _type_ ) ) )
|
||||
|
||||
#define REALLOC_ARRAY( _pointer_, _current_, _count_, _type_ ) \
|
||||
FT_SET_ERROR( MEM_Realloc( _pointer_, \
|
||||
(_current_)*sizeof ( _type_ ), \
|
||||
(_count_)*sizeof ( _type_ ) ) )
|
||||
|
||||
#define FREE( _pointer_ ) FT_Free( memory, (void**)&(_pointer_) )
|
||||
|
||||
|
||||
#endif /* FTMEMORY_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,532 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftobjs.h */
|
||||
/* */
|
||||
/* The FreeType private base classes (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file contains the definition of all internal FreeType classes. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTOBJS_H
|
||||
#define FTOBJS_H
|
||||
|
||||
#include <freetype/internal/ftmemory.h>
|
||||
#include <freetype/ftrender.h>
|
||||
#include <freetype/internal/ftdriver.h>
|
||||
#include <freetype/internal/autohint.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Some generic definitions. */
|
||||
/* */
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void*)0
|
||||
#endif
|
||||
|
||||
#ifndef UNUSED
|
||||
#define UNUSED( arg ) ( (arg)=(arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The min and max functions missing in C. As usual, be careful not to */
|
||||
/* write things like MIN( a++, b++ ) to avoid side effects. */
|
||||
/* */
|
||||
#ifndef MIN
|
||||
#define MIN( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||
#endif
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS( a ) ( (a) < 0 ? -(a) : (a) )
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** M O D U L E S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_ModuleRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A module object instance. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* clazz :: A pointer to the module's class. */
|
||||
/* */
|
||||
/* library :: A handle to the parent library object. */
|
||||
/* */
|
||||
/* memory :: A handle to the memory manager. */
|
||||
/* */
|
||||
/* generic :: A generic structure for user-level extensibility (?). */
|
||||
/* */
|
||||
typedef struct FT_ModuleRec_
|
||||
{
|
||||
FT_Module_Class* clazz;
|
||||
FT_Library library;
|
||||
FT_Memory memory;
|
||||
FT_Generic generic;
|
||||
|
||||
} FT_ModuleRec;
|
||||
|
||||
|
||||
/* typecast an object to a FT_Module */
|
||||
#define FT_MODULE( x ) ((FT_Module)(x))
|
||||
#define FT_MODULE_CLASS( x ) FT_MODULE(x)->clazz
|
||||
#define FT_MODULE_LIBRARY( x ) FT_MODULE(x)->library
|
||||
#define FT_MODULE_MEMORY( x ) FT_MODULE(x)->memory
|
||||
|
||||
#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_font_driver )
|
||||
|
||||
#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_renderer )
|
||||
|
||||
#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_hinter )
|
||||
|
||||
#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
||||
ft_module_styler )
|
||||
|
||||
#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS(x)->module_flags & \
|
||||
ft_module_driver_scalable )
|
||||
|
||||
#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS(x)->module_flags & \
|
||||
ft_module_driver_no_outlines )
|
||||
|
||||
#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS(x)->module_flags & \
|
||||
ft_module_driver_has_hinter )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Module_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Finds a module and returns its specific interface as a typeless */
|
||||
/* pointer. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to the library object. */
|
||||
/* */
|
||||
/* module_name :: The module's name (as an ASCII string). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* A module-specific interface if available, 0 otherwise. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* You should better be familiar with FreeType internals to know */
|
||||
/* which module to look for, and what its interface is :-) */
|
||||
/* */
|
||||
BASE_DEF( const void* ) FT_Get_Module_Interface( FT_Library library,
|
||||
const char* mod_name );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** FACE, SIZE & GLYPH SLOT OBJECTS ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* a few macros used to perform easy typecasts with minimal brain damage */
|
||||
|
||||
#define FT_FACE( x ) ((FT_Face)(x))
|
||||
#define FT_SIZE( x ) ((FT_Size)(x))
|
||||
#define FT_SLOT( x ) ((FT_GlyphSlot)(x))
|
||||
|
||||
#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
|
||||
#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
|
||||
#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
|
||||
|
||||
#define FT_SIZE_FACE( x ) FT_SIZE( x )->face
|
||||
#define FT_SLOT_FACE( x ) FT_SLOT( x )->face
|
||||
|
||||
#define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
|
||||
#define FT_FACE_SIZE( x ) FT_FACE( x )->size
|
||||
|
||||
|
||||
/* this must be kept exported -- tt will be used later in our own */
|
||||
/* high-level caching font manager called SemTex (way after the */
|
||||
/* 2.0 release though */
|
||||
FT_EXPORT_DEF( FT_Error ) FT_New_Size( FT_Face face,
|
||||
FT_Size* size );
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_Done_Size( FT_Size size );
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_New_GlyphSlot( FT_Face face,
|
||||
FT_GlyphSlot* aslot );
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_Done_GlyphSlot( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** G L Y P H L O A D E R ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#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
|
||||
#define FT_SUBGLYPH_FLAG_SCALE 8
|
||||
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
|
||||
#define FT_SUBGLYPH_FLAG_2X2 0x80
|
||||
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
ft_glyph_own_bitmap = 1
|
||||
};
|
||||
|
||||
|
||||
struct FT_SubGlyph_
|
||||
{
|
||||
FT_Int index;
|
||||
FT_UShort flags;
|
||||
FT_Int arg1;
|
||||
FT_Int arg2;
|
||||
FT_Matrix transform;
|
||||
};
|
||||
|
||||
|
||||
typedef struct FT_GlyphLoad_
|
||||
{
|
||||
FT_Outline outline; /* outline */
|
||||
FT_UInt num_subglyphs; /* number of subglyphs */
|
||||
FT_SubGlyph* subglyphs; /* subglyphs */
|
||||
FT_Vector* extra_points; /* extra points table */
|
||||
|
||||
} FT_GlyphLoad;
|
||||
|
||||
|
||||
struct FT_GlyphLoader_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_UInt max_points;
|
||||
FT_UInt max_contours;
|
||||
FT_UInt max_subglyphs;
|
||||
FT_Bool use_extra;
|
||||
|
||||
FT_GlyphLoad base;
|
||||
FT_GlyphLoad current;
|
||||
|
||||
void* other; /* for possible future extension? */
|
||||
|
||||
};
|
||||
|
||||
|
||||
BASE_DEF( FT_Error ) FT_GlyphLoader_New( FT_Memory memory,
|
||||
FT_GlyphLoader** aloader );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_GlyphLoader_Create_Extra(
|
||||
FT_GlyphLoader* loader );
|
||||
|
||||
BASE_DEF( void ) FT_GlyphLoader_Done( FT_GlyphLoader* loader );
|
||||
|
||||
BASE_DEF( void ) FT_GlyphLoader_Reset( FT_GlyphLoader* loader );
|
||||
|
||||
BASE_DEF( void ) FT_GlyphLoader_Rewind( FT_GlyphLoader* loader );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_GlyphLoader_Check_Points(
|
||||
FT_GlyphLoader* loader,
|
||||
FT_UInt n_points,
|
||||
FT_UInt n_contours );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_GlyphLoader_Check_Subglyphs(
|
||||
FT_GlyphLoader* loader,
|
||||
FT_UInt n_subs );
|
||||
|
||||
BASE_DEF( void ) FT_GlyphLoader_Prepare( FT_GlyphLoader* loader );
|
||||
|
||||
BASE_DEF( void ) FT_GlyphLoader_Add( FT_GlyphLoader* loader );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_GlyphLoader_Copy_Points( FT_GlyphLoader* target,
|
||||
FT_GlyphLoader* source );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** R E N D E R E R S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_RENDERER( x ) ((FT_Renderer)( x ))
|
||||
#define FT_GLYPH( x ) ((FT_Glyph)( x ))
|
||||
#define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
|
||||
#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
|
||||
|
||||
|
||||
typedef struct FT_RendererRec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
FT_Renderer_Class* clazz;
|
||||
FT_Glyph_Format glyph_format;
|
||||
const FT_Glyph_Class glyph_class;
|
||||
|
||||
FT_Raster raster;
|
||||
FT_Raster_Render_Func raster_render;
|
||||
FTRenderer_render render;
|
||||
|
||||
} FT_RendererRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** F O N T D R I V E R S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* typecast a module into a driver easily */
|
||||
#define FT_DRIVER( x ) ((FT_Driver)(x))
|
||||
|
||||
/* typecast a module as a driver, and get its driver class */
|
||||
#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_DriverRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The root font driver class. A font driver is responsible for */
|
||||
/* managing and loading font files of a given format. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* root :: Contains the fields of the root module class. */
|
||||
/* */
|
||||
/* clazz :: A pointer to the font driver's class. Note that */
|
||||
/* this is NOT root.clazz. `class' wasn't used */
|
||||
/* as it is a reserved word in C++. */
|
||||
/* */
|
||||
/* faces_list :: The list of faces currently opened by this */
|
||||
/* driver. */
|
||||
/* */
|
||||
/* extensions :: A typeless pointer to the driver's extensions */
|
||||
/* registry, if they are supported through the */
|
||||
/* configuration macro FT_CONFIG_OPTION_EXTENSIONS. */
|
||||
/* */
|
||||
/* glyph_loader :: The glyph loader for all faces managed by this */
|
||||
/* driver. This object isn't defined for unscalable */
|
||||
/* formats. */
|
||||
/* */
|
||||
typedef struct FT_DriverRec_
|
||||
{
|
||||
FT_ModuleRec root;
|
||||
FT_Driver_Class* clazz;
|
||||
|
||||
FT_ListRec faces_list;
|
||||
void* extensions;
|
||||
|
||||
FT_GlyphLoader* glyph_loader;
|
||||
|
||||
} FT_DriverRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** L I B R A R I E S ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define FT_DEBUG_HOOK_TRUETYPE 0
|
||||
#define FT_DEBUG_HOOK_TYPE1 1
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_LibraryRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The FreeType library class. This is the root of all FreeType */
|
||||
/* data. Use FT_New_Library() to create a library object, and */
|
||||
/* FT_Done_Library() to discard it and all child objects. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* memory :: The library's memory object. Manages memory */
|
||||
/* allocation. */
|
||||
/* */
|
||||
/* generic :: Client data variable. Used to extend the */
|
||||
/* Library class by higher levels and clients. */
|
||||
/* */
|
||||
/* num_modules :: The number of modules currently registered */
|
||||
/* within this library. This is set to 0 for new */
|
||||
/* libraries. New modules are added through the */
|
||||
/* FT_Add_Module() API function. */
|
||||
/* */
|
||||
/* modules :: A table used to store handles to the currently */
|
||||
/* registered modules. Note that each font driver */
|
||||
/* contains a list of its opened faces. */
|
||||
/* */
|
||||
/* renderers :: The list of renderers currently registered */
|
||||
/* within the library. */
|
||||
/* */
|
||||
/* cur_renderer :: The current outline renderer. This is a */
|
||||
/* shortcut used to avoid parsing the list on */
|
||||
/* each call to FT_Outline_Render(). It is a */
|
||||
/* handle to the current renderer for the */
|
||||
/* ft_glyph_format_outline format. */
|
||||
/* */
|
||||
/* auto_hinter :: XXX */
|
||||
/* */
|
||||
/* raster_pool :: The raster object's render pool. This can */
|
||||
/* ideally be changed dynamically at run-time. */
|
||||
/* */
|
||||
/* raster_pool_size :: The size of the render pool in bytes. */
|
||||
/* */
|
||||
/* debug_hooks :: XXX */
|
||||
/* */
|
||||
typedef struct FT_LibraryRec_
|
||||
{
|
||||
FT_Memory memory; /* library's memory manager */
|
||||
|
||||
FT_Generic generic;
|
||||
|
||||
FT_UInt num_modules;
|
||||
FT_Module modules[FT_MAX_MODULES]; /* module objects */
|
||||
|
||||
FT_ListRec renderers; /* list of renderers */
|
||||
FT_Renderer cur_renderer; /* current outline renderer */
|
||||
FT_Module auto_hinter;
|
||||
|
||||
FT_Byte* raster_pool; /* scan-line conversion */
|
||||
/* render pool */
|
||||
FT_ULong raster_pool_size; /* size of render pool in bytes */
|
||||
|
||||
FT_DebugHook_Func debug_hooks[4];
|
||||
|
||||
} FT_LibraryRec;
|
||||
|
||||
|
||||
BASE_DEF( FT_Renderer ) FT_Lookup_Renderer( FT_Library library,
|
||||
FT_Glyph_Format format,
|
||||
FT_ListNode* node );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Render_Glyph_Internal( FT_Library library,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt render_mode );
|
||||
|
||||
typedef FT_Error (*FT_Glyph_Name_Requester)( FT_Face face,
|
||||
FT_UInt glyph_index,
|
||||
FT_Pointer buffer,
|
||||
FT_UInt buffer_max );
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||
|
||||
|
||||
FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname,
|
||||
FT_Stream astream );
|
||||
|
||||
FT_EXPORT_DEF( void ) FT_Done_Stream( FT_Stream stream );
|
||||
|
||||
FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void );
|
||||
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
||||
|
||||
|
||||
/* Define default raster's interface. The default raster is located in */
|
||||
/* `src/base/ftraster.c' */
|
||||
/* */
|
||||
/* Client applications can register new rasters through the */
|
||||
/* FT_Set_Raster() API. */
|
||||
|
||||
#ifndef FT_NO_DEFAULT_RASTER
|
||||
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTOBJS_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,361 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftstream.h */
|
||||
/* */
|
||||
/* Stream handling(specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTSTREAM_H
|
||||
#define FTSTREAM_H
|
||||
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* format of an 8-bit frame_op value = [ xxxxx | e | s ] */
|
||||
/* s is set to 1 if the value is signed, */
|
||||
/* e is set to 1 if the value is little-endian */
|
||||
/* xxxxx is a command */
|
||||
|
||||
#define FT_FRAME_OP_SHIFT 2
|
||||
#define FT_FRAME_OP_SIGNED 1
|
||||
#define FT_FRAME_OP_LITTLE 2
|
||||
#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
|
||||
|
||||
#define FT_MAKE_FRAME_OP( command, little, sign ) \
|
||||
( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
|
||||
|
||||
#define FT_FRAME_OP_END 0
|
||||
#define FT_FRAME_OP_START 1 /* start a new frame */
|
||||
#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
|
||||
#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
|
||||
#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
|
||||
#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
|
||||
#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
|
||||
|
||||
|
||||
typedef enum FT_Frame_Op_
|
||||
{
|
||||
ft_frame_end = 0,
|
||||
ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
|
||||
|
||||
ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
|
||||
ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
|
||||
|
||||
ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
|
||||
ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
|
||||
ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
|
||||
ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
|
||||
|
||||
ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
|
||||
ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
|
||||
ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
|
||||
ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
|
||||
|
||||
ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
|
||||
ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
|
||||
ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
|
||||
ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
|
||||
|
||||
ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
|
||||
ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
|
||||
|
||||
} FT_Frame_Op;
|
||||
|
||||
|
||||
typedef struct FT_Frame_Field_
|
||||
{
|
||||
FT_Frame_Op value;
|
||||
char size;
|
||||
FT_UShort offset;
|
||||
|
||||
} FT_Frame_Field;
|
||||
|
||||
|
||||
/* make-up a FT_Frame_Field out of a structure type and a field name */
|
||||
#define FT_FIELD_REF( s, f ) (((s*)0)->f)
|
||||
|
||||
#define FT_FRAME_FIELD( frame_op, struct_type, field ) \
|
||||
{ \
|
||||
frame_op, \
|
||||
sizeof ( FT_FIELD_REF( struct_type,field ) ), \
|
||||
(FT_UShort)(char*)&FT_FIELD_REF( struct_type, field ) \
|
||||
}
|
||||
|
||||
#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
|
||||
|
||||
#define FT_FRAME_START( s ) { ft_frame_start, 0, s }
|
||||
#define FT_FRAME_END { ft_frame_end, 0, 0 }
|
||||
|
||||
#define FT_FRAME_LONG( s, f ) FT_FRAME_FIELD( ft_frame_long_be, s, f )
|
||||
#define FT_FRAME_ULONG( s, f ) FT_FRAME_FIELD( ft_frame_ulong_be, s, f )
|
||||
#define FT_FRAME_SHORT( s, f ) FT_FRAME_FIELD( ft_frame_short_be, s, f )
|
||||
#define FT_FRAME_USHORT( s, f ) FT_FRAME_FIELD( ft_frame_ushort_be, s, f )
|
||||
#define FT_FRAME_BYTE( s, f ) FT_FRAME_FIELD( ft_frame_byte, s, f )
|
||||
#define FT_FRAME_CHAR( s, f ) FT_FRAME_FIELD( ft_frame_schar, s, f )
|
||||
|
||||
#define FT_FRAME_LONG_LE( s, f ) FT_FRAME_FIELD( ft_frame_long_le, s, f )
|
||||
#define FT_FRAME_ULONG_LE( s, f ) FT_FRAME_FIELD( ft_frame_ulong_le, s, f )
|
||||
#define FT_FRAME_SHORT_LE( s, f ) FT_FRAME_FIELD( ft_frame_short_le, s, f )
|
||||
#define FT_FRAME_USHORT_LE( s, f ) FT_FRAME_FIELD( ft_frame_ushort_le, s, f )
|
||||
|
||||
#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
|
||||
#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
|
||||
#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
|
||||
|
||||
#define FT_FRAME_BYTES( struct_type, field, count ) \
|
||||
{ \
|
||||
ft_frame_bytes, \
|
||||
count, \
|
||||
(FT_UShort)(char*)&FT_FIELD_REF( struct_type, field ) \
|
||||
}
|
||||
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* integer extraction macros -- the `buffer' parameter must ALWAYS be of */
|
||||
/* type `char*' or equivalent (1-byte elements). */
|
||||
/* */
|
||||
#define NEXT_Char( buffer ) \
|
||||
( (signed char)*buffer++ )
|
||||
#define NEXT_Byte( buffer ) \
|
||||
( (unsigned char)*buffer++ )
|
||||
|
||||
#define NEXT_Short( buffer ) \
|
||||
( buffer += 2, \
|
||||
( (short)( (signed char)buffer[-2] << 8 ) | \
|
||||
(unsigned char)buffer[-1] ) )
|
||||
|
||||
#define NEXT_UShort( buffer ) \
|
||||
( (unsigned short)NEXT_Short( buffer ) )
|
||||
|
||||
#define NEXT_Offset( buffer ) \
|
||||
( buffer += 3, \
|
||||
( ( (long)(signed char)buffer[-3] << 16 ) | \
|
||||
( (long)(unsigned char)buffer[-2] << 8 ) | \
|
||||
(long)(unsigned char)buffer[-1] ) )
|
||||
|
||||
#define NEXT_UOffset( buffer ) \
|
||||
( (unsigned long)NEXT_Offset( buffer ) )
|
||||
|
||||
#define NEXT_Long( buffer ) \
|
||||
( buffer += 4, \
|
||||
( ( (long)(signed char)buffer[-4] << 24 ) | \
|
||||
( (long)(unsigned char)buffer[-3] << 16 ) | \
|
||||
( (long)(unsigned char)buffer[-2] << 8 ) | \
|
||||
(long)(unsigned char)buffer[-1] ) )
|
||||
|
||||
#define NEXT_ULong( buffer ) \
|
||||
( (unsigned long)NEXT_Long( buffer ) )
|
||||
|
||||
|
||||
#define NEXT_ShortLE( buffer ) \
|
||||
( buffer += 2, \
|
||||
( (short)( (signed char)buffer[-1] << 8 ) | \
|
||||
(unsigned char)buffer[-2] ) )
|
||||
|
||||
#define NEXT_UShortLE( buffer ) \
|
||||
( (unsigned short)NEXT_ShortLE( buffer ) )
|
||||
|
||||
#define NEXT_OffsetLE( buffer ) \
|
||||
( buffer += 3, \
|
||||
( ( (long)(signed char)buffer[-1] << 16 ) | \
|
||||
( (long)(unsigned char)buffer[-2] << 8 ) | \
|
||||
(long)(unsigned char)buffer[-3] ) )
|
||||
|
||||
#define NEXT_UOffsetLE( buffer ) \
|
||||
( (unsigned long)NEXT_OffsetLE( buffer ) )
|
||||
|
||||
|
||||
#define NEXT_LongLE( buffer ) \
|
||||
( buffer += 4, \
|
||||
( ( (long)(signed char)buffer[-1] << 24 ) | \
|
||||
( (long)(unsigned char)buffer[-2] << 16 ) | \
|
||||
( (long)(unsigned char)buffer[-3] << 8 ) | \
|
||||
(long)(unsigned char)buffer[-4] ) )
|
||||
|
||||
#define NEXT_ULongLE( buffer ) \
|
||||
( (unsigned long)NEXT_LongLE( buffer ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each GET_xxxx() macro uses an implicit `stream' variable. */
|
||||
/* */
|
||||
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
|
||||
|
||||
#define GET_Char() FT_GET_MACRO( FT_Get_Char, FT_Char )
|
||||
#define GET_Byte() FT_GET_MACRO( FT_Get_Char, FT_Byte )
|
||||
#define GET_Short() FT_GET_MACRO( FT_Get_Short, FT_Short )
|
||||
#define GET_UShort() FT_GET_MACRO( FT_Get_Short, FT_UShort )
|
||||
#define GET_Offset() FT_GET_MACRO( FT_Get_Offset, FT_Long )
|
||||
#define GET_UOffset() FT_GET_MACRO( FT_Get_Offset, FT_ULong )
|
||||
#define GET_Long() FT_GET_MACRO( FT_Get_Long, FT_Long )
|
||||
#define GET_ULong() FT_GET_MACRO( FT_Get_Long, FT_ULong )
|
||||
#define GET_Tag4() FT_GET_MACRO( FT_Get_Long, FT_ULong )
|
||||
|
||||
#define GET_ShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_Short )
|
||||
#define GET_UShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_UShort )
|
||||
#define GET_LongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Short )
|
||||
#define GET_ULongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Short )
|
||||
|
||||
#define FT_READ_MACRO( func, type, var ) \
|
||||
( var = (type)func( stream, &error ), \
|
||||
error != FT_Err_Ok )
|
||||
|
||||
#define READ_Byte( var ) FT_READ_MACRO( FT_Read_Char, FT_Byte, var )
|
||||
#define READ_Char( var ) FT_READ_MACRO( FT_Read_Char, FT_Char, var )
|
||||
#define READ_Short( var ) FT_READ_MACRO( FT_Read_Short, FT_Short, var )
|
||||
#define READ_UShort( var ) FT_READ_MACRO( FT_Read_Short, FT_UShort, var )
|
||||
#define READ_Offset( var ) FT_READ_MACRO( FT_Read_Offset, FT_Long, var )
|
||||
#define READ_UOffset( var ) FT_READ_MACRO( FT_Read_Offset, FT_ULong, var )
|
||||
#define READ_Long( var ) FT_READ_MACRO( FT_Read_Long, FT_Long, var )
|
||||
#define READ_ULong( var ) FT_READ_MACRO( FT_Read_Long, FT_ULong, var )
|
||||
|
||||
#define READ_ShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_Short, var )
|
||||
#define READ_UShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_UShort, var )
|
||||
#define READ_LongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_Long, var )
|
||||
#define READ_ULongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_ULong, var )
|
||||
|
||||
|
||||
BASE_DEF( void ) FT_New_Memory_Stream( FT_Library library,
|
||||
FT_Byte* base,
|
||||
FT_ULong size,
|
||||
FT_Stream stream );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Seek_Stream( FT_Stream stream,
|
||||
FT_ULong pos );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Skip_Stream( FT_Stream stream,
|
||||
FT_Long distance );
|
||||
|
||||
BASE_DEF( FT_Long ) FT_Stream_Pos( FT_Stream stream );
|
||||
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Read_Stream( FT_Stream stream,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Read_Stream_At( FT_Stream stream,
|
||||
FT_ULong pos,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Access_Frame( FT_Stream stream,
|
||||
FT_ULong count );
|
||||
|
||||
BASE_DEF( void ) FT_Forget_Frame( FT_Stream stream );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Extract_Frame( FT_Stream stream,
|
||||
FT_ULong count,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
BASE_DEF( void ) FT_Release_Frame( FT_Stream stream,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
BASE_DEF( FT_Char ) FT_Get_Char( FT_Stream stream );
|
||||
|
||||
BASE_DEF( FT_Short ) FT_Get_Short( FT_Stream stream );
|
||||
|
||||
BASE_DEF( FT_Long ) FT_Get_Offset( FT_Stream stream );
|
||||
|
||||
BASE_DEF( FT_Long ) FT_Get_Long( FT_Stream stream );
|
||||
|
||||
BASE_DEF( FT_Short ) FT_Get_ShortLE( FT_Stream stream );
|
||||
|
||||
BASE_DEF( FT_Long ) FT_Get_LongLE( FT_Stream stream );
|
||||
|
||||
|
||||
BASE_DEF( FT_Char ) FT_Read_Char( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
BASE_DEF( FT_Short ) FT_Read_Short( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
BASE_DEF( FT_Long ) FT_Read_Offset( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
BASE_DEF( FT_Long ) FT_Read_Long( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
BASE_DEF( FT_Short ) FT_Read_ShortLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
BASE_DEF( FT_Long ) FT_Read_LongLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
BASE_DEF( FT_Error ) FT_Read_Fields( FT_Stream stream,
|
||||
const FT_Frame_Field* fields,
|
||||
void* structure );
|
||||
|
||||
|
||||
#define USE_Stream( resource, stream ) \
|
||||
FT_SET_ERROR( FT_Open_Stream( resource, stream ) )
|
||||
|
||||
#define DONE_Stream( stream ) \
|
||||
FT_Done_Stream( stream )
|
||||
|
||||
|
||||
#define ACCESS_Frame( size ) \
|
||||
FT_SET_ERROR( FT_Access_Frame( stream, size ) )
|
||||
|
||||
#define FORGET_Frame() \
|
||||
FT_Forget_Frame( stream )
|
||||
|
||||
#define EXTRACT_Frame( size, bytes ) \
|
||||
FT_SET_ERROR( FT_Extract_Frame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
|
||||
#define RELEASE_Frame( bytes ) \
|
||||
FT_Release_Frame( stream, (FT_Byte**)&(bytes) )
|
||||
|
||||
#define FILE_Seek( position ) \
|
||||
FT_SET_ERROR( FT_Seek_Stream( stream, position ) )
|
||||
|
||||
#define FILE_Skip( distance ) \
|
||||
FT_SET_ERROR( FT_Skip_Stream( stream, distance ) )
|
||||
|
||||
#define FILE_Pos() \
|
||||
FT_Stream_Pos( stream )
|
||||
|
||||
#define FILE_Read( buffer, count ) \
|
||||
FT_SET_ERROR( FT_Read_Stream( stream, \
|
||||
(FT_Byte*)buffer, \
|
||||
count ) )
|
||||
|
||||
#define FILE_Read_At( position, buffer, count ) \
|
||||
FT_SET_ERROR( FT_Read_Stream_At( stream, \
|
||||
position, \
|
||||
(FT_Byte*)buffer, \
|
||||
count ) )
|
||||
|
||||
#define READ_Fields( fields, object ) \
|
||||
( ( error = FT_Read_Fields( stream, fields, object ) ) != FT_Err_Ok )
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTSTREAM_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,220 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* psnames.h */
|
||||
/* */
|
||||
/* High-level interface for the `PSNames' module (in charge of */
|
||||
/* various functions related to Postscript glyph names conversion). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef PSNAMES_H
|
||||
#define PSNAMES_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* PS_Unicode_Value_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to return the Unicode index corresponding to a */
|
||||
/* given glyph name. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* glyph_name :: The glyph name. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The Unicode character index resp. the non-Unicode value 0xFFFF if */
|
||||
/* the glyph name has no known Unicode meaning. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is able to map several different glyph names to the */
|
||||
/* same Unicode value, according to the rules defined in the Adobe */
|
||||
/* Glyph List table. */
|
||||
/* */
|
||||
/* This function will not be compiled if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
|
||||
/* */
|
||||
typedef FT_ULong (*PS_Unicode_Value_Func)( const char* glyph_name );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* PS_Unicode_Index_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to return the glyph index corresponding to a given */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* num_glyphs :: The number of glyphs in the face. */
|
||||
/* */
|
||||
/* glyph_names :: An array of glyph name pointers. */
|
||||
/* */
|
||||
/* unicode :: The Unicode value. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The glyph index resp. 0xFFFF if no glyph corresponds to this */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is able to recognize several glyph names per Unicode */
|
||||
/* value, according to the Adobe Glyph List. */
|
||||
/* */
|
||||
/* This function will not be compiled if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined. */
|
||||
/* */
|
||||
typedef FT_UInt (*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
FT_ULong unicode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* PS_Macintosh_Name_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to return the glyph name corresponding to an Apple */
|
||||
/* glyph name index. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* name_index :: The index of the Mac name. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The glyph name, or 0 if the index is invalid. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function will not be compiled if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
|
||||
/* */
|
||||
typedef const char* (*PS_Macintosh_Name_Func)( FT_UInt name_index );
|
||||
|
||||
|
||||
typedef const char* (*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
|
||||
|
||||
|
||||
typedef struct PS_UniMap_
|
||||
{
|
||||
FT_UInt unicode;
|
||||
FT_UInt glyph_index;
|
||||
|
||||
} PS_UniMap;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* PS_Unicodes */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A simple table used to map Unicode values to glyph indices. It is */
|
||||
/* built by the PS_Build_Unicodes table according to the glyphs */
|
||||
/* present in a font file. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* num_codes :: The number of glyphs in the font that match a given */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* unicodes :: An array of unicode values, sorted in increasing */
|
||||
/* order. */
|
||||
/* */
|
||||
/* gindex :: An array of glyph indices, corresponding to each */
|
||||
/* Unicode value. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Use the function PS_Lookup_Unicode() to retrieve the glyph index */
|
||||
/* corresponding to a given Unicode character code. */
|
||||
/* */
|
||||
typedef struct PS_Unicodes_
|
||||
{
|
||||
FT_UInt num_maps;
|
||||
PS_UniMap* maps;
|
||||
|
||||
} PS_Unicodes;
|
||||
|
||||
|
||||
typedef FT_Error (*PS_Build_Unicodes_Func)( FT_Memory memory,
|
||||
FT_UInt num_glyphs,
|
||||
const char** glyph_names,
|
||||
PS_Unicodes* unicodes );
|
||||
|
||||
typedef FT_UInt (*PS_Lookup_Unicode_Func)( PS_Unicodes* unicodes,
|
||||
FT_UInt unicode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* PSNames_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This structure defines the PSNames interface. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* unicode_value :: A function used to convert a glyph name */
|
||||
/* into a Unicode character code. */
|
||||
/* */
|
||||
/* build_unicodes :: A function which builds up the Unicode */
|
||||
/* mapping table. */
|
||||
/* */
|
||||
/* lookup_unicode :: A function used to return the glyph index */
|
||||
/* corresponding to a given Unicode */
|
||||
/* character. */
|
||||
/* */
|
||||
/* macintosh_name :: A function used to return the standard */
|
||||
/* Apple glyph Postscript name corresponding */
|
||||
/* to a given string index (used by the */
|
||||
/* TrueType `post' table). */
|
||||
/* */
|
||||
/* adobe_std_strings :: A function that returns a pointer to a */
|
||||
/* Adobe Standard String for a given SID. */
|
||||
/* */
|
||||
/* adobe_std_encoding :: A table of 256 unsigned shorts that maps */
|
||||
/* character codes in the Adobe Standard */
|
||||
/* Encoding to SIDs. */
|
||||
/* */
|
||||
/* adobe_expert_encoding :: A table of 256 unsigned shorts that maps */
|
||||
/* character codes in the Adobe Expert */
|
||||
/* Encoding to SIDs. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* `unicode_value' and `unicode_index' will be set to 0 if the */
|
||||
/* configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is */
|
||||
/* undefined. */
|
||||
/* */
|
||||
/* `macintosh_name' will be set to 0 if the configuration macro */
|
||||
/* FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined. */
|
||||
/* */
|
||||
typedef struct PSNames_Interface_
|
||||
{
|
||||
PS_Unicode_Value_Func unicode_value;
|
||||
PS_Build_Unicodes_Func build_unicodes;
|
||||
PS_Lookup_Unicode_Func lookup_unicode;
|
||||
PS_Macintosh_Name_Func macintosh_name;
|
||||
|
||||
PS_Adobe_Std_Strings_Func adobe_std_strings;
|
||||
const unsigned short* adobe_std_encoding;
|
||||
const unsigned short* adobe_expert_encoding;
|
||||
|
||||
} PSNames_Interface;
|
||||
|
||||
|
||||
#endif /* PSNAMES_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,492 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* sfnt.h */
|
||||
/* */
|
||||
/* High-level `sfnt' driver interface (specification). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef SFNT_H
|
||||
#define SFNT_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/internal/ftdriver.h>
|
||||
#include <freetype/internal/tttypes.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Init_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* First part of the SFNT face object initialization. This will find */
|
||||
/* the face in a SFNT file or collection, and load its format tag in */
|
||||
/* face->format_tag. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* */
|
||||
/* num_params :: The number of additional parameters. */
|
||||
/* */
|
||||
/* params :: Optional additional parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be at the font file's origin. */
|
||||
/* */
|
||||
/* This function recognizes fonts embedded in a `TrueType */
|
||||
/* collection'. */
|
||||
/* */
|
||||
/* Once the format tag has been validated by the font driver, it */
|
||||
/* should then call the TT_Load_Face_Func() callback to read the rest */
|
||||
/* of the SFNT tables in the object. */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Init_Face_Func)( FT_Stream stream,
|
||||
TT_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* 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. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* */
|
||||
/* num_params :: The number of additional parameters. */
|
||||
/* */
|
||||
/* params :: Optional additional parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function must be called after TT_Init_Face_Func(). */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Load_Face_Func)( FT_Stream stream,
|
||||
TT_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Done_Face_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A callback used to delete the common SFNT data from a face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function does NOT destroy the face object. */
|
||||
/* */
|
||||
typedef
|
||||
void (*TT_Done_Face_Func)( TT_Face face );
|
||||
|
||||
|
||||
typedef
|
||||
FT_Module_Interface (*SFNT_Get_Interface_Func)( FT_Module module,
|
||||
const char* interface );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_SFNT_Header_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the header of a SFNT font file. Supports collections. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face_index :: The index of the TrueType font, if we are opening a */
|
||||
/* collection. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be at the font file's origin. */
|
||||
/* */
|
||||
/* This function recognizes fonts embedded in a `TrueType */
|
||||
/* collection'. */
|
||||
/* */
|
||||
/* This function checks that the header is valid by looking at the */
|
||||
/* values of `search_range', `entry_selector', and `range_shift'. */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Load_SFNT_Header_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Long face_index,
|
||||
SFNT_Header* sfnt );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Directory_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads the table directory into a face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* sfnt :: The SFNT header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The stream cursor must be on the first byte after the 4-byte font */
|
||||
/* format tag. This is the case just after a call to */
|
||||
/* TT_Load_Format_Tag(). */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Load_Directory_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
SFNT_Header* sfnt );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Any_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads any font table into client memory. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The face object to look for. */
|
||||
/* */
|
||||
/* tag :: The tag of table to load. Use the value 0 if you want */
|
||||
/* to access the whole font file, else set this parameter */
|
||||
/* to a valid TrueType table tag that you can forge with */
|
||||
/* the MAKE_TT_TAG macro. */
|
||||
/* */
|
||||
/* offset :: The starting offset in the table (or the file if */
|
||||
/* tag == 0). */
|
||||
/* */
|
||||
/* length :: The address of the decision variable: */
|
||||
/* */
|
||||
/* If length == NULL: */
|
||||
/* Loads the whole table. Returns an error if */
|
||||
/* `offset' == 0! */
|
||||
/* */
|
||||
/* If *length == 0: */
|
||||
/* Exits immediately; returning the length of the given */
|
||||
/* table or of the font file, depending on the value of */
|
||||
/* `tag'. */
|
||||
/* */
|
||||
/* If *length != 0: */
|
||||
/* Loads the next `length' bytes of table or font, */
|
||||
/* starting at offset `offset' (in table or font too). */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* buffer :: The address of target buffer. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* TrueType error code. 0 means success. */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Load_Any_Func)( TT_Face face,
|
||||
FT_ULong tag,
|
||||
FT_Long offset,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong* length );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_SBit_Image_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given glyph sbit image from the font resource. This also */
|
||||
/* returns its metrics. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* x_ppem :: The horizontal resolution in points per EM. */
|
||||
/* */
|
||||
/* y_ppem :: The vertical resolution in points per EM. */
|
||||
/* */
|
||||
/* glyph_index :: The current glyph index. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* map :: The target pixmap. */
|
||||
/* */
|
||||
/* metrics :: A big sbit metrics structure for the glyph image. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. Returns an error if no */
|
||||
/* glyph sbit exists for the index. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The `map.buffer' field is always freed before the glyph is loaded. */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Load_SBit_Image_Func)( TT_Face face,
|
||||
FT_Int x_ppem,
|
||||
FT_Int y_ppem,
|
||||
FT_UInt glyph_index,
|
||||
FT_UInt load_flags,
|
||||
FT_Stream stream,
|
||||
FT_Bitmap* map,
|
||||
TT_SBit_Metrics* metrics );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Get_PS_Name_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Gets the PostScript glyph name of a glyph. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* index :: The glyph index. */
|
||||
/* */
|
||||
/* PSname :: The address of a string pointer. Will be NULL in case */
|
||||
/* of error, otherwise it is a pointer to the glyph name. */
|
||||
/* */
|
||||
/* You must not modify the returned string! */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Get_PS_Name_Func)( TT_Face face,
|
||||
FT_UInt index,
|
||||
FT_String** PSname );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Metrics_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads 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_Load_Metrics_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Bool vertical );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <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,
|
||||
TT_CMapTable* 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,
|
||||
TT_CMapTable* cmap );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Load_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Loads a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The function will use `face->goto_table' to seek the stream to */
|
||||
/* the start of the table. */
|
||||
/* */
|
||||
typedef
|
||||
FT_Error (*TT_Load_Table_Func)( TT_Face face,
|
||||
FT_Stream stream );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <FuncType> */
|
||||
/* TT_Free_Table_Func */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Frees a given TrueType table. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
typedef
|
||||
void (*TT_Free_Table_Func)( TT_Face face );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* SFNT_Interface */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This structure holds pointers to the functions used to load and */
|
||||
/* free the basic tables that are required in a `sfnt' font file. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* Check the various xxx_Func() descriptions for details. */
|
||||
/* */
|
||||
typedef struct SFNT_Interface_
|
||||
{
|
||||
TT_Goto_Table_Func goto_table;
|
||||
|
||||
TT_Init_Face_Func init_face;
|
||||
TT_Load_Face_Func load_face;
|
||||
TT_Done_Face_Func done_face;
|
||||
SFNT_Get_Interface_Func get_interface;
|
||||
|
||||
TT_Load_Any_Func load_any;
|
||||
TT_Load_SFNT_Header_Func load_sfnt_header;
|
||||
TT_Load_Directory_Func load_directory;
|
||||
|
||||
/* 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_os2;
|
||||
TT_Load_Table_Func load_psnames;
|
||||
|
||||
TT_Load_Table_Func load_names;
|
||||
TT_Free_Table_Func free_names;
|
||||
|
||||
/* optional tables */
|
||||
TT_Load_Table_Func load_hdmx;
|
||||
TT_Free_Table_Func free_hdmx;
|
||||
|
||||
TT_Load_Table_Func load_kerning;
|
||||
TT_Load_Table_Func load_gasp;
|
||||
TT_Load_Table_Func load_pclt;
|
||||
|
||||
/* see `ttsbit.h' */
|
||||
TT_Load_Table_Func load_sbits;
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
TT_Free_Table_Func free_sbits;
|
||||
|
||||
/* see `ttpost.h' */
|
||||
TT_Get_PS_Name_Func get_psname;
|
||||
TT_Free_Table_Func free_psnames;
|
||||
|
||||
/* see `ttcmap.h' */
|
||||
TT_CharMap_Load_Func load_charmap;
|
||||
TT_CharMap_Free_Func free_charmap;
|
||||
|
||||
} SFNT_Interface;
|
||||
|
||||
|
||||
#endif /* SFNT_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,67 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* t1errors.h */
|
||||
/* */
|
||||
/* Type 1 error ID definitions (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef T1ERRORS_H
|
||||
#define T1ERRORS_H
|
||||
|
||||
|
||||
/************************ error codes declaration **************/
|
||||
|
||||
/* The error codes are grouped into `classes' used to indicate the */
|
||||
/* `level' at which the error happened. */
|
||||
/* */
|
||||
/* The class is given by an error code's high byte. */
|
||||
|
||||
|
||||
/* ------------- Success is always 0 -------- */
|
||||
|
||||
#define T1_Err_Ok FT_Err_Ok
|
||||
|
||||
/* ----------- high level API errors -------- */
|
||||
|
||||
#define T1_Err_Invalid_File_Format FT_Err_Invalid_File_Format
|
||||
#define T1_Err_Invalid_Argument FT_Err_Invalid_Argument
|
||||
#define T1_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle
|
||||
#define T1_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle
|
||||
#define T1_Err_Invalid_Size_Handle FT_Err_Invalid_Size_Handle
|
||||
#define T1_Err_Invalid_Glyph_Handle FT_Err_Invalid_Slot_Handle
|
||||
#define T1_Err_Invalid_CharMap_Handle FT_Err_Invalid_CharMap_Handle
|
||||
#define T1_Err_Invalid_Glyph_Index FT_Err_Invalid_Glyph_Index
|
||||
|
||||
#define T1_Err_Unimplemented_Feature FT_Err_Unimplemented_Feature
|
||||
|
||||
#define T1_Err_Invalid_Engine FT_Err_Invalid_Driver_Handle
|
||||
|
||||
/* ------------- internal errors ------------ */
|
||||
|
||||
#define T1_Err_Out_Of_Memory FT_Err_Out_Of_Memory
|
||||
#define T1_Err_Unlisted_Object FT_Err_Unlisted_Object
|
||||
|
||||
/* ------------ general glyph outline errors ------ */
|
||||
|
||||
#define T1_Err_Invalid_Composite FT_Err_Invalid_Composite
|
||||
|
||||
#define T1_Err_Syntax_Error FT_Err_Invalid_File_Format
|
||||
#define T1_Err_Stack_Underflow FT_Err_Invalid_File_Format
|
||||
#define T1_Err_Stack_Overflow FT_Err_Invalid_File_Format
|
||||
|
||||
|
||||
#endif /* T1ERRORS_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,188 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* t1types.h */
|
||||
/* */
|
||||
/* Basic Type1/Type2 type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef T1TYPES_H
|
||||
#define T1TYPES_H
|
||||
|
||||
|
||||
#include <freetype/t1tables.h>
|
||||
#include <freetype/internal/psnames.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* T1_Encoding */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure modeling a custom encoding */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* num_chars :: The number of character codes in the encoding. */
|
||||
/* Usually 256. */
|
||||
/* */
|
||||
/* code_first :: The lowest valid character code in the encoding. */
|
||||
/* */
|
||||
/* code_last :: The highest valid character code in the encoding. */
|
||||
/* */
|
||||
/* char_index :: An array of corresponding glyph indices. */
|
||||
/* */
|
||||
/* char_name :: An array of corresponding glyph names. */
|
||||
/* */
|
||||
typedef struct T1_Encoding_
|
||||
{
|
||||
FT_Int num_chars;
|
||||
FT_Int code_first;
|
||||
FT_Int code_last;
|
||||
|
||||
FT_UShort* char_index;
|
||||
FT_String** char_name;
|
||||
|
||||
} T1_Encoding;
|
||||
|
||||
|
||||
typedef enum T1_EncodingType_
|
||||
{
|
||||
t1_encoding_none = 0,
|
||||
t1_encoding_array,
|
||||
t1_encoding_standard,
|
||||
t1_encoding_expert
|
||||
|
||||
} T1_EncodingType;
|
||||
|
||||
|
||||
typedef struct T1_Font_
|
||||
{
|
||||
|
||||
/* font info dictionary */
|
||||
T1_FontInfo font_info;
|
||||
|
||||
/* private dictionary */
|
||||
T1_Private private_dict;
|
||||
|
||||
/* top-level dictionary */
|
||||
FT_String* font_name;
|
||||
|
||||
T1_EncodingType encoding_type;
|
||||
T1_Encoding encoding;
|
||||
|
||||
FT_Byte* subrs_block;
|
||||
FT_Byte* charstrings_block;
|
||||
FT_Byte* glyph_names_block;
|
||||
|
||||
FT_Int num_subrs;
|
||||
FT_Byte** subrs;
|
||||
FT_Int* subrs_len;
|
||||
|
||||
FT_Int num_glyphs;
|
||||
FT_String** glyph_names; /* array of glyph names */
|
||||
FT_Byte** charstrings; /* array of glyph charstrings */
|
||||
FT_Int* charstrings_len;
|
||||
|
||||
FT_Byte paint_type;
|
||||
FT_Byte font_type;
|
||||
FT_Matrix font_matrix;
|
||||
FT_BBox font_bbox;
|
||||
FT_Long font_id;
|
||||
|
||||
FT_Int stroke_width;
|
||||
|
||||
} T1_Font;
|
||||
|
||||
|
||||
typedef struct CID_Subrs_
|
||||
{
|
||||
FT_UInt num_subrs;
|
||||
FT_Byte** code;
|
||||
|
||||
} CID_Subrs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** ORIGINAL T1_FACE CLASS DEFINITION ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This structure/class is defined here because it is common to the */
|
||||
/* following formats: TTF, OpenType-TT, and OpenType-CFF. */
|
||||
/* */
|
||||
/* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
|
||||
/* are not shared between font drivers, and are thus defined normally in */
|
||||
/* `ttobjs.h'. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct T1_FaceRec_* T1_Face;
|
||||
typedef struct CID_FaceRec_* CID_Face;
|
||||
|
||||
|
||||
typedef struct T1_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
T1_Font type1;
|
||||
void* psnames;
|
||||
void* afm_data;
|
||||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
PS_Unicodes unicode_map;
|
||||
|
||||
/* support for Multiple Masters fonts */
|
||||
T1_Blend* blend;
|
||||
|
||||
} T1_FaceRec;
|
||||
|
||||
|
||||
typedef struct CID_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
void* psnames;
|
||||
CID_Info cid;
|
||||
void* afm_data;
|
||||
CID_Subrs* subrs;
|
||||
|
||||
} CID_FaceRec;
|
||||
|
||||
|
||||
#endif /* T1TYPES_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,121 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* t2errors.h */
|
||||
/* */
|
||||
/* OpenType error ID definitions (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef T2ERRORS_H
|
||||
#define T2ERRORS_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Error codes declaration */
|
||||
/* */
|
||||
/* The error codes are grouped in `classes' used to indicate the `level' */
|
||||
/* at which the error happened. The class is given by an error code's */
|
||||
/* high byte. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* Success is always 0. */
|
||||
|
||||
#define T2_Err_Ok FT_Err_Ok
|
||||
|
||||
/* High level API errors. */
|
||||
|
||||
#define T2_Err_Invalid_File_Format FT_Err_Invalid_File_Format
|
||||
#define T2_Err_Invalid_Argument FT_Err_Invalid_Argument
|
||||
#define T2_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle
|
||||
#define T2_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle
|
||||
#define T2_Err_Invalid_Instance_Handle FT_Err_Invalid_Size_Handle
|
||||
#define T2_Err_Invalid_Glyph_Handle FT_Err_Invalid_Slot_Handle
|
||||
#define T2_Err_Invalid_CharMap_Handle FT_Err_Invalid_CharMap_Handle
|
||||
#define T2_Err_Invalid_Glyph_Index FT_Err_Invalid_Glyph_Index
|
||||
|
||||
#define T2_Err_Unimplemented_Feature FT_Err_Unimplemented_Feature
|
||||
|
||||
#define T2_Err_Invalid_Engine FT_Err_Invalid_Driver_Handle
|
||||
|
||||
/* Internal errors. */
|
||||
|
||||
#define T2_Err_Out_Of_Memory FT_Err_Out_Of_Memory
|
||||
#define T2_Err_Unlisted_Object FT_Err_Unlisted_Object
|
||||
|
||||
/* General glyph outline errors. */
|
||||
|
||||
#define T2_Err_Invalid_Composite FT_Err_Invalid_Composite
|
||||
|
||||
/* Bytecode interpreter error codes. */
|
||||
|
||||
/* These error codes are produced by the TrueType */
|
||||
/* bytecode interpreter. They usually indicate a */
|
||||
/* broken font file, a broken glyph within a font */
|
||||
/* file, or a bug in the interpreter! */
|
||||
|
||||
#define T2_Err_Invalid_Opcode 0x500
|
||||
#define T2_Err_Too_Few_Arguments 0x501
|
||||
#define T2_Err_Stack_Overflow 0x502
|
||||
#define T2_Err_Code_Overflow 0x503
|
||||
#define T2_Err_Bad_Argument 0x504
|
||||
#define T2_Err_Divide_By_Zero 0x505
|
||||
#define T2_Err_Storage_Overflow 0x506
|
||||
#define T2_Err_Cvt_Overflow 0x507
|
||||
#define T2_Err_Invalid_Reference 0x508
|
||||
#define T2_Err_Invalid_Distance 0x509
|
||||
#define T2_Err_Interpolate_Twilight 0x50A
|
||||
#define T2_Err_Debug_OpCode 0x50B
|
||||
#define T2_Err_ENDF_In_Exec_Stream 0x50C
|
||||
#define T2_Err_Out_Of_CodeRanges 0x50D
|
||||
#define T2_Err_Nested_DEFS 0x50E
|
||||
#define T2_Err_Invalid_CodeRange 0x50F
|
||||
#define T2_Err_Invalid_Displacement 0x510
|
||||
#define T2_Err_Execution_Too_Long 0x511
|
||||
|
||||
#define T2_Err_Too_Many_Instruction_Defs 0x512
|
||||
#define T2_Err_Too_Many_Function_Defs 0x513
|
||||
|
||||
/* Other TrueType specific error codes. */
|
||||
|
||||
#define T2_Err_Table_Missing 0x520
|
||||
#define T2_Err_Too_Many_Extensions 0x521
|
||||
#define T2_Err_Extensions_Unsupported 0x522
|
||||
#define T2_Err_Invalid_Extension_Id 0x523
|
||||
|
||||
#define T2_Err_No_Vertical_Data 0x524
|
||||
|
||||
#define T2_Err_Max_Profile_Missing 0x530
|
||||
#define T2_Err_Header_Table_Missing 0x531
|
||||
#define T2_Err_Horiz_Header_Missing 0x532
|
||||
#define T2_Err_Locations_Missing 0x533
|
||||
#define T2_Err_Name_Table_Missing 0x534
|
||||
#define T2_Err_CMap_Table_Missing 0x535
|
||||
#define T2_Err_Hmtx_Table_Missing 0x536
|
||||
#define T2_Err_OS2_Table_Missing 0x537
|
||||
#define T2_Err_Post_Table_Missing 0x538
|
||||
|
||||
#define T2_Err_Invalid_Horiz_Metrics 0x540
|
||||
#define T2_Err_Invalid_CharMap_Format 0x541
|
||||
#define T2_Err_Invalid_PPem 0x542
|
||||
#define T2_Err_Invalid_Vert_Metrics 0x543
|
||||
|
||||
#define T2_Err_Could_Not_Find_Context 0x550
|
||||
|
||||
|
||||
#endif /* T2ERRORS_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,218 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* t2types.h */
|
||||
/* */
|
||||
/* Basic OpenType/CFF type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef T2TYPES_H
|
||||
#define T2TYPES_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* CFF_Index */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a CFF Index table. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* stream :: XXX */
|
||||
/* */
|
||||
/* count :: The number of elements in the index. */
|
||||
/* */
|
||||
/* off_size :: The size in bytes of object offsets in index. */
|
||||
/* */
|
||||
/* data_offset :: The position of first data byte in the index's */
|
||||
/* bytes. */
|
||||
/* */
|
||||
/* offsets :: XXX */
|
||||
/* */
|
||||
/* bytes :: If the index is loaded in memory, its bytes. */
|
||||
/* */
|
||||
typedef struct CFF_Index_
|
||||
{
|
||||
FT_Stream stream;
|
||||
FT_UInt count;
|
||||
FT_Byte off_size;
|
||||
FT_ULong data_offset;
|
||||
|
||||
FT_ULong* offsets;
|
||||
FT_Byte* bytes;
|
||||
|
||||
} CFF_Index;
|
||||
|
||||
|
||||
typedef struct CFF_Font_Dict_
|
||||
{
|
||||
FT_UInt version;
|
||||
FT_UInt notice;
|
||||
FT_UInt copyright;
|
||||
FT_UInt full_name;
|
||||
FT_UInt family_name;
|
||||
FT_UInt weight;
|
||||
FT_Bool is_fixed_pitch;
|
||||
FT_Fixed italic_angle;
|
||||
FT_Pos underline_position;
|
||||
FT_Pos underline_thickness;
|
||||
FT_Int paint_type;
|
||||
FT_Int charstring_type;
|
||||
FT_Matrix font_matrix;
|
||||
FT_ULong unique_id;
|
||||
FT_BBox font_bbox;
|
||||
FT_Pos stroke_width;
|
||||
FT_ULong charset_offset;
|
||||
FT_ULong encoding_offset;
|
||||
FT_ULong charstrings_offset;
|
||||
FT_ULong private_offset;
|
||||
FT_ULong private_size;
|
||||
FT_Long synthetic_base;
|
||||
FT_UInt embedded_postscript;
|
||||
FT_UInt base_font_name;
|
||||
FT_UInt postscript;
|
||||
|
||||
/* these should only be used for the top-level font dictionary */
|
||||
FT_UInt cid_registry;
|
||||
FT_UInt cid_ordering;
|
||||
FT_ULong cid_supplement;
|
||||
|
||||
FT_Long cid_font_version;
|
||||
FT_Long cid_font_revision;
|
||||
FT_Long cid_font_type;
|
||||
FT_Long cid_count;
|
||||
FT_ULong cid_uid_base;
|
||||
FT_ULong cid_fd_array_offset;
|
||||
FT_ULong cid_fd_select_offset;
|
||||
FT_UInt cid_font_name;
|
||||
|
||||
} CFF_Font_Dict;
|
||||
|
||||
|
||||
typedef struct CFF_Private_
|
||||
{
|
||||
FT_Byte num_blue_values;
|
||||
FT_Byte num_other_blues;
|
||||
FT_Byte num_family_blues;
|
||||
FT_Byte num_family_other_blues;
|
||||
|
||||
FT_Pos blue_values[14];
|
||||
FT_Pos other_blues[10];
|
||||
FT_Pos family_blues[14];
|
||||
FT_Pos family_other_blues[10];
|
||||
|
||||
FT_Fixed blue_scale;
|
||||
FT_Pos blue_shift;
|
||||
FT_Pos blue_fuzz;
|
||||
FT_Pos standard_width;
|
||||
FT_Pos standard_height;
|
||||
|
||||
FT_Byte num_snap_widths;
|
||||
FT_Byte num_snap_heights;
|
||||
FT_Pos snap_widths[13];
|
||||
FT_Pos snap_heights[13];
|
||||
FT_Bool force_bold;
|
||||
FT_Fixed force_bold_threshold;
|
||||
FT_Int lenIV;
|
||||
FT_Int language_group;
|
||||
FT_Fixed expansion_factor;
|
||||
FT_Long initial_random_seed;
|
||||
FT_ULong local_subrs_offset;
|
||||
FT_Pos default_width;
|
||||
FT_Pos nominal_width;
|
||||
|
||||
} CFF_Private;
|
||||
|
||||
|
||||
typedef struct CFF_FD_Select_
|
||||
{
|
||||
FT_Byte format;
|
||||
FT_UInt range_count;
|
||||
|
||||
/* that's the table, taken from the file `as is' */
|
||||
FT_Byte* data;
|
||||
FT_UInt data_size;
|
||||
|
||||
/* small cache for format 3 only */
|
||||
FT_UInt cache_first;
|
||||
FT_UInt cache_count;
|
||||
FT_Byte cache_fd;
|
||||
|
||||
} CFF_FD_Select;
|
||||
|
||||
|
||||
/* A SubFont packs a font dict and a private dict together. They are */
|
||||
/* needed to support CID-keyed CFF fonts. */
|
||||
typedef struct CFF_SubFont_
|
||||
{
|
||||
CFF_Font_Dict font_dict;
|
||||
CFF_Private private_dict;
|
||||
|
||||
CFF_Index local_subrs_index;
|
||||
FT_UInt num_local_subrs;
|
||||
FT_Byte** local_subrs;
|
||||
|
||||
} CFF_SubFont;
|
||||
|
||||
|
||||
/* maximum number of sub-fonts in a CID-keyed file */
|
||||
#define CFF_MAX_CID_FONTS 16
|
||||
|
||||
|
||||
typedef struct CFF_Font_
|
||||
{
|
||||
FT_Stream stream;
|
||||
FT_Memory memory;
|
||||
FT_UInt num_faces;
|
||||
FT_UInt num_glyphs;
|
||||
|
||||
FT_Byte version_major;
|
||||
FT_Byte version_minor;
|
||||
FT_Byte header_size;
|
||||
FT_Byte absolute_offsize;
|
||||
|
||||
|
||||
CFF_Index name_index;
|
||||
CFF_Index top_dict_index;
|
||||
CFF_Index string_index;
|
||||
CFF_Index global_subrs_index;
|
||||
|
||||
/* we don't load the Encoding and CharSet tables */
|
||||
|
||||
CFF_Index charstrings_index;
|
||||
CFF_Index font_dict_index;
|
||||
CFF_Index private_index;
|
||||
CFF_Index local_subrs_index;
|
||||
|
||||
FT_String* font_name;
|
||||
FT_UInt num_global_subrs;
|
||||
FT_Byte** global_subrs;
|
||||
|
||||
CFF_SubFont top_font;
|
||||
FT_UInt num_subfonts;
|
||||
CFF_SubFont* subfonts[CFF_MAX_CID_FONTS];
|
||||
|
||||
CFF_FD_Select fd_select;
|
||||
|
||||
} CFF_Font;
|
||||
|
||||
|
||||
#endif /* T2TYPES_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,121 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* tterrors.h */
|
||||
/* */
|
||||
/* TrueType error ID definitions (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef TTERRORS_H
|
||||
#define TTERRORS_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Error codes declaration */
|
||||
/* */
|
||||
/* The error codes are grouped in `classes' used to indicate the `level' */
|
||||
/* at which the error happened. The class is given by an error code's */
|
||||
/* high byte. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* Success is always 0. */
|
||||
|
||||
#define TT_Err_Ok FT_Err_Ok
|
||||
|
||||
/* High level API errors. */
|
||||
|
||||
#define TT_Err_Invalid_File_Format FT_Err_Invalid_File_Format
|
||||
#define TT_Err_Invalid_Argument FT_Err_Invalid_Argument
|
||||
#define TT_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle
|
||||
#define TT_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle
|
||||
#define TT_Err_Invalid_Instance_Handle FT_Err_Invalid_Size_Handle
|
||||
#define TT_Err_Invalid_Glyph_Handle FT_Err_Invalid_Slot_Handle
|
||||
#define TT_Err_Invalid_CharMap_Handle FT_Err_Invalid_CharMap_Handle
|
||||
#define TT_Err_Invalid_Glyph_Index FT_Err_Invalid_Glyph_Index
|
||||
|
||||
#define TT_Err_Unimplemented_Feature FT_Err_Unimplemented_Feature
|
||||
|
||||
#define TT_Err_Invalid_Engine FT_Err_Invalid_Driver_Handle
|
||||
|
||||
/* Internal errors. */
|
||||
|
||||
#define TT_Err_Out_Of_Memory FT_Err_Out_Of_Memory
|
||||
#define TT_Err_Unlisted_Object FT_Err_Unlisted_Object
|
||||
|
||||
/* General glyph outline errors. */
|
||||
|
||||
#define TT_Err_Too_Many_Ins FT_Err_Too_Many_Hints
|
||||
#define TT_Err_Invalid_Composite FT_Err_Invalid_Composite
|
||||
|
||||
/* Bytecode interpreter error codes. */
|
||||
|
||||
/* These error codes are produced by the TrueType */
|
||||
/* bytecode interpreter. They usually indicate a */
|
||||
/* broken font file, a broken glyph within a font */
|
||||
/* file, or a bug in the interpreter! */
|
||||
|
||||
#define TT_Err_Invalid_Opcode 0x400
|
||||
#define TT_Err_Too_Few_Arguments 0x401
|
||||
#define TT_Err_Stack_Overflow 0x402
|
||||
#define TT_Err_Code_Overflow 0x403
|
||||
#define TT_Err_Bad_Argument 0x404
|
||||
#define TT_Err_Divide_By_Zero 0x405
|
||||
#define TT_Err_Storage_Overflow 0x406
|
||||
#define TT_Err_Cvt_Overflow 0x407
|
||||
#define TT_Err_Invalid_Reference 0x408
|
||||
#define TT_Err_Invalid_Distance 0x409
|
||||
#define TT_Err_Interpolate_Twilight 0x40A
|
||||
#define TT_Err_Debug_OpCode 0x40B
|
||||
#define TT_Err_ENDF_In_Exec_Stream 0x40C
|
||||
#define TT_Err_Out_Of_CodeRanges 0x40D
|
||||
#define TT_Err_Nested_DEFS 0x40E
|
||||
#define TT_Err_Invalid_CodeRange 0x40F
|
||||
#define TT_Err_Invalid_Displacement 0x410
|
||||
#define TT_Err_Execution_Too_Long 0x411
|
||||
#define TT_Err_Too_Many_Function_Defs 0x412
|
||||
#define TT_Err_Too_Many_Instruction_Defs 0x413
|
||||
|
||||
/* Other TrueType specific error codes. */
|
||||
|
||||
#define TT_Err_Table_Missing 0x420
|
||||
#define TT_Err_Too_Many_Extensions 0x421
|
||||
#define TT_Err_Extensions_Unsupported 0x422
|
||||
#define TT_Err_Invalid_Extension_Id 0x423
|
||||
|
||||
#define TT_Err_No_Vertical_Data 0x424
|
||||
|
||||
#define TT_Err_Max_Profile_Missing 0x430
|
||||
#define TT_Err_Header_Table_Missing 0x431
|
||||
#define TT_Err_Horiz_Header_Missing 0x432
|
||||
#define TT_Err_Locations_Missing 0x433
|
||||
#define TT_Err_Name_Table_Missing 0x434
|
||||
#define TT_Err_CMap_Table_Missing 0x435
|
||||
#define TT_Err_Hmtx_Table_Missing 0x436
|
||||
#define TT_Err_OS2_Table_Missing 0x437
|
||||
#define TT_Err_Post_Table_Missing 0x438
|
||||
|
||||
#define TT_Err_Invalid_Horiz_Metrics 0x440
|
||||
#define TT_Err_Invalid_CharMap_Format 0x441
|
||||
#define TT_Err_Invalid_PPem 0x442
|
||||
#define TT_Err_Invalid_Vert_Metrics 0x443
|
||||
|
||||
#define TT_Err_Could_Not_Find_Context 0x450
|
||||
|
||||
|
||||
#endif /* TTERRORS_H */
|
||||
|
||||
|
||||
/* END */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,235 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* t1tables.h */
|
||||
/* */
|
||||
/* Basic Type 1/Type 2 tables definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef T1TABLES_H
|
||||
#define T1TABLES_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
|
||||
/* Note that we separate font data in T1_FontInfo and T1_Private */
|
||||
/* structures in order to support Multiple Master fonts. */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* T1_FontInfo */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
|
||||
/* that for Multiple Master fonts, each instance has its own */
|
||||
/* FontInfo. */
|
||||
/* */
|
||||
typedef struct T1_FontInfo
|
||||
{
|
||||
FT_String* version;
|
||||
FT_String* notice;
|
||||
FT_String* full_name;
|
||||
FT_String* family_name;
|
||||
FT_String* weight;
|
||||
FT_Long italic_angle;
|
||||
FT_Bool is_fixed_pitch;
|
||||
FT_Short underline_position;
|
||||
FT_UShort underline_thickness;
|
||||
|
||||
} T1_FontInfo;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* T1_Private */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
|
||||
/* that for Multiple Master fonts, each instance has its own Private */
|
||||
/* dict. */
|
||||
/* */
|
||||
typedef struct T1_Private
|
||||
{
|
||||
FT_Int unique_id;
|
||||
FT_Int lenIV;
|
||||
|
||||
FT_Byte num_blue_values;
|
||||
FT_Byte num_other_blues;
|
||||
FT_Byte num_family_blues;
|
||||
FT_Byte num_family_other_blues;
|
||||
|
||||
FT_Short blue_values[14];
|
||||
FT_Short other_blues[10];
|
||||
|
||||
FT_Short family_blues [14];
|
||||
FT_Short family_other_blues[10];
|
||||
|
||||
FT_Fixed blue_scale;
|
||||
FT_Int blue_shift;
|
||||
FT_Int blue_fuzz;
|
||||
|
||||
FT_UShort standard_width[1];
|
||||
FT_UShort standard_height[1];
|
||||
|
||||
FT_Byte num_snap_widths;
|
||||
FT_Byte num_snap_heights;
|
||||
FT_Bool force_bold;
|
||||
FT_Bool round_stem_up;
|
||||
|
||||
FT_Short snap_widths [13]; /* reserve one place for the std */
|
||||
FT_Short snap_heights[13]; /* reserve one place for the std */
|
||||
|
||||
FT_Long language_group;
|
||||
FT_Long password;
|
||||
|
||||
FT_Short min_feature[2];
|
||||
|
||||
} T1_Private;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Enum> */
|
||||
/* T1_Blend_Flags */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A set of flags used to indicate which fields are present in a */
|
||||
/* given blen dictionary (font info or private). Used to support */
|
||||
/* Multiple Masters fonts. */
|
||||
/* */
|
||||
typedef enum
|
||||
{
|
||||
/* required fields in a FontInfo blend dictionary */
|
||||
t1_blend_underline_position = 0,
|
||||
t1_blend_underline_thickness,
|
||||
t1_blend_italic_angle,
|
||||
|
||||
/* required fields in a Private blend dictionary */
|
||||
t1_blend_blue_values,
|
||||
t1_blend_other_blues,
|
||||
t1_blend_standard_width,
|
||||
t1_blend_standard_height,
|
||||
t1_blend_stem_snap_widths,
|
||||
t1_blend_stem_snap_heights,
|
||||
t1_blend_blue_scale,
|
||||
t1_blend_blue_shift,
|
||||
t1_blend_family_blues,
|
||||
t1_blend_family_other_blues,
|
||||
t1_blend_force_bold,
|
||||
|
||||
/* never remove */
|
||||
t1_blend_max
|
||||
|
||||
} T1_Blend_Flags;
|
||||
|
||||
|
||||
/* maximum number of Multiple Masters designs, as defined in the spec */
|
||||
#define T1_MAX_MM_DESIGNS 16
|
||||
|
||||
/* maximum number of Multiple Masters axes, as defined in the spec */
|
||||
#define T1_MAX_MM_AXIS 4
|
||||
|
||||
/* maximum number of elements in a design map */
|
||||
#define T1_MAX_MM_MAP_POINTS 20
|
||||
|
||||
|
||||
/* this structure is used to store the BlendDesignMap entry for an axis */
|
||||
typedef struct T1_DesignMap_
|
||||
{
|
||||
FT_Byte num_points;
|
||||
FT_Fixed* design_points;
|
||||
FT_Fixed* blend_points;
|
||||
|
||||
} T1_DesignMap;
|
||||
|
||||
|
||||
typedef struct T1_Blend_
|
||||
{
|
||||
FT_UInt num_designs;
|
||||
FT_UInt num_axis;
|
||||
|
||||
FT_String* axis_names[T1_MAX_MM_AXIS];
|
||||
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
|
||||
T1_DesignMap design_map[T1_MAX_MM_AXIS];
|
||||
|
||||
FT_Fixed* weight_vector;
|
||||
FT_Fixed* default_weight_vector;
|
||||
|
||||
T1_FontInfo* font_infos[T1_MAX_MM_DESIGNS + 1];
|
||||
T1_Private* privates [T1_MAX_MM_DESIGNS + 1];
|
||||
|
||||
FT_ULong blend_bitflags;
|
||||
|
||||
} T1_Blend;
|
||||
|
||||
|
||||
typedef struct CID_FontDict_
|
||||
{
|
||||
T1_Private private_dict;
|
||||
|
||||
FT_UInt len_buildchar;
|
||||
FT_Fixed forcebold_threshold;
|
||||
FT_Pos stroke_width;
|
||||
FT_Fixed expansion_factor;
|
||||
|
||||
FT_Byte paint_type;
|
||||
FT_Byte font_type;
|
||||
FT_Matrix font_matrix;
|
||||
|
||||
FT_UInt num_subrs;
|
||||
FT_ULong subrmap_offset;
|
||||
FT_Int sd_bytes;
|
||||
|
||||
} CID_FontDict;
|
||||
|
||||
|
||||
typedef struct CID_Info_
|
||||
{
|
||||
FT_String* cid_font_name;
|
||||
FT_Fixed cid_version;
|
||||
FT_Int cid_font_type;
|
||||
|
||||
FT_String* registry;
|
||||
FT_String* ordering;
|
||||
FT_Int supplement;
|
||||
|
||||
T1_FontInfo font_info;
|
||||
FT_BBox font_bbox;
|
||||
FT_ULong uid_base;
|
||||
|
||||
FT_Int num_xuid;
|
||||
FT_ULong xuid[16];
|
||||
|
||||
|
||||
FT_ULong cidmap_offset;
|
||||
FT_Int fd_bytes;
|
||||
FT_Int gd_bytes;
|
||||
FT_ULong cid_count;
|
||||
|
||||
FT_Int num_dicts;
|
||||
CID_FontDict* font_dicts;
|
||||
|
||||
FT_ULong data_offset;
|
||||
|
||||
} CID_Info;
|
||||
|
||||
|
||||
#endif /* T1TABLES_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,698 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ttmakeid.h */
|
||||
/* */
|
||||
/* TrueType name ID definitions (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef TTNAMEID_H
|
||||
#define TTNAMEID_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Possible values for the `platform' identifier code in the name */
|
||||
/* records of the TTF `name' table. */
|
||||
/* */
|
||||
#define TT_PLATFORM_APPLE_UNICODE 0
|
||||
#define TT_PLATFORM_MACINTOSH 1
|
||||
#define TT_PLATFORM_ISO 2 /* deprecated */
|
||||
#define TT_PLATFORM_MICROSOFT 3
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Possible values of the platform specific encoding identifier field in */
|
||||
/* the name records of the TTF `name' table if the `platform' identifier */
|
||||
/* code is TT_PLATFORM_APPLE_UNICODE. */
|
||||
/* */
|
||||
#define TT_APPLE_ID_DEFAULT 0
|
||||
#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
|
||||
#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
|
||||
#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Possible values of the platform specific encoding identifier field in */
|
||||
/* the name records of the TTF `name' table if the `platform' identifier */
|
||||
/* code is TT_PLATFORM_MACINTOSH. */
|
||||
/* */
|
||||
#define TT_MAC_ID_ROMAN 0
|
||||
#define TT_MAC_ID_JAPANESE 1
|
||||
#define TT_MAC_ID_TRADITIONAL_CHINESE 2
|
||||
#define TT_MAC_ID_KOREAN 3
|
||||
#define TT_MAC_ID_ARABIC 4
|
||||
#define TT_MAC_ID_HEBREW 5
|
||||
#define TT_MAC_ID_GREEK 6
|
||||
#define TT_MAC_ID_RUSSIAN 7
|
||||
#define TT_MAC_ID_RSYMBOL 8
|
||||
#define TT_MAC_ID_DEVANAGARI 9
|
||||
#define TT_MAC_ID_GURMUKHI 10
|
||||
#define TT_MAC_ID_GUJARATI 11
|
||||
#define TT_MAC_ID_ORIYA 12
|
||||
#define TT_MAC_ID_BENGALI 13
|
||||
#define TT_MAC_ID_TAMIL 14
|
||||
#define TT_MAC_ID_TELUGU 15
|
||||
#define TT_MAC_ID_KANNADA 16
|
||||
#define TT_MAC_ID_MALAYALAM 17
|
||||
#define TT_MAC_ID_SINHALESE 18
|
||||
#define TT_MAC_ID_BURMESE 19
|
||||
#define TT_MAC_ID_KHMER 20
|
||||
#define TT_MAC_ID_THAI 21
|
||||
#define TT_MAC_ID_LAOTIAN 22
|
||||
#define TT_MAC_ID_GEORGIAN 23
|
||||
#define TT_MAC_ID_ARMENIAN 24
|
||||
#define TT_MAC_ID_MALDIVIAN 25
|
||||
#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
|
||||
#define TT_MAC_ID_TIBETAN 26
|
||||
#define TT_MAC_ID_MONGOLIAN 27
|
||||
#define TT_MAC_ID_GEEZ 28
|
||||
#define TT_MAC_ID_SLAVIC 29
|
||||
#define TT_MAC_ID_VIETNAMESE 30
|
||||
#define TT_MAC_ID_SINDHI 31
|
||||
#define TT_MAC_ID_UNINTERP 32
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Possible values of the platform specific encoding identifier field in */
|
||||
/* the name records of the TTF `name' table if the `platform' identifier */
|
||||
/* code is TT_PLATFORM_ISO. */
|
||||
/* */
|
||||
/* This use is now deprecated. */
|
||||
/* */
|
||||
#define TT_ISO_ID_7BIT_ASCII 0
|
||||
#define TT_ISO_ID_10646 1
|
||||
#define TT_ISO_ID_8859_1 2
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* possible values of the platform specific encoding identifier field in */
|
||||
/* the name records of the TTF `name' table if the `platform' identifier */
|
||||
/* code is TT_PLATFORM_MICROSOFT. */
|
||||
/* */
|
||||
#define TT_MS_ID_SYMBOL_CS 0
|
||||
#define TT_MS_ID_UNICODE_CS 1
|
||||
#define TT_MS_ID_SJIS 2
|
||||
#define TT_MS_ID_GB2312 3
|
||||
#define TT_MS_ID_BIG_5 4
|
||||
#define TT_MS_ID_WANSUNG 5
|
||||
#define TT_MS_ID_JOHAB 6
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Possible values of the language identifier field in the name records */
|
||||
/* of the TTF `name' table if the `platform' identifier code is */
|
||||
/* TT_PLATFORM_MACINTOSH. */
|
||||
/* */
|
||||
/* The canonical source for the Apple assigned Language ID's is at */
|
||||
/* */
|
||||
/* http://fonts.apple.com/TTRefMan/RM06/Chap6name.html */
|
||||
/* */
|
||||
#define TT_MAC_LANGID_ENGLISH 0
|
||||
#define TT_MAC_LANGID_FRENCH 1
|
||||
#define TT_MAC_LANGID_GERMAN 2
|
||||
#define TT_MAC_LANGID_ITALIAN 3
|
||||
#define TT_MAC_LANGID_DUTCH 4
|
||||
#define TT_MAC_LANGID_SWEDISH 5
|
||||
#define TT_MAC_LANGID_SPANISH 6
|
||||
#define TT_MAC_LANGID_DANISH 7
|
||||
#define TT_MAC_LANGID_PORTUGUESE 8
|
||||
#define TT_MAC_LANGID_NORWEGIAN 9
|
||||
#define TT_MAC_LANGID_HEBREW 10
|
||||
#define TT_MAC_LANGID_JAPANESE 11
|
||||
#define TT_MAC_LANGID_ARABIC 12
|
||||
#define TT_MAC_LANGID_FINNISH 13
|
||||
#define TT_MAC_LANGID_GREEK 14
|
||||
#define TT_MAC_LANGID_ICELANDIC 15
|
||||
#define TT_MAC_LANGID_MALTESE 16
|
||||
#define TT_MAC_LANGID_TURKISH 17
|
||||
#define TT_MAC_LANGID_CROATIAN 18
|
||||
#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19
|
||||
#define TT_MAC_LANGID_URDU 20
|
||||
#define TT_MAC_LANGID_HINDI 21
|
||||
#define TT_MAC_LANGID_THAI 22
|
||||
#define TT_MAC_LANGID_KOREAN 23
|
||||
#define TT_MAC_LANGID_LITHUANIAN 24
|
||||
#define TT_MAC_LANGID_POLISH 25
|
||||
#define TT_MAC_LANGID_HUNGARIAN 26
|
||||
#define TT_MAC_LANGID_ESTONIAN 27
|
||||
#define TT_MAC_LANGID_LETTISH 28
|
||||
#define TT_MAC_LANGID_SAAMISK 29
|
||||
#define TT_MAC_LANGID_FAEROESE 30
|
||||
#define TT_MAC_LANGID_FARSI 31
|
||||
#define TT_MAC_LANGID_RUSSIAN 32
|
||||
#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33
|
||||
#define TT_MAC_LANGID_FLEMISH 34
|
||||
#define TT_MAC_LANGID_IRISH 35
|
||||
#define TT_MAC_LANGID_ALBANIAN 36
|
||||
#define TT_MAC_LANGID_ROMANIAN 37
|
||||
#define TT_MAC_LANGID_CZECH 38
|
||||
#define TT_MAC_LANGID_SLOVAK 39
|
||||
#define TT_MAC_LANGID_SLOVENIAN 40
|
||||
#define TT_MAC_LANGID_YIDDISH 41
|
||||
#define TT_MAC_LANGID_SERBIAN 42
|
||||
#define TT_MAC_LANGID_MACEDONIAN 43
|
||||
#define TT_MAC_LANGID_BULGARIAN 44
|
||||
#define TT_MAC_LANGID_UKRAINIAN 45
|
||||
#define TT_MAC_LANGID_BYELORUSSIAN 46
|
||||
#define TT_MAC_LANGID_UZBEK 47
|
||||
#define TT_MAC_LANGID_KAZAKH 48
|
||||
#define TT_MAC_LANGID_AZERBAIJANI 49
|
||||
#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49
|
||||
#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50
|
||||
#define TT_MAC_LANGID_ARMENIAN 51
|
||||
#define TT_MAC_LANGID_GEORGIAN 52
|
||||
#define TT_MAC_LANGID_MOLDAVIAN 53
|
||||
#define TT_MAC_LANGID_KIRGHIZ 54
|
||||
#define TT_MAC_LANGID_TAJIKI 55
|
||||
#define TT_MAC_LANGID_TURKMEN 56
|
||||
#define TT_MAC_LANGID_MONGOLIAN 57
|
||||
#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57
|
||||
#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58
|
||||
#define TT_MAC_LANGID_PASHTO 59
|
||||
#define TT_MAC_LANGID_KURDISH 60
|
||||
#define TT_MAC_LANGID_KASHMIRI 61
|
||||
#define TT_MAC_LANGID_SINDHI 62
|
||||
#define TT_MAC_LANGID_TIBETAN 63
|
||||
#define TT_MAC_LANGID_NEPALI 64
|
||||
#define TT_MAC_LANGID_SANSKRIT 65
|
||||
#define TT_MAC_LANGID_MARATHI 66
|
||||
#define TT_MAC_LANGID_BENGALI 67
|
||||
#define TT_MAC_LANGID_ASSAMESE 68
|
||||
#define TT_MAC_LANGID_GUJARATI 69
|
||||
#define TT_MAC_LANGID_PUNJABI 70
|
||||
#define TT_MAC_LANGID_ORIYA 71
|
||||
#define TT_MAC_LANGID_MALAYALAM 72
|
||||
#define TT_MAC_LANGID_KANNADA 73
|
||||
#define TT_MAC_LANGID_TAMIL 74
|
||||
#define TT_MAC_LANGID_TELUGU 75
|
||||
#define TT_MAC_LANGID_SINHALESE 76
|
||||
#define TT_MAC_LANGID_BURMESE 77
|
||||
#define TT_MAC_LANGID_KHMER 78
|
||||
#define TT_MAC_LANGID_LAO 79
|
||||
#define TT_MAC_LANGID_VIETNAMESE 80
|
||||
#define TT_MAC_LANGID_INDONESIAN 81
|
||||
#define TT_MAC_LANGID_TAGALOG 82
|
||||
#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83
|
||||
#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84
|
||||
#define TT_MAC_LANGID_AMHARIC 85
|
||||
#define TT_MAC_LANGID_TIGRINYA 86
|
||||
#define TT_MAC_LANGID_GALLA 87
|
||||
#define TT_MAC_LANGID_SOMALI 88
|
||||
#define TT_MAC_LANGID_SWAHILI 89
|
||||
#define TT_MAC_LANGID_RUANDA 90
|
||||
#define TT_MAC_LANGID_RUNDI 91
|
||||
#define TT_MAC_LANGID_CHEWA 92
|
||||
#define TT_MAC_LANGID_MALAGASY 93
|
||||
#define TT_MAC_LANGID_ESPERANTO 94
|
||||
#define TT_MAC_LANGID_WELSH 128
|
||||
#define TT_MAC_LANGID_BASQUE 129
|
||||
#define TT_MAC_LANGID_CATALAN 130
|
||||
#define TT_MAC_LANGID_LATIN 131
|
||||
#define TT_MAC_LANGID_QUECHUA 132
|
||||
#define TT_MAC_LANGID_GUARANI 133
|
||||
#define TT_MAC_LANGID_AYMARA 134
|
||||
#define TT_MAC_LANGID_TATAR 135
|
||||
#define TT_MAC_LANGID_UIGHUR 136
|
||||
#define TT_MAC_LANGID_DZONGKHA 137
|
||||
#define TT_MAC_LANGID_JAVANESE 138
|
||||
#define TT_MAC_LANGID_SUNDANESE 139
|
||||
|
||||
|
||||
#if 0 /* these seem to be errors that have been dropped */
|
||||
|
||||
#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
|
||||
#define TT_MAC_LANGID_IRISH_GAELIC 141
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* The following codes are new as of 2000-03-10 */
|
||||
#define TT_MAC_LANGID_GALICIAN 140
|
||||
#define TT_MAC_LANGID_AFRIKAANS 141
|
||||
#define TT_MAC_LANGID_BRETON 142
|
||||
#define TT_MAC_LANGID_INUKTITUT 143
|
||||
#define TT_MAC_LANGID_SCOTTISH_GAELIC 144
|
||||
#define TT_MAC_LANGID_MANX_GAELIC 145
|
||||
#define TT_MAC_LANGID_IRISH_GAELIC 146
|
||||
#define TT_MAC_LANGID_TONGAN 147
|
||||
#define TT_MAC_LANGID_GREEK_POLYTONIC 148
|
||||
#define TT_MAC_LANGID_GREELANDIC 149
|
||||
#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Possible values of the language identifier field in the name records */
|
||||
/* of the TTF `name' table if the `platform' identifier code is */
|
||||
/* TT_PLATFORM_MICROSOFT. */
|
||||
/* */
|
||||
/* The canonical source for the MS assigned LCID's is at */
|
||||
/* */
|
||||
/* http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt */
|
||||
/* */
|
||||
#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
|
||||
#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
|
||||
#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01
|
||||
#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
|
||||
#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
|
||||
#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
|
||||
#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01
|
||||
#define TT_MS_LANGID_ARABIC_OMAN 0x2001
|
||||
#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
|
||||
#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
|
||||
#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01
|
||||
#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
|
||||
#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
|
||||
#define TT_MS_LANGID_ARABIC_UAE 0x3801
|
||||
#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01
|
||||
#define TT_MS_LANGID_ARABIC_QATAR 0x4001
|
||||
#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
|
||||
#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
|
||||
#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
|
||||
#define TT_MS_LANGID_CHINESE_PRC 0x0804
|
||||
#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04
|
||||
#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
|
||||
#define TT_MS_LANGID_CHINESE_MACAU 0x1404
|
||||
#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
|
||||
#define TT_MS_LANGID_DANISH_DENMARK 0x0406
|
||||
#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
|
||||
#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
|
||||
#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07
|
||||
#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
|
||||
#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
|
||||
#define TT_MS_LANGID_GREEK_GREECE 0x0408
|
||||
#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
|
||||
#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
|
||||
#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09
|
||||
#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
|
||||
#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
|
||||
#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
|
||||
#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09
|
||||
#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
|
||||
#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
|
||||
#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
|
||||
#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09
|
||||
#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
|
||||
#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
|
||||
#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a
|
||||
#define TT_MS_LANGID_SPANISH_MEXICO 0x080a
|
||||
#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a
|
||||
#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a
|
||||
#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a
|
||||
#define TT_MS_LANGID_SPANISH_PANAMA 0x180a
|
||||
#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a
|
||||
#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a
|
||||
#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a
|
||||
#define TT_MS_LANGID_SPANISH_PERU 0x280a
|
||||
#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a
|
||||
#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a
|
||||
#define TT_MS_LANGID_SPANISH_CHILE 0x340a
|
||||
#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a
|
||||
#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a
|
||||
#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a
|
||||
#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a
|
||||
#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a
|
||||
#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a
|
||||
#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a
|
||||
#define TT_MS_LANGID_FINNISH_FINLAND 0x040b
|
||||
#define TT_MS_LANGID_FRENCH_FRANCE 0x040c
|
||||
#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c
|
||||
#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c
|
||||
#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c
|
||||
#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c
|
||||
#define TT_MS_LANGID_FRENCH_MONACO 0x180c
|
||||
#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
|
||||
#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
|
||||
#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f
|
||||
#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
|
||||
#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
|
||||
#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
|
||||
#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
|
||||
#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
|
||||
#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
|
||||
#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
|
||||
#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
|
||||
#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814
|
||||
#define TT_MS_LANGID_POLISH_POLAND 0x0415
|
||||
#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
|
||||
#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
|
||||
#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
|
||||
#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
|
||||
#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
|
||||
#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
|
||||
#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
|
||||
#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a
|
||||
#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a
|
||||
#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a
|
||||
#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b
|
||||
#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c
|
||||
#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d
|
||||
#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d
|
||||
#define TT_MS_LANGID_THAI_THAILAND 0x041e
|
||||
#define TT_MS_LANGID_TURKISH_TURKEY 0x041f
|
||||
#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
|
||||
#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
|
||||
#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
|
||||
#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
|
||||
#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
|
||||
#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
|
||||
#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
|
||||
#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
|
||||
#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
|
||||
#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0428
|
||||
#define TT_MS_LANGID_FARSI_IRAN 0x0429
|
||||
#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a
|
||||
#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b
|
||||
#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c
|
||||
#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c
|
||||
#define TT_MS_LANGID_BASQUE_SPAIN 0x042d
|
||||
#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e
|
||||
#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f
|
||||
#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
|
||||
#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
|
||||
#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
|
||||
#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
|
||||
#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
|
||||
#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
|
||||
#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
|
||||
#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
|
||||
#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
|
||||
#define TT_MS_LANGID_HINDI_INDIA 0x0439
|
||||
#define TT_MS_LANGID_MALTESE_MALTA 0x043a
|
||||
#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b
|
||||
#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
|
||||
#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
|
||||
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e
|
||||
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
|
||||
#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
|
||||
#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
|
||||
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
|
||||
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
|
||||
#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
|
||||
#define TT_MS_LANGID_BENGALI_INDIA 0x0445
|
||||
#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
|
||||
#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
|
||||
#define TT_MS_LANGID_ORIYA_INDIA 0x0448
|
||||
#define TT_MS_LANGID_TAMIL_INDIA 0x0449
|
||||
#define TT_MS_LANGID_TELUGU_INDIA 0x044a
|
||||
#define TT_MS_LANGID_KANNADA_INDIA 0x044b
|
||||
#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c
|
||||
#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d
|
||||
#define TT_MS_LANGID_MARATHI_INDIA 0x044e
|
||||
#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f
|
||||
#define TT_MS_LANGID_KONKANI_INDIA 0x0457
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Possible values of the `name' identifier field in the name records of */
|
||||
/* the TTF `name' table. These values are platform independent. */
|
||||
/* */
|
||||
#define TT_NAME_ID_COPYRIGHT 0
|
||||
#define TT_NAME_ID_FONT_FAMILY 1
|
||||
#define TT_NAME_ID_FONT_SUBFAMILY 2
|
||||
#define TT_NAME_ID_UNIQUE_ID 3
|
||||
#define TT_NAME_ID_FULL_NAME 4
|
||||
#define TT_NAME_ID_VERSION_STRING 5
|
||||
#define TT_NAME_ID_PS_NAME 6
|
||||
#define TT_NAME_ID_TRADEMARK 7
|
||||
|
||||
/* the following values are from the OpenType spec */
|
||||
#define TT_NAME_ID_MANUFACTURER 8
|
||||
#define TT_NAME_ID_DESIGNER 9
|
||||
#define TT_NAME_ID_DESCRIPTION 10
|
||||
#define TT_NAME_ID_VENDOR_URL 11
|
||||
#define TT_NAME_ID_DESIGNER_URL 12
|
||||
#define TT_NAME_ID_LICENSE 13
|
||||
#define TT_NAME_ID_LICENSE_URL 14
|
||||
/* number 15 is reserved */
|
||||
#define TT_NAME_ID_PREFERRED_FAMILY 16
|
||||
#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
|
||||
#define TT_NAME_ID_MAC_FULL_NAME 18
|
||||
|
||||
/* The following code is new as of 2000-01-21 */
|
||||
#define TT_NAME_ID_SAMPLE_TEXT 19
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
|
||||
/* */
|
||||
/* Updated 02-Jul-2000. */
|
||||
/* */
|
||||
|
||||
/* General Scripts Area */
|
||||
|
||||
/* Bit 0 C0 Controls and Basic Latin */
|
||||
#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
|
||||
/* Bit 1 C1 Controls and Latin-1 Supplement */
|
||||
#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+00A0-U+00FF */
|
||||
/* Bit 2 Latin Extended-A */
|
||||
#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
|
||||
/* Bit 3 Latin Extended-B */
|
||||
#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
|
||||
/* Bit 4 IPA Extensions */
|
||||
#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
|
||||
/* Bit 5 Spacing Modifier Letters */
|
||||
#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
|
||||
/* Bit 6 Combining Diacritical Marks */
|
||||
#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
|
||||
/* Bit 7 Greek */
|
||||
#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
|
||||
/* Bit 8 is reserved (was: Greek Symbols and Coptic) */
|
||||
/* Bit 9 Cyrillic */
|
||||
#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
|
||||
/* Bit 10 Armenian */
|
||||
#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
|
||||
/* Bit 11 Hebrew */
|
||||
#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
|
||||
/* Bit 12 is reserved (was: Hebrew Extended) */
|
||||
/* Bit 13 Arabic */
|
||||
#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
|
||||
/* Bit 14 is reserved (was: Arabic Extended) */
|
||||
/* Bit 15 Devanagari */
|
||||
#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
|
||||
/* Bit 16 Bengali */
|
||||
#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
|
||||
/* Bit 17 Gurmukhi */
|
||||
#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
|
||||
/* Bit 18 Gujarati */
|
||||
#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
|
||||
/* Bit 19 Oriya */
|
||||
#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
|
||||
/* Bit 20 Tamil */
|
||||
#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
|
||||
/* Bit 21 Telugu */
|
||||
#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
|
||||
/* Bit 22 Kannada */
|
||||
#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
|
||||
/* Bit 23 Malayalam */
|
||||
#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
|
||||
/* Bit 24 Thai */
|
||||
#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
|
||||
/* Bit 25 Lao */
|
||||
#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
|
||||
/* Bit 26 Georgian */
|
||||
#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
|
||||
/* Bit 27 is reserved (was Georgian Extended) */
|
||||
/* Bit 28 Hangul Jamo */
|
||||
#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
|
||||
/* Bit 29 Latin Extended Additional */
|
||||
#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
|
||||
/* Bit 30 Greek Extended */
|
||||
#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
|
||||
|
||||
/* Symbols Area */
|
||||
|
||||
/* Bit 31 General Punctuation */
|
||||
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
|
||||
/* Bit 32 Superscripts And Subscripts */
|
||||
#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
|
||||
/* Bit 33 Currency Symbols */
|
||||
#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
|
||||
/* Bit 34 Combining Diacritical Marks For Symbols */
|
||||
#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
|
||||
/* Bit 35 Letterlike Symbols */
|
||||
#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
|
||||
/* Bit 36 Number Forms */
|
||||
#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
|
||||
/* Bit 37 Arrows */
|
||||
#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
|
||||
/* Bit 38 Mathematical Operators */
|
||||
#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
|
||||
/* Bit 39 Miscellaneous Technical */
|
||||
#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
|
||||
/* Bit 40 Control Pictures */
|
||||
#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
|
||||
/* Bit 41 Optical Character Recognition */
|
||||
#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
|
||||
/* Bit 42 Enclosed Alphanumerics */
|
||||
#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
|
||||
/* Bit 43 Box Drawing */
|
||||
#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
|
||||
/* Bit 44 Block Elements */
|
||||
#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
|
||||
/* Bit 45 Geometric Shapes */
|
||||
#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
|
||||
/* Bit 46 Miscellaneous Symbols */
|
||||
#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
|
||||
/* Bit 47 Dingbats */
|
||||
#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
|
||||
|
||||
/* CJK Phonetics and Symbols Area */
|
||||
|
||||
/* Bit 48 CJK Symbols And Punctuation */
|
||||
#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
|
||||
/* Bit 49 Hiragana */
|
||||
#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
|
||||
/* Bit 50 Katakana */
|
||||
#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
|
||||
/* Bit 51 Bopomofo + Extended Bopomofo */
|
||||
#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
|
||||
/* U+31A0-U+31BF */
|
||||
/* Bit 52 Hangul Compatibility Jamo */
|
||||
#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
|
||||
/* Bit 53 CJK Miscellaneous */
|
||||
#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */
|
||||
/* Bit 54 Enclosed CJK Letters And Months */
|
||||
#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
|
||||
/* Bit 55 CJK Compatibility */
|
||||
#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
|
||||
|
||||
/* Hangul Syllables Area */
|
||||
|
||||
/* Bit 56 Hangul */
|
||||
#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
|
||||
|
||||
/* Surrogates Area */
|
||||
|
||||
/* Bit 57 Surrogates */
|
||||
#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DFFF */
|
||||
/* Bit 58 is reserved for Unicode SubRanges */
|
||||
|
||||
/* CJK Ideographs Area */
|
||||
|
||||
/* Bit 59 CJK Unified Ideographs + */
|
||||
/* CJK Radical Supplement + */
|
||||
/* Kangxi Radicals + */
|
||||
/* Ideographic Description + */
|
||||
/* CJK Unified Ideographs Extension A */
|
||||
#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
|
||||
/* U+2E80-U+2EFF */
|
||||
/* U+2F00-U+2FDF */
|
||||
/* U+2FF0-U+2FFF */
|
||||
/* U+34E0-U+4DB5 */
|
||||
|
||||
/* Private Use Area */
|
||||
|
||||
/* Bit 60 Private Use */
|
||||
#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
|
||||
|
||||
/* Compatibility Area and Specials */
|
||||
|
||||
/* Bit 61 CJK Compatibility Ideographs */
|
||||
#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */
|
||||
/* Bit 62 Alphabetic Presentation Forms */
|
||||
#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
|
||||
/* Bit 63 Arabic Presentation Forms-A */
|
||||
#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */
|
||||
/* Bit 64 Combining Half Marks */
|
||||
#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
|
||||
/* Bit 65 CJK Compatibility Forms */
|
||||
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */
|
||||
/* Bit 66 Small Form Variants */
|
||||
#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
|
||||
/* Bit 67 Arabic Presentation Forms-B */
|
||||
#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */
|
||||
/* Bit 68 Halfwidth And Fullwidth Forms */
|
||||
#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
|
||||
/* Bit 69 Specials */
|
||||
#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */
|
||||
/* Bit 70 Tibetan */
|
||||
#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FCF */
|
||||
/* Bit 71 Syriac */
|
||||
#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
|
||||
/* Bit 72 Thaana */
|
||||
#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
|
||||
/* Bit 73 Sinhala */
|
||||
#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
|
||||
/* Bit 74 Myanmar */
|
||||
#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
|
||||
/* Bit 75 Ethiopic */
|
||||
#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+12BF */
|
||||
/* Bit 76 Cherokee */
|
||||
#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
|
||||
/* Bit 77 Canadian Aboriginal Syllabics */
|
||||
#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+14DF */
|
||||
/* Bit 78 Ogham */
|
||||
#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
|
||||
/* Bit 79 Runic */
|
||||
#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
|
||||
/* Bit 80 Khmer */
|
||||
#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
|
||||
/* Bit 81 Mongolian */
|
||||
#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
|
||||
/* Bit 82 Braille */
|
||||
#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
|
||||
/* Bit 83 Yi + Yi Radicals */
|
||||
#define TT_UCR_YI (1L << 19) /* U+A000-U+A48C */
|
||||
/* U+A490-U+A4CF */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Some compilers have a very limited length of identifiers. */
|
||||
/* */
|
||||
#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
|
||||
#define HAVE_LIMIT_ON_IDENTS
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_LIMIT_ON_IDENTS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Here some alias #defines in order to be clearer. */
|
||||
/* */
|
||||
/* These are not always #defined to stay within the 31 character limit */
|
||||
/* which some compilers have. */
|
||||
/* */
|
||||
/* Credits go to Dave Hoo <[email protected]> for pointing out that modern */
|
||||
/* Borland compilers (read: from BC++ 3.1 on) can increase this limit. */
|
||||
/* If you get a warning with such a compiler, use the -i40 switch. */
|
||||
/* */
|
||||
#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
|
||||
TT_UCR_ARABIC_PRESENTATIONS_A
|
||||
#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
|
||||
TT_UCR_ARABIC_PRESENTATIONS_B
|
||||
|
||||
#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
|
||||
TT_UCR_COMBINING_DIACRITICS
|
||||
#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
|
||||
TT_UCR_COMBINING_DIACRITICS_SYMB
|
||||
|
||||
|
||||
#endif /* !HAVE_LIMIT_ON_IDENTS */
|
||||
|
||||
|
||||
#endif /* TTNAMEID_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,583 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* tttables.h */
|
||||
/* */
|
||||
/* Basic SFNT/TrueType tables definitions and interface */
|
||||
/* (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef TTTABLES_H
|
||||
#define TTTABLES_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_Header */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType font header table. All */
|
||||
/* fields follow the TrueType specification. */
|
||||
/* */
|
||||
typedef struct TT_Header_
|
||||
{
|
||||
FT_Fixed Table_Version;
|
||||
FT_Fixed Font_Revision;
|
||||
|
||||
FT_Long CheckSum_Adjust;
|
||||
FT_Long Magic_Number;
|
||||
|
||||
FT_UShort Flags;
|
||||
FT_UShort Units_Per_EM;
|
||||
|
||||
FT_Long Created [2];
|
||||
FT_Long Modified[2];
|
||||
|
||||
FT_Short xMin;
|
||||
FT_Short yMin;
|
||||
FT_Short xMax;
|
||||
FT_Short yMax;
|
||||
|
||||
FT_UShort Mac_Style;
|
||||
FT_UShort Lowest_Rec_PPEM;
|
||||
|
||||
FT_Short Font_Direction;
|
||||
FT_Short Index_To_Loc_Format;
|
||||
FT_Short Glyph_Data_Format;
|
||||
|
||||
} TT_Header;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_HoriHeader */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType horizontal header, the `hhea' */
|
||||
/* table, as well as the corresponding horizontal metrics table, */
|
||||
/* i.e., the `hmtx' table. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* Version :: The table version. */
|
||||
/* */
|
||||
/* Ascender :: The font's ascender, i.e., the distance */
|
||||
/* from the baseline to the top-most of all */
|
||||
/* glyph points found in the font. */
|
||||
/* */
|
||||
/* This value is invalid in many fonts, as */
|
||||
/* it is usually set by the font designer, */
|
||||
/* and often reflects only a portion of the */
|
||||
/* glyphs found in the font (maybe ASCII). */
|
||||
/* */
|
||||
/* You should use the `sTypoAscender' field */
|
||||
/* of the OS/2 table instead if you want */
|
||||
/* the correct one. */
|
||||
/* */
|
||||
/* Descender :: The font's descender, i.e., the distance */
|
||||
/* from the baseline to the bottom-most of */
|
||||
/* all glyph points found in the font. It */
|
||||
/* is negative. */
|
||||
/* */
|
||||
/* This value is invalid in many fonts, as */
|
||||
/* it is usually set by the font designer, */
|
||||
/* and often reflects only a portion of the */
|
||||
/* glyphs found in the font (maybe ASCII). */
|
||||
/* */
|
||||
/* You should use the `sTypoDescender' */
|
||||
/* field of the OS/2 table instead if you */
|
||||
/* want the correct one. */
|
||||
/* */
|
||||
/* Line_Gap :: The font's line gap, i.e., the distance */
|
||||
/* to add to the ascender and descender to */
|
||||
/* get the BTB, i.e., the */
|
||||
/* baseline-to-baseline distance for the */
|
||||
/* font. */
|
||||
/* */
|
||||
/* advance_Width_Max :: This field is the maximum of all advance */
|
||||
/* widths found in the font. It can be */
|
||||
/* used to compute the maximum width of an */
|
||||
/* arbitrary string of text. */
|
||||
/* */
|
||||
/* min_Left_Side_Bearing :: The minimum left side bearing of all */
|
||||
/* glyphs within the font. */
|
||||
/* */
|
||||
/* min_Right_Side_Bearing :: The minimum right side bearing of all */
|
||||
/* glyphs within the font. */
|
||||
/* */
|
||||
/* xMax_Extent :: The maximum horizontal extent (i.e., the */
|
||||
/* `width' of a glyph's bounding box) for */
|
||||
/* all glyphs in the font. */
|
||||
/* */
|
||||
/* caret_Slope_Rise :: The rise coefficient of the cursor's */
|
||||
/* slope of the cursor (slope=rise/run). */
|
||||
/* */
|
||||
/* caret_Slope_Run :: The run coefficient of the cursor's */
|
||||
/* slope. */
|
||||
/* */
|
||||
/* Reserved :: 10 reserved bytes. */
|
||||
/* */
|
||||
/* metric_Data_Format :: Always 0. */
|
||||
/* */
|
||||
/* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
|
||||
/* table -- this value can be smaller than */
|
||||
/* the total number of glyphs in the font. */
|
||||
/* */
|
||||
/* long_metrics :: A pointer into the `hmtx' table. */
|
||||
/* */
|
||||
/* short_metrics :: A pointer into the `hmtx' table. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
|
||||
/* be identical except for the names of their fields which */
|
||||
/* are different. */
|
||||
/* */
|
||||
/* This ensures that a single function in the `ttload' */
|
||||
/* module is able to read both the horizontal and vertical */
|
||||
/* headers. */
|
||||
/* */
|
||||
typedef struct TT_HoriHeader_
|
||||
{
|
||||
FT_Fixed Version;
|
||||
FT_Short Ascender;
|
||||
FT_Short Descender;
|
||||
FT_Short Line_Gap;
|
||||
|
||||
FT_UShort advance_Width_Max; /* advance width maximum */
|
||||
|
||||
FT_Short min_Left_Side_Bearing; /* minimum left-sb */
|
||||
FT_Short min_Right_Side_Bearing; /* minimum right-sb */
|
||||
FT_Short xMax_Extent; /* xmax extents */
|
||||
FT_Short caret_Slope_Rise;
|
||||
FT_Short caret_Slope_Run;
|
||||
FT_Short caret_Offset;
|
||||
|
||||
FT_Short Reserved[4];
|
||||
|
||||
FT_Short metric_Data_Format;
|
||||
FT_UShort number_Of_HMetrics;
|
||||
|
||||
/* The following fields are not defined by the TrueType specification */
|
||||
/* but they're used to connect the metrics header to the relevant */
|
||||
/* `HMTX' table. */
|
||||
|
||||
void* long_metrics;
|
||||
void* short_metrics;
|
||||
|
||||
} TT_HoriHeader;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_VertHeader */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType vertical header, the `vhea' */
|
||||
/* table, as well as the corresponding vertical metrics table, i.e., */
|
||||
/* the `vmtx' table. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* Version :: The table version. */
|
||||
/* */
|
||||
/* Ascender :: The font's ascender, i.e., the distance */
|
||||
/* from the baseline to the top-most of */
|
||||
/* all glyph points found in the font. */
|
||||
/* */
|
||||
/* This value is invalid in many fonts, as */
|
||||
/* it is usually set by the font designer, */
|
||||
/* and often reflects only a portion of */
|
||||
/* the glyphs found in the font (maybe */
|
||||
/* ASCII). */
|
||||
/* */
|
||||
/* You should use the `sTypoAscender' */
|
||||
/* field of the OS/2 table instead if you */
|
||||
/* want the correct one. */
|
||||
/* */
|
||||
/* Descender :: The font's descender, i.e., the */
|
||||
/* distance from the baseline to the */
|
||||
/* bottom-most of all glyph points found */
|
||||
/* in the font. It is negative. */
|
||||
/* */
|
||||
/* This value is invalid in many fonts, as */
|
||||
/* it is usually set by the font designer, */
|
||||
/* and often reflects only a portion of */
|
||||
/* the glyphs found in the font (maybe */
|
||||
/* ASCII). */
|
||||
/* */
|
||||
/* You should use the `sTypoDescender' */
|
||||
/* field of the OS/2 table instead if you */
|
||||
/* want the correct one. */
|
||||
/* */
|
||||
/* Line_Gap :: The font's line gap, i.e., the distance */
|
||||
/* to add to the ascender and descender to */
|
||||
/* get the BTB, i.e., the */
|
||||
/* baseline-to-baseline distance for the */
|
||||
/* font. */
|
||||
/* */
|
||||
/* advance_Height_Max :: This field is the maximum of all */
|
||||
/* advance heights found in the font. It */
|
||||
/* can be used to compute the maximum */
|
||||
/* height of an arbitrary string of text. */
|
||||
/* */
|
||||
/* min_Top_Side_Bearing :: The minimum top side bearing of all */
|
||||
/* glyphs within the font. */
|
||||
/* */
|
||||
/* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
|
||||
/* glyphs within the font. */
|
||||
/* */
|
||||
/* yMax_Extent :: The maximum vertical extent (i.e., the */
|
||||
/* `height' of a glyph's bounding box) for */
|
||||
/* all glyphs in the font. */
|
||||
/* */
|
||||
/* caret_Slope_Rise :: The rise coefficient of the cursor's */
|
||||
/* slope of the cursor (slope=rise/run). */
|
||||
/* */
|
||||
/* caret_Slope_Run :: The run coefficient of the cursor's */
|
||||
/* slope. */
|
||||
/* */
|
||||
/* Reserved :: 10 reserved bytes. */
|
||||
/* */
|
||||
/* metric_Data_Format :: Always 0. */
|
||||
/* */
|
||||
/* number_Of_HMetrics :: Number of VMetrics entries in the */
|
||||
/* `vmtx' table -- this value can be */
|
||||
/* smaller than the total number of glyphs */
|
||||
/* in the font. */
|
||||
/* */
|
||||
/* long_metrics :: A pointer into the `vmtx' table. */
|
||||
/* */
|
||||
/* short_metrics :: A pointer into the `vmtx' table. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
|
||||
/* be identical except for the names of their fields which */
|
||||
/* are different. */
|
||||
/* */
|
||||
/* This ensures that a single function in the `ttload' */
|
||||
/* module is able to read both the horizontal and vertical */
|
||||
/* headers. */
|
||||
/* */
|
||||
typedef struct TT_VertHeader_
|
||||
{
|
||||
FT_Fixed Version;
|
||||
FT_Short Ascender;
|
||||
FT_Short Descender;
|
||||
FT_Short Line_Gap;
|
||||
|
||||
FT_UShort advance_Height_Max; /* advance height maximum */
|
||||
|
||||
FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
|
||||
FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
|
||||
FT_Short yMax_Extent; /* xmax or ymax extents */
|
||||
FT_Short caret_Slope_Rise;
|
||||
FT_Short caret_Slope_Run;
|
||||
FT_Short caret_Offset;
|
||||
|
||||
FT_Short Reserved[4];
|
||||
|
||||
FT_Short metric_Data_Format;
|
||||
FT_UShort number_Of_VMetrics;
|
||||
|
||||
/* The following fields are not defined by the TrueType specification */
|
||||
/* but they're used to connect the metrics header to the relevant */
|
||||
/* `HMTX' or `VMTX' table. */
|
||||
|
||||
void* long_metrics;
|
||||
void* short_metrics;
|
||||
|
||||
} TT_VertHeader;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_OS2 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType OS/2 table. This is the long */
|
||||
/* table version. All fields comply to the TrueType specification. */
|
||||
/* */
|
||||
/* Note that we now support old Mac fonts which do not include an */
|
||||
/* OS/2 table. In this case, the `version' field is always set to */
|
||||
/* 0xFFFF. */
|
||||
/* */
|
||||
typedef struct TT_OS2_
|
||||
{
|
||||
FT_UShort version; /* 0x0001 - more or 0xFFFF */
|
||||
FT_Short xAvgCharWidth;
|
||||
FT_UShort usWeightClass;
|
||||
FT_UShort usWidthClass;
|
||||
FT_Short fsType;
|
||||
FT_Short ySubscriptXSize;
|
||||
FT_Short ySubscriptYSize;
|
||||
FT_Short ySubscriptXOffset;
|
||||
FT_Short ySubscriptYOffset;
|
||||
FT_Short ySuperscriptXSize;
|
||||
FT_Short ySuperscriptYSize;
|
||||
FT_Short ySuperscriptXOffset;
|
||||
FT_Short ySuperscriptYOffset;
|
||||
FT_Short yStrikeoutSize;
|
||||
FT_Short yStrikeoutPosition;
|
||||
FT_Short sFamilyClass;
|
||||
|
||||
FT_Byte panose[10];
|
||||
|
||||
FT_ULong ulUnicodeRange1; /* Bits 0-31 */
|
||||
FT_ULong ulUnicodeRange2; /* Bits 32-63 */
|
||||
FT_ULong ulUnicodeRange3; /* Bits 64-95 */
|
||||
FT_ULong ulUnicodeRange4; /* Bits 96-127 */
|
||||
|
||||
FT_Char achVendID[4];
|
||||
|
||||
FT_UShort fsSelection;
|
||||
FT_UShort usFirstCharIndex;
|
||||
FT_UShort usLastCharIndex;
|
||||
FT_Short sTypoAscender;
|
||||
FT_Short sTypoDescender;
|
||||
FT_Short sTypoLineGap;
|
||||
FT_UShort usWinAscent;
|
||||
FT_UShort usWinDescent;
|
||||
|
||||
/* only version 1 tables: */
|
||||
|
||||
FT_ULong ulCodePageRange1; /* Bits 0-31 */
|
||||
FT_ULong ulCodePageRange2; /* Bits 32-63 */
|
||||
|
||||
/* only version 2 tables: */
|
||||
|
||||
FT_Short sxHeight;
|
||||
FT_Short sCapHeight;
|
||||
FT_UShort usDefaultChar;
|
||||
FT_UShort usBreakChar;
|
||||
FT_UShort usMaxContext;
|
||||
|
||||
} TT_OS2;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_Postscript */
|
||||
/* */
|
||||
/* <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. */
|
||||
/* */
|
||||
typedef struct TT_Postscript_
|
||||
{
|
||||
FT_Fixed FormatType;
|
||||
FT_Fixed italicAngle;
|
||||
FT_Short underlinePosition;
|
||||
FT_Short underlineThickness;
|
||||
FT_ULong isFixedPitch;
|
||||
FT_ULong minMemType42;
|
||||
FT_ULong maxMemType42;
|
||||
FT_ULong minMemType1;
|
||||
FT_ULong maxMemType1;
|
||||
|
||||
/* Glyph names follow in the file, but we don't */
|
||||
/* load them by default. See the ttpost.c file. */
|
||||
|
||||
} TT_Postscript;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_PCLT */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to model a TrueType PCLT table. All fields */
|
||||
/* comply to the TrueType table. */
|
||||
/* */
|
||||
typedef struct TT_PCLT_
|
||||
{
|
||||
FT_Fixed Version;
|
||||
FT_ULong FontNumber;
|
||||
FT_UShort Pitch;
|
||||
FT_UShort xHeight;
|
||||
FT_UShort Style;
|
||||
FT_UShort TypeFamily;
|
||||
FT_UShort CapHeight;
|
||||
FT_UShort SymbolSet;
|
||||
FT_Char TypeFace[16];
|
||||
FT_Char CharacterComplement[8];
|
||||
FT_Char FileName[6];
|
||||
FT_Char StrokeWeight;
|
||||
FT_Char WidthType;
|
||||
FT_Byte SerifStyle;
|
||||
FT_Byte Reserved;
|
||||
|
||||
} TT_PCLT;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* TT_MaxProfile */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The maximum profile is a table containing many max values which */
|
||||
/* can be used to pre-allocate arrays. This ensures that no memory */
|
||||
/* allocation occurs during a glyph load. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* version :: The version number. */
|
||||
/* */
|
||||
/* numGlyphs :: The number of glyphs in this TrueType */
|
||||
/* font. */
|
||||
/* */
|
||||
/* maxPoints :: The maximum number of points in a */
|
||||
/* non-composite TrueType glyph. See also */
|
||||
/* the structure element */
|
||||
/* `maxCompositePoints'. */
|
||||
/* */
|
||||
/* maxContours :: The maximum number of contours in a */
|
||||
/* non-composite TrueType glyph. See also */
|
||||
/* the structure element */
|
||||
/* `maxCompositeContours'. */
|
||||
/* */
|
||||
/* maxCompositePoints :: The maximum number of points in a */
|
||||
/* composite TrueType glyph. See also the */
|
||||
/* structure element `maxPoints'. */
|
||||
/* */
|
||||
/* maxCompositeContours :: The maximum number of contours in a */
|
||||
/* composite TrueType glyph. See also the */
|
||||
/* structure element `maxContours'. */
|
||||
/* */
|
||||
/* maxZones :: The maximum number of zones used for */
|
||||
/* glyph hinting. */
|
||||
/* */
|
||||
/* maxTwilightPoints :: The maximum number of points in the */
|
||||
/* twilight zone used for glyph hinting. */
|
||||
/* */
|
||||
/* maxStorage :: The maximum number of elements in the */
|
||||
/* storage area used for glyph hinting. */
|
||||
/* */
|
||||
/* maxFunctionDefs :: The maximum number of function */
|
||||
/* definitions in the TrueType bytecode for */
|
||||
/* this font. */
|
||||
/* */
|
||||
/* maxInstructionDefs :: The maximum number of instruction */
|
||||
/* definitions in the TrueType bytecode for */
|
||||
/* this font. */
|
||||
/* */
|
||||
/* maxStackElements :: The maximum number of stack elements used */
|
||||
/* during bytecode interpretation. */
|
||||
/* */
|
||||
/* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
|
||||
/* used for glyph hinting. */
|
||||
/* */
|
||||
/* maxComponentElements :: An obscure value related to composite */
|
||||
/* glyphs definitions. */
|
||||
/* */
|
||||
/* maxComponentDepth :: An obscure value related to composite */
|
||||
/* glyphs definitions. Probably the maximum */
|
||||
/* number of simple glyphs in a composite. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This structure is only used during font loading. */
|
||||
/* */
|
||||
typedef struct TT_MaxProfile_
|
||||
{
|
||||
FT_Fixed version;
|
||||
FT_UShort numGlyphs;
|
||||
FT_UShort maxPoints;
|
||||
FT_UShort maxContours;
|
||||
FT_UShort maxCompositePoints;
|
||||
FT_UShort maxCompositeContours;
|
||||
FT_UShort maxZones;
|
||||
FT_UShort maxTwilightPoints;
|
||||
FT_UShort maxStorage;
|
||||
FT_UShort maxFunctionDefs;
|
||||
FT_UShort maxInstructionDefs;
|
||||
FT_UShort maxStackElements;
|
||||
FT_UShort maxSizeOfInstructions;
|
||||
FT_UShort maxComponentElements;
|
||||
FT_UShort maxComponentDepth;
|
||||
|
||||
} TT_MaxProfile;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ft_sfnt_head = 0,
|
||||
ft_sfnt_maxp = 1,
|
||||
ft_sfnt_os2 = 2,
|
||||
ft_sfnt_hhea = 3,
|
||||
ft_sfnt_vhea = 4,
|
||||
ft_sfnt_post = 5,
|
||||
ft_sfnt_pclt = 6,
|
||||
|
||||
sfnt_max /* don't remove */
|
||||
|
||||
} FT_Sfnt_Tag;
|
||||
|
||||
|
||||
/* internal use only */
|
||||
typedef void* (*FT_Get_Sfnt_Table_Func)( FT_Face face,
|
||||
FT_Sfnt_Tag tag );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Sfnt_Table */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Returns a pointer to a given SFNT table within a face. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the source. */
|
||||
/* */
|
||||
/* tag :: The index of the SFNT table. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* A type-less pointer to the table. This will be 0 in case of */
|
||||
/* error, or if the corresponding table was not found *OR* loaded */
|
||||
/* from the file. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* 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. */
|
||||
/* */
|
||||
/* You can load any table using the (internal) SFNT_Interface */
|
||||
/* structure -- this is available via FT_Get_Module_Interface(). */
|
||||
/* */
|
||||
FT_EXPORT_DEF( void* ) FT_Get_Sfnt_Table( FT_Face face,
|
||||
FT_Sfnt_Tag tag );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* TTTABLES_H */
|
||||
|
||||
|
||||
/* END */
|
||||
@@ -0,0 +1,66 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* tttags.h */
|
||||
/* */
|
||||
/* Tags for TrueType tables (specification only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef TTAGS_H
|
||||
#define TTAGS_H
|
||||
|
||||
|
||||
#include <freetype/freetype.h> /* for MAKE_TT_TAG() */
|
||||
|
||||
|
||||
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
|
||||
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
|
||||
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
|
||||
#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
|
||||
#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
|
||||
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
|
||||
#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_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' )
|
||||
#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
|
||||
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
|
||||
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
|
||||
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
|
||||
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
|
||||
#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
|
||||
#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
|
||||
#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_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
|
||||
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
|
||||
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
|
||||
#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_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' )
|
||||
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
|
||||
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
|
||||
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
|
||||
|
||||
#endif /* TTAGS_H */
|
||||
|
||||
|
||||
/* END */
|
||||
Reference in New Issue
Block a user