Changed location of FreeType to lib/freetype

svn path=/trunk/; revision=4467
This commit is contained in:
Gé van Geldorp
2003-04-01 08:55:51 +00:00
parent b4f4566a01
commit 1d1253f734
317 changed files with 0 additions and 123453 deletions
-187
View File
@@ -1,187 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,10 +0,0 @@
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)
-395
View File
@@ -1,395 +0,0 @@
/***************************************************************************/
/* */
/* 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
-72
View File
@@ -1,72 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-166
View File
@@ -1,166 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-422
View File
@@ -1,422 +0,0 @@
/***************************************************************************/
/* */
/* 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
-175
View File
@@ -1,175 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-274
View File
@@ -1,274 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-52
View File
@@ -1,52 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-344
View File
@@ -1,344 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-191
View File
@@ -1,191 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-101
View File
@@ -1,101 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-400
View File
@@ -1,400 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,195 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-123
View File
@@ -1,123 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-232
View File
@@ -1,232 +0,0 @@
/***************************************************************************/
/* */
/* 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. */
/* */
/*************************************************************************/
#if __GNUC__ >= 3
#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
#else
#define FT_TRACE( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_COMPONENT] >= level ) \
FT_XCAT( FT_Message, varformat ); \
} while ( 0 )
#endif
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, ... );
#if __GNUC__ >= 3
#define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */
#else
#define FT_ERROR( varformat ) FT_XCAT( FT_Message, varformat )
#endif
#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 */
@@ -1,182 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,178 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-113
View File
@@ -1,113 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,127 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-532
View File
@@ -1,532 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,361 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-220
View File
@@ -1,220 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-492
View File
@@ -1,492 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,67 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-188
View File
@@ -1,188 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,121 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-218
View File
@@ -1,218 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,121 +0,0 @@
/***************************************************************************/
/* */
/* 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
-235
View File
@@ -1,235 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-698
View File
@@ -1,698 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-583
View File
@@ -1,583 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
-66
View File
@@ -1,66 +0,0 @@
/***************************************************************************/
/* */
/* 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 */
@@ -1,3 +0,0 @@
*.d
*.o
*.sym
-904
View File
@@ -1,904 +0,0 @@
LATEST CHANGES
- deactivated the trueType bytecode interpreter by default
- deactivated the "src/type1" font driver. Now "src/type1z" is
used by default..
- updates to the build system. We now compile the library correctly
under Unix system through "configure" which is automatically called
on the first "make" invocation.
- added the auto-hinting module !!. Fixing some bugs here and there..
- found some bugs in the composite loader (seac) of the Type1-based
font drivers..
- renamed the directory "freetype2/config" to "freetype2/builds" and
updated all relevant files..
- found a memory leak in the "type1" driver
- incorporated Tom's patches to support flex operators correctly
in OpenType/CFF fonts.. Now all I need is to support pure CFF
and CEF fonts to be done with this driver.. :-)
- added the Windows FNT/FON driver in "src/winfonts". For now,
it always "simulates" a Unicode charmap, so it shouldn't be
considered completed right now..
It's there to be more a proof of concept than anything else
anyway. The driver is a single C source file, that compiles
to 3 Kb of code..
I'm still working on the PCF/BDF drivers.. but I'm too lazy
to finish them now..
- CHANGES TO THE HIGH-LEVEL API
o FT_Get_Kerning has a new parameter that allows you to select
the coordinates of the kerning vector ( font units, scaled,
scaled + grid-fitted ).
o the outline functions are now in <freetype/ftoutln.h> and not
part of <freetype/freetype.h> anymore
o <freetype/ftmodule.h> now contains declarations for
FT_New_Library, FT_Done_Library, FT_Add_Default_Modules
o the so-called convenience functions have moved from "ftoutln.c"
to "ftglyph.c", and are thus available with this optional component
of the library. They are declared in <freetype/ftglyph.h> now..
o anti-aliased rendering is now the default for FT_Render_Glyph
(i.e. corresponds to render_mode == 0 == ft_render_mode_normal).
To generate a monochrome bitmap, use ft_render_mode_mono, or the
FT_LOAD_MONOCHROME flag in FT_Load_Glyph/FT_Load_Char.
FT_LOAD_ANTI_ALIAS is still defined, but values to 0.
o <freetype/freetype.h> now include <freetype/config/ftconfig.h>,
solving a few headaches :-)
o the type FT_GlyphSlotRec has now a "library" field.
- CHANGES TO THE "ftglyph.h" API
This API has been severely modified in order to make it simpler,
clearer, and more efficient. It certainly now looks like a real
"glyph factory" object, and allows client applications to manage
(i.e. transform, bbox and render) glyph images without ever knowing
their original format.
- added support for CID-keyed fonts to the CFF driver.
maybe support for pure CFF + CEF fonts should come in ??
- cleaned up source code in order to avoid two functions with the
same name. Also changed the names of the files in "type1z" from
"t1XXXX" to "z1XXXX" in order to avoid any conflicts.
"make multi" now works well :-)
Also removed the use of "cidafm" for now, even if the source files
are still there. This functionality will certainly go into a specific
module..
- ADDED SUPPORT FOR THE AUTO-HINTER
It works :-) I have a demo program which simply is a copy of "ftview"
that does a FT_Add_Module( library, &autohinter_module_class ) after
library initialisation, and Type 1 & OpenType/CFF fonts are now hinted.
CID fonts are not hinted, as they include no charmap and the auto-hinter
doesn't include "generic" global metrics computations yet..
Now, I need to release this thing to the FreeType 2 source..
- CHANGES TO THE RENDERER MODULES
the monochrome and smooth renderers are now in two distinct directories,
namely "src/raster1" and "src/smooth". Note that the old "src/renderer"
is now gone..
I ditched the 5-gray-levels renderers. Basically, it involved a simple
#define toggle in 'src/raster1/ftraster.c'
FT_Render_Glyph, FT_Outline_Render & FT_Outline_Get_Bitmap now select
the best renderer available, depending on render mode. If the current
renderer for a given glyph image format isn't capable of supporting
the render mode, another one will be found in the library's list.
This means that client applications do not need to switch or set the
renderers themselves (as in the latest change), they'll get what they
want automatically... At last..
Changed the demo programs accordingly..
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
- reformated all modules source code in order to get rid of the basic
data types redifinitions (i.e. "TT_Int" instead of "FT_Int", "T1_Fixed"
instead of "FT_Fixed"). Hence the format-specific prefixes like "TT_",
"T1_", "T2_" and "CID_" are only used for relevant structures..
============================================================================
OLD CHANGES FOR BETA 7
- bug-fixed the OpenType/CFF parser. It now loads and displays my two
fonts nicely, but I'm pretty certain that more testing is needed :-)
- fixed the crummy Type 1 hinter, it now handles accented characters
correctly (well, the accent is not always well placed, but that's
another problem..)
- added the CID-keyed Type 1 driver in "src/cid". Works pretty well for
only 13 Kb of code ;-) Doesn't read AFM files though, nor the really
useful CMAP files..
- fixed two bugs in the smooth renderer (src/base/ftgrays.c). Thanks to
Boris Letocha for spotting them and providing a fix..
- fixed potential "divide by zero" bugs in ftcalc.c.. my god..
- added source code for the OpenType/CFF driver (still incomplete though..)
- modified the SFNT driver slightly to perform more robust header
checks in TT_Load_SFNT_Header. This prevents certain font files
(e.g. some Type 1 Multiple Masters) from being incorrectly "recognized"
as TrueType font files..
- moved a lot of stuff from the TrueType driver to the SFNT module,
this allows greater code re-use between font drivers (e.g. TrueType,
OpenType, Compact-TrueType, etc..)
- added a tiny segment cache to the SFNT Charmap 4 decoder, in order
to minimally speed it up..
- added support for Multiple Master fonts in "type1z". There is also
a new file named <freetype/ftmm.h> which defines functions to
manage them from client applications.
The new file "src/base/ftmm.c" is also optional to the engine..
- various formatting changes (e.g. EXPORT_DEF -> FT_EXPORT_DEF) +
small bug fixes in FT_Load_Glyph, the "type1" driver, etc..
- a minor fix to the Type 1 driver to let them apply the font matrix
correctly (used for many oblique fonts..)
- some fixes for 64-bit systems (mainly changing some FT_TRACE calls
to use %p instead of %lx).. Thanks to Karl Robillard
- fixed some bugs in the sbit loader (src/base/sfnt/ttsbit.c) + added
a new flag, FT_LOAD_CROP_BITMAP to query that bitmaps be cropped when
loaded from a file (maybe I should move the bitmap cropper to the
base layer ??).
- changed the default number of gray levels of the smooth renderer to
256 (instead of the previous 128). Of course, the human eye can't
see any difference ;-)
- removed TT_MAX_SUBGLYPHS, there is no static limit on the number of
subglyphs in a TrueType font now..
=============================================================================
OLD CHANGES 16 May 2000
- tagged "BETA-6" in the CVS tree. This one is a serious release candidate
even though it doesn't incorporate the auto-hinter yet..
- various obsolete files were removed, and copyright header updated
- finally updated the standard raster to fix the monochrome rendering bug
+ re-enable support for 5-gray levels anti-aliasing (suck, suck..)
- created new header files, and modified sources accordingly:
<freetype/fttypes.h> - simple FreeType types, without the API
<freetype/internal/ftmemory.h> - definition of memory-management macros
- added the "DSIG" (OpenType Digital Signature) tag to <freetype/tttags.h>
- light update/cleaning of the build system + changes to the sources in
order to get rid of _all_ compiler warnings with three compilers, i.e:
gcc with "-ansi -pedantic -Wall -W", Visual C++ with "/W3 /WX"
and LCC
IMPORTANT NOTE FOR WIN32-LCC USERS:
|
| It seems the C pre-processor that comes with LCC is broken, it
| doesn't recognize the ANSI standard directives # and ## correctly
| when one of the argument is a macro. Also, something like:
|
| #define F(x) print##x
|
| F(("hello"))
|
| will get incorrectly translated to:
|
| print "hello")
|
| by its pre-processor. For this reason, you simply cannot build
| FreeType 2 in debug mode with this compiler..
- yet another massive grunt work. I've changed the definition of the
EXPORT_DEF, EXPORT_FUNC, BASE_DEF & BASE_FUNC macros. These now take
an argument, which is the function's return value type.
This is necessary to compile FreeType as a DLL on Windows and OS/2.
Depending on the compiler used, a compiler-specific keyword like __export
or __system must be placed before (VisualC++) or after (BorlandC++)
the type..
Of course, this needed a lot of changes throughout the source code
to make it compile again... All cleaned up now, apparently..
Note also that there is a new EXPORT_VAR macro defined to allow the
_declaration_ of an exportable public (constant) variable. This is the
case of the raster interfaces (see ftraster.h and ftgrays.h), as well
as each module's interface (see sfdriver.h, psdriver.h, etc..)
- new feature: it is now possible to pass extra parameters to font
drivers when creating a new face object. For now, this
capability is unused. It could however prove to be useful
in a near future..
the FT_Open_Args structure was changes, as well as the internal
driver interface (the specific "init_face" module function has now
a different signature).
- updated the tutorial (not finished though).
- updated the top-level BUILD document
- fixed a potential memory leak that could occur when loading embedded
bitmaps.
- added the declaration of FT_New_Memory_Face in <freetype/freetype.h>, as
it was missing from the public header (the implementation was already
in "ftobjs.c").
- the file <freetype/fterrors.h> has been seriously updated in order to
allow the automatic generation of error message tables. See the comments
within it for more information.
- major directory hierarchy re-organisation. This was done for two things:
* first, to ease the "manual" compilation of the library by requiring
at lot less include paths :-)
* second, to allow external programs to effectively access internal
data fields. For example, this can be extremely useful if someone
wants to write a font producer or a font manager on top of FreeType.
Basically, you should now use the 'freetype/' prefix for header inclusion,
as in:
#include <freetype/freetype.h>
#include <freetype/ftglyph.h>
Some new include sub-directories are available:
a. the "freetype/config" directory, contains two files used to
configure the build of the library. Client applications should
not need to look at these normally, but they can if they want.
#include <freetype/config/ftoption.h>
#include <freetype/config/ftconfig.h>
b. the "freetype/internal" directory, contains header files that
describes library internals. These are the header files that were
previously found in the "src/base" and "src/shared" directories.
As usual, the build system and the demos have been updated to reflect
the change..
Here's a layout of the new directory hierarchy:
TOP
include/
freetype/
freetype.h
...
config/
ftoption.h
ftconfig.h
ftmodule.h
internal/
ftobjs.h
ftstream.h
ftcalc.h
...
src/
base/
...
sfnt/
psnames/
truetype/
type1/
type1z/
Compiling a module is now much easier, for example, the following should
work when in the TOP directory on an ANSI build:
gcc -c -I./include -I./src/base src/base/ftbase.c
gcc -c -I./include -I./src/sfnt src/sfnt/sfnt.c
etc..
(of course, using -Iconfig/<system> if you provide system-specific
configuration files).
- updated the structure of FT_Outline_Funcs in order to allow
direct coordinate scaling within the outline decomposition routine
(this is important for virtual "on" points with TrueType outlines)
+ updates to the rasters to support this..
- updated the OS/2 table loading code in "src/sfnt/ttload.c" in order
to support version 2 of the table (see OpenType 1.2 spec)
- created "include/tttables.h" and "include/t1tables.h" to allow
client applications to access some of the SFNT and T1 tables of a
face with a procedural interface (see FT_Get_Sfnt_Table())
+ updates to internal source files to reflect the change..
- some cleanups in the source code to get rid of warnings when compiling
with the "-Wall -W -ansi -pedantic" options in gcc.
- debugged and moved the smooth renderer to "src/base/ftgrays.c" and
its header to "include/ftgrays.h"
- updated TT_MAX_SUBGLYPHS to 96 as some CJK fonts have composites with
up to 80 sub-glyphs !! Thanks to Werner
================================================================================
OLD CHANGES - 14-apr-2000
- fixed a bug in the TrueType glyph loader that prevented the correct
loading of some CJK glyphs in mingli.ttf
- improved the standard Type 1 hinter in "src/type1"
- fixed two bugs in the experimental Type 1 driver in "src/type1z"
to handle the new XFree86 4.0 fonts (and a few other ones..)
- the smooth renderer is now complete and supports sub-banding
to render large glyphs at high speed. However, it is still located
in "demos/src/ftgrays.c" and should move to the library itself
in the next beta.. NOTE: The smooth renderer doesn't compile in
stand-alone mode anymore, but this should be fixed RSN..
- introduced convenience functions to more easily deal with glyph
images, see "include/ftglyph.h" for more details, as well as the
new demo program named "demos/src/ftstring.c" that demonstrates
its use
- implemented FT_LOAD_NO_RECURSE in both the TrueType and Type 1
drivers (this is required by the auto-hinter to improve its results).
- changed the raster interface, in order to allow client applications
to provide their own span-drawing callbacks. However, only the
smooth renderer supports this. See "FT_Raster_Params" in the
file "include/ftimage.h"
- fixed a small bug in FT_MulFix that caused incorrect transform
computation !!
- Note: The tutorial is out-of-date, grumpf.. :-(
================================================================================
OLD CHANGES - 12-mar-2000
- changed the layout of configuration files : now, all ANSI configuration
files are located in "freetype2/config". System-specific over-rides
can be placed in "freetype2/config/<system>".
- moved all configuration macros to "config/ftoption.h"
- improvements in the Type 1 driver with AFM support
- changed the fields in the FT_Outline structure : the old "flags"
array is re-named "tags", while all ancient flags are encoded into
a single unsigned int named "flags".
- introduced new flags in FT_Outline.flags (see ft_outline_.... enums in
"ftimage.h").
- changed outline functions to "FT_Outline_<action>" syntax
- added a smooth anti-alias renderer to the demonstration programs
- added Mac graphics driver (thanks Just)
- FT_Open_Face changed in order to received a pointer to a FT_Open_Args
descriptor..
- various cleanups, a few more API functions implemented (see FT_Attach_File)
- updated some docs
================================================================================
OLD CHANGES - 22-feb-2000
- introduced the "psnames" module. It is used to:
o convert a Postscript glyph name into the equivalent Unicode
character code (used by the Type 1 driver(s) to synthetize
on the fly a Unicode charmap).
o provide an interface to retrieve the Postscript names of
the Macintosh, Adobe Standard & Adobe Expert character codes.
(the Macintosh names are used by the SFNT-module postscript
names support routines, while the other two tables are used
by the Type 1 driver(s)).
- introduced the "type1z" alternate Type 1 driver. This is a (still
experimental) driver for the Type 1 format that will ultimately
replace the one in "src/type1". It uses pattern matching to load
data from the font, instead of a finite state analyzer. It works
much better than the "old" driver with "broken" fonts. It is also
much smaller (under 15 Kb).
- the Type 1 drivers (both in "src/type1" and "src/type1z") are
nearly complete. They both provide automatic Unicode charmap
synthesis through the "psnames" module. No re-encoding vector
is needed. (note that they still leak memory due to some code
missing, and I'm getting lazy).
Trivial AFM support has been added to read kerning information
but wasn't exactly tested as it should ;-)
- The TrueType glyph loader has been seriously rewritten (see the
file "src/truetype/ttgload.c". It is now much, much simpler as
well as easier to read, maintain and understand :-) Preliminary
versions introduced a memory leak that has been reported by Jack
Davis, and is now fixed..
- introduced the new "ft_glyph_format_plotter", used to represent
stroked outlines like Windows "Vector" fonts, and certain Type 1
fonts like "Hershey". The corresponding raster will be written
soon.
- FT_New_Memory_Face is gone. Likewise, FT_Open_Face has a new
interface that uses a structure to describe the input stream,
the driver (if required), etc..
TODO
- Write FT_Get_Glyph_Bitmap and FT_Load_Glyph_Bitmap
- Add a function like FT_Load_Character( face, char_code, load_flags )
that would really embbed a call to FT_Get_Char_Index then FT_Load_Glyph
to ease developer's work.
- Update the tutorial !!
- consider adding support for Multiple Master fonts in the Type 1
drivers.
- Test the AFM routines of the Type 1 drivers to check that kerning
information is returned correctly.
- write a decent auto-gridding component !! We need this to release
FreeType 2.0 gold !
----- less urgent needs : ----------
- add a CFF/Type2 driver
- add a BDF driver
- add a FNT/PCF/HBF driver
- add a Speedo driver from the X11 sources
==============================================================================
OLDER CHANGES - 27-jan-2000
- updated the "sfnt" module interface to allow several SFNT-based
drivers to co-exist peacefully
- updated the "T1_Face" type to better separate Postscript font content
from the rest of the FT_Face structure. Might be used later by the
CFF/Type2 driver..
- added an experimental replacement Type 1 driver featuring advanced
(and speedy) pattern matching to retrieve the data from postscript
fonts.
- very minor changes in the implementation of FT_Set_Char_Size and
FT_Set_Pixel_Sizes (they now implement default to ligthen the
font driver's code).
=============================================================================
OLD MESSAGE
This file summarizes the changes that occured since the last "beta" of FreeType 2.
Because the list is important, it has been divided into separate sections:
Table Of Contents:
I High-Level Interface (easier !)
II Directory Structure
III Glyph Image Formats
IV Build System
V Portability
VI Font Drivers
-----------------------------------------------------------------------------------------
High-Level Interface :
The high-level API has been considerably simplified. Here is how :
- resource objects have disappeared. this means that face objects can
now be created with a single function call (see FT_New_Face and
FT_Open_Face)
- when calling either FT_New_Face & FT_Open_Face, a size object and a
glyph slot object are automatically created for the face, and can be
accessed through "face->glyph" and "face->size" if one really needs to.
In most cases, there's no need to call FT_New_Size or FT_New_Glyph.
- similarly, FT_Load_Glyph now only takes a "face" argument (instead of
a glyph slot and a size). Also, it's "result" parameter is gone, as
the glyph image type is returned in the field "face->glyph.format"
- the list of available charmaps is directly accessible through
"face->charmaps", counting "face->num_charmaps" elements. Each
charmap has an 'encoding' field which specifies which known encoding
it deals with. Valid values are, for example :
ft_encoding_unicode (for ASCII, Latin-1 and Unicode)
ft_encoding_apple_roman
ft_encoding_sjis
ft_encoding_adobe_standard
ft_encoding_adobe_expert
other values may be added in the future. Each charmap still holds its
"platform_id" and "encoding_id" values in case the encoding is too
exotic for the current library
-----------------------------------------------------------------------------------------
Directory Structure:
Should seem obvious to most of you:
freetype/
config/ -- configuration sub-makefiles
ansi/
unix/ -- platform-specific configuration files
win32/
os2/
msdos/
include/ -- public header files, those to be included directly
by client apps
src/ -- sources of the library
base/ -- the base layer
sfnt/ -- the sfnt "driver" (see the drivers section below)
truetype/ -- the truetype driver
type1/ -- the type1 driver
shared/ -- some header files shared between drivers
demos/ -- demos/tools
docs/ -- documentation (a bit empty for now)
-----------------------------------------------------------------------------------------
Glyph Image Formats :
Drivers are now able to register new glyph image formats within the library.
For now, the base layer supports of course bitmaps and vector outlines, but
one could imagine something different like colored bitmaps, bi-color
vectors or wathever else (Metafonts anyone ??).
See the file `include/ftimage.h'. Note also that the type FT_Raster_Map is
gone, and is now replaced by FT_Bitmap, which should encompass all known
bitmap types.
Each new image format must provide at least one "raster", i.e. a module
capable of transforming the glyph image into a bitmap. It's also possible
to change the default raster used for a given glyph image format.
The default outline scan-converter now uses 128 levels of grays by default,
which tends to smooth many things. Note that the demo programs have been
updated significantly in order to display these..
-----------------------------------------------------------------------------------------
Build system :
You still need GNU Make to build the library. The build system has been
very seriously re-vamped in order to provide things like :
- automatic host platform detection (reverting to 'config/ansi'
if it is not detected, with pseudo-standard compilation flags)
- the ability to compile from the Makefiles with very different and
exotic compilers. Note that linking the library can be difficult for
some platforms.
For example, the file `config/win32/lcclib.bat' is invoked by the
build system to create the ".lib" file with LCC-Win32 because its
librarian has too many flaws to be invoked directly from the Makefile.
Here's how it works :
- the first time you type `make', the build system runs a series of
sub-makefiles in order to detect your host platform. It then dumps
what it found, and creates a file called `config.mk' in the current
directory. This is a sub-Makefile used to define many important Make
variables used to build the library.
- the second time, the build system detects the `config.mk' then use it
to build the library. All object files go into 'obj' by default, as
well as the library file, but this can easily be changed.
Note that you can run "make setup" to force another host platform detection
even if a `config.mk' is present in the current directory. Another solution
is simply to delete the file, then re-run make.
Finally, the default compiler for all platforms is gcc (for now, this will
hopefully changed in the future). You can however specify a different
compiler by specifying it after the 'setup' target as in :
gnumake setup lcc on Win32 to use the LCC compiler
gnumake setup visualc on Win32 to use Visual C++
See the file `config/<system>/detect.mk' for a list of supported compilers
for your platforms.
It should be relatively easy to write new detection rules files and
config.mk..
Finally, to build the demo programs, go to `demos' and launch GNU Make,
it will use the `config.mk' in the top directory to build the test
programs..
-----------------------------------------------------------------------------------------
Portability :
In the previous beta, a single FT_System object was used to encompass
all low-level operations like thread synchronisation, memory management
and i/o access. This has been greatly simplified :
- thread synchronisation has been dropped, for the simple reason that
the library is already re-entrant, and that if you really need two
threads accessing the same FT_Library, you should really synchronize
access to it yourself with a simple mutex.
- memory management is performed through a very simple object called
"FT_Memory", which really is a table containing a table of pointers
to functions like malloc, realloc and free as well as some user data
(closure).
- resources have disappeared (they created more problems than they
solved), and i/o management have been simplified greatly as a
result. Streams are defined through FT_Stream objects, which can
be either memory-based or disk-based.
Note that each face has its own stream, which is closed only when
the face object is destroyed. Hence, a function like TT_Flush_Face
in 1.x cannot be directly supported. However, if you really need
something like this, you can easily tailor your own streams to achieve
the same feature at a lower level (and use FT_Open_Face instead of
FT_New_Face to create the face).
See the file "include/ftsystem.h" for more details, as well as the
implementations found in "config/unix" and "config/ansi".
-----------------------------------------------------------------------------------------
Font Drivers :
The Font Driver interface has been modified in order to support
extensions & versioning.
The list of the font drivers that are statically linked to the
library at compile time is managed through a new configuration file
called `config/<platform>/ftmodule.h'.
This file is autogenerated when invoking `make modules'. This target
will parse all sub-directories of 'src', looking for a "module.mk"
rules file, used to describe the driver to the build system.
Hence, one should call `make modules' each time a font driver is added
or removed from the `src' directory.
Finally, this version provides a "pseudo-driver" in `src/sfnt'. This
driver doesn't support font files directly, but provides services used
by all TrueType-like font drivers. Hence, its code is shared between
the TrueType & OpenType font formats, and possibly more formats to
come if we're lucky..
-----------------------------------------------------------------------------------------
Extensions support :
The extensions support is inspired by the one found in 1.x.
Now, each font driver has its own "extension registry", which lists
which extensions are available for the font faces managed by the driver.
Extension ids are now strings, rather than 4-byte tags, as this is
usually more readable..
Each extension has:
- some data, associated to each face object
- an interface (table of function pointers)
An extension that is format-specific should simply register itself
to the correct font driver. Here is some example code:
// Registering an extensions
//
FT_Error FT_Init_XXXX_Extension( FT_Library library )
{
FT_DriverInterface* tt_driver;
driver = FT_Get_Driver( library, "truetype" );
if (!driver) return FT_Err_Unimplemented_Feature;
return FT_Register_Extension( driver, &extension_class );
}
// Implementing the extensions
//
FT_Error FT_Proceed_Extension_XXX( FT_Face face )
{
FT_XXX_Extension ext;
FT_XXX_Extension_Interface ext_interface;
ext = FT_Get_Extension( face, "extensionid", &ext_interface );
if (!ext) return error;
return ext_interface->do_it(ext);
}
@@ -1,3 +0,0 @@
*.d
*.o
*.sym
@@ -1,134 +0,0 @@
#
# FreeType 2 configuration rules for a `normal' ANSI compiler
#
# 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 TOP
TOP := .
endif
DELETE := rm -f
SEP := /
HOSTSEP := $(SEP)
BUILD := $(TOP)/builds/ansi
PLATFORM := ansi
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f $TOP/Makefile setup [options]
# make -f $TOP/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := o
SO := o
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := a
SA := a
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := libfreetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -o # Don't remove this comment line! We need the space after `-o'.
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := -c
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS :=
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_std
distclean_freetype: distclean_freetype_std
# Librarian to use to build the static library
#
FT_LIBRARIAN := $(AR) -r
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
-$(DELETE) $@
$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
endif
# EOF
@@ -1,130 +0,0 @@
#
# FreeType 2 host platform detection rules
#
# 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 sub-Makefile is in charge of detecting the current platform. It sets
# the following variables:
#
# BUILD The configuration and system-specific directory. Usually
# `freetype/builds/$(PLATFORM)' but can be different for
# custom builds of the library.
#
# The following variables must be defined in system specific `detect.mk'
# files:
#
# PLATFORM The detected platform. This will default to `ansi' if
# auto-detection fails.
# CONFIG_FILE The configuration sub-makefile to use. This usually depends
# on the compiler defined in the `CC' environment variable.
# DELETE The shell command used to remove a given file.
# COPY The shell command used to copy one file.
# SEP The platform-specific directory separator.
# CC The compiler to use.
#
# You need to set the following variable(s) before calling it:
#
# TOP The top-most directory in the FreeType library source
# hierarchy. If not defined, it will default to `.'.
# If TOP is not defined, default it to `.'
#
ifndef TOP
TOP := .
endif
# Set auto-detection default to `ansi' resp. UNIX-like operating systems.
# Note that we delay the evaluation of $(BUILD_CONFIG_), $(BUILD), and
# $(CONFIG_RULES).
#
PLATFORM := ansi
DELETE := $(RM)
COPY := cp
SEP := /
BUILD_CONFIG_ = $(TOP)$(SEP)builds$(SEP)
BUILD = $(BUILD_CONFIG_)$(PLATFORM)
CONFIG_RULES = $(BUILD)$(SEP)$(CONFIG_FILE)
# We define the BACKSLASH variable to hold a single back-slash character.
# This is needed because a line like
#
# SEP := \
#
# does not work with GNU Make (the backslash is interpreted as a line
# continuation). While a line like
#
# SEP := \\
#
# really defines $(SEP) as `\' on Unix, and `\\' on Dos and Windows!
#
BACKSLASH := $(strip \ )
# Now, include all detection rule files found in the `builds/<system>'
# directories. Note that the calling order of the various `detect.mk' files
# isn't predictable.
#
include $(wildcard $(BUILD_CONFIG_)*/detect.mk)
# In case no detection rule file was successful, use the default.
#
ifndef CONFIG_FILE
CONFIG_FILE := ansi.mk
setup: std_setup
endif
# The following targets are equivalent, with the exception that they use
# a slightly different syntax for the `echo' command.
#
# std_setup: defined for most (i.e. Unix-like) platforms
# dos_setup: defined for Dos-ish platforms like Dos, Windows & OS/2
#
.PHONY: std_setup dos_setup
std_setup:
@echo ""
@echo "FreeType build system -- automatic system detection"
@echo ""
@echo "The following settings are used:"
@echo ""
@echo " platform $(PLATFORM)"
@echo " compiler $(CC)"
@echo " configuration directory $(BUILD)"
@echo " configuration rules $(CONFIG_RULES)"
@echo ""
@echo "If this does not correspond to your system or settings please remove the file"
@echo "\`$(CONFIG_MK)' from this directory then read the INSTALL file for help."
@echo ""
@echo "Otherwise, simply type \`make' again to build the library."
@echo ""
@$(COPY) $(CONFIG_RULES) $(CONFIG_MK)
dos_setup:
@echo ÿ
@echo FreeType build system -- automatic system detection
@echo ÿ
@echo The following settings are used:
@echo ÿ
@echo ÿÿplatformÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$(PLATFORM)
@echo ÿÿcompilerÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$(CC)
@echo ÿÿconfiguration directoryÿÿÿÿÿÿ$(BUILD)
@echo ÿÿconfiguration rulesÿÿÿÿÿÿÿÿÿÿ$(CONFIG_RULES)
@echo ÿ
@echo If this does not correspond to your system or settings please remove the file
@echo '$(CONFIG_MK)' from this directory then read the INSTALL file for help.
@echo ÿ
@echo Otherwise, simply type 'make' again to build the library.
@echo ÿ
@$(COPY) $(subst /,\,$(CONFIG_RULES) $(CONFIG_MK)) > nul
# EOF
@@ -1,87 +0,0 @@
#
# FreeType 2 configuration file to detect a DOS host platform.
#
# 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.
# We test for the COMSPEC environment variable, then run the `ver'
# command-line program to see if its output contains the word `Dos'.
#
# If this is true, we are running a Dos-ish platform (or an emulation).
#
ifeq ($(PLATFORM),ansi)
ifdef COMSPEC
is_dos := $(findstring Dos,$(shell ver))
# We try to recognize a Dos session under OS/2. The `ver' command
# returns `Operating System/2 ...' there, so `is_dos' should be empty.
#
# To recognize a Dos session under OS/2, we check COMSPEC for the
# substring `MDOS\COMMAND'
#
ifeq ($(is_dos),)
is_dos := $(findstring MDOS\COMMAND,$(COMSPEC))
endif
ifneq ($(is_dos),)
PLATFORM := dos
DELETE := del
COPY := copy
# Use DJGPP (i.e. gcc) by default.
#
CONFIG_FILE := dos-gcc.mk
SEP := /
ifndef CC
CC := gcc
endif
# additionally, we provide hooks for various other compilers
#
ifneq ($(findstring turboc,$(MAKECMDGOALS)),) # Turbo C
CONFIG_FILE := dos-tcc.mk
SEP := $(BACKSLASH)
CC := tcc
.PHONY: turboc
endif
ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
CONFIG_FILE := dos-wat.mk
SEP := $(BACKSLASH)
CC := wcc386
.PHONY: watcom
endif
ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit
CONFIG_FILE := dos-bcc.mk
SEP := $(BACKSLASH)
CC := bcc
.PHONY: borlandc16
endif
ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32-bit
CONFIG_FILE := dos-bcc.mk
SEP := $(BACKSLASH)
CC := bcc32
.PHONY: borlandc
endif
setup: dos_setup
endif # test Dos
endif # test COMSPEC
endif # test PLATFORM
# EOF
@@ -1,134 +0,0 @@
#
# FreeType 2 configuration rules for the DJGPP compiler
#
# 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 TOP
TOP := .
endif
DELETE := rm -f
SEP := /
HOSTSEP := $(strip \ )
BUILD := $(TOP)/builds/dos
PLATFORM := dos
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := o
SO := o
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := a
SA := a
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := libfreetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -o # Don't remove this comment line! We need the space after `-o'.
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := -c -g -O6 -Wall
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := -ansi -pedantic
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# Librarian to use to build the static library
#
FT_LIBRARIAN := $(AR) -r
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like:
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
-$(DELETE) $@
$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
endif
# EOF
@@ -1,279 +0,0 @@
#
# FreeType 2 library sub-Makefile
#
# 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.
# DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY
# OTHER MAKEFILES.
# The following variables (set by other Makefile components, in the
# environment, or on the command line) are used:
#
# BUILD The architecture dependent directory,
# e.g. `$(TOP)/builds/unix'.
#
# OBJ_DIR The directory in which object files are created.
#
# LIB_DIR The directory in which the library is created.
#
# INCLUDES A list of directories to be included additionally.
# Usually empty.
#
# CFLAGS Compilation flags. This overrides the default settings
# in the platform-specific configuration files.
#
# FTSYS_SRC If set, its value is used as the name of a replacement
# file for `src/base/ftsystem.c'.
#
# FTDEBUG_SRC If set, its value is used as the name of a replacement
# file for `src/base/ftdebug.c'. [For a normal build, this
# file does nothing.]
#
# FT_MODULE_LIST The file which contains the list of modules for the
# current build. Usually, this is automatically created by
# `modules.mk'.
#
# BASE_OBJ_S
# BASE_OBJ_M A list of base objects (for single object and multiple
# object builds, respectively). Set up in
# `src/base/rules.mk'.
#
# BASE_EXT_OBJ A list of base extension objects. Set up in
# `src/base/rules.mk'.
#
# DRV_OBJ_S
# DRV_OBJ_M A list of driver objects (for single object and multiple
# object builds, respectively). Set up cumulatively in
# `src/<driver>/rules.mk'.
#
# CLEAN
# DISTCLEAN The sub-makefiles can append additional stuff to these two
# variables which is to be removed for the `clean' resp.
# `distclean' target.
#
# TOP, SEP,
# LIBRARY, CC,
# A, I, O, T Check `config.mk' for details.
# The targets `objects' and `library' are defined at the end of this
# Makefile after all other rules have been included.
#
.PHONY: single objects library
# default target -- build single objects and library
#
single: objects library
# `multi' target -- build multiple objects and library
#
multi: objects library
# The FreeType source directory, usually `./src'.
#
SRC := $(TOP)$(SEP)src
# The directory where the base layer components are placed, usually
# `./src/base'.
#
BASE_DIR := $(SRC)$(SEP)base
# A few short-cuts in order to avoid typing $(SEP) all the time for the
# directory separator.
#
# For example: $(SRC_) equals to `./src/' where `.' is $(TOP).
#
#
SRC_ := $(SRC)$(SEP)
BASE_ := $(BASE_DIR)$(SEP)
OBJ_ := $(OBJ_DIR)$(SEP)
LIB_ := $(LIB_DIR)$(SEP)
PUBLIC_ := $(TOP)$(SEP)include$(SEP)freetype$(SEP)
INTERNAL_ := $(PUBLIC_)internal$(SEP)
CONFIG_ := $(PUBLIC_)config$(SEP)
# The final name of the library file.
#
FT_LIBRARY := $(LIB_)$(LIBRARY).$A
# include paths
#
# IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed
# in front of the include list. Porters are then able to
# put their own version of some of the FreeType components
# in the `freetype/builds/<system>' directory, as these
# files will override the default sources.
#
INCLUDES := $(BUILD) $(TOP)$(SEP)include $(SRC)
INCLUDE_FLAGS = $(INCLUDES:%=$I%)
# C flags used for the compilation of an object file. This must include at
# least the paths for the `base' and `builds/<system>' directories;
# debug/optimization/warning flags + ansi compliance if needed.
#
FT_CFLAGS = $(CFLAGS) $(INCLUDE_FLAGS)
FT_CC = $(CC) $(FT_CFLAGS)
FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
# Include the `modules' rules file.
#
include $(TOP)/builds/modules.mk
# Initialize the list of objects.
#
OBJECTS_LIST :=
# Define $(PUBLIC_H) as the list of all public header files located in
# `$(TOP)/include/freetype'. $(BASE_H) and $(CONFIG_H) are defined
# similarly.
#
# This is used to simplify the dependency rules -- if one of these files
# changes, the whole library is recompiled.
#
PUBLIC_H := $(wildcard $(PUBLIC_)*.h)
BASE_H := $(wildcard $(INTERNAL_)*.h)
CONFIG_H := $(wildcard $(CONFIG_)*.h)
FREETYPE_H := $(PUBLIC_H) $(BASE_H) $(CONFIG_H)
# ftsystem component
#
ifndef FTSYS_SRC
FTSYS_SRC = $(BASE_)ftsystem.c
endif
FTSYS_OBJ = $(OBJ_)ftsystem.$O
OBJECTS_LIST += $(FTSYS_OBJ)
$(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H)
$(FT_COMPILE) $T$@ $<
# ftdebug component
#
ifndef FTDEBUG_SRC
FTDEBUG_SRC = $(BASE_)ftdebug.c
endif
FTDEBUG_OBJ = $(OBJ_)ftdebug.$O
OBJECTS_LIST += $(FTDEBUG_OBJ)
$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
$(FT_COMPILE) $T$@ $<
# Include all rule files from FreeType components.
#
include $(wildcard $(SRC)/*/rules.mk)
# ftinit component
#
# The C source `ftinit.c' contains the FreeType initialization routines.
# It is able to automatically register one or more drivers when the API
# function FT_Init_FreeType() is called.
#
# The set of initial drivers is determined by the driver Makefiles
# includes above. Each driver Makefile updates the FTINIT_xxx lists
# which contain additional include paths and macros used to compile the
# single `ftinit.c' source.
#
FTINIT_SRC := $(BASE_)ftinit.c
FTINIT_OBJ := $(OBJ_)ftinit.$O
OBJECTS_LIST += $(FTINIT_OBJ)
$(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H) $(FT_MODULE_LIST)
$(FT_COMPILE) $T$@ $<
# All FreeType library objects
#
# By default, we include the base layer extensions. These could be
# omitted on builds which do not want them.
#
OBJ_M = $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
OBJ_S = $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
# The target `multi' on the Make command line indicates that we want to
# compile each source file independently.
#
# Otherwise, each module/driver is compiled in a single object file through
# source file inclusion (see `src/base/ftbase.c' or
# `src/truetype/truetype.c' for examples).
#
BASE_OBJECTS := $(OBJECTS_LIST)
ifneq ($(findstring multi,$(MAKECMDGOALS)),)
OBJECTS_LIST += $(OBJ_M)
else
OBJECTS_LIST += $(OBJ_S)
endif
objects: $(OBJECTS_LIST)
library: $(FT_LIBRARY)
.c.$O:
$(FT_COMPILE) $T$@ $<
# Standard cleaning and distclean rules. These are not accepted
# on all systems though.
#
clean_freetype_std:
-$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S) $(CLEAN)
distclean_freetype_std: clean_freetype_std
-$(DELETE) $(FT_LIBRARY)
-$(DELETE) *.orig *~ core *.core $(DISTCLEAN)
# The Dos command shell does not support very long list of arguments, so
# we are stuck with wildcards.
#
clean_freetype_dos:
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(OBJ_))*.$O $(CLEAN) 2> nul
distclean_freetype_dos: clean_freetype_dos
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) $(DISTCLEAN) 2> nul
# Remove configuration file (used for distclean).
#
remove_config_mk:
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(CONFIG_MK))
# The `config.mk' file must define `clean_freetype' and
# `distclean_freetype'. Implementations may use to relay these to either
# the `std' or `dos' versions from above, or simply provide their own
# implementation.
#
clean: clean_freetype
distclean: distclean_freetype remove_config_mk
# EOF
Binary file not shown.
@@ -1,11 +0,0 @@
This folder contains supporting code and CodeWarrior Pro 4 project
files to build the FreeType library.
Notes:
The library will be built as a static lib in the obj/ folder.
Just van Rossum, <[email protected]>
DISCLAIMER: this subdirectory is *not* being maintained by the
FreeType team, but by Just van Rossum. It's being released under
the same terms as FreeType (see LICENSE.TXT).
@@ -1,75 +0,0 @@
#
# FreeType 2 modules sub-Makefile
#
# 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.
# DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY
# OTHER MAKEFILES.
# This file is in charge of handling the generation of the modules list
# file.
.PHONY: make_module_list clean_module_list remake_module_list
# MODULE_LIST, as its name suggests, indicates where the modules list
# resides. For now, it is in `include/freetype/config/ftmodule.h'.
#
ifndef FT_MODULE_LIST
FT_MODULE_LIST := $(TOP)$(SEP)include$(SEP)freetype$(SEP)config$(SEP)ftmodule.h
endif
# To build the modules list, we invoke the `make_module_list' target.
#
# This rule is commented out by default since FreeType comes already with
# a ftmodule.h file.
#
#$(FT_MODULE_LIST): make_module_list
# Before the modules list file can be generated, we must remove the file in
# order to `clean' the list.
#
clean_module_list:
@-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_MODULE_LIST))
@-echo Regenerating the modules list in $(FT_MODULE_LIST)...
make_module_list: clean_module_list
@echo done.
# Trailing spaces are protected with a `#' sign to avoid accidental
# removing.
#
ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
OPEN_MODULE := @echo #
CLOSE_MODULE := >> $(subst $(SEP),$(HOSTSEP),$(FT_MODULE_LIST))
else
OPEN_MODULE := @echo "
CLOSE_MODULE := " >> $(FT_MODULE_LIST)
endif
# $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver
# in the `module.mk' rules file.
#
OPEN_DRIVER := $(OPEN_MODULE)FT_USE_MODULE(
CLOSE_DRIVER := )$(CLOSE_MODULE)
ECHO_DRIVER := @echo "* module: #
ECHO_DRIVER_DESC := (
ECHO_DRIVER_DONE := )"
# Each `module.mk' in the `src' sub-dirs is used to add one rule to the
# target `make_module_list'.
#
include $(wildcard $(TOP)/src/*/module.mk)
# EOF
@@ -1,62 +0,0 @@
#
# FreeType 2 configuration file to detect an OS/2 host platform.
#
# 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.
ifeq ($(PLATFORM),ansi)
ifdef OS2_SHELL
PLATFORM := os2
COPY := copy
DELETE := del
CONFIG_FILE := os2-gcc.mk # gcc-emx by default
SEP := /
# additionally, we provide hooks for various other compilers
#
ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++
CONFIG_FILE := os2-icc.mk
SEP := $(BACKSLASH)
CC := icc
.PHONY: visualage
endif
ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
CONFIG_FILE := os2-wat.mk
SEP := $(BACKSLASH)
CC := wcc386
.PHONY: watcom
endif
ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32-bit
CONFIG_FILE := os2-bcc.mk
SEP := $(BACKSLASH)
CC := bcc32
.PHONY: borlandc
endif
ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target
CONFIG_FILE := os2-dev.mk
CC := gcc
SEP := /
devel: setup
endif
setup: dos_setup
endif # test OS2_SHELL
endif # test PLATFORM
#EOF
@@ -1,137 +0,0 @@
#
# FreeType 2 configuration rules for OS/2 + gcc
#
# Development version without optimizations.
#
# 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 TOP
TOP := .
endif
DELETE := del
SEP := /
HOSTSEP := $(strip \ )
BUILD := $(TOP)/builds/os2
PLATFORM := os2
CC := gcc
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := o
SO := o
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := a
SA := a
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := libfreetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -o # Don't remove this comment line! We need the space after `-o'.
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := -c -g -O0 -Wall
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := -ansi -pedantic
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# Librarian to use to build the static library
#
FT_LIBRARIAN := $(AR) -r
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
endif
# EOF
@@ -1,135 +0,0 @@
#
# FreeType 2 configuration rules for OS/2 + gcc
#
# 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 TOP
TOP := .
endif
DELETE := del
SEP := /
HOSTSEP := $(strip \ )
BUILD := $(TOP)/builds/os2
PLATFORM := os2
CC := gcc
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := o
SO := o
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := a
SA := a
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := libfreetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -o # Don't remove this comment line! We need the space after `-o'.
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := -c -g -O6 -Wall
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := -ansi -pedantic
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# Librarian to use to build the static library
#
FT_LIBRARIAN := $(AR) -r
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
endif
# EOF
-430
View File
@@ -1,430 +0,0 @@
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <[email protected]>, 1996
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
AC_DEFUN(AC_LIBTOOL_SETUP,
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
])
esac
])
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_SHARED, [dnl
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_STATIC, [dnl
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
ac_cv_prog_gnu_ld=yes
else
ac_cv_prog_gnu_ld=no
fi])
])
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
break
else
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case "$lt_target" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
INCLTDL=
fi
])
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,74 +0,0 @@
dnl This file is part of the FreeType project.
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(ftconfig.in)
dnl Configuration file -- stay in 8.3 limit
AC_CONFIG_HEADER(ftconfig.h:ftconfig.in)
version_info='6:0:0'
AC_SUBST(version_info)
dnl checks for system type
AC_CANONICAL_SYSTEM
dnl checks for programs
AC_PROG_CC
AC_PROG_CPP
dnl get Compiler flags right.
if test "x$CC" = xgcc; then
XX_CFLAGS="-Wall"
XX_ANSIFLAGS="-pedantic -ansi"
else
case "$host" in
*-dec-osf*)
XX_CFLAGS="-std1 -O2 -g3"
XX_ANSIFLAGS=
;;
*)
XX_CFLAGS=
XX_ANSIFLAGS=
;;
esac
fi
AC_SUBST(XX_CFLAGS)
AC_SUBST(XX_ANSIFLAGS)
AC_CHECK_PROG(RMF, rm, rm -f)
AC_CHECK_PROG(RMDIR, rmdir, rmdir)
AC_PROG_INSTALL
dnl checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h)
dnl checks for typedefs, structures, and compiler characteristics
AC_C_CONST
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
dnl Checks for library functions.
dnl Here we check whether we can use our mmap file component.
AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
FTSYS_SRC='$(BASE_)ftsystem.c'
else
FTSYS_SRC='$(BUILD)/ftsystem.c'
fi
AC_SUBST(FTSYS_SRC)
AC_CHECK_FUNCS(memcpy memmove)
AM_PROG_LIBTOOL
dnl create the Unix-specific sub-Makefile `builds/unix/unix.mk' that will be
dnl used by the build system
dnl
AC_OUTPUT(unix.mk:unix.in)
dnl end of configure.in
@@ -1,59 +0,0 @@
#
# FreeType 2 configuration file to detect a UNIX host platform.
#
# 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.
ifeq ($(PLATFORM),ansi)
has_init := $(strip $(wildcard /sbin/init))
ifneq ($(has_init),)
PLATFORM := unix
COPY := cp
DELETE := rm -f
# If a Unix platform is detected, the configure script is called and
# `unix.mk' is created.
#
# Arguments to `configure' should be in the CFG variable. Example:
#
# make CFG="--prefix=/usr --disable-static"
#
# If you need to set CFLAGS or LDFLAGS, do it here also.
#
# Feel free to add support for other platform specific compilers in this
# directory (e.g. solaris.mk + changes here to detect the platform).
#
CONFIG_FILE := unix.mk
setup: unix.mk
unix: setup
# If `devel' is the requested target, use `-g -O0' as the default value
# for CFLAGS if CFLAGS isn't set.
#
ifneq ($(findstring devel,$(MAKECMDGOALS)),)
ifndef CFLAGS
USE_CFLAGS := CFLAGS="-g -O0"
endif
devel: setup
endif
setup: std_setup
unix.mk: builds/unix/unix.in
cd builds/unix; $(USE_CFLAGS) ./configure $(CFG)
endif # test Unix
endif # test PLATFORM
# EOF
@@ -1,172 +0,0 @@
/***************************************************************************/
/* */
/* ftconfig.in */
/* */
/* UNIX-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. */
/* */
/*************************************************************************/
#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. */
/* */
/*************************************************************************/
#define HAVE_UNISTD_H 0
#define HAVE_FCNTL_H 0
#define SIZEOF_INT 2
#define SIZEOF_LONG 2
#define FT_SIZEOF_INT SIZEOF_INT
#define FT_SIZEOF_LONG SIZEOF_LONG
/* 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 */
@@ -1,306 +0,0 @@
/***************************************************************************/
/* */
/* ftsystem.c */
/* */
/* Unix-specific FreeType low-level system interface (body). */
/* */
/* 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. */
/* */
/***************************************************************************/
#include <ftconfig.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/ftsystem.h>
#include <freetype/fterrors.h>
#include <freetype/fttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* memory-mapping includes and definitions */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/mman.h>
#ifndef MAP_FILE
#define MAP_FILE 0x00
#endif
/*************************************************************************/
/* */
/* The prototype for munmap() is not provided on SunOS. This needs to */
/* have a check added later to see if the GNU C library is being used. */
/* If so, then this prototype is not needed. */
/* */
#if defined( __sun__ ) && !defined( SVR4 ) && !defined( __SVR4 )
extern int munmap( caddr_t addr,
int len );
#endif
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*************************************************************************/
/* */
/* MEMORY MANAGEMENT INTERFACE */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* ft_alloc */
/* */
/* <Description> */
/* The memory allocation function. */
/* */
/* <Input> */
/* memory :: A pointer to the memory object. */
/* size :: The requested size in bytes. */
/* */
/* <Return> */
/* block :: The address of newly allocated block. */
/* */
static
void* ft_alloc( FT_Memory memory,
long size )
{
FT_UNUSED( memory );
return malloc( size );
}
/*************************************************************************/
/* */
/* <Function> */
/* ft_realloc */
/* */
/* <Description> */
/* The memory reallocation function. */
/* */
/* <Input> */
/* memory :: A pointer to the memory object. */
/* */
/* cur_size :: The current size of the allocated memory block. */
/* */
/* new_size :: The newly requested size in bytes. */
/* */
/* block :: The current address of the block in memory. */
/* */
/* <Return> */
/* The address of the reallocated memory block. */
/* */
static
void* ft_realloc( FT_Memory memory,
long cur_size,
long new_size,
void* block )
{
FT_UNUSED( memory );
FT_UNUSED( cur_size );
return realloc( block, new_size );
}
/*************************************************************************/
/* */
/* <Function> */
/* ft_free */
/* */
/* <Description> */
/* The memory release function. */
/* */
/* <Input> */
/* memory :: A pointer to the memory object. */
/* */
/* block :: The address of block in memory to be freed. */
/* */
static
void ft_free( FT_Memory memory,
void* block )
{
FT_UNUSED( memory );
free( block );
}
/*************************************************************************/
/* */
/* RESOURCE MANAGEMENT INTERFACE */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_io
/* We use the macro STREAM_FILE for convenience to extract the */
/* system-specific stream handle from a given FreeType stream object */
#define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer )
/*************************************************************************/
/* */
/* <Function> */
/* ft_close_stream */
/* */
/* <Description> */
/* The function to close a stream. */
/* */
/* <Input> */
/* stream :: A pointer to the stream object. */
/* */
static
void ft_close_stream( FT_Stream stream )
{
munmap ( stream->descriptor.pointer, stream->size );
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = 0;
}
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Stream */
/* */
/* <Description> */
/* Creates a new stream object. */
/* */
/* <Input> */
/* filepathname :: The name of the stream (usually a file) to be */
/* opened. */
/* */
/* stream :: A pointer to the stream object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_New_Stream( const char* filepathname,
FT_Stream stream )
{
int file;
struct stat stat_buf;
if ( !stream )
return FT_Err_Invalid_Stream_Handle;
/* open the file */
file = open( filepathname, O_RDONLY );
if ( file < 0 )
{
FT_ERROR(( "FT_New_Stream:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_Err_Cannot_Open_Resource;
}
if ( fstat( file, &stat_buf ) < 0 )
{
FT_ERROR(( "FT_New_Stream:" ));
FT_ERROR(( " could not `fstat' file `%s'\n", filepathname ));
goto Fail_Map;
}
stream->size = stat_buf.st_size;
stream->pos = 0;
stream->base = mmap( NULL,
stream->size,
PROT_READ,
MAP_FILE | MAP_PRIVATE,
file,
0 );
if ( (long)stream->base == -1 )
{
FT_ERROR(( "FT_New_Stream:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
goto Fail_Map;
}
close( file );
stream->descriptor.pointer = stream->base;
stream->pathname.pointer = (char*)filepathname;
stream->close = ft_close_stream;
stream->read = 0;
FT_TRACE1(( "FT_New_Stream:" ));
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
filepathname, stream->size ));
return FT_Err_Ok;
Fail_Map:
close( file );
stream->base = NULL;
stream->size = 0;
stream->pos = 0;
return FT_Err_Cannot_Open_Stream;
}
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Memory */
/* */
/* <Description> */
/* Creates a new memory object. */
/* */
/* <Return> */
/* A pointer to the new memory object. 0 in case of error. */
/* */
FT_EXPORT_FUNC( FT_Memory ) FT_New_Memory( void )
{
FT_Memory memory;
memory = (FT_Memory)malloc( sizeof ( *memory ) );
if ( memory )
{
memory->user = 0;
memory->alloc = ft_alloc;
memory->realloc = ft_realloc;
memory->free = ft_free;
}
return memory;
}
/* END */
@@ -1,250 +0,0 @@
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,40 +0,0 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <[email protected]>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.1 2001/05/02 12:21:30 jfilby Exp $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here
@@ -1,216 +0,0 @@
#
# FreeType 2 configuration rules templates for Unix + configure
#
# 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 TOP
TOP := .
endif
DELETE := @RMF@
DELDIR := @RMDIR@
SEP := /
HOSTSEP := $(SEP)
BUILD := $(TOP)/builds/unix
PLATFORM := unix
CC := @CC@
INSTALL := @INSTALL@
INSTALL_DATA := @INSTALL_DATA@
MKINSTALLDIRS := $(BUILD)/mkinstalldirs
LIBTOOL := $(BUILD)/libtool
# don't use `:=' here since the path stuff will be included after this file
#
FTSYS_SRC = @FTSYS_SRC@
DISTCLEAN += $(BUILD)/config.cache \
$(BUILD)/config.log \
$(BUILD)/config.status \
$(BUILD)/unix.mk \
$(BUILD)/ftconfig.h \
$(LIBTOOL)
# Standard installation variables.
#
prefix := @prefix@
exec_prefix := @exec_prefix@
libdir := @libdir@
bindir := @bindir@
includedir := @includedir@
version_info := @version_info@
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f $TOP/Makefile setup [options]
# make -f $TOP/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := lo
SO := o
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := la
SA := a
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := libfreetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -o # Don't remove this comment line! We need the space after `-o'.
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS := -c @XX_CFLAGS@ @CFLAGS@
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := @XX_ANSIFLAGS@
# C compiler to use -- we use libtool!
#
#
CCraw := $(CC)
CC := $(LIBTOOL) --mode=compile $(CCraw)
# Linker flags.
#
LDFLAGS := @LDFLAGS@
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_unix
distclean_freetype: distclean_freetype_unix
# Unix installation and deinstallation targets.
install: $(FT_LIBRARY)
$(MKINSTALLDIRS) $(libdir) \
$(includedir)/freetype/config \
$(includedir)/freetype/internal
$(LIBTOOL) --mode=install $(INSTALL) $(FT_LIBRARY) $(libdir)
-for P in $(PUBLIC_H) ; do \
$(INSTALL_DATA) $$P $(includedir)/freetype ; \
done
-for P in $(BASE_H) ; do \
$(INSTALL_DATA) $$P $(includedir)/freetype/internal ; \
done
-for P in $(CONFIG_H) ; do \
$(INSTALL_DATA) $$P $(includedir)/freetype/config ; \
done
uninstall:
-$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/$(LIBRARY).$A
-$(DELETE) $(includedir)/freetype/config/*
-$(DELDIR) $(includedir)/freetype/config
-$(DELETE) $(includedir)/freetype/internal/*
-$(DELDIR) $(includedir)/freetype/internal
-$(DELETE) $(includedir)/freetype/*
-$(DELDIR) $(includedir)/freetype
# Unix cleaning and distclean rules.
#
clean_freetype_unix:
-$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)
-$(DELETE) $(subst $O,$(SO),$(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)) \
$(CLEAN)
distclean_freetype_unix: clean_freetype_unix
-$(DELETE) $(FT_LIBRARY)
-$(DELETE) $(OBJ_DIR)/.libs/*
-$(DELDIR) $(OBJ_DIR)/.libs
-$(DELETE) *.orig *~ core *.core $(DISTCLEAN)
# Librarian to use to build the library
#
FT_LIBRARIAN := $(LIBTOOL) --mode=link $(CCraw)
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
$(FT_LIBRARIAN) -o $@ $(OBJECTS_LIST) \
-rpath $(libdir) -version-info $(version_info)
endif
# EOF
@@ -1,90 +0,0 @@
#
# FreeType 2 configuration file to detect a Win32 host platform.
#
# 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.
ifeq ($(PLATFORM),ansi)
# Detecting Windows NT is easy, as the OS variable must be defined and
# contains `Windows_NT'. Untested with Windows 2K, but I guess it should
# work...
#
ifeq ($(OS),Windows_NT)
is_windows := 1
# We test for the COMSPEC environment variable, then run the `ver'
# command-line program to see if its output contains the word `Windows'.
#
# If this is true, we are running a win32 platform (or an emulation).
#
else
ifdef COMSPEC
is_windows := $(findstring Windows,$(strip $(shell ver)))
endif
endif # test NT
ifdef is_windows
PLATFORM := win32
DELETE := del
COPY := copy
CONFIG_FILE := w32-gcc.mk # gcc Makefile by default
SEP := /
ifeq ($(firstword $(CC)),cc)
CC := gcc
endif
# additionally, we provide hooks for various other compilers
#
ifneq ($(findstring visualc,$(MAKECMDGOALS)),) # Visual C/C++
CONFIG_FILE := w32-vcc.mk
SEP := $(BACKSLASH)
CC := cl
visualc: setup
endif
ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
CONFIG_FILE := w32-wat.mk
SEP := $(BACKSLASH)
CC := wcc386
watcom: setup
endif
ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++
CONFIG_FILE := w32-icc.mk
SEP := $(BACKSLASH)
CC := icc
visualage: setup
endif
ifneq ($(findstring lcc,$(MAKECMDGOALS)),) # LCC-Win32
CONFIG_FILE := w32-lcc.mk
SEP := $(BACKSLASH)
CC := lcc
lcc: setup
endif
ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target
CONFIG_FILE := w32-dev.mk
CC := gcc
SEP := /
devel: setup
endif
setup: dos_setup
endif # test is_windows
endif # test PLATFORM
# EOF
@@ -1,140 +0,0 @@
#
# FreeType 2 Configuration rules for Win32 + GCC
#
# Development version without optimizations.
#
# 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.
#
# NOTE: This version requires that GNU Make is invoked from the Windows
# Shell (_not_ Cygwin BASH)!
#
ifndef TOP
TOP := .
endif
DELETE := del
SEP := /
HOSTSEP := $(strip \ )
BUILD := $(TOP)/builds/win32
PLATFORM := win32
CC := gcc
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := o
SO := o
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := a
SA := a
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := libfreetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -o # Don't remove this comment line! We need the space after `-o'.
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := -c -g -O0 -Wall -W
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := -ansi -pedantic
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# Librarian to use to build the static library
#
FT_LIBRARIAN := $(AR) -r
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
endif
# EOF
@@ -1,138 +0,0 @@
#
# FreeType 2 Configuration rules for Win32 + GCC
#
# 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.
#
# NOTE: This version requires that GNU Make is invoked from the Windows
# Shell (_not_ Cygwin BASH)!
#
ifndef TOP
TOP := .
endif
DELETE := del
SEP := /
HOSTSEP := $(strip \ )
BUILD := $(TOP)/builds/win32
PLATFORM := win32
CC := gcc
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := o
SO := o
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := a
SA := a
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := libfreetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -o # Don't remove this comment line! We need the space after `-o'.
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := -c -g -O6 -Wall
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := -ansi -pedantic
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# Librarian to use to build the static library
#
FT_LIBRARIAN := $(AR) -r
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
endif
# EOF
@@ -1,122 +0,0 @@
#
# FreeType 2 Configuration rules for Win32 + IBM Visual Age C++
#
# 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.
#
DELETE := del
SEP := $(strip \ )
HOSTSEP := $(strip \ )
BUILD := $(TOP)$(SEP)config$(SEP)win32
PLATFORM := win32
CC := icc
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := obj
SO := obj
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := lib
SA := lib
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := freetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := /I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := /D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := /Fl
# Target flag.
#
T := /Fo
# C flags
#
# These should concern: debug output, optimization & warnings.
#
ifndef CFLAGS
CFLAGS := /Q- /Gd+ /O2 /G5 /W3 /C
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSI_FLAGS := /Sa
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
lib /nologo /out:$@ $(OBJECTS_LIST)
endif
# EOF
@@ -1,130 +0,0 @@
#
# FreeType 2 Configuration rules for Win32 + LCC
#
# 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 TOP
TOP := .
endif
DELETE := del
SEP := /
HOSTSEP := $(strip \ )
BUILD := $(TOP)/builds/win32
PLATFORM := win32
CC := lcc
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := obj
SO := obj
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := lib
SA := lib
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := freetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := -D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -Fl
# Target flag.
#
T := -Fo
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := -c -g2 -O
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS :=
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
lcclib /out:$(subst $(SEP),\\,$@) \
$(subst $(SEP),\\,$(OBJECTS_LIST))
endif
# EOF
@@ -1,129 +0,0 @@
#
# FreeType 2 Configuration rules for Win32 + Visual C/C++
#
# 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 TOP
TOP := .
endif
DELETE := del
SEP := /
HOSTSEP := $(strip \ )
BUILD := $(TOP)/builds/win32
PLATFORM := win32
CC := cl
# The directory where all object files are placed.
#
# Note that this is not $(TOP)/obj!
# This lets you build the library in your own directory with something like
#
# set TOP=.../path/to/freetype2/top/dir...
# mkdir obj
# make -f %TOP%/Makefile setup [options]
# make -f %TOP%/Makefile
#
OBJ_DIR := obj
# The directory where all library files are placed.
#
# By default, this is the same as $(OBJ_DIR), however, this can be changed
# to suit particular needs.
#
LIB_DIR := $(OBJ_DIR)
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := obj
SO := obj
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := lib
SA := lib
# The name of the final library file. Note that the DOS-specific Makefile
# uses a shorter (8.3) name.
#
LIBRARY := freetype
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := /I
# C flag used to define a macro before the compilation of a given source
# object. Usually is `-D' like in `-DDEBUG'.
#
D := /D
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := /Fl
# Target flag.
#
T := /Fo
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
ifndef CFLAGS
CFLAGS := /nologo /c /Ox /G5 /W3 /WX
endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := /Za
ifdef BUILD_FREETYPE
# Now include the main sub-makefile. It contains all the rules used to
# build the library with the previous variables defined.
#
include $(TOP)/builds/freetype.mk
# The cleanup targets.
#
clean_freetype: clean_freetype_dos
distclean_freetype: distclean_freetype_dos
# This final rule is used to link all object files into a single library.
# It is part of the system-specific sub-Makefile because not all
# librarians accept a simple syntax like
#
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
lib /nologo /out:$@ $(OBJECTS_LIST)
endif
# EOF
-706
View File
@@ -1,706 +0,0 @@
/* $Id: ctype.c,v 1.2 2002/09/30 21:21:38 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/rtl/ctype.c
* PURPOSE: Character type and conversion functions
* PROGRAMMERS: ???
* Eric Kohl
* HISTORY: ???: Created
* 10/01/2000: Added missing functions and changed
* all functions to use ctype table
*/
#undef __MSVCRT__
#include <ctype.h>
#include <string.h>
#undef _pctype
#define upalpha ('A' - 'a')
unsigned short _ctype[] = {
0, /* <EOF>, 0xFFFF */
_CONTROL, /* CTRL+@, 0x00 */
_CONTROL, /* CTRL+A, 0x01 */
_CONTROL, /* CTRL+B, 0x02 */
_CONTROL, /* CTRL+C, 0x03 */
_CONTROL, /* CTRL+D, 0x04 */
_CONTROL, /* CTRL+E, 0x05 */
_CONTROL, /* CTRL+F, 0x06 */
_CONTROL, /* CTRL+G, 0x07 */
_CONTROL, /* CTRL+H, 0x08 */
_CONTROL | _SPACE, /* CTRL+I, 0x09 */
_CONTROL | _SPACE, /* CTRL+J, 0x0a */
_CONTROL | _SPACE, /* CTRL+K, 0x0b */
_CONTROL | _SPACE, /* CTRL+L, 0x0c */
_CONTROL | _SPACE, /* CTRL+M, 0x0d */
_CONTROL, /* CTRL+N, 0x0e */
_CONTROL, /* CTRL+O, 0x0f */
_CONTROL, /* CTRL+P, 0x10 */
_CONTROL, /* CTRL+Q, 0x11 */
_CONTROL, /* CTRL+R, 0x12 */
_CONTROL, /* CTRL+S, 0x13 */
_CONTROL, /* CTRL+T, 0x14 */
_CONTROL, /* CTRL+U, 0x15 */
_CONTROL, /* CTRL+V, 0x16 */
_CONTROL, /* CTRL+W, 0x17 */
_CONTROL, /* CTRL+X, 0x18 */
_CONTROL, /* CTRL+Y, 0x19 */
_CONTROL, /* CTRL+Z, 0x1a */
_CONTROL, /* CTRL+[, 0x1b */
_CONTROL, /* CTRL+\, 0x1c */
_CONTROL, /* CTRL+], 0x1d */
_CONTROL, /* CTRL+^, 0x1e */
_CONTROL, /* CTRL+_, 0x1f */
_SPACE | _BLANK, /* ` ', 0x20 */
_PUNCT, /* `!', 0x21 */
_PUNCT, /* 0x22 */
_PUNCT, /* `#', 0x23 */
_PUNCT, /* `$', 0x24 */
_PUNCT, /* `%', 0x25 */
_PUNCT, /* `&', 0x26 */
_PUNCT, /* 0x27 */
_PUNCT, /* `(', 0x28 */
_PUNCT, /* `)', 0x29 */
_PUNCT, /* `*', 0x2a */
_PUNCT, /* `+', 0x2b */
_PUNCT, /* `,', 0x2c */
_PUNCT, /* `-', 0x2d */
_PUNCT, /* `.', 0x2e */
_PUNCT, /* `/', 0x2f */
_DIGIT | _HEX, /* `0', 0x30 */
_DIGIT | _HEX, /* `1', 0x31 */
_DIGIT | _HEX, /* `2', 0x32 */
_DIGIT | _HEX, /* `3', 0x33 */
_DIGIT | _HEX, /* `4', 0x34 */
_DIGIT | _HEX, /* `5', 0x35 */
_DIGIT | _HEX, /* `6', 0x36 */
_DIGIT | _HEX, /* `7', 0x37 */
_DIGIT | _HEX, /* `8', 0x38 */
_DIGIT | _HEX, /* `9', 0x39 */
_PUNCT, /* `:', 0x3a */
_PUNCT, /* `;', 0x3b */
_PUNCT, /* `<', 0x3c */
_PUNCT, /* `=', 0x3d */
_PUNCT, /* `>', 0x3e */
_PUNCT, /* `?', 0x3f */
_PUNCT, /* `@', 0x40 */
_UPPER | _HEX, /* `A', 0x41 */
_UPPER | _HEX, /* `B', 0x42 */
_UPPER | _HEX, /* `C', 0x43 */
_UPPER | _HEX, /* `D', 0x44 */
_UPPER | _HEX, /* `E', 0x45 */
_UPPER | _HEX, /* `F', 0x46 */
_UPPER, /* `G', 0x47 */
_UPPER, /* `H', 0x48 */
_UPPER, /* `I', 0x49 */
_UPPER, /* `J', 0x4a */
_UPPER, /* `K', 0x4b */
_UPPER, /* `L', 0x4c */
_UPPER, /* `M', 0x4d */
_UPPER, /* `N', 0x4e */
_UPPER, /* `O', 0x4f */
_UPPER, /* `P', 0x50 */
_UPPER, /* `Q', 0x51 */
_UPPER, /* `R', 0x52 */
_UPPER, /* `S', 0x53 */
_UPPER, /* `T', 0x54 */
_UPPER, /* `U', 0x55 */
_UPPER, /* `V', 0x56 */
_UPPER, /* `W', 0x57 */
_UPPER, /* `X', 0x58 */
_UPPER, /* `Y', 0x59 */
_UPPER, /* `Z', 0x5a */
_PUNCT, /* `[', 0x5b */
_PUNCT, /* 0x5c */
_PUNCT, /* `]', 0x5d */
_PUNCT, /* `^', 0x5e */
_PUNCT, /* `_', 0x5f */
_PUNCT, /* 0x60 */
_LOWER | _HEX, /* `a', 0x61 */
_LOWER | _HEX, /* `b', 0x62 */
_LOWER | _HEX, /* `c', 0x63 */
_LOWER | _HEX, /* `d', 0x64 */
_LOWER | _HEX, /* `e', 0x65 */
_LOWER | _HEX, /* `f', 0x66 */
_LOWER, /* `g', 0x67 */
_LOWER, /* `h', 0x68 */
_LOWER, /* `i', 0x69 */
_LOWER, /* `j', 0x6a */
_LOWER, /* `k', 0x6b */
_LOWER, /* `l', 0x6c */
_LOWER, /* `m', 0x6d */
_LOWER, /* `n', 0x6e */
_LOWER, /* `o', 0x6f */
_LOWER, /* `p', 0x70 */
_LOWER, /* `q', 0x71 */
_LOWER, /* `r', 0x72 */
_LOWER, /* `s', 0x73 */
_LOWER, /* `t', 0x74 */
_LOWER, /* `u', 0x75 */
_LOWER, /* `v', 0x76 */
_LOWER, /* `w', 0x77 */
_LOWER, /* `x', 0x78 */
_LOWER, /* `y', 0x79 */
_LOWER, /* `z', 0x7a */
_PUNCT, /* `{', 0x7b */
_PUNCT, /* `|', 0x7c */
_PUNCT, /* `}', 0x7d */
_PUNCT, /* `~', 0x7e */
_CONTROL, /* 0x7f */
0, /* 0x80 */
0, /* 0x81 */
0, /* 0x82 */
0, /* 0x83 */
0, /* 0x84 */
0, /* 0x85 */
0, /* 0x86 */
0, /* 0x87 */
0, /* 0x88 */
0, /* 0x89 */
0, /* 0x8a */
0, /* 0x8b */
0, /* 0x8c */
0, /* 0x8d */
0, /* 0x8e */
0, /* 0x8f */
0, /* 0x90 */
0, /* 0x91 */
0, /* 0x92 */
0, /* 0x93 */
0, /* 0x94 */
0, /* 0x95 */
0, /* 0x96 */
0, /* 0x97 */
0, /* 0x98 */
0, /* 0x99 */
0, /* 0x9a */
0, /* 0x9b */
0, /* 0x9c */
0, /* 0x9d */
0, /* 0x9e */
0, /* 0x9f */
0, /* 0xa0 */
0, /* 0xa1 */
0, /* 0xa2 */
0, /* 0xa3 */
0, /* 0xa4 */
0, /* 0xa5 */
0, /* 0xa6 */
0, /* 0xa7 */
0, /* 0xa8 */
0, /* 0xa9 */
0, /* 0xaa */
0, /* 0xab */
0, /* 0xac */
0, /* 0xad */
0, /* 0xae */
0, /* 0xaf */
0, /* 0xb0 */
0, /* 0xb1 */
0, /* 0xb2 */
0, /* 0xb3 */
0, /* 0xb4 */
0, /* 0xb5 */
0, /* 0xb6 */
0, /* 0xb7 */
0, /* 0xb8 */
0, /* 0xb9 */
0, /* 0xba */
0, /* 0xbb */
0, /* 0xbc */
0, /* 0xbd */
0, /* 0xbe */
0, /* 0xbf */
0, /* 0xc0 */
0, /* 0xc1 */
0, /* 0xc2 */
0, /* 0xc3 */
0, /* 0xc4 */
0, /* 0xc5 */
0, /* 0xc6 */
0, /* 0xc7 */
0, /* 0xc8 */
0, /* 0xc9 */
0, /* 0xca */
0, /* 0xcb */
0, /* 0xcc */
0, /* 0xcd */
0, /* 0xce */
0, /* 0xcf */
0, /* 0xd0 */
0, /* 0xd1 */
0, /* 0xd2 */
0, /* 0xd3 */
0, /* 0xd4 */
0, /* 0xd5 */
0, /* 0xd6 */
0, /* 0xd7 */
0, /* 0xd8 */
0, /* 0xd9 */
0, /* 0xda */
0, /* 0xdb */
0, /* 0xdc */
0, /* 0xdd */
0, /* 0xde */
0, /* 0xdf */
0, /* 0xe0 */
0, /* 0xe1 */
0, /* 0xe2 */
0, /* 0xe3 */
0, /* 0xe4 */
0, /* 0xe5 */
0, /* 0xe6 */
0, /* 0xe7 */
0, /* 0xe8 */
0, /* 0xe9 */
0, /* 0xea */
0, /* 0xeb */
0, /* 0xec */
0, /* 0xed */
0, /* 0xee */
0, /* 0xef */
0, /* 0xf0 */
0, /* 0xf1 */
0, /* 0xf2 */
0, /* 0xf3 */
0, /* 0xf4 */
0, /* 0xf5 */
0, /* 0xf6 */
0, /* 0xf7 */
0, /* 0xf8 */
0, /* 0xf9 */
0, /* 0xfa */
0, /* 0xfb */
0, /* 0xfc */
0, /* 0xfd */
0, /* 0xfe */
0 /* 0xff */
};
unsigned short *_pctype = _ctype + 1;
unsigned short *_pwctype = _ctype + 1;
int _isctype (int c, int ctypeFlags)
{
return (_pctype[(unsigned char)(c & 0xFF)] & ctypeFlags);
}
int iswctype(wint_t wc, wctype_t wctypeFlags)
{
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
}
int isalpha(int c)
{
return(_isctype(c, _ALPHA));
}
int isalnum(int c)
{
return(_isctype(c, _ALPHA | _DIGIT));
}
int __isascii(int c)
{
return ((unsigned char)c <= 0x7f);
}
int iscntrl(int c)
{
return(_isctype(c, _CONTROL));
}
int __iscsym(int c)
{
return(isalnum(c)||(c == '_'));
}
int __iscsymf(int c)
{
return(isalpha(c)||(c == '_'));
}
int isdigit(int c)
{
return(_isctype(c, _DIGIT));
}
/*
int isgraph(int c)
{
return (_isctype (c, _PUNCT | _ALPHA | _DIGIT));
}
*/
int islower(int c)
{
return (_isctype (c, _LOWER));
}
int isprint(int c)
{
return (_isctype (c, _BLANK | _PUNCT | _ALPHA | _DIGIT));
}
/*
int ispunct(int c)
{
return (_isctype (c, _PUNCT));
}
*/
int isspace(int c)
{
return (_isctype (c, _SPACE));
}
int isupper(int c)
{
return (_isctype (c, _UPPER));
}
int isxdigit(int c)
{
return (_isctype (c, _HEX));
}
/*
int iswalpha(wint_t c)
{
return (iswctype (c, _ALPHA));
}
*/
int iswdigit(wint_t c)
{
return (iswctype (c, _DIGIT));
}
int iswlower(wint_t c)
{
return (iswctype (c, _LOWER));
}
int iswxdigit(wint_t c)
{
return (iswctype (c, _HEX));
}
/*
int __toascii(int c)
{
return((unsigned)(c) & 0x7f);
}
int _tolower(int c)
{
if (_isctype (c, _UPPER))
return (c - upalpha);
return(c);
}
int _toupper(int c)
{
if (_isctype (c, _LOWER))
return (c + upalpha);
return(c);
}
*/
int tolower(int c)
{
if (_isctype (c, _UPPER))
return (c - upalpha);
return(c);
}
int toupper(int c)
{
if (_isctype (c, _LOWER))
return (c + upalpha);
return(c);
}
wchar_t towlower(wchar_t c)
{
if (iswctype (c, _UPPER))
return (c - upalpha);
return(c);
}
wchar_t towupper(wchar_t c)
{
if (iswctype (c, _LOWER))
return (c + upalpha);
return(c);
}
/* EOF */
int strcmp(const char *s1, const char *s2)
{
while (*s1 == *s2)
{
if (*s1 == 0)
return 0;
s1++;
s2++;
}
return *(unsigned const char *)s1 - *(unsigned const char *)(s2);
}
int strncmp(const char *s1, const char *s2, size_t n)
{
if (n == 0)
return 0;
do
{
if (*s1 != *s2++)
return *(unsigned const char *)s1 - *(unsigned const char *)--s2;
if (*s1++ == 0)
break;
}
while (--n != 0);
return 0;
}
char *strncpy(char *dst, const char *src, size_t n)
{
if (n != 0)
{
char *d = dst;
const char *s = src;
do
{
if ((*d++ = *s++) == 0)
{
while (--n != 0)
*d++ = 0;
break;
}
}
while (--n != 0);
}
return dst;
}
void * memmove(void *dest,const void *src,size_t count)
{
char *char_dest = (char *)dest;
char *char_src = (char *)src;
if ((char_dest <= char_src) || (char_dest >= (char_src+count)))
{
/* non-overlapping buffers */
while(count > 0)
{
*char_dest = *char_src;
char_dest++;
char_src++;
count--;
}
}
else
{
/* overlaping buffers */
char_dest = (char *)dest + count - 1;
char_src = (char *)src + count - 1;
while(count > 0)
{
*char_dest = *char_src;
char_dest--;
char_src--;
count--;
}
}
return dest;
}
/* FIXME: these types should be from the default includes */
typedef int (* _pfunccmp_t) (char *, char *);
#define min(a,b) ((a)<(b)?(a):(b))
/*
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
*/
#define swapcode(TYPE, parmi, parmj, n) { \
long i = (n) / sizeof (TYPE); \
register TYPE *pi = (TYPE *) (parmi); \
register TYPE *pj = (TYPE *) (parmj); \
do { \
register TYPE t = *pi; \
*pi++ = *pj; \
*pj++ = t; \
} while (--i > 0); \
}
#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
static inline void
swapfunc (
char * a,
char * b,
int n,
int swaptype
)
{
if(swaptype <= 1)
swapcode(long, a, b, n)
else
swapcode(char, a, b, n)
}
#define swap(a, b) \
if (swaptype == 0) { \
long t = *(long *)(a); \
*(long *)(a) = *(long *)(b); \
*(long *)(b) = t; \
} else \
swapfunc(a, b, es, swaptype)
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
static inline char *
med3 (
char * a,
char * b,
char * c,
_pfunccmp_t cmp
)
{
return cmp(a, b) < 0 ?
(cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
:(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
}
/* EXPORTED */
void
qsort (
void * a,
size_t n,
size_t es,
_pfunccmp_t cmp
)
{
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
int d, r, swaptype, swap_cnt;
loop: SWAPINIT(a, es);
swap_cnt = 0;
if (n < 7)
{
for ( pm = (char *) a + es;
pm < (char *) a + n * es;
pm += es
)
{
for ( pl = pm;
pl > (char *) a && cmp(pl - es, pl) > 0;
pl -= es
)
{
swap(pl, pl - es);
}
}
return;
}
pm = (char *) a + (n / 2) * es;
if (n > 7)
{
pl = (char *) a;
pn = (char *) a + (n - 1) * es;
if (n > 40)
{
d = (n / 8) * es;
pl = med3(pl, pl + d, pl + 2 * d, cmp);
pm = med3(pm - d, pm, pm + d, cmp);
pn = med3(pn - 2 * d, pn - d, pn, cmp);
}
pm = med3(pl, pm, pn, cmp);
}
swap(a, pm);
pa = pb = (char *) a + es;
pc = pd = (char *) a + (n - 1) * es;
for (;;)
{
while (pb <= pc && (r = cmp(pb, a)) <= 0)
{
if (r == 0)
{
swap_cnt = 1;
swap(pa, pb);
pa += es;
}
pb += es;
}
while (pb <= pc && (r = cmp(pc, a)) >= 0)
{
if (r == 0)
{
swap_cnt = 1;
swap(pc, pd);
pd -= es;
}
pc -= es;
}
if (pb > pc)
{
break;
}
swap(pb, pc);
swap_cnt = 1;
pb += es;
pc -= es;
}
if (swap_cnt == 0) /* Switch to insertion sort */
{
for ( pm = (char *) a + es;
pm < (char *) a + n * es;
pm += es
)
{
for ( pl = pm;
pl > (char *) a && cmp(pl - es, pl) > 0;
pl -= es
)
{
swap(pl, pl - es);
}
}
return;
}
pn = (char *) a + n * es;
r = min(pa - (char *)a, pb - pa);
vecswap(a, pb - r, r);
r = min(pd - pc, pn - pd - es);
vecswap(pb, pn - r, r);
if ((r = pb - pa) > es)
{
qsort(a, r / es, es, cmp);
}
if ((r = pd - pc) > es)
{
/* Iterate rather than recurse to save stack space */
a = pn - r;
n = r / es;
goto loop;
}
/* qsort(pn - r, r / es, es, cmp);*/
}
-264
View File
@@ -1,264 +0,0 @@
FreeType 2 compilation how-to
Introduction:
Welcome to this new beta of the FreeType 2 library. You'll find in this
document instructions on how to compile the library on your favorite
platform.
*** UNIX USERS : Even though the FT2 build system doesn't
************** : use the Autoconf/Automake tools, these will
************** : be introduced in the Unix-specific parts of
************** : the build in our final release..
I. QUICK COMMAND-LINE GUIDE:
----------------------------
Install GNU Make, then try the following on Unix or any system with gcc:
make // this will setup the build
make // this will build the library
On Win32+Visual C++:
make setup visualc // setup the build for VisualC++ on Win32
make // build the library
Then, go to the "demos" directory and type
make
To compile the demo programs..
If this doesn't work, read the following..
II. COMMAND-LINE COMPILATION:
-----------------------------
Note that if you do not want to compile FreeType 2 from a command line
shell, please skip to section III below (DETAILED COMPILATION)
FreeType 2 includes a powerful and flexible build system that allows you
to easily compile it on a great variety of platforms from the command
line. To do so, just follow these simple instructions:
a/ Install GNU Make:
Because GNU Make is the only Make tool supported to compile FreeType 2,
you should install it on your machine.
Because the FT2 build system relies on many important features of GNU
Make, trying to build the library with any other Make tool will *fail*.
b/ Invoke "make":
Go to the root FT2 directory, then simply invoke GNU Make from the
command line, this will launch the FreeType 2 Host Platform detection
routines. A summary will be displayed, for example, on Win32:
========================================================================
FreeType build system -- automatic system detection
The following settings are used:
platform win32
compiler gcc
configuration directory ./builds/win32
configuration rules ./builds/win32/w32-gcc.mk
If this does not correspond to your system or settings please remove
the file 'config.mk' from this directory then read the INSTALL file
for help.
Otherwise, simply type 'make' again to build the library.
=========================================================================
If the detected settings correspond to your platform and compiler,
skip to step e/. Note that if your platform is completely alien to
the build system, the detected platform will be "ansi".
c/ Configure the build system for a different compiler:
If the build system correctly detected your platform, but you want to
use a different compiler than the one specified in the summary (for
most platforms, gcc is the defaut compiler), simply invoke GNU Make
like :
make setup <compiler>
For example:
to use Visual C++ on Win32, type: "make setup visualc"
to use LCC-Win32 on Win32, type: "make setup lcc"
The <compiler> name to use is platform-dependent. The list of available
compilers for your system is available in the file
"builds/<system>/detect.mk" (note that we hope to make the list
displayed at user demand in the final release)..
If you're satisfying by the new configuration summary, skip to step e/
d/ Configure the build system for an unknown platform/compiler:
What the auto-detection/setup phase of the build system does is simply
copy a file to the current directory under the name "config.mk".
For example, on OS/2+gcc, it would simply copy "builds/os2/os2-gcc.mk"
to "./config.mk"
If for some reason your platform isn't correctly detected, simply copy
manually the configuration sub-makefile to "./config.mk" and go to
step e/.
Note that this file is a sub-Makefile used to specify Make variables
used to invoke the compiler and linker during the build, you can easily
create your own version from one of the existing configuration files,
then copy it to the current directory under the name "./config.mk".
e/ Build the library:
The auto-detection/setup phase should have copied a file in the current
directory, called "./config.mk". This file contains definitions of various
Make variables used to invoke the compiler and linker during the build.
To launch the build, simply invoke GNU Make again: the top Makefile will
detect the configuration file and run the build with it..
f/ Build the demonstration programs:
Once the library is compiled, go to "demos", then invoke GNU Make.
Note that the demonstration programs include a tiny graphics sub-system
that includes "drivers" to display Windows on Win32, X11 and OS/2. The
build system should automatically detect which driver to use based on
the current platform.
UNIX USERS TAKE NOTE: XXXXXX
When building the demos, the build system tries to detect your X11 path
by looking for the patterns "X11R5/bin", "X11R6/bin" or "X11/bin" in
your current path. If no X11 path is found, the demo programs will not
be able to display graphics and will fail. Change your current path
if you encounter this problem.
Note that the release version will use Autoconf to detect everything
on Unix, so this will not be necessary !!
II. DETAILED COMPILATION PROCEDURE:
-----------------------------------
If you don't want to compile FreeType 2 from the command-line (for example
from a graphical IDE on a Mac or Windows), you'll need to understand how the
FreeType files are organized.
FreeType 2 has a very module design, and it is made of several components.
Each component must be compiled as a stand-alone object file, even when it
is really made of several C source files. For example, the "base layer"
component is made of the following C files:
src/
base/
ftcalc.c - computations
ftobjs.c - object management
ftstream.c - stream input
ftlist.c - simple list management
ftoutln.c - simple outline processing
ftextend.c - extensions support
However, you can create a single object file by compiling the file
"src/base/ftbase.c", whose content is basically:
#include <base/ftcalc.c>
#include <base/ftobjs.c>
#include <base/ftstream.c>
#include <base/ftlist.c>
#include <base/ftoutln.c>
#include <base/ftextend.c>
Similarly, each component has a single "englobing" C file to compile it
as a stand-alone object, i.e. :
src/base/ftbase.c - the base layer, high-level interface
src/sfnt/sfnt.c - the "sfnt" module
src/psnames/psnames.c - the Postscript Names module
src/truetype/truetype.c - the TrueType font driver
src/type1/type1.c - the Type 1 font driver
To compile one component, do the following:
- add the top-level "include" directory to your compilation include path
- add the "src" directory to your compilation include path.
- compile the component "source" file (see list below), you don't need
to be in the component's directory..
For example, the following line can be used to compile the truetype driver
on Unix:
cd freetype2/
cc -c -Iinclude -Isrc src/truetype/truetype.c
Alternatively:
cd freetype2/src/truetype
cc -c -I../../include -I.. truetype.c
The complete list of files to compile for a feature-complete build of
FreeType 2 is:
src/base/ftsystem.c - system-specific memory and i/o support
src/base/ftinit.c - initialisation layer
src/base/ftdebug.c - debugging component (empty in release build)
src/base/ftbase.c - the "base layer" component
src/base/ftglyph.c - optional convenience functions
src/raster1/raster1.c - the monochrome bitmap renderer
src/smooth/smooth.c - the anti-aliased bitmap renderer
src/sfnt/sfnt.c - the "sfnt" module
src/psnames/psnames.c - the "psnames" module
src/truetype/truetype.c - the TrueType font driver
src/type1/type1.c - the Type 1 font driver (incl. Multiple Masters)
src/cid/type1cid.c - the Type 1 CID-keyed font driver
src/cff/cff.c - the OpenType/CFF/CEF font driver
src/winfonts/winfnt.c - the Windows FNT/FON font driver
All font drivers are optional. the "sfnt" and "psnames" modules are
mandatory for certain drivers.
III. Support for flat-directory compilation:
----------------------------------------
It is now possible to put all FreeType 2 source files into a single
directory, with the exception of the "include" hierarchy.
Note that you'll still need to only compile the 'wrapper' sources described
above. Define the "FT_FLAT_COMPILE" macro when compiling. Here's an
example:
1/ Copy all files in current directory:
cp freetype2/src/base/*.[hc] .
cp freetype2/src/raster1/*.[hc] .
cp freetype2/src/smooth/*.[hc] .
etc...
2/ Compile sources:
cc -c -DFT_FLAT_COMPILE -Ifreetype/include ftsystem.c
cc -c -DFT_FLAT_COMPILE -Ifreetype/include ftinit.c
cc -c -DFT_FLAT_COMPILE -Ifreetype/include ftdebug.c
cc -c -DFT_FLAT_COMPILE -Ifreetype/include ftbase.c
etc...
@@ -1,910 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="David Turner">
<meta name="GENERATOR" content="Mozilla/4.5 [fr] (Win98; I) [Netscape]">
<title>FreeType 2 Internals - I/O Frames</title>
<basefont face="Georgia, Arial, Helvetica, Geneva">
<style content="text/css">
P { text-align=justify }
H1 { text-align=center }
H2 { text-align=center }
LI { text-align=justify }
</style>
</head>
<body text="#000000"
bgcolor="#FFFFFF"
link="#0000EF"
vlink="#51188E"
alink="#FF0000">
<center>
<h1>FreeType 2.0 Build System</h1></center>
<center>
<h3>
&copy; 2000 David Turner (<a href="fichier :///[email protected]">[email protected]</a>)<br>
&copy; 2000 The FreeType Development Team
(<a href="mailto:[email protected]">[email protected]</a>)
</h3></center>
<center><table width=650><tr><td>
<p><hr WIDTH="100%"></p>
<h2>Table of Content</h2>
<center><table><tr><td>
<p><font size="+1"><a href="#introduction">Introduction</a></font></p>
<p><font size="+1"><a href="#features">I. Features & Background</a></font></p>
<ul>
<li><a href="#features-1">1. Convenience, not Requirement</a>
<li><a href="#features-2">2. Compiler and platform independence</a>
<li><a href="#features-3">3. Uses GNU Make</a>
<li><a href="#features-4">4. Automatic host platform detection</a>
<li><a href="#features-5">5. User-selectable builds</a>
<li><a href="#features-6">6. Robustness</a>
<li><a href="#features-7">7. Simple modules management</a>
</ul>
<p><font size="+1"><a href="#overview">II. Overview of the build process</a></font></p>
<ul>
<p><li><a href="#overview-1">1. Build setup</a>
<ul>
<li><a href="#overview-1-a">a. Default build setup</a>
<li><a href="#overview-1-b">b. Selecting another build configuration</a>
</ul>
</p>
<li><a href="#overview-2">2. Library compilation</a>
</ul>
<p><font size="+1"><a href="#setup">III. Build setup details</a></font></p>
<p><font size="+1"><a href="#compilation">IV. Library compilation details</a></font></p>
<ul>
<li><a href="#compilation-1">a. Compiling the <tt>ftsystem</tt> component</a>
<li><a href="#compilation-2">b. Compiling the base layer and optional components</a>
<li><a href="#compilation-3">c. Compiling the modules</a>
<li><a href="#compilation-4">d. Compiling the <tt>ftinit</tt> component</a>
</ul>
</ul>
</td></tr></table></center>
<hr><a name="introduction">
<h2>Introduction:</h2>
<p>This document describes the new build system that was introduced
with FreeType 2.</p>
<p><hr></p>
<a name="features">
<h2>I. Features and Background:</h2>
<p>The FreeType 2 build system is a set of Makefiles and sub-Makefiles that
are used to build the library on a very large variety of systems easily.
One of its main features are the following:</p>
<a name="features-1">
<h3>1. Convenience, not Requirement</h3>
<ul>
<p>Even though the build system is rather sophisticated, it simply is a
convenience that was written simply to allow the compilation of the
FreeType 2 library on as many platforms as possible, as easily as
possible. However, it is not a requirement and the library can be
compiled manually or in a graphical IDE without using it, with minimal
efforts</p>
<p>(for more information on this topic, see the <tt>BUILD</tt>
document that comes with your release of FreeType, in its <em>Detailed
Compilation Guide</em> section).</p>
</ul>
<a name="features-2">
<h3>2. Compiler and platform independence</h3>
<ul>
<p>The FreeType 2 build system can be used with any compiler, on any platform.
It is independent of object file suffix, executable file suffix, directory
separator convention (i.e. "/" or "\"), and compiler flags for path
inclusion, macro definition, output naming, ansi compliance, etc..</p>
<p>Supporting a new compiler is trivial and only requires writing a minimal
configuration sub-makefile that contains several Makefile variables
definitions that are later used by the rest of the build system. This is
described in details later in the document.</p>
</ul>
<a name="features-3">
<h3>3. Uses GNU Make</h3>
<ul>
<p>The build system works <em>exclusively</em> with <b>GNU Make</b>. Reason
is that it is the only make utility that has all the features required to
implement the build system as described below. Moreover, it is already
ported to hundreds of various distinct platforms and is widely and
freely available.</p>
<p>It also uses the native command line shell. <em>You thus
don't need a Unix-like shell on your platform</em>.
For example, FreeType 2 already compiles on Unix, Dos, Windows
and OS/2 right "out of the box" (assuming you have GNU Make
installed).</p>
<p>Finally, note that the build system is <em>specifically</em> designed
for gnu make and will <em>fail</em> with any other make tool. We have
<em>no plans</em> to support a different tools, as you'll rapidly
understand by reading this document or looking at the sub-makefiles
themselves.</p>
</ul>
<a name="features-4">
<h3>4. Automatic host platform detection</h3>
<ul>
<p>When you launch the build system for the first time, by simply invoking
GNU make in the top-level directory, it automatically tries to detect
your current platform in order to choose the best configuration
sub-makefile available. It then displays what it found. If everything
is ok, you can then launch compilation of the library, by invoking make
a second time.</p>
<p>The following platforms are currently automatically detected:</p>
<ul>
<li>Dos (plain-dos, windows in Dos mode, or Dos session under OS/2)
<li>Windows 95, 98 + Windows NT (a.k.a win32)
<li>OS/2
<li>Unix (uses Autoconf/Automake)
</ul>
<p>Note that adding support for a new platform requires writing a minimal
number of very small files, and simply putting them in a new sub-directory
of <tt>freetype2/config</tt>.</p>
</ul>
<a name="features-5">
<h3>5. User-selectable builds</h3>
<ul>
<p>The platform auto-detection rules try to setup the build for a default
compiler (<em>gcc</em> for most platforms), with default build options
for the library (which normally is
<em>"all features enable, no debugging"</em>), as well as the default
list of modules (which is <em>"all modules in <tt>freetype2/src</tt>"</em>)</p>
<p>There are cases where it is important to specify a different compiler,
different build options or simply a different module list. The FreeType 2
build system is designed in such a way that all of this is easily possible
from the command line, <em>without having to touch a single file</em>.
The latter is crucial when dealing with projects that need specific
builds of the library without modifying a single file from the FreeType
distribution.</p>
<p>The exact mechanism and implementation to do this is described later in
this document. It allows, for example, to compile FreeType with any of
the following compilers on Win32: gcc, Visual C++, Win32-LCC.</p>
</ul>
<a name="features-6">
<h3>6. Robustness</h3>
<ul>
<p>The build system uses a single top-level Makefile that includes
one or more sub-makefiles to build the entire library (base layer
plus all modules).
<font color="red">
To understand why this is important, we <em>strongly</em> recommend
the following article to all of our readers:</font></p>
<p>
<center>
<font size="+2"><a href="http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html">
Recursive Make Considered Dangerous
</a>
</font>
</center>
</p>
<p>As an example, here's a short list of files that make up the
build system. Note that each sub-makefile contains rules corresponding
to a very specific purpose, and that they all use the "<tt>.mk</tt>"
suffix:</p>
<ul>
<li><tt>freetype2/Makefile</tt>
<li><tt>freetype2/config/detect.mk</tt>
<li><tt>freetype2/config/freetype.mk</tt>
<li><tt>freetype2/config/<em>&lt;system&gt;</em>/detect.mk</tt>
<li><tt>freetype2/src/<em>&lt;module&gt;</em>/rules.mk</tt>
<li><tt>freetype2/src/<em>&lt;module&gt;</em>/module.mk</tt>
</ul>
</ul>
<a name="features-7">
<h3>7. Simple Module Management</h3>
<ul>
<p>FreeType 2 has a very modular design, and is made of a core
<em>base layer</em> that provides its high-level API as well as
generic services used by one or more <em>modules</em>.
Most modules are used to support a specific font format (like TrueType
or Type 1), and they are called <em>font drivers</em>. However, some of
them do not support font files directly, but rather provide helper
services to the font drivers.</p>
<p>FreeType 2 is designed so that adding modules at run-time is possible
and easy. Similarly, we expect many more modules to come in the near
future and wanted a build system that makes such additions to the
source package itself dead easy.
Indeed, all source code (base + modules) is located in the
<tt>freetype2/src</tt> directory hierarchy. And the build system is
capable of re-generating automatically the list of known modules
from the contents of this directory. Hence, adding a new font driver
to the FreeType sources simply requires to:</p>
<ul>
<li><p>Add a new sub-directory to <tt>freetype2/src</tt>
<li><p>Re-launch the build system</p>
</ul>
<p>There is thus no need to edit a source file</p>
</ul>
<p><hr><p>
<a name="overview">
<h2>II. Overview of the build process(es):</h2>
<p>Before describing in details how the build system works, it is essential
to give a few examples of how it's used. This section presents
what's the build process is to the typical developer:</p>
<p>Compiling the library is normally done in two steps: the first one
configures the build according to the current platform and possible
additional parameters, while the second simply compiles the library with
the information gathered in the configuration step.</p>
<a name="overview-1">
<h3>1. Build Setup</h3>
<a name="overview-1-a">
<h4>a. Default build setup</h4>
<ul>
<p>To configure the build, simply invoke gnu make from the top-level FreeType
directory. This will launch a series of rules that will detect your current
host platform, and choose a configuration file for you. It will then display
what it found. For example, here's the output of typing the command "make"
on a win32 platform (assuming this calls GNU make):</p>
<pre><font color="blue">
<font color="purple">C:\FreeType> make</font>
FreeType build system -- automatic system detection
The following settings are used:
platform win32
compiler gcc
configuration directory ./config/win32
configuration rules ./config/win32/w32-gcc.mk
If this does not correspond to your system or settings please remove the file
'config.mk' from this directory then read the INSTALL file for help.
Otherwise, simply type 'make' again to build the library.
<font color="purple">C:\FreeType></font>
</font></pre>
<p>Note that this step copies the selected configuration file (here
<tt>./config/win32/w32-gcc.mk</tt>) to <em>the current directory</em>, under
the name <tt><b>config.mk</b></tt>. This file contains data that is used
to drive the library compilation of the second step. It correspond to
the platform and compiler selected by the auto-detection phase.</p>
<p>Note that you can re-generate the <tt><b>config.mk</b></tt> file anytime
by invoking <tt>make setup</tt> whenever you need it, even when the file is
already present in the current directory.</p>
<p>Finally, if your platform is not correctly detected, the build system will
display and use configuration information for the virtual "ansi" platform.
</p>
</ul>
<a name="overview-1-b">
<h4>b. Selecting another build configuration</h4>
<ul>
<p>You may not be really satisfied by the configuration file selected by the
auto-detection routines. Typically, you might be using a compiler that is
not the default one for your platform. It is however possible to re-launch
the build setup phase with an additional argument, used to specify a
different compiler/config file. For example, you can type the following
commands on Win32 systems:</p>
<p align=center><table width="80%" cellpadding=10><tr valign=top><td>
<p><b><tt>make&nbsp;setup</tt></b></p>
</td><td>
<p>re-run the platform detection phase, and select the default compiler for it.
On Win32, this is <em>gcc</em>.</p>
</td></tr><tr valign=top><td>
<p><b><tt>make&nbsp;setup&nbsp;visualc</tt></b></p>
</td><td>
<p>re-run the platform detection phase, and select a config file that
corresponds to the <em>Visual C++</em> compiler</p>
</td></tr><tr valign=top><td>
<p><b><tt>make&nbsp;setup&nbsp;lcc</tt></b></p>
</td><td>
<p>re-run the platform detection phase, and select a config file that
corresponds to the <em>Win32-LCC</em> compiler</p>
</td></tr></table>
</p>
<p>Note that a specific configuration is selected with a command that
looks like : <tt><b>make&nbsp;setup&nbsp;<em>compiler</em></b></tt>,
where the <em><tt>compiler</tt></em> keywords depends on the platform.
Moreover, each one of them corresponds to a specific configuration
sub-makefile that is copied as <b><tt>config.mk</tt></b> in the current
directory.</p>
</ul>
<a name="overview-2">
<h3>2. Library compilation</h3>
<p>Once you're satisfied with the version of <b><tt>config.mk</tt></b> that
has been copied to your current directory, you can simply re-invoke
gnu make <em>with no arguments</em>. The top-level Makefile will
automatically detect the config sub-makefile in the current directory,
and use it to drive the library compilation. The latter can be seen
as a series of different steps decribed here:</p>
<ul>
<li><p><b>Compiling the <tt>ftsystem</tt> component</b><br><ul>
It encapsulates all low-level operations (memory management +
i/o access) for the library. Its default version, located in
<tt>./src/base/ftsystem.c</tt> uses the ANSI C library but
system-specific implementations are also available to
improve performance (e.g. memory-mapped files on Unix).
</ul></p>
<li><p><b>Compiling the <em>base layer</em> and optional components</b><br><ul>
They provide the library's high-level API as well as various useful
routines for client applications. Many features of the base layer can
be activated or not depending on a configuration file named
<tt>ftoption.h</tt>
</ul></p>
<li><p><b>Compiling the <em>modules</em></b><br><ul>
Each module is used to support a specific font format (it is then
called a <em>font driver</em>), or to provide helper services to
the drivers (e.g. the auto-hinter). They are all located in
sub-directories of <tt>./src</tt>, like <tt>./src/truetype</tt>,
<tt>./src/type1</tt>.
</ul></p>
<li><p><b>Compiling the <tt>ftinit</tt> component</b><br><ul>
This one is in charge of implementing <tt>FT_Init_FreeType</tt>,
the library initialisation routine. It also selects what modules
are activated when a new library instance is created.
</ul></p>
</ul>
<p><hr><p>
<a name="setup">
<h2>II. Details of the build setup.</h2>
<p>When the top-level <tt>Makefile</tt> is invoked, it looks for a
file named <b><tt>config.mk</tt></b> in the <em>current directory</em>.
If this file is found, it is used directly to build the library
(skip to <a href="library">Section III</a> for details then).</p>
<p>Otherwise, the file <b><tt>./config/detect.mk</tt></b> is included
by the top-level <tt>Makefile</tt> and parsed. Its purpose is to drive the
platform-detection phase, by:</p>
<ul>
<li><p>Defining the <tt>PLATFORM</tt> variable, which indicates
what the currently detected platform is. It is initially
set to the default value "<tt><b>ansi</b></tt>".
</p>
<li><p>Searching for a <tt>detect.mk</tt> file in <em>all
subdirectories</em> of <b><tt>./config</tt></b>.
Each such file is included and parsed. Each of these files must
try to detect if the host platform is a system it knows
about. If so, it changes the value of the <tt>PLATFORM</tt> variable
accordingly.</p>
<li><p>Copying the selected configuration submakefile to the current directory
under the name <tt><b>config.mk</b></tt>.</p>
</ul>
<p>This is illustrated by the following graphics :</p>
<p><center>
<img src="platform-detection.png" border=0>
</center></p>
<p>Each system-specific <b><tt>detect.mk</tt></b> works as follows:</p>
<ul>
<li><p>It checks that the value of <tt>PLATFORM</tt> is currently set
to <b>ansi</b>, which indicates that no platform was detected
for now. If this isn't true, it doesn't do anything</p>
<li><p>Otherwise, it runs a series of test to see wether it is on a
system it knows about. Here are a few examples of tests:</p>
<p><center><table width="80%" cellpadding=5><tr valign=top><td>
<em><b>Unix</b></em>
</td><td>
<p>checks for a file named <tt>/sbin/init</tt>, and runs, when it found
it, a 'configure' script to generate the relevant config sub-makefile</p>
</td></tr><tr valign=top><td>
<em><b>Dos</b></em>
</td><td>
<p>checks for the <tt>COMSPEC</tt> environment variable, then tries to
run the "<tt>ver</tt>" command on the current shell to check that there
is a "Dos" substring in its output; if not, it tries to find the
substring "<tt>MDOS\COMMAND</tt>" in <tt>COMSPEC</tt>, which indicates
a Dos session under OS/2.</p>
</td></tr><tr valign=top><td>
<em><b>Win32</b></em>
</td><td>
<p>if the environment variable <tt>OS</tt> is defined and has the value
<tt>Windows_NT</tt>, or if <tt>COMSPEC</tt> is defined and the
"<tt>ver</tt>" returns a string that contains <tt>Windows</tt> in it,
we're on a Win32 system.</p>
</td></tr></table></center>
</p>
<li><p>It sets the value of <tt>PLATFORM</tt> to a new value corresponding
to its platform.</p>
<li><p>It then tries to select a configuration
sub-makefile, depending on the current platform and any optional
make target (like "visualc" or "devel", etc..). Note that it can
even generate the file, as on Unix through Autoconf/Automake.</p>
<li><p>It copies the selected configuration sub-makefile to the current
directory, under the name <tt><b>config.mk</b></tt>
</ul>
<p>If one wants to support a new platform in the build system, it simply needs
to provide:</p>
<ul>
<li>A new subdirectory, in <tt>./config</tt>, with a file named
<tt>detect.mk</tt> in it, containing relevant checks for the system.
<li>One or more configuration sub-makefiles that will get copied to
<tt>config.mk</tt> at build setup time. You can use the one in
<tt>./config/ansi/config.mk</tt> as a template.
</ul>
<p>Similary, supporting a new compiler on an existing system simply means:</p>
<ul>
<li>Writing a new config sub-makefile that contains definitions used to
specify the compiler and flags for the build.
<li>Change your <tt>./config/<em>system</em>/detect.mk</tt> to recognize
a new optional build target that will copy your new config sub-makefile
instead of the default one.
</ul>
<p><hr><p>
<h2>III. Details of the library compilation.</h2>
<p>When the top-level Makefile is invoked, it looks for a file named
<tt>config.mk</tt> in the current directory. If one is found, it
defines the <tt>BUILD_FREETYPE</tt> variable, then includes and parses it.
The structure of this file is the following:
</p>
<ul>
<li><p>First, it defines a series of Make variables that describe
the host environment, like the compiler, compilation flags,
object file suffix, the directory where all object files are
placed, etc..</p>
<li><p>If <tt>BUILD_FREETYPE</tt> is defined, it includes the file
<tt><b>./config/freetype.mk</b></tt>, which is in charge of
defining all the rules used to build the library object files.
(The test is useful to use the <tt>config.mk</tt> file to
compile other projects that rely on FreeType 2, like its
demonstration programs).</p>
<li><p>Finally, it defines the rule(s) used to link FreeType 2 object files
into a library file (e.g. <tt>libfreetype.a</tt>, <tt>freetype.lib</tt>,
<tt>freetype.dll</tt>, ...). Unfortunately, the command line interface of link tools is
a <em>lot less</em> standardized than those of compilers, which
explains why this rule must be defined in the system-specific
<tt>config.mk</tt>.</p>
</ul>
<p>The following is an explanation of what <tt><b>./config/freetype.mk</b></tt>
does to build the library objects:
</p>
<h4>a. Include paths</h4>
<ul>
<p>To avoid namespace pollution, the <tt><em>freetype</em></tt> directory prefix
is used to include all public header files of the library. This means
that a client application will typically use lines like:</p>
<pre><font color="blue">
#include &lt;freetype/freetype.h&gt;
#include &lt;freetype/ftglyph.h&gt;
</font></pre>
<p>to include one the FreeType 2 public header files. <tt>freetype.mk</tt>
uses a variable named <tt><b>INCLUDES</b></tt> to hold the inclusion
paths list, and thus starts by adding <tt>./include</tt> to it. However,
nothing prevents
<p><tt>freetype.mk</tt> uses a variable named <tt><b>INCLUDES</b></tt>
to hold directory inclusion-path to be used when compiling the library.
It always add <tt>./include</tt> to this variable, which means
</ul>
<h4>b. Configuration header files:</h4>
<ul>
<p>Three header files used to configure the compilation of the
FreeType 2 library. Their default versions are all located in the
directory <tt><b>./include/freetype/config/</b></tt>, even though
project specific versions can be provided on a given build, as
described later:</p>
<ul>
<p><b><tt>#include &lt;freetype/config/ftoption.h&gt;</tt></b><br><ul>
This file contains a set of configuration macro definitions that
can be toggled to activate or deactivate certain features of the
library. By changing one of these definitions, it is possible to
compile <em>only the features that are needed</em> for a specific
project. Note that by default, all options are enabled.
<br><br>
You might need to provide an alternative version of <tt>ftoption.h</tt>
for one of your own projects.
</ul></p>
<p><b><tt>#include &lt;freetype/config/ftconfig.h&gt;</tt></b><br><ul>
This file includes <tt>ftoption.h</tt> but also contains some automatic
macro definitions used to indicate some important system-specific
features (e.g: word size in bytes, DLL export prefix macros, etc..).
<br><br>
You shouldn't normally need to change or provide an alternative
version of this file.
</ul></p>
<p><b><tt>#include &lt;freetype/config/ftmodule.h&gt;</tt></b><br><ul>
This file is very special, as it is normally machine-generated, and
used by the <tt>ftinit</tt> component that is described below. To
understand it, one must reminds that FreeType 2 has an extremely
modular design and that it's possible to change, <em>at run-time</em>,
the modules it's using. The <tt>ftmodule.h</tt> file simply contains
the list of modules that are registered with each new instance of
the library.
<br><br>
Note that the file can be re-generated automatically by invoking
<tt>make setup</tt> from the top-level directory. The re-generated
list contains all the modules that were found in subdirectories of
<tt>./src</tt>.
</ul></p>
</ul>
<p>Note that we strongly advise you to avoid modifying the config files
within the FreeType 2 source directory hierarchy. Rather, it's possible
to specify alternative versions through the help of a build-specific
include path that is include before <tt>./include</tt> in the inclusion
path.</p>
<p>For example, imagine that your platform, named <em>foo</em>, needs a
specific version of <tt>ftoption.h</tt>
</ul>
<h4>a. Compiling the <b><tt>ftsystem</tt></b> component:</h4>
<ul>
<p>FreeType 2 encapsulates all low-level operations (i.e. memory management
and i/o access) within a single component called <tt><b>ftsystem</b></tt>.
Its default implementation uses the <em>ANSI C Library</em> and is located
in <tt>./src/base/ftsystem.c</tt>.</p>
<p>However, some alternate, system-specific, implementations of
<tt>ftsystem</tt> are provided with the library in order to support more
efficient and advanced features. As an example, the file
<tt>./config/unix/ftsystem.c</tt> is an implementation that
uses memory-mapped files rather than the slow ANSI <tt>fopen</tt>,
<tt>fread</tt> and <tt>fseek</tt>, boosting performance significantly.</p>
<p>The build system is thus capable of managing alternate implementations
of <tt>ftsystem</tt></p>
</ul>
<h4>b. Compiling the base layer and optional components:</h4>
<ul>
<p>The high-level API of the library is provided by a component called the
<em>base layer</em>, whose source is located in <tt>./src/base</tt>. This
directory also contains one or more components that are optional, i.e.
that are not required by the library but provide valuable routines to
client applications.</p>
<p>The features of the base library and other components are selected through
a single configuration file named
<tt><b>./include/freetype/config/ftoption.h</b></tt>. It contains a list
of commented configuration macro definitions, that can be toggled to
activate or de-activate a certain feature or component at build time.</p>
<p>For example, the code in <tt>./src/base/ftdebug.c</tt> will be compiled
only if one of these two macros are defined in <tt>ftoption.h</tt>:
<tt>FT_DEBUG_LEVEL_ERROR</tt> or <tt>FT_DEBUG_LEVEL_TRACE</tt></p>
</ul>
<h4>c. Compiling the modules:</h4>
<ul>
<p>Once the base layer is completed, the build system starts to compile each
additional module independently. These are simply defined as all source
code located in a sub-directory of <tt>./src</tt> that contains a file
named <tt><b>rules.</b></tt>, for example:
<tt>src/sfnt</tt>, <tt>src/truetype</tt>, <tt>src/type1</tt>, ...</p>
<p>The <tt><b>rules.</b></tt> file simply contains directives used by the
build system to compile the corresponding module into a single object
file.</p>
</ul>
<h4>d. Compiling the <b><tt>ftinit</tt></b> component:</h4>
<ul>
<p>The file <tt><b>./src/base/ftinit.c</b></tt> is special because it is used
to implement the library initialisation function <tt>FT_Init_FreeType</tt>.
</p>
</ul>
<p>Typically, you will end up with all object files, as well as the
corresponding library file, residing in the <tt>freetype2/obj</tt>
directory.</p>
<h3>1. Purpose of the configuration sub-makefile</h3>
<h3>2. Managing module dependencies</h3>
<h3>3. </h3>
<p><hr><p>
<a name="modules">
<h2>IV. Managing the modules list</h2>
<p><hr><p>
The build system features some important points, which are all detailed
in the following sections:<p>
<ul>
<li><b>Automatic host platform detection</b><br>
The first time the top <tt>Makefile</tt> is invoked, it will
run a series of rules to detect your platform. It will then
create a system-specific configuration sub-Makefile in the
current directory, called <b><tt>config.mk</tt></b>. You can now
invoke the top <tt>Makefile</tt> a second time to compile the
library directly.
<p>
The configuration sub-makefile can be regenerated any time
by invoking "<tt>make setup</tt>", which will re-run the
detection rules even if a <tt>config.mk</tt> is already present.
<p>
<li><b>User-selectable builds</b><br>
<p>
<li><b>Automatic detection of font drivers</b><br>
FreeType is made of a "base" layer that invokes several
separately-compiled modules. Each module is a given
font driver, in charge of supporting a given font format.
<p>
The list of font drivers is located in the file
"<tt>freetype2/config/<em>system</em>/ftmodule.h</tt>", however
it can be regenerated on-demand. Adding a new module to the
FreeType source tree is thus as easy as:<p>
<ul>
<li>create a new directory in "<tt>freetype2/src</tt>" and
put the new driver's source code and sub-makefiles there.
<p>
<li>invoke the top <tt>Makefile</tt> with target
"<tt>modules</tt>" (as in "<tt>make modules</tt>"),
as this will automatically regenerate the list of
available drivers by detecting the new directory and
its content.
</ul>
<p>
</ul>
</ul>
<p><hr><p>
<h2>II. Host Platform Detection</h2>
<ul>
When the top-level <tt>Makefile</tt> is invoked, it looks for a
file named <tt>config.mk</tt> in the current directory. If this
file is found, it is used to build the library
(see <a href="library">Section III</a>).
<p>
Otherwise, the file <tt>freetype2/config/detect.mk</tt> is included
and parsed. Its purpose is to:<p>
<ul>
<li>Define the <tt>PLATFORM</tt> variable, which indicates
what is the currently detected platform. It is initially
set to the default value "<tt>ansi</tt>".
<p>
<li>It searches for a <tt>detect.mk</tt> file in all
subdirectories of <tt>freetype2/config</tt>. Each such
file is included and parsed. Each of these files must
try to detect if the host platform is a system it knows
about. If so, it changes the value of the <tt>PLATFORM</tt>
accordingly.
</ul>
<p>
This is illustrated by the following graphics :<p>
<center>
<img src="platform-detection.png" border=0>
</center>
<p>
Note that each system-specific <tt>detect.mk</tt> is in charge
of copying a valid configuration makefile to the current directory
(i.e. the one where <tt>make</tt> was invoked), depending on the
current targets. For example, the Win32 <tt>detect.mk</tt> will
be able to detect a "<tt>visualc</tt>" or "<tt>lcc</tt>" target,
as described in section I. Similarly, the OS/2 <tt>detect.mk</tt>
can detect targets like "<tt>borlandc</tt>", "<tt>watcom</tt>"
or "<tt>visualage</tt>", etc..
</ul>
<p><hr><p>
<h2>III. Building the library</h2>
<ul>
When the top-level <tt>Makefile</tt> is invoked and that it finds
a <tt>config.mk</tt> file in the current directory, it defines
the variable <tt>BUILD_FREETYPE</tt>, then includes and parses the
configuration sub-makefile.
<p>
The latter defines a number of important variables that describe
the compilation process to the build system. Among other things:<p>
<ul>
<li>the extension to be used for object files and library files
(i.e. <tt>.o</tt> and <tt>.a</tt> on Unix, <tt>.obj</tt>
and <tt>.lib</tt> on Dos-Windows-OS/2, etc..).
<p>
<li>the directory where all object files will be stored
(usually <tt>freetype2/obj</tt>), as well as the one
containing the library file (usually the same as for
objects).
<p>
<li>the command line compiler, and its compilation flags for
indicating a new include path (usually "<tt>-I</tt>"),
a new macro declaration (usually "<tt>-D</tt>") or
the target object file (usually "<tt>-o&nbsp;</tt>")
</ul>
<p>
Once these variable are defined, <tt>config.mk</tt> test for the
definition of the <tt>BUILD_FREETYPE</tt> variable. If it exists,
the makefile then includes "<tt>freetype2/config/freetype.mk</tt>"
which contains the rules required to compile the library.
<p>
Note that <tt>freetype.mk</tt> also scans the subdirectories of
"<tt>freetype2/src</tt>" for a file called "<tt>rules.mk</tt>".
Each <tt>rules.mk</tt> contains, as it names suggests, the rules
required to compile a given font driver or module.
<p>
Once all this parsing is done, the library can be compiled. Usually,
each font driver is compiled as a standalone object file (e.g.
<tt>sfnt.o</tt>, <tt>truetype.o</tt> and <tt>type1.o</tt>).
<p>
This process can be illustrated by the following graphics:<p>
<center>
<img src="library-compilation.png" border=0>
</center>
<p>
</ul>
<p><hr><p>
<h2>IIV. Managing the list of modules</h2>
<ul>
The makefile <tt>freetype.mk</tt> only determines how to compile
each one of the modules that are located in the sub-directories of
<tt>freetype2/src</tt>.
<p>
However, when the function <tt>FT_Init_FreeType</tt> is invoked at
the start of an application, it must create a new <tt>FT_Library</tt>
object, and registers all <em>known</em> font drivers to it by
repeatly calling <tt>FT_Add_Driver</tt>.
<p>
The list of <em>known</em> drivers is located in the file
"<tt>freetype2/config/<em>system</em>/ftmodule.h</tt>", and is used
exclusively by the internal function <tt>FT_Default_Drivers</tt>. The
list in <tt>ftmodule.h</tt> must be re-generated each time you add
or remove a module from <tt>freetype2/src</tt>.
<p>
This is normally performed by invoking the top-level <tt>Makefile</tt>
with the <tt>modules</tt> target, as in:<p>
<ul>
<tt>make modules</tt>
</ul>
<p>
This will trigger a special rule that will re-generate
<tt>ftmodule.h</tt>. To do so, the Makefile will parse all module
directories for a file called "<tt>module.mk</tt>". Each
<tt>module.mk</tt> is a tiny sub-Makefile used to add a single
module to the driver list.
<p>
This is illustrated by the following graphics:<p>
<center>
<img src="drivers-list.png" border=0>
</center>
<p>
Note that the new list of modules is displayed in a very human-friendly
way after a "<tt>make modules</tt>". Here's an example with the current
source tree (on 11 Jan 2000):<p>
<ul><pre>
Regenerating the font drivers list in ./config/unix/ftmodule.h
* driver: sfnt ( pseudo-driver for TrueType & OpenType formats )
* driver: truetype ( Windows/Mac font files with extension *.ttf or *.ttc )
* driver: type1 ( Postscript font files with extension *.pfa or *.pfb )
-- done --
</pre></ul>
</ul>
<p><hr><p>
<h2>V. Building the demonstration programs</h2>
<ul>
Several demonstration programs are located in the
"<tt>freetype2/demos</tt>" directory hierarchy. This directory also
includes a tiny graphics sub-system that is able to blit glyphs to
a great variety of surfaces, as well as display these in various
graphics libraries or windowed environments.
<p>
This section describes how the demonstration programs are compiled,
using the configuration <tt>freetype2/config.mk</tt> and their own
<tt>freetype2/demos/Makefile</tt>.
<p>
To compile the demonstration programs, <em>after the library</em>,
simply go to <tt>freetype2/demos</tt> then invoke GNU make with no
arguments.
<p>
The top-level Makefile will detect the <tt>config.mk</tt> in the
<em>upper</em> directory and include it. Because it doesn't define
the <tt>BUILD_FREETYPE</tt> variable, this will not force the
inclusion of <tt>freetype2/config/freetype.mk</tt> as described in
the previous section.
<p>
the <tt>Makefile</tt> will then include the makefile called
"<tt>freetype2/demos/graph/rules.mk</tt>". The graphics <tt>rules.mk</tt>
defines the rules required to compile the graphics sub-system.
<p>
Because the graphics syb-system is also designed modularly, it is able
to use any number of "modules" to display surfaces on the screen.
The graphics modules are located in the subdirectories of
<tt>freetype2/demos/config</tt>. Each such directory contains a file
named <tt>rules.mk</tt> which is in charge of:<p>
<ul>
<li>detecting wether the corresponding graphics library is
available at the time of compilation.
<p>
<li>if it is, alter the compilation rules to include the graphics
module in the build of the <tt>graph</tt> library.
</ul>
<p>
When the <tt>graph</tt> library is built in <tt>demos/obj</tt>, the
demonstration programs executables are generated by the top-level
Makefile.
<p>
This is illustrated by the following graphics:<p>
<center>
<img src="demo-programs.png" border="0">
</center>
</ul>
<p><hr>
</td></tr></table></center>
</body>
</html>
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1,791 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="David Turner">
<meta name="GENERATOR" content="Mozilla/4.5 [fr] (Win98; I) [Netscape]">
<title>FreeType 2 Internals</title>
</head>
<body>
<body text="#000000"
bgcolor="#FFFFFF"
link="#0000EF"
vlink="#51188E"
alink="#FF0000">
<center>
<h1>
FreeType 2.0 Internals</h1></center>
<center>
<h2>
Version 1.2</h2></center>
<center>
<h3>
&copy; 1999-2000 David Turner (<a href="fichier :///[email protected]">[email protected]</a>)<br>
&copy; 1999-2000 The FreeType Development Team (<a href="fichier :///[email protected]">[email protected]</a>)</h3></center>
<p><br>
<hr WIDTH="100%">
<br>&nbsp;
<h2>Introduction:</h2>
<p>This document describes in great deatils the internals of FreeType 2.
It is a must read for porters and developers alike. Its purpose is to
present the
<blockquote>This document describes in great details the internals of the
FreeType 2.0 library. It is a must read for porters and developers alike.
Its purpose is to present the engine's objects, their roles and interactions.
It is assumed that the <b><i>FreeType Glyph Conventions</i></b> document
has been read.
<p>We advise porters to also read the <b><i>FreeType Porting Guide</i></b>
after this document. Would-be hackers and maintainers are of course encouraged
to read the <b><i>FreeType Coding Conventions</i></b> document too. The
development of a new driver is described in more details in the <b><i>FreeType
Driver HowTo</i></b> document.</blockquote>
<p><br>
<hr WIDTH="100%">
<h2>
I. Overview :</h2>
<blockquote>
<h3>
1. Features (and what's new) :</h3>
<blockquote>FreeType 2.0 has a number of important new features that were
not found in the 1.x releases :
<br>&nbsp;
<blockquote><b>font-format independent API</b>
<br>FreeType 2.0 is able to support any kind of font format, be it fixed
or scalable, through the use of pluggable "font drivers". These drivers
can be added or replaced at run time, while applications use a new font
format-independent API.
<p><b>advanced stream caching</b>
<br>2.0 is able to control the number of concurrently opened streams when
using fonts. It is thus possible to open dozens or hundreds of font faces
without running out of system resources.
<p><b>real reentrancy support</b>
<br>It is now possible to use FreeType as a shared library with no static
data in a multi-threaded environment. The synchronization model has also
been simplified in order to make font driver writing easier. Of course,
you can build FreeType with no thread support to get a smaller library.
<p><b>support for cubic beziers and 17-levels anti-aliasing</b>
<br>The FreeType scan-line converter (a.k.a. raster) now supports cubic
bezier arcs seamlessly. It also provides a new anti-aliasing mode which
uses a palette of 17 levels of grays.
<br>&nbsp;</blockquote>
It also features the following :
<blockquote><b>performance improvements :</b>
<br>The FreeType raster has been optimized, and the generation of anti-aliased
pixmaps is now 60% faster than in the 1.x release. Moreover, the TrueType
bytecode interpreter has been profiled and greatly optimised.
<p><b>easier portability</b>
<br>Porting and configuring FreeType is now much easier. A single file
must be provided for system-specific operations (like memory, i/o, thread
management), and a single configuration header is used to select the build
you need.
<br>&nbsp;</blockquote>
</blockquote>
<h3>
2. Architecture :</h3>
<blockquote>The engine is now split in several parts, which are :
<h4>
a. The base layer :</h4>
<blockquote>This part contains all the font-format independent features
of the engine which are :
<ul>
<li>
computations/scaling</li>
<li>
list processing</li>
<li>
outline processing</li>
<li>
scan-line converter</li>
<li>
stream manager</li>
<li>
base object classes</li>
<li>
debugging &amp; traces</li>
<li>
high-level API functions</li>
<li>
low-level system object (memory, i/o, threads)</li>
</ul>
</blockquote>
<h4>
b. The font drivers :</h4>
<blockquote>Each font format is managed with the use of a single font driver
object. The base layer is able to manage several drivers, and these can
be easily added, removed or upgraded at runtime. Each driver has the following
features and functions :
<ul>
<li>
auto-check font format when opening a font resource (i.e. file)</li>
<li>
access, load and/or extract all tables and data from the font file</li>
<li>
grid-fit/hint the glyph outlines (in the case of scalable formats like
TrueType or Type1)</li>
<li>
provide extensions to access font format-specific data and tables from
the font file</li>
</ul>
Note that FreeType 2.0 is a font service. Its purpose is to provide a unified
API for all kinds of fonts and extract individual glyph images and metrics.
However, it does not render text itself, as this operation is left to the
developer, or to higher-level libraries built on top of FreeType. Here
are a few features that are thus not implemented :
<blockquote>1) Text string rendering
<br>2) Glyph bitmap/outline caching for improved performance
<br>3) Synthetic fonts (i.e. italicising, emboldening, underlining)
<br>4) Contextual glyph substitution and other advanced layout processes</blockquote>
Note that features 1 through 3 should be provided by the SemTex library,
which may soon become part of the standard FreeType distribution.</blockquote>
</blockquote>
</blockquote>
<p><br>
<hr WIDTH="100%">
<h2>
II. Design :</h2>
<blockquote>
<h3>
1. Objects :</h3>
<blockquote>They are several kinds of objects in FreeType, which can be
described as follows :
<blockquote><b>Base objects</b>
<br>These objects do not relate directly to font data, but to the way it
is organised and managed. It is the basic core and provides functions that
are heavily used by each font driver. Examples are the resource objects,
used to describe font files, the system object used to manage low-level
system operations, or the raster object, used to convert vector outlines
into bitmaps or anti-aliased pixmaps. Most of the base objects are not
directly visible for client applications of FreeType.
<p><b>Font objects</b>
<br>The font objects directly model the data as it is found in font files.
The root classes implemented in the base layer like <tt>FT_Face</tt>, <tt>FT_Size</tt>,
<tt>FT_GlyphSlot</tt>,
must be derived in each font driver.</blockquote>
Objects are defined in the files "<tt>base/freetype.h</tt>" and "<tt>base/ftobjs.h</tt>".
The former contains all the public object definitions usable by client
applications. The latter contains private definitions used by the rest
of the base layer and each font driver.</blockquote>
<h3>
2. List management</h3>
<blockquote>The "<tt>base/ftlist.c</tt>" component a very simple doubly-linked
list facility which is used by the rest of the engine to create and process
lists, including iteration and finalisation. The definition of the list
node and functions are placed in the "<tt>base/freetype.h</tt>" to let
client applications access listed objects as they like.
<p>The base list type is <tt>FT_List</tt>, which links nodes of type <tt>FT_ListNode</tt>
together.
<br>&nbsp;</blockquote>
<h3>
3. Limited encapsulation</h3>
<blockquote>Unlike what happened in the 1.x releases, the <tt>FT_Face</tt>,
<tt>FT_Size</tt>,
<tt>FT_GlyphSlot</tt> and <tt>FT_CharMap</tt> types are no longer blind
pointers to opaque types. Rather, the corresponding structures are now
public (and defined in "<tt>base/freetype.h</tt>", see <tt>FT_FaceRec</tt>,
<tt>FT_SizeRec</tt>,
etc..) in order to let client applications read directly the various object
attributes they're interested in.
<p>This breaks encapsulation of implementation, famed by OOP, but was chosen
because:
<br>&nbsp;
<ul>
<li>
it simplifies a lot the work of client applications and libraries which
don't need to perform a function call everytime they want to read one important
object attribute (nor does it force them to cache these attributes in their
own structures).</li>
</ul>
<ul>
<li>
It reduces greatly the API, as many <tt>FT_Get_XXX</tt> functions are avoided.</li>
</ul>
<ul>
<li>
Higher-level libraries are able to&nbsp; access data directly. When it
is used frequently, they don't need to cache it in their own structures.</li>
</ul>
<ul>
<li>
It is possible to tightly link FreeType objects with higher-level ones,
in a clearer and more efficient way. This is very important when one wants
to write a C++ wrapper or a text rendering library on top of FreeType (actually,
both projects were performed in an earlier version of FreeType 2.0 which
featured classic encapsulation through get/set methods. The resulting code
was ugly and slow. Moving to a limited encapsulation approach simplified
so many things that the compiled code size was reduced by a factor of two
!).</li>
</ul>
<ul>
<li>
Finally, the API and font object structures were designed after the creation
of two scalable font drivers and one bitmap font driver. They are now very
stable and the public (visible) attributes are not going to change.</li>
</ul>
</blockquote>
</blockquote>
<p><br>
<hr WIDTH="100%">
<h2>
III. Base objects :</h2>
<blockquote>This section describes the FreeType base object classes :
<br>&nbsp;
<h3>
1. System objects :</h3>
<blockquote>The system class is in charge of managing all low-level and
system-specific operations. This means simply memory management, i/o access
and thread synchronisation. It is implemented by the "<tt>ftsys.c</tt>"
component, whose source must be located in the configuration directory
when building FreeType. (e.g. "<tt>lib/arch/ansi/ftsys.c</tt>" for an ANSI
build, "<tt>lib/arch/unix/ftsys.c</tt>" for a Unix one, etc..).
<p>Porting FreeType 2.0 really means providing a new implementation of
<tt>ftsys</tt>
(along with a few configuration file changes). Note however that its interface
is common to all ports, and located in "<tt>base/ftsys.h</tt>".</blockquote>
<h3>
2. Resources and Streams:</h3>
<blockquote>The concepts of files as storages, and files as streams has
been separated for FreeType 2.0. The "<b><i>resource</i></b>" concept was
introduced while the "<b><i>stream</i></b>" one has been redefined. Here
is how they work together :
<ul>
<li>
a "<b>resource</b>" is an object which models a file, seen as a storage.
There are several classes of resources, which differ usually in two ways
: the way their data is accessed by applications, and the way they're named
within the system.</li>
</ul>
<ul>For example, when parsing files with the ANSI C library, data has to
be read (through fseek/fread) into intermediate buffers before it can be
decoded. This scheme is highly portable, but rather inefficient; when using
it, we'll describe the file as a disk-based resource.
<p>As most modern operating systems now provide memory-mapped files, which
allow direct access while improving performance and reducing memory usage.
Because data can be read directly in memory, we'll speak of a memory-based
resource in this case. For embedded systems (like printers, PDAs, etc..),
ROM-fonts fit into this category as well.
<p>Regarding naming, most systems use a string to name files in their storage
hierarchy. Though a typical pathname is an ASCII string (<tt>'c:\windows\fonts\times.ttf'</tt>
on Windows, <tt>'/home/fonts/times.ttf'</tt> on Unix), some OSes use different
schemes, varying from Unicode character strings to file i-node numbers.
These details are platform-specific and must be hidden to the rest of the
library in resource objects.
<p>A resource encapsulates the lowest details regarding a file, though
it should have NO STATE. Note that the nature or type of a resource (i.e.
disk or memory based) is important to the "stream" component only. The
rest of the library and font drivers work transparently from their implementation.
<p>Note also that it is perfectly possible to mix resources of distinct
natures in a single build</ul>
<ul>
<li>
a "<b>stream</b>" is an object which is used to extract bytes from a resource.
Only resource objects can create streams, through its <i><tt>Open_Stream()</tt></i>
method. A stream has state, which typically consist of a file "cursor",
some intermediate buffers, a "current frame" and, of course, methods used
to extract the data from streams, resolving endianess and alignement issues.</li>
</ul>
Data can be extracted from streams through direct reads, or through the
use of <b>frames</b>. A frame models <i>a run of contiguous bytes</i> starting
from the current stream position, and of liberal size.
<p>Methods exist to extract successive integers of any sizes, while resolving
endianess and alignement issues. Rather than a long rethorical explanation,
here's how frames are typically used :
<blockquote><tt>{</tt>
<br><tt>&nbsp;</tt>
<br><tt>&nbsp; FT_Error&nbsp; error;</tt>
<p><tt>&nbsp; error = FT_Access_Frame( stream, 14 );</tt>
<br><tt>&nbsp; if (error) goto Fail;</tt>
<p><tt>&nbsp; val1 = FT_Get_Short(stream);</tt>
<br><tt>&nbsp; val2 = FT_Get_Long(stream);</tt>
<br><tt>&nbsp; val3 = FT_Get_Long(stream);</tt>
<br><tt>&nbsp; val4 = FT_Get_Long(stream);</tt>
<p><tt>&nbsp; FT_Forget_Frame(stream);</tt>
<br><tt>&nbsp;</tt>
<br><tt>}</tt></blockquote>
This code does the following :
<blockquote>
<ol>
<li>
&nbsp;first, it "loads" the next 14 bytes from the current cursor position
into the stream's frame, using the <tt>FT_Access_Frame</tt> API. An error
is returned if, for example, less than 14 bytes are left in the stream
when the call occurs..</li>
</ol>
<ol>
<li>
&nbsp;it extract four integers (one 16-bit short, three 32-bit longs) from
the frame using <tt>FT_Get_Short</tt> and <tt>FT_Get_Long</tt>. These function
increment the frame's cursor finally, it "releases" the stream's frame.</li>
</ol>
<ol>
<li>
&nbsp;Each stream has its own frame which can be accessed independently,
however, nested frame accesses are not allowed. Note also that the bytes
are effectively read from the stream on the call to <tt>FT_Access_Frame</tt>.
Any subsequent read will occur after these 14 bytes, even if less are extracted
through <tt>FT_Get_xxxx</tt> functions.</li>
</ol>
</blockquote>
The implementation of the resource class is located in the system component
(i.e. "<tt>arch/<i>&lt;system></i>/ftsys.c</tt>") and can thus be tailored
for a specific port of the engine.
<p>A resource can be created through the <tt>FT_New_Resource</tt> API;
however this function only accepts an 8-bit pathname to name the target
font file, which may be inappropriate for systems using a different naming
scheme (e.g. UTF-16 pathname, i-node number, etc..). It's up to the porter
then to provide its own resource creation function (like. <tt>FT_New_UTF16_Resource</tt>,
for example) in its version of "<tt>ftsys.c</tt>".
<p>Note that <tt>FT_New_Resource</tt> will fail and return an error code
if the font file cannot be found, or when its font format isn't recognized
by one of the drivers installed in the library. The list or resources created
for a given library instance is thus the list of "installed font files".
<br>&nbsp;</blockquote>
<h3>
3. Stream Manager :</h3>
<blockquote>As said before, resources do not bear states, while streams
do. Stream creation is also a very lengthy process, depending on the target
operating system (e.g. "<tt>fopen</tt>" is usually very slow).
<p>Because a typical font driver will want to use a new stream on each
access to individual glyphs, being able to cache the most recently used
streams is a requirement in order to avoid considerable performance penalties.
<p>Stream caching is thus implemented in the "<tt>ftstream</tt>" component.
It maintains a simple LRU list of the least recently used streams. Each
stream in the cache is still opened and available for immediate processing.
When a resource is destroyed, the stream cache is parsed to remove all
related cached streams.
<p>Stream caching can also be disabled with a configuration macro when
using only ROM based resources (where stream opening is really quick).
It is implemented through a Stream Manager object (see <tt>ftstream.c</tt>).
<br>&nbsp;</blockquote>
<h3>
4. Raster :</h3>
<blockquote>The raster is the component is charge of generating bitmaps
and anti-aliased pixmaps from vectorial outline definitions. It is also
sometimes called the scan-line converter. It has been completely rewritten
for FreeType 2.0 in order to support third-order bezier arcs, 17-levels
anti-aliasing (through 4x4 sub-sampling), improved performance, as well
as stand-alone compilation (in order to include it in other graphics package
without requiring the rest of the FreeType engine).
<p>Because it was designed for easy re-use and embedded systems, the raster
is a rtaher 'unusual' piece of code, because it doesn't perform a single
memory allocation, nor contain any static or global variable. Rather, it
is up to client applications to allocate a raster object in their own heap
or memory space.
<p>Each raster object also needs a rather large block of memory called
its render pool. The pool is used during rendering (and only during it)
in order to perform the scan-line conversion. Because it accesses and manages
data directly within the pool, the raster yelds impressive performance
as well as bounded memory consumption. It can also automatically decompose
large requests into smaller individual sub-tasks.
<p>Finally, it never creates bitmaps or pixmaps, but simply renders into
them (providing clipping too). These must be described to the raster with
the help of a <tt>FT_Raster_Map</tt> structure (a very simple bitmap/pixmap
descriptor).
<p>Note that when rendering anti-aliased pixmaps, the raster doesn't use
an intermediate bitmap buffer, as filtering is part of the scan-line conversion
process.
<br>&nbsp;</blockquote>
<h3>
5. Library objects :</h3>
<blockquote>A library object models a single instance of the FreeType engine.
This is useful when FreeType is compiled as a shared object (DLL), as it
can then be used by several applications, each with its own resources and
objects.
<p>The <tt>FT_Library</tt> type is an opaque handle to a library object.
Such an object is created through a call&nbsp; to <tt>FT_Init_FreeType</tt>.
Once you don't need it anymore, one can destroy a library object through
<tt>FT_Done_FreeType</tt>.
<p>Note that in reentrant builds, several threads can access a single library
object concurrently. Such a build can be chosen by switching one configuration
macro in the file '<tt>arch/<i>&lt;system></i>/ftconfig.h</tt>'</blockquote>
<h3>
6. Driver objects :</h3>
<blockquote>A driver object models an instance of a given font driver,
i.e. an element of FreeType code in charge of handling a given font format,
like TrueType, Type1, FNT, PCF, etc..
<p>Each library object contains a given set of driver objects when it is
created through FT_Init_FreeType, this set being determined at compile
time (see the file 'base/ftapi.c'). However, removing or adding drivers
is possible at run-time, in order to make upgrades easy.</blockquote>
<h3>
7. Diagram</h3>
<blockquote>This diagram show the object relationships for the sole base
layer. The library object is the root of the object graph :
<center>
<p><img SRC="objects_diagram.png" height=300 width=562></center>
<p>It can be read as follows :
<br>&nbsp;
<ul>
<li>
Each library object has one system, one raster and one stream manager objects.
These objects can only belong to one given library.</li>
</ul>
<ul>
<li>
Each library contains one list of 0 or more resources, as well as one list
of 0 or more driver objects.</li>
</ul>
<ul>
<li>
Each stream manager holds a bounded list ("0..n" where 'n' is the stream
cache's size) of stream objects. Each stream is related to one given resource
object. Each resource may be related to zero or one stream.</li>
</ul>
<ul>
<li>
Each resource is related to one driver object. A driver is related to 0
or more resources.</li>
</ul>
</blockquote>
</blockquote>
<p><br>
<hr WIDTH="100%">
<h2>
IV. Font objects :</h2>
<blockquote>Font objects are used to directly map the information found
in font files into several categories :
<br>&nbsp;
<h3>
1. Face objects :</h3>
<blockquote>Face objects are used to model individual font faces. They
encapsulate data which isn't related to a specific character size, or a
specific glyph or glyph set. Usually, this means :
<ul>
<li>
the font face's family and style names (e.g. "Palatino" + "Regular")</li>
<li>
some flags indicating which kind of font this is (scalable or fixed ? fixed-width
or proportional ? horizontal or vertical ? etc…)</li>
<li>
the number of glyphs, charmaps and eventually fixed character sizes (for
bitmap formats) found in the font face.</li>
<li>
for scalable formats, some important metrics like the ascender, descender,
global font bounding box, maximum advance width, etc.. expressed in notional
font/grid units (as well as the number of units on the EM grid).</li>
</ul>
A face is created from a resource object, with the <tt>FT_New_Face</tt>
API. Each driver contains a list of opened face objects for the resources
it manages. When a driver is removed or destroyed, all its child faces
are discarded automatically with it.</blockquote>
<h3>
2. Size objects :</h3>
<blockquote>Size objects are used to model a given character dimension
for a given device resolution (which really means a given character pixel
dimensions).
<p>Each size object is created from a parent face object. The object can
be reset to new dimensions at any time. Each face object holds a list of
all its child sizes, these are destroyed automatically when the face object
is discarded.
<p>The metrics contains metrics, expressed in pixels, for the ascender,
descender, maximum advance width, etc..
<br>&nbsp;</blockquote>
<h3>
3. Glyph Slot objects :</h3>
<blockquote>A glyph slot is a container where one can load individual glyphs,
be they in vector of bitmap format. Each slot also contains metrics for
the glyph it contains.
<p>Each face object contains one or more glyph slot object : the first
glyph slot is created automatically with its parent face, and it is possible
to add new glyph slots (this is rarely used outside of debugging purposes).
<br>&nbsp;</blockquote>
<h3>
4. CharMap objects :</h3>
<blockquote>A charmap object is a sort of dictionary whose task is to translate
character codes in a given character encoding (like ShiftJIS, Unicode,
ANSI, etc..) into glyph indexes in a given font face.
<p>A face object contains one or more charmap objects. All charmap objects
are created when the parent face is created, though they're not directly
visible to client applications (rather, they can be enumerated through
FT_Get_First_CharMap and FT_Get_Next_CharMap, or more simply picked adequately
with FT_Find_CharMap for a set of given encodings).
<br>&nbsp;</blockquote>
<h3>
5. Diagram</h3>
<blockquote>The following diagram illustrates the relationships between
font objects :
<center>
<p><img SRC="objects_diagram2.png" height=327 width=561></center>
<p>Which can be read as :
<br>&nbsp;
<ul>
<li>
each resource may have zero or more child face objects "opened" for it.
The number of faces is bounded by the number of font faces within the font
resource.</li>
</ul>
<ul>
<li>
each driver holds a list of all the faces opened for the resources it manages.
When the driver is removed, its child faces are discarded automatically.</li>
</ul>
<ul>
<li>
each face object has one single parent resource, and one single driver.</li>
</ul>
<ul>
<li>
each face has one or more charmaps, and one or more glyph slots</li>
</ul>
<ul>
<li>
each face holds a list of zero or more child size objects</li>
</ul>
<ul>
<li>
each charmap, glyph slot and size is related to one given parent face.
These objects are destroyed automatically when the parent face is discarded.</li>
</ul>
</blockquote>
</blockquote>
<p><br>
<hr WIDTH="100%">
<h2>
V. Driver Interface :</h2>
<blockquote>A font driver is added to a given library object through the
<tt>FT_Add_Driver</tt>
API. This function receives a structure known as a <tt>FT_DriverInterface</tt>,
which describes the driver's basic properties.
<p>The <tt>FT_DriverInterface</tt> contains a set of function pointers
used for the base FreeType functionalities. However, each driver can also
provide a font-format-specific extended interface to allow client applications
to use more advanced features.
<br>&nbsp;
<h3>
1. Common Interface</h3>
<blockquote>The structure of <tt>FT_DriverInterface</tt> is rather simple,
and defined in "<tt>base/ftdriver.h</tt>". It must be well known by any
developer who wants to write a new driver for the engine. We advise reading
the <b><i>FreeType Driver HowTo</i></b> as well as the source code of existing
drivers. Source comments.</blockquote>
<h3>
2. Driver-specific extensions</h3>
<blockquote>The field of the <tt>FT_DriverInterface</tt> structure is a
typeless pointer to a format-specific interface. This extended interface
is usually a structure containing function pointers as well as other kind
of information related to the driver.
<p>It is assumed that client applications that wish to use the driver-specific
extensions are able to <tt>#include</tt> the relevant header files to understand
the format-specific interface structure.</blockquote>
</blockquote>
<hr WIDTH="100%">
<h2>
VI. Configuration:</h2>
<blockquote>This section relates to the configuration of the FreeType library.
By configuration, we mean selection of build options as well as the choice
of font drivers to be used for each new library object.
<br>&nbsp;
<h3>
1. Configuration files :</h3>
<blockquote>A single file is used to configure the FreeType base engine.
As it is considered system-specific, it is located in the architecture
directories of the library, under the name "arch/&lt;system>/ftconfig.h".
Note that the same directory should also contain a platform-specific implementation
of "ftsys.c".
<p>The configuration files is a simple C header which is included by the
engine's sources during compilation. It is not included in "freetype.h",
and hence doesn't need to be copied when installing the FreeType headers
on your system.
<p>It is made of a series of #define or #undef statements, which are used
to select or turn off a specific option. Each option is documented with
heavy comments, and some of them are explained below.</blockquote>
<h3>
2. Building and Makefiles :</h3>
<blockquote>FreeType 2.0 is more complex than its 1.x release. In order
to facilitate maintenance, as well as ease considerably the writing of
new font drivers, <b><i>only GNU Make is supported with FreeType 2.0</i></b>.
However, it is possible to use any compiler, as well as any object or library
prefix (<tt>.o, .obj, .a, .lib</tt> etc..) with them.
<p>To build FreeType 2.0, one has to be in the library directory, then
invoke its platform-specific makefile. For a Unix system, this would be
:
<blockquote>
<blockquote><tt>% cd freetype2/lib</tt>
<br><tt>% make -f arch/unix/Makefile</tt>
<p>where '<tt>make</tt>' is really GNU Make !</blockquote>
</blockquote>
The system-specific <tt>Makefile</tt> located in '<tt>arch/<i>&lt;system></i></tt>'
is a tiny file used to define several variables. It then includes the file
<tt>freetype2/lib/Makefile.lib</tt>,
which contains all the gory details about library compilation. The system-specific
<tt>Makefile</tt> can be very easily modified to accomodate a new compiler/platform
(see the comments within one of these files).
<p>Each font driver is located in a directory like "<tt>freetype2/lib/drivers/<i>&lt;formatdir></i></tt>".
For example, the TrueType driver is located in "<tt>drivers/truetype</tt>".
Each driver directory must contain a <tt>Makefile</tt> which will be included
by <tt>Makefile.lib</tt>. The former is used to define and build driver
object files.
<br>&nbsp;
<p><br>
<center>
<p><img SRC="build_diagram.png" height=284 width=559></center>
</blockquote>
<h3>
3. Make options :</h3>
<blockquote>The base layer, as well as each font driver, are made up of
several C sources. Traditionally, one compiles each source (i.e. '<tt>.c</tt>'
file) into an object ('<tt>.o</tt>' or '<tt>.obj</tt>') file, and all of
them are grouped into a library file (i.e. '<tt>.a</tt>' or '<tt>.lib</tt>').
<p>By default, FreeType takes a slightly different approach when it comes
to compiling each part of the engine. Usually, a single tiny source is
compiled, which includes all other component sources. This results in a
single object files, with the benefits or reduced code size, usually better
compilation as well as a drastic reduction of the number of symbols exported
by the library. Of course, it is made possible through the use of specific
declaration macros in the FreeType source (see the definition of <tt>LOCAL_DEF</tt>
and <tt>LOCAL_FUNC</tt> in <tt>ftconfig.h</tt> for details).
<p>For a concrete example, see the source code in "<tt>base/ftbase.c</tt>"
which generates the whole base layer in a single object file. The same
build process is applied to font drivers, in order to generate one single
object file per given font format (e.g. <tt>truetype.o</tt>, <tt>type1.o</tt>,
etc..).
<p>Compiling the library and drivers in "normal" mode is possible, through
the use of the '<tt>multi</tt>' target (which really means &laquo; multiple
objects &raquo;). For example, calling :
<blockquote><tt>% make -f arch/ansi/Makefile multi</tt></blockquote>
Will build the FreeType library by compiling each source file to an individual
object, then linking them together. You'll notice that the library is significantly
bigger in this case. Creating a shared dll from a 'multi' build is certainly
a very poor idea, as this will export a huge quantity of symbols that aren't
useful to any client application.</blockquote>
<h3>
4. Adding a driver at compile time</h3>
<blockquote>A driver can be included very easily in the build process by
including its <tt>Makefile</tt> in <tt>Makefile.lib</tt>. For example,
the TrueType driver is simply included with the following lines (see <tt>Makefile.lib</tt>):
<blockquote><tt># TrueType driver rules</tt>
<br><tt>#</tt>
<br><tt>include $(DRIVERS_DIR)/truetype/Makefile</tt></blockquote>
<p><br>Where <tt>DRIVERS_DIR</tt> really is "<tt>freetype2/lib/drivers</tt>",
though this can be redefined. You can, of course specify a different path
if you want to place your driver sources in another location.
<p>Note that this only adds the driver's object files to the generated
library file. A few more steps are needed to make your <tt>FT_Library</tt>
objects use the driver. They consist in modifying the file "<tt>base/ftinit.c</tt>",
whose sole purpose is to define the set of driver objects that are to be
created with each new library object.
<br>&nbsp;</blockquote>
<h3>
5. Adding a driver at run time</h3>
<blockquote>New driver objects can be added at run-time through the <tt>FT_Add_Driver</tt>
API. This function takes a handle to an existing library object, as well
as a pointer to a given driver interface. This interface is used to create
a new driver object and register it within the library.
<p>Similarly, a single driver can be removed from a library anytime through
<tt>FT_Remove_Driver</tt>.
This will automatically discard the resources and face objects managed
by the driver.</blockquote>
<h3>
6. Custom library objects :</h3>
<blockquote>Finally, it is possible to build custom library objects. You
need to pass a handle to a valid <tt>FT_System</tt> object to the <tt>FT_Build_Library</tt>
API. The function will return a handle to the new fresh library object.
Note that the library has no registered drivers after the call, developers
have to add them by hand with <tt>FT_Add_Driver</tt>.
<p>It is thus possible to create two distinct library objects with distinct
<tt>FT_System</tt>
implementations in the same session, which can be useful for debugging
purpose.</blockquote>
<br>&nbsp;</blockquote>
</body>
</html>
@@ -1,343 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="Author"
content="David Turner">
<title>FreeType 2 Internals - I/O Frames</title>
</head>
<body text="#000000"
bgcolor="#FFFFFF"
link="#0000EF"
vlink="#51188E"
alink="#FF0000">
<h1 align=center>
FreeType 2.0 I/O Frames
</h1>
<h3 align=center>
&copy; 2000 David Turner
(<a href="mailto:[email protected]">[email protected]</a>)<br>
&copy; 2000 The FreeType Development Team
(<a href="http://www.freetype.org">www.freetype.org</a>)
</h3>
<center>
<table width="70%">
<tr><td>
<hr>
<h2>
Introduction
</h2>
<p>This document explains the concept of I/O <b>frames</b> as used in the
FreeType&nbsp;2 source code. It also enumerates the various functions and
macros that can be used to read them.</p>
<p>It is targeted to FreeType hackers, or more simply to developers who
would like a better understanding of the library's source code.</p>
<hr>
<h2>
I. What frames are
</h2>
<p>Simply speaking, a frame is an array of bytes in a font file that is
`preloaded' into memory in order to be rapidly parsed. Frames are useful
to ensure that every `load' is checked against end-of-file overruns, and
provides nice functions to extract data in a variety of distinct
formats.</p>
<p>But an example is certainly more meaningful than anything else. The
following code</p>
<font color="blue">
<pre>
error = read_short( stream, &str.value1 );
if ( error ) goto ...
error = read_ulong( stream, &str.value2 );
if ( error ) goto ...
error = read_ulong( stream, &str.value3 );
if ( error ) goto ...</pre>
</font>
<p>can easily be replaced with</p>
<font color="blue">
<pre>
error = FT_Access_Frame( stream, 2 + 4 + 4 );
if ( error ) goto ...
str.value1 = FT_Get_Short( stream );
str.value2 = FT_Get_ULong( stream );
str.value3 = FT_Get_ULong( stream );
FT_Forget_Frame( stream );</pre>
</font>
<p>Here, the call to <code>FT_Access_Frame()</code> will</p>
<ul>
<li>
<p>Ensure that there are at least 2+4+4=10 bytes left in the
stream.</p>
</li>
<li>
<p>`Preload' (for disk-based streams) 10&nbsp;bytes from the current
stream position.</p>
</li>
<li>
<p>Set the frame `cursor' to the first byte in the frame.</p>
</li>
</ul>
<p>Each <code>FT_Get_Short()</code> or <code>FT_Get_ULong()</code> call
will read a big-endian integer from the stream (2&nbsp;bytes for
<code>FT_Get_Short()</code>, 4&nbsp;bytes for <code>FT_Get_ULong</code>)
and advance the frame cursor accordingly.</p>
<p><code>FT_Forget_Frame()</code> `releases' the frame from memory.</p>
<p>There are several advantages to using frames:</p>
<ul>
<li>
<p>Single-check when loading tables.</p>
</li>
<li>
<p><em>Making code clearer</em> by providing simple parsing functions
<em>while keeping code safe</em> from file over-runs and invalid
offsets.</p>
</li>
</ul>
<hr>
<h2>
II. Accessing and reading a frame with macros
</h2>
<p>By convention in the FreeType source code, macros are able to use two
implicit variables named <var>error</var> and <var>stream</var>. This is
useful because these two variables are extremely often used in the
library, and doing this only reduces our typing requirements and make the
source code much clearer.</p>
<p>Note that <var>error</var> must be a local variable of type
<code>FT_Error</code>, while <var>stream</var> must be a local variable or
argument of type <code>FT_Stream</code>.</p>
<p>The macro used to access a frame is <font
color="purple"><code><b>ACCESS_Frame(_size_)</b></code></font>, it will
translate to</p>
<font color="blue">
<pre>
( error = FT_Access_Frame( stream, _size_ ) )
!= FT_Err_Ok</pre>
</font>
<p>Similarly, the macro <font
color="purple"><b><code>FORGET_Frame()</code></b></font> translates to</p>
<font color="blue">
<pre>
FT_Forget_Frame( stream )</pre>
</font>
<p>Extracting integers can be performed with the <code>GET_xxx()</code>
macros, like</p>
<table align=center
cellpadding=5>
<tr valign="top">
<th>
Macro name
</th>
<th>
Translation
</th>
<th>
Description
</th>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_Byte()</b></code></font>
</td>
<td>
<font color="blue"><code>FT_Get_Byte(stream)</code></font>
</td>
<td>
<p>Reads an 8-bit unsigned byte.</p>
</td>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_Char()</b></code></font>
</td>
<td>
<font color="blue"><code>(FT_Char)<br>
FT_Get_Byte(stream)</code></font>
</td>
<td>
<p>Reads an 8-bit <em>signed</em> byte.</p>
</td>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_Short()</b></code></font>
</td>
<td>
<font color="blue"><code>FT_Get_Short(stream)</code></font>
</td>
<td>
Reads a 16-bit signed big-endian integer.
</td>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_UShort()</b></code></font>
</td>
<td>
<font color="blue"><code>(FT_UShort)<br>
FT_Get_Short(stream)</code></font>
</td>
<td>
Reads a 16-bit unsigned big-endian integer.
</td>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_Offset()</b></code></font>
</td>
<td>
<font color="blue"><code>FT_Get_Offset(stream)</code></font>
</td>
<td>
Reads a 24-bit signed big-endian integer.
</td>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_UOffset()</b></code></font>
</td>
<td>
<font color="blue"><code>(FT_UOffset)<br>
FT_Get_Offset(stream)</code></font>
</td>
<td>
Reads a 24-bit unsigned big-endian integer.
</td>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_Long()</b></code></font>
</td>
<td>
<font color="blue"><code>FT_Get_Long(stream)</code></font>
</td>
<td>
Reads a 32-bit signed big-endian integer.
</td>
</tr>
<tr valign="top">
<td>
<font color="purple"><code><b>GET_ULong()</b></code></font>
</td>
<td>
<font color="blue"><code>(FT_ULong)<br>
FT_Get_Long(stream)</code></font>
</td>
<td>
Reads a 32-bit unsigned big-endian integer.
</td>
</tr>
</table>
<p>(Note that an <b>Offset</b> is an integer stored with 3&nbsp;bytes on
the file.)</p>
<p>All this means that the following code</p>
<font color="blue">
<pre>
error = FT_Access_Frame( stream, 2 + 4 + 4 );
if ( error ) goto ...
str.value1 = FT_Get_Short( stream );
str.value2 = FT_Get_ULong( stream );
str.value3 = FT_Get_ULong( stream );
FT_Forget_Frame( stream );</pre>
</font>
<p>can be simplified with macros:</p>
<font color="blue">
<pre>
if ( ACCESS_Frame( 2 +4 + 4 ) ) goto ...
str.value1 = GET_Short();
str.value2 = GET_ULong();
str.value3 = GET_ULong();
FORGET_Frame();</pre>
</font>
<p>Which is clearer. Notice that <var>error</var> and <var>stream</var>
must be defined locally though for this code to work!</p>
<hr>
<h2>
III. Alternatives
</h2>
<p>It is sometimes useful to read small integers from a font file without
using a frame. Some functions have been introduced in FreeType&nbsp;2 to
do just that, and they are of the form <font
color="blue"><code>FT_Read_xxxx</code></font>.</p>
<p>For example, <font color="blue"><code>FT_Read_Short(stream,
&error)</code></font> reads and returns a 2-byte big-endian integer from a
<var>stream</var>, and places an error code in the <var>error</var>
variable.</p>
<p>Thus, reading a single big-endian integer is shorter than using a frame
for it.</p>
<p>Note that there are also macros <font
color="purple"><code>READ_xxx()</code></font> which translate to</p>
<font color="blue">
<pre>
FT_Read_xxx( stream, &error ), error != FT_Err_Ok</pre>
</font>
<p>and can be used as in</p>
<font color="blue">
<pre>
if ( READ_UShort( variable1 ) ||
READ_ULong ( variable2 ) )
goto Fail;</pre>
</font>
<p>if <var>error</var> and <var>stream</var> are already defined
locally.</p>
</td></tr>
</table>
</center>
</body>
</html>
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1,258 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="David Turner">
<meta name="GENERATOR" content="Mozilla/4.5 [fr] (Win98; I) [Netscape]">
<title>FreeType 2 Internals</title>
</head>
<body>
<body text="#000000"
bgcolor="#FFFFFF"
link="#0000EF"
vlink="#51188E"
alink="#FF0000">
<center>
<h1>
FreeType 2.0 System Interface</h1></center>
<center>
<h3>
&copy; 2000 David Turner (<a href="fichier :///[email protected]">[email protected]</a>)<br>
&copy; 2000 The FreeType Development Team (<a href="fichier :///[email protected]">[email protected]</a>)</h3></center>
<p><br>
<hr WIDTH="100%">
<br>&nbsp;
<h2>Introduction:</h2>
<ul>
This document explains how the FreeType 2 library performs the low-level and
system-specific operations of memory management and i/o access. It is targetted
to FreeType hackers, porters and "advanced" developers who want special
features like providing their own memory manager or streams.
<p>
Note that the only system-specific part of the library is a file
named "<tt>ftsystem.c</tt>", normally located in the directory
"<tt>freetype2/config/&lt;system&gt;</tt>" where <tt>&lt;system&gt;</tt> designates
your platform (e.g. "<tt>config/ansi/ftsystem.c</tt>" or
"<tt>config/unix/ftsystem.c</tt>").
<p>
</ul>
<p>
<hr>
<p>
<h2>I. Memory Management</h2>
<ul>
Memory allocation and releases are performed through a <tt>FT_Memory</tt> object in
FreeType. A <tt>FT_Memory</tt> is nothing more than a table of functions plus
an arbitrary user data field. It is defined in the file
"<tt>freetype2/include/ftsystem.h</tt>" and has the following structure:
<p>
<ul>
<tt>typedef struct</tt><br>
<tt>{</tt>
<ul>
<table>
<tr><td><tt><b>void* user</b></tt> <td> // a user-defined pointer. This is zero by default
<tr><td><tt><b>void* (*alloc)( FT_System, int)</b></tt> <td> // a function used to allocate a new block
<tr><td><tt><b>void* (*realloc)( FT_System, int, int, void* )</b></tt><td> // a function used to reallocate a given block
<tr><td><tt><b>void (*free)( FT_System, void*)</b></tt> <td> // a function used to release a given block
</table>
</ul>
<tt>} FT_MemoryRec, *FT_Memory;</tt><br>
</ul>
<p>
You'll notice that:<p>
<ul>
<li>The <tt>FT_Memory</tt> type is really a pointer to a <tt>FT_MemoryRec</tt>.
This is a normal convention for the FreeType code.
<li>The <tt>realloc</tt> takes two integer arguments. The first one is the
current block size, the second one its new size.
</ul>
<p>
All current implementations of "<tt>ftsystem.c</tt>" provide a very simple
implementation of the <tt>FT_Memory</tt> interface by calling directly the
standard C <tt>alloc</tt>, <tt>realloc</tt> and <tt>free</tt>.
<p>
The FreeType source code never invokes directly the function pointers. Rather,
it calls <tt>FT_Alloc</tt>, <tt>FT_Realloc</tt> and <tt>FT_Free</tt> functions
which are defined in "<tt>freetype2/src/base/ftobjs.c</tt>". These will not be
discussed here.
<p>
<b>If you want to use your own memory allocator</b> rather than the one provided
by your build of FreeType, follow these simple steps:<p>
<ol>
<li>Create your own <tt>FT_Memory</tt> object, with pointers that map to
your own memory management routines (beware function signatures though).
<p>
<li>Call <tt>FT_Build_Library(memory,&library)</tt>. This will create a new
<tt>FT_Library</tt> object that uses your own <tt>FT_Memory</tt> exclusively.
Note however that this library has no font drivers loaded in !!
<p>
<li>Load the default font drivers into the new library, either by
calling <tt>FT_Default_Drivers(library)</tt>, or by adding them manually
through repeated calls to <tt>FT_Add_Driver(library,&driver_interface)</tt>
<p>
</ol>
This will replace the <tt>FT_Init_FreeType(&library)</tt> call that an application
must do to initialise one library instance.
<p>
Notice that you <em>don't need to recompile FreeType 2 to use your own memory
manager !!</em>.
<p>
</ul>
<p>
<hr>
<p>
<h2>II. Streams</h2>
<ul>
<h3>1. Basic Stream Structure</h3>
<p>
A stream models the array of bytes found in a font file. FreeType 2 separates
streams into two families :<p>
<ul>
<li><b>memory-based streams:</b><br>
when the stream's content is entirely found in memory. This is the
case for ROM font files, or memory-mapped files.
<p>
<li><b>disk-based streams:</b><br>
when the stream isn't directly accessible in memory. This is the
case for local or remote files.
<p>
</ul>
<p>
Note that a stream's nature only determines how FreeType accesses its content, not
the way it is effectively stored. For example, in the case of a compressed font file,
one implementation may choose to uncompress the font in memory, then provide a memory
based stream to access it. Another one might chose a disk based stream to perform
on-the-fly decompression of the font data. Similarly, the font file can be stored
on a local disk, or obtained from a network. This will be completely transparent to
FreeType.
<p>
The stream structure is:
<p>
<ul>
<tt>typedef struct</tt><br>
<tt>{</tt><br>
<ul><table>
<tr><td><tt><b>char* base</b></tt> <td> for memory-based streams, the address
of its first byte.
<tr><td><tt><b>ulong size</b></tt> <td> the stream's size in bytes.
<tr><td><tt><b>ulong pos</b></tt> <td> the current stream position in the file
<tr><td><tt><b>descriptor</b></tt><td> a union field used to hold either an
integer file descriptor or pointer.
This field is not used by FreeType
itself, but is left to implementations
of "<tt>ftsystem</tt>"
<tr><td><tt><b>pathname</b></tt> <td> a union field that can hold either an
integer or pointer. It is not used by
FreeType itself, but is left to
implementations. These can put the
file pathname's during debugging for
example.
<tr><td><tt><b>read</b></tt> <td> a pointer to a function used to seek the
stream and/or read a run of bytes from it.
<tr><td><tt><b>close</b></tt><td> a pointer to a function called when the
stream is closed.
<tr><td><tt><b>memory</b></tt> <td> a <tt>FT_Memory</tt> object, which is used
to allocate frames for disk-based streams.
This field is set and used by FreeType.
<tr><td><tt><b>cursor</b></tt> <td> a pointer in memory used when accessing
frames. This is set and used by FreeType.
<tr><td><tt><b>limit</b></tt> <td> a pointer in memory used when accessing
frames. This is set and used by FreeType.
</table></ul>
<tt>} FT_StreamRec, *FT_Stream</tt>
</ul>
<p>
The following important things must be noticed here:<p>
<ul>
<li>The <tt>FT_Stream</tt> type is really a pointer to a <tt>FT_StreamRec</tt>.
This is a normal convention for the FreeType source.
<p>
<li>When the <tt>read</tt> field is non NULL, the stream is considered to be
disk-based. Otherwise, the stream is memory-based, and the <tt>base</tt>
field <em>must</em> be set by "<tt>ftsystem.c</tt>" when the stream is
created.
<p>
<li>The <tt>base</tt> field must be set to 0 when a disk-based stream is created.
However, this field will later be set and used by the FreeType library when
accessing frames of bytes within the font file (of course, this doesn't
happen with memory-based streams).
</ul>
<h3>2. Stream lifecyles</h3>
<p>
Each <tt>FT_Face</tt> needs its own stream to access font data. The most common
way to create a new <tt>FT_Stream</tt> object is to call the function
<tt>FT_New_Face</tt>. This function takes a <em>file pathname</em> argument that
is used to create a new stream object.
<p>
This is possible because each implementation of "<tt>ftsystem.c</tt>" provides
a function called <tt>FT_New_Stream</tt> which takes a file pathname and a
<tt>FT_Stream</tt> pointer as an argument. The function simply opens the file
and initialises the stream structure accordingly. It is called by <tt>FT_New_Face</tt>
to create the face's stream object.
<p>
A stream is only closed when the face is destroyed through <tt>FT_Done_Face</tt>.
Its <tt>close</tt> field function will then be called. Note that the function should
<em>never</em> destroy the <tt>FT_Stream</tt>.
<p>
<h3>3. Using your own streams</h3>
<p>
There are cases where it is interesting to provide your own stream to create
a new face object, rather than rely on the default implementation. For example,
a filepathname, which is a C string, might not be useful on a system where files
are named with a UTF-16 string or via an i-node number of memory address (for ROM files).
<p>
For this purpose, the <tt>FT_Open_Face</tt> is defined. It simply takes a
<tt>FT_Stream</tt> pointer as its second argument, instead of a file pathname (the
stream must be allocated and initialised by you, so be careful).
<p>
Actually, the only thing that <tt>FT_New_Face</tt> does is create a new stream
through <tt>FT_New_Stream</tt>, then call <tt>FT_Open_Face</tt> to create the
face with it.
<p>
Note also that you can use the function <tt>FT_New_Memory_Face</tt> to create
a new font face for a memory-based font file, whose address and size can be passed
as arguments. The function automatically creates the corresponding memory-based
stream and use it to create the face.
<p>
</ul>
<p>
<hr>
<p>
<h2>III. Thread synchronisation</h2>
<ul>
The FreeType library uses no static data. It can be used concurrently by two
thread as long as each one uses its own <tt>FT_Library</tt> instance. Otherwise,
one can very simply synchronize access to a single library instance by using a
mutex to protect each call to one of FreeType's API functions.
<p>
</ul>
@@ -1,516 +0,0 @@
#!/usr/bin/env python
#
# DocMaker is a very simple program used to generate HTML documentation
# from the source files of the FreeType packages.
#
import fileinput, sys, string
# This function is used to parse a source file, and extract comment blocks
# from it. The following comment block formats are recognized :
#
# /**************************
# *
# * FORMAT1
# *
# *
# *
# *
# *************************/
#
# /**************************/
# /* */
# /* FORMAT2 */
# /* */
# /* */
# /* */
# /* */
#
# /**************************/
# /* */
# /* FORMAT3 */
# /* */
# /* */
# /* */
# /* */
# /**************************/
#
# Each block is modeled as a simple list of text strings
# The function returns a list of blocks, i.e. a list of strings lists
#
def make_block_list():
"""parse a file and extract comments blocks from it"""
list = []
block = []
format = 0
for line in fileinput.input():
line = string.strip(line)
l = len(line)
if format == 0:
if l > 3 and line[0:3] == '/**':
i = 3
while (i < l) and (line[i] == '*'):
i = i+1
if i == l:
# this is '/**' followed by any number of '*', the
# beginning of a Format 1 block
#
block = [];
format = 1;
elif (i == l-1) and (line[i] == '/'):
# this is '/**' followed by any number of '*', followed
# by a '/', i.e. the beginning of a Format 2 or 3 block
#
block = [];
format = 2;
##############################################################
#
# FORMAT 1
#
elif format == 1:
# if the line doesn't begin with a "*", something went
# wrong, and we must exit, and forget the current block..
if (l == 0) or (line[0] != '*'):
block = []
format = 0
# otherwise, we test for an end of block, which is an
# arbitrary number of '*', followed by '/'
else:
i = 1
while (i < l) and (line[i] == '*'):
i = i+1
# test for the end of the block
if (i < l) and (line[i] == '/'):
if block != []: list.append( block )
format = 0
block = []
else:
block.append( line[1:] )
##############################################################
#
# FORMAT 2
#
elif format == 2:
# if the line doesn't begin with '/*' and end with '*/',
# this is the end of the format 2 format..
if (l < 4 ) or (line[:2] != '/*') or (line[-2:] != '*/'):
if block != []: list.append(block)
block = []
format = 0
continue
# remove the start and end comment delimiters, then right-strip
# the line
line = string.rstrip(line[2:-2])
# check for end of a format2 block, i.e. a run of '*'
if string.count(line,'*') == l-4:
if block != []: list.append(block)
block = []
format = 0
else:
# otherwise, add the line to the current block
block.append(line)
return list
# This function is only used for debugging
#
def dump_block_list( list ):
"""dump a comment block list"""
for block in list:
print "----------------------------------------"
for line in block:
print line
print "---------the end-----------------------"
######################################################################################
#
#
# The DocParagraph is used to store either simple text paragraph or
# source code lines
#
#
# If the paragraph contains source code (use code=1 when initializing the
# object), self.lines is a list of source code strings
#
# Otherwise, self.lines is simply a list of words for the paragraph
#
class DocParagraph:
def __init__(self,code=0,margin=0):
self.lines = []
self.code = code
self.margin = margin
def add(self,line):
if self.code==0:
# get rid of unwanted spaces in the paragraph
self.lines.extend( string.split(line) )
else:
# remove margin whitespace
if string.strip( line[:self.margin] ) == "": line = line[self.margin:]
self.lines.append(line)
def dump(self):
max_width = 50
if self.code == 0:
cursor = 0
line = ""
for word in self.lines:
if cursor+len(word)+1 > max_width:
print line
cursor = 0
line = ""
line = line + word + " "
cursor = cursor + len(word) + 1
if cursor > 0:
print line
else:
for line in self.lines:
print "--" + line
print ""
######################################################################################
#
#
# The DocContent class is used to store the content of a given marker
# Each DocContent can have its own text, plus a list of fields. Each field
# has its own text too
#
# Hence, the following lines :
#
# """
# Some arbitraty text:
#
# fieldone :: some arbitraty text for this field,
# note that the text stretches to several lines
#
# fieldtwo :: some other text
#
# """
#
# will be stored as (each text is a list of string:
#
# self.fields = [ "", "fieldone", "fieldtwo" ]
# self.texts = [
# [ "some arbitraty text for this field," ,
# "note that the text stretches to several lines" ],
#
# [ "some other text" ]
# ]
#
#
class DocContent:
def __init__(self, paragraph_lines=[]):
self.fields = []
self.texts = []
code_mode = 0
code_margin = 0
field = ""
text = []
paragraph = None
for aline in paragraph_lines:
if code_mode == 0:
line = string.lstrip(aline)
l = len(line)
margin = len(aline) - l
# if the line is empty, this is the end of the current
# paragraph
if line == "":
if paragraph:
text.append(paragraph)
paragraph = None
continue
# test for the beginning of a code block, i.e.'{' is the first
# and only character on the line..
#
if line == '{':
code_mode = 1
code_margin = margin
if paragraph:
text.append(paragraph)
paragraph = DocParagraph( 1, margin )
continue
words = string.split(line)
# test for a field delimiter on the start of the line, i.e.
# the oken `::'
#
if len(words) >= 2 and words[1] == "::":
if paragraph:
text.append(paragraph)
paragraph = None
self.fields.append(field)
self.texts.append(text)
field = words[0]
text = []
words = words[2:]
if len(words) > 0:
line = string.join(words)
if not paragraph:
paragraph = DocParagraph()
paragraph.add( line )
else:
line = aline
# the code block ends with a line that has a single '}' on it
if line == " "*code_margin+'}':
text.append(paragraph)
paragraph = None
code_mode = 0
code_margin = 0
# otherwise, add the line to the current paragraph
else:
paragraph.add(line)
if paragraph:
text.append(paragraph)
self.fields.append( field )
self.texts.append( text )
def dump(self):
for i in range(len(self.fields)):
field = self.fields[i]
if field: print "<field "+field+">"
for paras in self.texts[i]:
paras.dump()
if field: print "</field> "
def dump_html(self):
n = len(self.fields)
for i in range(n):
field = self.fields[i]
if field==[]:
print "<p>"
for paras in self.texts[i]:
print "<p>"
paras.dump()
print "</p>"
else:
if i==1:
print "<table cellpadding=4><tr valign=top><td>"
else:
print "</td></tr><tr valign=top><td>"
print "<b>"+field+"</b></td><td>"
for paras in self.texts[i]:
print "<p>"
paras.dump()
print "</p>"
print "</td></tr>"
if n > 1:
print "</table>"
######################################################################################
#
#
# The DocBlock class is used to store a given comment block. It contains
# a list of markers, as well as a list of contents for each marker.
#
#
class DocBlock:
def __init__(self, block_line_list=[]):
self.markers = []
self.contents = []
marker = ""
content = []
alphanum = string.letters + string.digits + "_"
for line in block_line_list:
line2 = string.lstrip(line)
l = len(line2)
margin = len(line) - l
if l > 3 and line2[0] == '<':
i = 1
while i < l and line2[i] in alphanum: i = i+1
if i < l and line2[i] == '>':
if marker or content:
self.add( marker, content )
marker = line2[1:i]
content = []
line2 = string.lstrip(line2[i+1:])
l = len(line2)
line = " "*margin + line2
content.append(line)
if marker or content:
self.add( marker, content )
def add( self, marker, lines ):
# remove the first and last empty lines from the content list
l = len(lines)
if l > 0:
i = 0
while l > 0 and string.strip(lines[l-1]) == "": l = l-1
while i < l and string.strip(lines[i]) == "": i = i+1
lines = lines[i:l]
l = len(lines)
# add a new marker only if its marker and its content list aren't empty
if l > 0 and marker:
self.markers.append(marker)
self.contents.append(lines)
def dump( self ):
for i in range( len(self.markers) ):
print "["+self.markers[i]+"]"
for line in self.contents[i]:
print "-- "+line
def doc_contents(self):
contents = []
for item in self.contents:
contents.append( DocContent(item) )
return contents
def dump_doc_blocks( block_list ):
for block in block_list:
docblock = DocBlock(block)
docblock.dump()
print "<<------------------->>"
#
#
#
def dump_single_content( block_list ):
block = block_list[0]
docblock = DocBlock(block)
print "<block>"
for i in range(len(docblock.markers)):
marker = docblock.markers[i]
contents = docblock.contents[i]
print "<marker "+marker+">"
doccontent = DocContent( contents )
doccontent.dump()
print "</marker>"
print "</block>"
def dump_doc_contents( block_list ):
for block in block_list:
docblock = DocBlock(block)
print "<block>"
for i in range(len(docblock.markers)):
print "<marker "+docblock.markers[i]+">"
content = DocContent( docblock.contents[i] )
content.dump()
print "</marker>"
print "</block>"
def dump_html_1( block_list ):
print "<html><body>"
types = [ 'Type', 'Struct', 'FuncType', 'Function', 'Constant', 'Enumeration' ]
for block in block_list:
docblock = DocBlock(block)
print "<hr>"
for i in range(len(docblock.markers)):
marker = docblock.markers[i]
content = docblock.contents[i]
dcontent = DocContent( content )
if marker=="Description":
print "<ul><p>"
dcontent.dump()
print "</p></ul>"
elif marker in types:
print "<h3><font color=blue>"+content[0]+"</font></h3>"
else:
print "<h4>"+marker+"</h4>"
print "<ul><p>"
dcontent.dump_html()
print "</p></ul>"
print ""
print "<hr></body></html>"
def main(argv):
"""main program loop"""
print "extracting comment blocks from sources .."
list = make_block_list()
# dump_block_list( list )
# dump_doc_blocks( list )
# print "dumping block contents .."
# dump_doc_contents(list)
dump_html_1(list)
# dump_single_content(list)
# If called from the command line
if __name__=='__main__': main(sys.argv)
@@ -1,352 +0,0 @@
<html>
<head>
<title>FreeType 2 Introduction</title>
<basefont face="Georgia, Arial, Helvetica, Geneva">
<style content="text/css">
P { text-align=justify }
H1 { text-align=center }
H2 { text-align=center }
LI { text-align=justify }
</style>
</head>
<body text="#000000"
bgcolor="#FFFFFF"
link="#0000EF"
vlink="#51188E"
alink="#FF0000">
<font size=1>http://www.freetype.org</font><p>
<center>
<a href="freetype.html">
<img src="image/freetype.jpg" width=550 height=105 alt="The FreeType Project" border=0></a>
<h1>An Introduction to FreeType 2</h1>
</center>
<center><table width=750 cellspacing=10 cellpadding=30><tr><td>
<hr><p>
DOCUMENT INDEX:<br>
<ul>
<li><a href="#what">What is FreeType 2 ?</a>
<li><a href="#features">Features</a>
<li><a href="#requirements">Requirements</a>
<li><a href="#patents">Patents issues</a>
</ul><p>
<hr><p>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="what">What is FreeType 2 ?</h2>
</td></tr><tr><td>
<p>The FreeType project is a team of volunteers who develop free, portable
and high-quality software solutions for digital typography. We specifically
target embedded systems and focus on bringing small, efficient and
ubiquitous products.</p>
<p>the FreeType 2 library is our new software font engine. It has been
designed to provide the following important features:</p>
<ul>
<li><p>
<b>A universal and simple API to manage font files:</b><br>
<ul>
<p>The FreeType 2 API is simple and easy to use. It supports both
bitmapped and scalable fonts and is well-suited to manage font
files of all formats. Unlike other font libraries, FreeType 2
returns and manages outline font data (images & metrics).</p>
</ul>
</p></li>
<li><p>
<b>Support for several font formats through loadable modules:</b><br>
<ul>
<p>FreeType 2 uses <em>"font drivers"</em>. Each driver is a loadable
module used to support one specific font format. Each driver can also
provide specific extensions used to access format-specific features of
the font.</p>
</ul>
</p></li>
<li><p>
<b>High-quality anti-aliasing:</b><br>
<ul>
<p>FreeType 2 produces etremely smooth outlines at small sizes, with its new
anti-aliasing renderer, which produces bitmaps with 256-levels of gray.
It uses a new algorithm that has been specifically designed to render
small complex shapes (like glyphs) at high speed. Indeed, it's even
faster than the monochrome renderer for small character sizes (under
20 pixels) !!
</p>
</ul>
<li><b>High portability & performance:</b><br>
<ul>
<p>The FreeType 2 source code is written in ANSI C and runs on any
platform with a compliant compiler. Client applications can
provide their own memory manager or input stream to the library
(which means that font files can come from any place: disk,
memory, compressed file, network, etc..).
</p>
</ul>
</ul>
<p>Note that <em>the beta of FreeType 2 is available <b>now</b></em>. For more
info, check our <a href="download.html">Download page</a> or see the source
and its diffs through our <a href="cgi-bin/cvsweb.cgi">CVS Web interface</a>.
</p>
</ul>
</td></tr></table>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="features">Features</h2>
</td></tr><tr><td>
<h3>Supported font formats</h3>
<p>FreeType 2 readily supports the following font formats:</p>
<ul>
<li>TrueType files (.ttf) and collections (.ttc)</li>
<li>Type 1 font files both in ASCII (.pfa) or binary (.pfb) format</li>
<li>Type 1 Multiple Master fonts. The FreeType 2 API also provides
routines to manage design instances easily</li>
<li>Type 1 CID-keyed fonts</li>
<li>OpenType/CFF (.otf) fonts</li>
<li>CFF/Type 2 fonts</li>
<li>Adobe CEF fonts (.cef), used to embed fonts in SVG documents
with the Adobe SVG viewer plugin.</li>
<li>Windows FNT/FON bitmap fonts</li>
</ul>
<p>Note that Apple's TrueType GX fonts are supported as normal TTFs,
(the advanced tables are ignored).</p>
<p>Besides, it's possible to add support for new font formats by providing
a specific <em>font driver</em> module. Modules can be added either at
build time (when recompiling the library), or at <em>run-time</em>;
this allows, for example, applications to register their own
font driver to support program-specific formats.</p>
<h3>Patent-free automatic hinter</h3>
<p>TrueType fonts are normally renderered (hinted) with the help of a
specific bytecode where the behaviour of a few opcodes is patented by
Apple. We're currently in contact with Apple to discuss the importance
of such patents and their use in open source projects like FreeType.
</p>
<p>In the meantime, we have developped our own alternative technology that
is capable of automatically hinting scalable glyph images. It is
now part of the FreeType 2 source tree as the "autohint" module,
and is used to hint glyphs when the bytecode interpreter is disabled
(through a configuration macro when building the engine). Note that
the auto-hinter is also used to handle glyphs in other formats like
CFF and Type 1.</p>
<p>The auto-hinter provides pretty good results (in some cases, it even
significantly improves the output of poorly hinted fonts) but we'll
continue to improve it with each new release of FreeType to achieve
the highest possible quality.</p>
<h3>Modular design:</h3>
<p>The design of FreeType 2 is extremely modular as most features are
supported through optional modules. This means it's easily possible to
only compile the features you need. As each module is between
10 and 20 Kb in size, it's possible to build a bare-bones
font engine that supports anti-aliasing in about 30 Kb !!</p>
<p>Configuration is performed by modifications of only two header
files (one to select global features, another one to select modules)
and don't need tweaking of source code. Note that it is however
possible to provide your own implementation of certain components.</p>
<p>For example, when building on Unix, the engine will automatically
use memory-mapped files when available on the target platform,
thus significantly increasing font file i/o.</p>
<p>Due to its very flexible design, it is possible to add, remove and
upgrade modules at run-time.</p>
<h3>Advanced glyph management</h3>
<p>The API comes with a standard extension used to extract individual
glyph images from font files. These images can be bitmaps, scalable
bezier outlines or even anything else. (e.g. bi-color or metafont
glyphs, as long as they're supported by a module).</p>
<p>Each scalable glyph image can be transformed, measured and
rendered into a monochrome or anti-aliased bitmaps easily
through a uniform interface.
This allows client applications to easily cache glyphs or
perform text rendering effects with minimal difficulty
(look at the FreeType 2 Tutorial to see how to render
rotated text with very few lines of code).
</p>
<h3>Advanced font access</h3>
<p>The FreeType 2 API is useful to retrieve advanced information from
various fonts:</p>
<ul>
<li>vertical metrics are available whenever found in the font file</li>
<li>kerning distances are available when found in the font file. It
is also possible to "attach" a given additional file to a given
font face. This is useful to load kerning distances from an
.afm file into a Type 1 face for example.</li>
<li>provides ASCII glyph names whenever available in the font
(TrueType, OpenType, Type1, etc..)</li>
<li>provides access to important tables for SFNT-based font formats
(i.e. TrueType, OpenType, CEF, etc..), like the name table,
font header, maximum profile, etc...</li>
<li>automatic synthesis of Unicode-based character maps for
those fonts or formats that do not provide one. This is
extremely useful with Type 1 fonts which are normally
limited to a stupid 256-characters encoding.</li>
</ul>
<h3>Simple & clean API</h3>
<p>The FreeType 2 high-level API is simple and straightforward, as it
has been specifically designed to make the most commmon font operations
easy</p>
<p>As a comparison, the number of function calls needed to perform a
the tasks of font face creation/opening and glyph loading/rendering
has been reduced by a factor of 4 !!</p>
<p>The API is also independent of any font-format specific issue, though
it provides standard extensions to access format-specific tables and
information. More extensions can also be easily added through new
modules</p>
<h3>Robust & Portable code</h3>
<p>Because it is written in industry-standard ANSI C, FreeType 2 compiles
on all platforms with a compliant compiler. Because the default build
only relies on the C library, it is free of any system-specific
dependencies, even if it is possible to "enhance" certain components
by providing a specific implementation.</p>
<p>The code doesn't use global or static variables. Client applications
can provide their own memory manager. Font files can be read from
a disk file, memory, or through a client-provided input stream. This
allows to support compressed font files, remote fonts, fonts embedded
in other streams (e.g. Type42 fonts), etc..</p>
<p>An advanced i/o sub-system is used to optimise file access, as well
as reduce memory usage of the library when the file is memory-based
( ROM, RAM, memory-mapped ).</p>
<h3>Open Source & Vendor Independence</h3>
<p>Finally, FreeType 2 is released under its own BSD-like open source
license, one of the less restricting licenses available, and this
means that:</p>
<ul>
<li><p>
It can be included in all kinds of products, be they proprietary
or not.
</p></li>
<li><p>
As any module can be added or replaced anytime, any third party
vendor has the ability to provide its own set of modules (under
its own license) in order to support proprietary font formats or
more advanced features (e.g. a new auto-hinter, or a new
anti-aliasing renderer for LCDs or TV screens).
</p></li>
</ul>
<p>One could even imagine an application using the FreeType 2 API with
a "wrapper" module used to access system-specific fonts (like through
the Windows GDI). This would mean native font support with more portable
application code (as simply changing the wrapper module would be required
to port the application to another system).</p>
</td></tr></table>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="requirements">Requirements</h2>
</td></tr><tr><td>
<p>FreeType 2 is written in ANSI&nbsp;C and should compile with no problems
on a great variety of platforms. We have taken care of removing all
compilation warnings from major compliant compilers. Detailed compilation
instructions are provided in the software archive.</p>
<p>This version of the library has been succesfully compiled and run
under the following systems: Dos, OS/2, Windows, Macintosh, Unix
(including the 64-bits DEC Unix, a.k.a. "True64"). You should not
encounter major problems compiling it on any other kind of platform.
In all cases, contact us if you do.</p>
<p>Note that a small set of demonstration programs is also separately
available. They include a tiny graphics sub-system that is used to
display and show-off the library's capabilities on the following
platforms: X11, MacOS, OS/2 & Windows.</p>
<p>Please visit our <a href="http://www.freetype.org/download.html">
Download section</a> to access the software archives.</p>
</ul>
</td></tr></table>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="patents">Patents issues</h2>
</td></tr><tr><td>
<p>The FreeType 2 source code includes a TrueType bytecode interpreter that
is covered by the Apple patents. However, this piece of code is never
compiled by default in this release (unlike in previous betas) making
a default build of the library <em>entirely patent-free !!</em></p>
<p>Note that in order to compile the interpreter, one needs to define
the configuration macro <tt><b>TT_CONFIG_OPTION_BYTECODE_INTERPRETER</b></tt> configuration
macro in the file "<tt>ftoption.h</tt>". More details are available in
the software archive. Note that the use of the interpreter is normally
protected by US, UK and French patents. In the event you'd absolutely
need it, you may have to <a href="mailto:[email protected]">contact
Apple legal department</a> for licensing conditions, depending on your
location and the places you distribute/sell your products.</p>
<p>Please do not ask us any detailed information regarding licensing, as
we're still discussing with Apple this issue, we're unable to inform
the public of what's currently going on..</p>
</td></tr></table>
<hr>
<p>
<a href="index.html">Back to FreeType homepage</a><p>
</td></tr></table>
</body>
</html>
@@ -1,502 +0,0 @@
<html>
<head>
<title>FreeType 2 FAQ</title>
<basefont face="Georgia, Arial, Helvetica, Geneva">
<style content="text/css">
P { text-align=justify }
H1 { text-align=center }
H2 { text-align=center }
LI { text-align=justify }
</style>
</head>
<body text="#000000"
bgcolor="#FFFFFF"
link="#0000EF"
vlink="#51188E"
alink="#FF0000">
<font size=1>http://www.freetype.org</font><p>
<center>
<a href="freetype.html">
<img src="image/freetype.jpg" width=550 height=105 alt="The FreeType Project" border=0></a>
<h1>The FreeType 2 FAQ</h1>
</center>
<center><table width=750 cellspacing=10 cellpadding=30><tr><td>
<hr><p>
DOCUMENT INDEX:<br>
<ul>
<li><p><a href="#general">General</a>
<ul>
<li><a href="#general-dead">I thought the FreeType project was dead. It this true?</a></li>
<li><a href="#general-long">Why did it take so long to release FreeType 2?</a></li>
<li><a href="#general-unix">Is FreeType 2 a Unix-only project?</a></li>
<li><a href="#general-x11">When will X11 support anti-aliased glyphs?</a></li>
<li><a href="#general-ft1">Is FreeType 2 backwards compatible with 1.x?</a></li>
<li><a href="#general-edit">Can I use FreeType 2 to edit fonts or create new ones?</a></li>
</ul></p>
</li>
<li><p><a href="#builds">Compilation & Configuration</a>
<ul>
<li><a href="#builds-compile">How do I compile the FreeType 2 library?</a></li>
<li><a href="#builds-config">How do I configure my library build?</a></li>
<li><a href="#builds-modules">How do I select the modules I need?</a></li>
<li><a href="#builds-flat">How do I compile all FreeType 2 files in a single directory?</a></li>
</ul>
</p></li>
<li><p><a href="#library">Using the FreeType 2 library</a></p></li>
<li><p><a href="#autohint">The FreeType 2 Autohinter</a>
<ul>
<li><a href="#autohint-license">Under which license is the auto-hinter released ?</a></li>
<li><a href="#autohint-work">How does auto-hinting work in FreeType 2 ?</a></li>
<li><a href="#autohint-cjk">Why doesn't the auto-hinter work well with CJK fonts ?</a></li>
</ul>
</p></li>
<li><p><a href="#other">Other questions</a>
<ul>
<li><a href="#other-antialias">What is the anti-aliasing algorithm used in the FreeType 2 renderer?</a></li>
<li><a href="#other-opentype">When will FreeType 2 support OpenType ?</a></li>
</ul></p>
</li>
</ul><p>
<hr><p>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="general">General questions & answers</h2>
</td></tr><tr><td>
<a name="general-dead">
<h3>I.1. I though the FreeType project was dead. Is this true?</h3>
<ul>
<p>Well, not exactly :-) It's true that the TrueType patents issues
have been less than a graceful event to handle but it didn't not
really killed the project per se, as Apple hasn't made an official
statement yet regarding the use of the patented "technology" in
open source projects (or other products).</p>
<p>We have thus continued updating FreeType 1.x, and started developping
FreeType 2 with the idea of providing this time a completely patent
free font engine. However, we largely preferred not to broadly
communicate about it until we've got a satisfying implementation
to show.</p>
</ul>
<a name="general-long">
<h3>I.2. Why did it take so long to release FreeType 2?</h3>
<ul>
<p>Several factors come to mind. The first one is that FreeType 2 is
a much more complex and dense project that was mostly developed
on non-working hours. And surely some important changes in the
life (like marriage, new jobs and kids) of some the FreeType
developers cannot be ignored :-)</p>
<p>A second one is that a first version of the library was designed
one year ago (and already worked with a multitude of font drivers),
though with a design that was judged by its authors as well as
beta testers as not enough flexible or consistent. In short, it worked
well but we were not exactly proud of it (call us perfectionists).
It has then be significantly reworked to become what we're now
distributing as FreeType 2</p>
<p>Finally, it would have been hard to distribute such a library without
an alternative technology to replace the patented bytecode interpreter.
This involved significant research work that could only be performed
correctly full-time, and we had to found a company to fund such a
development and still make it available under a BSD-like license.
Huge thanks to <a href="http://www.catharon.com">Catharon Productions, Inc.</a>
for their commitment to this project.</p>
<p>And of course, we added support for more font files, and we'll
continue to as long as the specs are available and that we find an
interest in it. For example, FreeType 2 is to date the only
software library available on the market that supports the new
Adobe "CEF" font format.</p>
</ul>
<a name="general-unix">
<h3>I.3. Is FreeType 2 a Unix-only project?</h3>
<ul>
<p>Absolutely not, even though many people still seem to think so :-)
FreeType 2, just like version 1.x, can be compiled on any platform with
an ANSI compiler. Some beta versions of the library are even heavily
used in brand new OSes (see the <a href="http://www.atheos.cx">AtheOS
</a> screenshots for examples).</p>
<p>The library is itself mainly developped on several platforms
(Windows & Linux, though a great deal has also been achieved on OS/2)
and the code is highly generic and modular to adapt even the most
strict environments like low-memory embedded systems.</p>
</ul>
<a name="general-x11">
<h3>I.4. When will X11/XFree support anti-aliased text?</h3>
<ul>
<p>This question isn't exactly related to FreeType as we have no direct
connection to the XFree people, but we've been asked so frequently
about it that it deserves a prominent place in this FAQ :-)</p>
<p>FreeType has been capable of anti-aliasing since version 1.0. The
reason why XFree doesn't support it is directly related to the
limitations of the design and specification of X11. More specifically:</p>
<ul>
<li><p>
X11 assumes that all glyph images are monochrome bitmaps,
hence the X font library and server are unable to send anything
else to the X server.
</p></li>
<li><p>
Even if the X font library/server was able to generate anti-aliased
bitmaps (and this has been already done through extensions), the X
rendering model doesn't allow translucent composition of "gray" pixmaps
onto an arbitrary drawable.
</p></li>
</ul>
<p>As both the font and rendering models of X11 are limited, it's basically
impossible to draw anti-aliased glyphs without performing <em>huge</em>
hacks within the server.</p>
<p>Note that Keith Packard, from XFree fame, has recently started working
on a new rendering model for X11 in order to support new features
(mainly transparency and anti-aliased fonts). This will be provided
through protocol extensions. The question of knowing wether legacy X
applications will be able to display anti-aliased text is still very
uncertain.
</p>
</ul>
<a name="general-ft1">
<h3>I.5. Is FreeType 2 backwards compatible with FreeType 1.x?</h3>
<ul>
<p>Not directly, though we had the project to provide an optional binary
compatibility layer on top of it in order to easily re-link applications
with the new version. However, this idea has been dropped as it is
possible to install and use the two versions independtly on any
system (read: no namespace conflicts).</p>
<p>The FreeType 2 API is a lot simpler than the one in 1.x while being
much more powerful. We thus encourage you to adapt your source code
to it as this should not involve much work.</p>
</ul>
<a name="general-edit">
<h3>I.6. Can I use FreeType 2 to edit fonts or create new ones?</h3>
<ul>
<p>The answer is a definitive NO, because the library was specifically
designed to <em>read</em> font files with small code size and very
low memory usage.</p>
<p>We thus do not plan to support editing or creation in the font
engine in any way, as this would imply a complete rewrite. This
doesn't mean that we won't introduce a font editing/creation library
in the future, as this really depends on how many people are asking
for it (or how much they would be willing to pay for it), as well as
the time of the FreeType developers.</p>
<p>Do not expect anything in this direction until we officially announce
something though. There are other axis of development for this project
(like text-layout capabilities, glyph caching, etc..) that may be more
important to us at the moment..</p>
</ul>
</td></tr></table>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="builds">Compilation & Configuration</h2>
</td></tr><tr><td>
<a name="builds-compile">
<h3>II.1. How do I compile the FreeType 2 library?</h3>
<ul>
<p>The library can be compiled in various ways, and a detailed documentation
is available in the file "<tt>freetype2/docs/BUILD</tt>". However, we'll
summarize the process to a few cases:</p>
<h3>a. by using the command-line 2 build system</h3>
<p>The engine comes with a sophisticated build system that is used
to configure and compile a build of the library. You'll need
<em>GNU Make</em> installed on your platform (NOTE: It will <b>not</b>
work with other Make tools).</p>
<p>Basically, you'll need to invoke <tt>make</tt> a first time in the
top-level FreeType 2 directory in order to setup the build. This will
detect your current platform and choose a configuration sub-makefile to
drive the build. A specific compiler can be selected on some platforms
by providing an additional target. For example, on Win32:</p>
<ul>
<li><b><tt>make visualc</tt></b> will select the Visual C++ compiler</li>
<li><b><tt>make lcc</tt></b> will select the Win32-lcc compiler</li>
</ul>
<p>Note that on Unix, the first time make is called, a configure script
located in "<tt>freetype2/builds/unix</tt>" will be run in order to
automatically detect the platform & compiler.</p>
<p>A summary will be displayed showing the detected platform and compiler
selected. You'll then be able to start the build by invoking <tt>make</tt>
a second time. In case of problem, consult the <tt>BUILD</tt> document.</p>
<h3>b. by direct compilation</h3>
<p>You can also directly compile the library from the command line by
using these simple rules:</p>
<ul>
<li><p>
You should place the directories "<tt>freetype2/include</tt>" and
"<tt>freetype2/src</tt>" in your include path in order to compile
any component of the library. You can also add the system-specific
build directory (i.e. "<tt>builds/<em>system</em>/</tt>") in the
case where an alternate implementation of some of the components
is available there (e.g. the memory-mapped i/o implementation
on some Unix systems).
</p></li>
<li><p>
The components of the library are located in sub-directories of
"<tt>src</tt>", for example: "<tt>src/base</tt>",
"<tt>src/truetype</tt>", etc..
</p></li>
<li><p>
Each component is normally compiled through a single C file that
"wraps" other sources in the component's directory. For example,
your should compile the TrueType font driver by compiling the
file "<tt>src/truetype/truetype.c</tt>". The list of C files to
compile for a feature-complete build of the library is given in
the <tt>BUILD</tt> document.
</p></li>
</ul>
<h3>c. in a graphical IDE</h3>
<ul>
<p>Well, the process is vastly similar to the one described in b.,
except that you need to set the include paths, source code paths,
etc.. in dialog boxes before running the compilation.
</p>
</ul>
</ul>
<a name="builds-config">
<h3>II.2. How do I configure my build of the library?</h3>
<ul>
<p>Each build of the library is configured through two header files
located in "<tt>include/freetype/config</tt>":</p>
<ul>
<li><p><b><tt>ftoption.h</tt></b><br>
This file contains various configuration macros whose definition
can be toggled on a per-build basis. Each macro is heavily
commented in this file's comment, and we invite you to refer
to it directly.</p></li>
<li><p><b><tt>ftmodule.h</tt></b><br>
This file contains the list of all the modules that are initially
registered (added) when the function <b><tt>FT_Init_FreeType</tt></b>
is called. See the next answer to know how to change it and
why it may be important.</p></li>
</ul>
<p>Alternatively, some specific implementations of some FT2 components
can be provided in a "<tt>builds/<em>system</em>/</tt>" directory
(e.g. the Unix-specific <tt>ftsystem.c</tt> that uses memory-mapped
file for i/o).</p>
</ul>
<a name="builds-modules">
<h3>II.3. How do I select the modules I need in my build?</h3>
<ul>
<p>The function <tt><b>FT_Init_FreeType</b></tt> creates a new instance
of the FT2 library and registers a set of "default" modules before
returning to the calling application. Its default implementation
is in the file "<tt>src/base/ftinit.c</tt>".</p>
<p>The list of default modules used by <tt>ftinit.c</tt> is located in
the configuration file "<tt>include/freetype/config/ftmodule.h</tt>".
It is normally automatically generated by the build system by
invoking the "<tt><b>make modules</b></tt>" command in the top
level FT2 directory (note: only works with GNU Make, you can
edit the file by hand otherwise). It does so by parsing all
sub-directories of "<tt>src</tt>" that contain a file named
<tt>module.mk</tt>.</p>
<p>Note that a specific port or project is free to provide its own
implementation of <tt>ftinit.c</tt> in order to ensure a different
initialisation sequence. For example, one could do something like:</p>
<ul>
<li><p>compile each module as a shared library (DLL or .so) with
a common "entry point" to retrieve a pointer to its
module class (there is already some code that allows this
when compiling each module).</p></li>
<li><p>place these modules in a directory like
"<tt>/usr/lib/freetype2/modules/</tt>"</p></li>
<li><p>provide an implementation of <tt>ftinit.c</tt> that would
scan the directory for valid modules.</p></li>
</ul>
<p>This example only emphasize the flexibility that is left to
developers when building the library.</p>
</ul>
<a name="builds-flat">
<h3>II.4. How do I compile all FreeType 2 files in a single directory?</h3>
<ul>
<p>Some projects may need, for the sake of simplicity or ease of
building, to compile the FT2 library with all source files
copied to a single directory. This is possible.</p>
<p>To do so, you'll need to copy all source files located under
"<tt>src</tt>" to your own directory (you must retain the
include files in a distinct hierarchy though), then compile
each of the FreeType 2 component with the macro
<tt><b>FT_FLAT_COMPILE</b></tt>. This will change the way
<tt><b>#include</b></tt> works during the build.</p>
</ul>
</td></tr></table>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="library">Using the FreeType 2 library</h2>
</td></tr><tr><td>
</td></tr></table>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="autohint">The FreeType 2 auto-hinter</h2>
</td></tr><tr><td>
<a name="autohint-license">
<h3>IV.1. Under which license is the FreeType 2 auto-hinter released</h3>
<ul>
<p>The auto-hinter was initially designed and implemented under contract
for <a href="http://www.catharon.com">Catharon Productions, Inc</a>
which gladly accepted to released it under an open-source license
compatible with the FreeType one.</p>
<p>This license can be found in "<tt>src/autohint/CatharonLicense.txt</tt>"
and requires that you cite Catharon Productions in your documentation
(just like you do with FreeType) when using the auto-hinting module.</p>
<p>Other than that, you still have the same freedom than with the good old
FreeType license. Enjoy !</p>
</ul>
<a name="autohint-work">
<h3>IV.2. How does the auto-hinter works ?</h3>
<ul>
<p>Well, a complete description would be difficult. Have a look at the
dedicated <a href="autohinting/index.html">auto-hinter pages</a> on the FreeType
site, as they describe most of its details with graphics and explanations.
You could also look at the source code if you want to :-)</p>
<p>To give a few details, the auto-hinter is used to perform grid-fitting
on scalable font formats that use bezier outlines as their primary glyph
image format (this means nearly all scalable font formats today). When
a given font driver doesn't provide its own hinter, the auto-hinter is
used by default. When a format-specific hinter is provided, it is still
possible to use the auto-hinter using the
<tt><b>FT_LOAD_FORCE_AUTOHINT</b></tt> bit flag when calling
<tt>FT_Load_Glyph</tt>.</p>
<p>The auto-hinter currently doesn't use external hints to do its job,
as it automatically computes global metrics (when it "opens" a font
for the first time) and glyph "hints" from their outline. Note that
we plan the ability to specify external hints, given that it is based
on a constraint system. That could be used to support native hints
in Type 1/Type 2 fonts, for example.</p>
</ul>
<a name="autohint-cjk">
<h3>IV.3. Why does the auto-hinter doesn't work correctly with CJK fonts ?</h3>
<ul>
<p>The auto-hinter was first designed to manage and hint latin-based fonts,
as they consist of most of the fonts available today. It doesn't hint
asian fonts, as well as a few other complex scripts, because we didn't
put enough research on the topic yet. Hinting CJK isn't really more
difficult than latin, just different with a set of different constraints
(basically, more distortion of glyphs is acceptable as long as certain
features like triple-stem positions are respected more strictly..).</p>
<p>We thus plan to handle such a case rather rapidly.. Please be patient.</p>
</ul>
</td></tr></table>
<table width="100%" cellspacing=5><tr bgcolor="#CCCCEE"><td>
<h2 align=center><a name="other">Other questions</h2>
</td></tr><tr><td>
<a name="other-antialias">
<h3>V.1. What is the anti-aliasing algorithm used by FreeType 2 ?</h3>
<ul>
<p>The algorithm has been specifically designed for FreeType. It is
based on ideas that were originally found in the implementation
of the <a href="http://www.levien.com/libart">libArt</a> graphics
library to compute the <em>exact pixel coverage</em> of a vector
image with absolutely now sub-sampling/filtering.
</p>
<p>However, these two implementations are radically distinct and use
vastly different models. The FreeType 2 renderer is optimized
specifically for rendering small complex shapes, like glyphs, at
very high speed while using very few memory; while libArt shines
at general shape/polygon processing, especially large ones.</p>
<p>The FT2 anti-aliasing renderer is indeed <em>faster</em> than the
monochrome renderer for small character sizes (typically &lt; 20 pixels).
This is explained because the monochrome renderer must perform two
passes on the outline in order to perform drop-out control according
to the TrueType spec (we could drop this requirement later though).</p>
<p>We'll try to document its design in a later document, though this is
not a priority for now.</p>
</ul>
<a name="other-opentype">
<h3>V.2. When will FreeType 2 support OpenType ?</h3>
<ul>
<p>Well, the engine already reads OpenType/CFF files perfectly. What it
doesn't do is handle "OpenType Layout" tables yet.</p>
<p>FreeType 1 comes with a set of extensions that are used to load
and manage OpenType Layout tables. It even has a demonstration program
named "<tt>ftstrtto</tt>" used to demonstrate its capabilities that
runs pretty smooth.</p>
<p>For FreeType 2, we have decided that the layout operations provided
through these tables is better placed in a specific text-layout library,
(many people having asked for such a thing). This new engine would not
depend on FT2 explicitely and will be developed as a separate project.
We plan to announce it in a few weeks with all gory details,
once the definitive 2.0 release of FreeType has been made.</p>
</ul>
</td></tr></table>
<hr>
<p>
<a href="index.html">Back to FreeType homepage</a><p>
</td></tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
@@ -1 +0,0 @@
‰PNG
File diff suppressed because it is too large Load Diff
@@ -1 +0,0 @@
‰PNG

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