summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base/ftcalc.c6
-rw-r--r--src/base/ftcalc.h114
-rw-r--r--src/base/ftdebug.c2
-rw-r--r--src/base/ftdebug.h205
-rw-r--r--src/base/ftdriver.h588
-rw-r--r--src/base/ftextend.c2
-rw-r--r--src/base/ftextend.h167
-rw-r--r--src/base/ftglyph.c4
-rw-r--r--src/base/ftgrays.c6
-rw-r--r--src/base/ftinit.c12
-rw-r--r--src/base/ftlist.c6
-rw-r--r--src/base/ftlist.h116
-rw-r--r--src/base/ftobjs.c10
-rw-r--r--src/base/ftobjs.h447
-rw-r--r--src/base/ftoutln.c9
-rw-r--r--src/base/ftoutln.h6
-rw-r--r--src/base/ftraster.c11
-rw-r--r--src/base/ftstream.c4
-rw-r--r--src/base/ftstream.h285
-rw-r--r--src/base/ftsystem.c4
-rw-r--r--src/base/rules.mk14
-rw-r--r--src/macfond/fonddrvr.c4
-rw-r--r--src/oldapi/ttapi.c18
-rw-r--r--src/psnames/psdriver.c4
-rw-r--r--src/psnames/psdriver.h4
-rw-r--r--src/sfnt/sfdriver.c2
-rw-r--r--src/sfnt/sfdriver.h3
-rw-r--r--src/sfnt/ttcmap.c4
-rw-r--r--src/sfnt/ttcmap.h2
-rw-r--r--src/sfnt/ttload.c7
-rw-r--r--src/sfnt/ttload.h4
-rw-r--r--src/sfnt/ttpost.c8
-rw-r--r--src/sfnt/ttpost.h4
-rw-r--r--src/sfnt/ttsbit.c6
-rw-r--r--src/shared/autohint.h200
-rw-r--r--src/shared/psnames.h214
-rw-r--r--src/shared/readme.txt6
-rw-r--r--src/shared/rules.mk27
-rw-r--r--src/shared/sfnt.h380
-rw-r--r--src/shared/t1types.h398
-rw-r--r--src/shared/tterrors.h126
-rw-r--r--src/shared/tttags.h60
-rw-r--r--src/shared/tttypes.h2073
-rw-r--r--src/truetype/ttdriver.c8
-rw-r--r--src/truetype/ttdriver.h5
-rw-r--r--src/truetype/tterrors.h4
-rw-r--r--src/truetype/ttgload.c13
-rw-r--r--src/truetype/ttinterp.c7
-rw-r--r--src/truetype/ttobjs.c17
-rw-r--r--src/truetype/ttobjs.h4
-rw-r--r--src/truetype/ttpload.c8
-rw-r--r--src/truetype/ttpload.h2
-rw-r--r--src/type1/t1afm.c6
-rw-r--r--src/type1/t1afm.h2
-rw-r--r--src/type1/t1driver.c6
-rw-r--r--src/type1/t1gload.c4
-rw-r--r--src/type1/t1hinter.c2
-rw-r--r--src/type1/t1load.c6
-rw-r--r--src/type1/t1load.h2
-rw-r--r--src/type1/t1objs.c6
-rw-r--r--src/type1/t1objs.h6
-rw-r--r--src/type1/t1parse.c4
-rw-r--r--src/type1/t1parse.h2
-rw-r--r--src/type1/t1tokens.c4
-rw-r--r--src/type1z/t1afm.c4
-rw-r--r--src/type1z/t1afm.h2
-rw-r--r--src/type1z/t1driver.c6
-rw-r--r--src/type1z/t1errors.h2
-rw-r--r--src/type1z/t1gload.c4
-rw-r--r--src/type1z/t1load.c6
-rw-r--r--src/type1z/t1load.h2
-rw-r--r--src/type1z/t1objs.c6
-rw-r--r--src/type1z/t1objs.h6
-rw-r--r--src/type1z/t1parse.c8
-rw-r--r--src/type1z/t1parse.h2
75 files changed, 161 insertions, 5577 deletions
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 3440e427f..92ad70693 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -30,9 +30,9 @@
/* */
/*************************************************************************/
-#include <ftcalc.h>
-#include <ftdebug.h>
-#include <ftobjs.h> /* for ABS() */
+#include <freetype/internal/ftcalc.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftobjs.h> /* for ABS() */
#ifdef FT_CONFIG_OPTION_OLD_CALCS
diff --git a/src/base/ftcalc.h b/src/base/ftcalc.h
deleted file mode 100644
index cbc2e70d7..000000000
--- a/src/base/ftcalc.h
+++ /dev/null
@@ -1,114 +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.h>
-#include <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 )
-
- EXPORT_DEF
- FT_Int32 FT_Sqrt64( FT_Int64 x );
-
-#endif /* OLD_CALCS */
-
-#else /* LONG64 */
-
- typedef struct FT_Int64_
- {
- FT_Word32 lo;
- FT_Word32 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 )
-
- EXPORT_DEF
- void FT_Add64 ( FT_Int64* x, FT_Int64* y, FT_Int64* z );
-
- EXPORT_DEF
- void FT_MulTo64 ( FT_Int32 x, FT_Int32 y, FT_Int64* z );
-
- 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 )
-
- EXPORT_DEF
- FT_Int32 FT_Sqrt64( FT_Int64* x );
-
-#endif /* OLD_CALC */
-
-#endif /* LONG64 */
-
-
-#ifndef FT_CONFIG_OPTION_OLD_CALCS
-
-#define SQRT_32( x ) FT_Sqrt32( x )
-
- BASE_DEF
- FT_Int32 FT_Sqrt32( FT_Int32 l );
-#endif
-
- /*************************************************************************/
- /* */
- /* 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 */
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index 06d232981..fa71216b8 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -16,7 +16,7 @@
/***************************************************************************/
-#include <ftdebug.h>
+#include <freetype/internal/ftdebug.h>
#ifdef FT_DEBUG_LEVEL_TRACE
char ft_trace_levels[trace_max];
diff --git a/src/base/ftdebug.h b/src/base/ftdebug.h
deleted file mode 100644
index 2e90646b2..000000000
--- a/src/base/ftdebug.h
+++ /dev/null
@@ -1,205 +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. */
-/* */
-/***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* This component contains various macros and functions used to ease the */
- /* debugging of the FreeType engine. Its main purpose is in assertion */
- /* checking, tracing, and error detection. */
- /* */
- /* There are now three debugging modes: */
- /* */
- /* - trace mode */
- /* */
- /* Error and trace messages are sent to the log file (which can be the */
- /* standard error output). */
- /* */
- /* - error mode */
- /* */
- /* Only error messages are generated. */
- /* */
- /* - release mode: */
- /* */
- /* No error message is sent or generated. The code is free from any */
- /* debugging parts. */
- /* */
- /*************************************************************************/
-
-
-#ifndef FTDEBUG_H
-#define FTDEBUG_H
-
-#include <ftconfig.h> /* for FT_DEBUG_LEVEL_TRACE, FT_DEBUG_LEVEL_ERROR */
-
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
-#ifdef FT_DEBUG_LEVEL_TRACE
-
-
- typedef enum FT_Trace_
- {
- /* the first level must always be `trace_any' */
- trace_any = 0,
-
- /* first, define an enum for each common component */
- trace_io, /* in ftsys */
- trace_memory, /* in ftsys */
- trace_sync, /* in ftsys */
- trace_stream, /* stream manager - see ftstream.c */
- trace_calc, /* computations - see ftcalc.c */
- trace_raster, /* raster - see ftraster.c */
- trace_list, /* list manager - see ftlist.c */
- trace_objs, /* base objects - see ftobjs.c */
-
- /* then define an enum for each TrueType driver component */
- trace_ttobjs,
- trace_ttload,
- trace_ttgload,
- trace_ttinterp,
- trace_ttcmap,
- trace_ttextend,
- trace_ttdriver,
-
-#if 0
- /* define an enum for each TrueDoc driver component */
- trace_tdobjs,
- trace_tdload,
- trace_tdgload,
- trace_tdhint,
- trace_tddriver,
-#endif
-
- /* define an enum for each Type1 driver component */
- trace_t1objs,
- trace_t1load,
- trace_t1gload,
- trace_t1hint,
- trace_t1driver,
-
- /* other trace levels */
- trace_init,
-
- /* 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 */
- /* Trace_Component value before using any TRACE macro. */
- /* */
- /*************************************************************************/
-
-
-#define FT_TRACE( level, varformat ) \
- do \
- { \
- if ( ft_trace_levels[FT_COMPONENT] >= level ) \
- FT_Message##varformat; \
- } while ( 0 )
-
-
- EXPORT_DEF
- void FT_SetTraceLevel( FT_Trace component,
- char level );
-
-
-#elif defined( FT_DEBUG_LEVEL_ERROR )
-
-
-#define FT_TRACE( level, varformat ) while ( 0 ) { } /* nothing */
-
-
-#else /* release mode */
-
-
-#define FT_Assert( condition ) while ( 0 ) { } /* nothing */
-
-#define FT_TRACE( level, varformat ) while ( 0 ) { } /* nothing */
-#define FT_ERROR( varformat ) 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 */
- extern void FT_Message( const char* fmt, ... );
-
- /* print a message and exit */
- extern void FT_Panic ( const char* fmt, ... );
-
-#define FT_ERROR( varformat ) FT_Message##varformat
-
-
-#endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */
-
-
-/* you need two opening resp. closing parentheses!
- Example: FT_TRACE0(( "Value is %i", foo )) */
-
-#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
-#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
-#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
-#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
-#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
-#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
-#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
-#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
-
-
-#ifdef __cplusplus
- }
-#endif
-
-
-#endif /* FTDEBUG_H */
-
-
-/* END */
diff --git a/src/base/ftdriver.h b/src/base/ftdriver.h
deleted file mode 100644
index 3462a1826..000000000
--- a/src/base/ftdriver.h
+++ /dev/null
@@ -1,588 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftdriver.h */
-/* */
-/* FreeType 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.h>
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** D R I V E R S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_initDriver */
- /* */
- /* <Description> */
- /* A driver method used to create a new driver object for a given */
- /* format. */
- /* */
- /* <InOut> */
- /* driver :: A handle to the `new' driver object. The fields */
- /* `library', `system', and `lock' are already set when the */
- /* base layer calls this method. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error (*FTDriver_initDriver)( FT_Driver driver );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_doneDriver */
- /* */
- /* <Description> */
- /* A driver method used to finalize a given driver object. Note that */
- /* all faces and resources for this driver have been released before */
- /* this call, and that this function should NOT destroy the driver */
- /* object. */
- /* */
- /* <InOut> */
- /* driver :: A handle to target driver object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error (*FTDriver_doneDriver)( FT_Driver driver );
-
-
- typedef void (*FTDriver_Interface)( void );
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_getInterface */
- /* */
- /* <Description> */
- /* Each driver can provide one or more extensions to the base */
- /* FreeType API. These can be used to access format specific */
- /* features (e.g., all TrueType/OpenType resources share a common */
- /* file structure and common tables which can be accessed through the */
- /* `sfnt' interface), or more simply generic ones (e.g., the */
- /* `postscript names' interface which can be used to retrieve the */
- /* PostScript name of a given glyph index). */
- /* */
- /* <InOut> */
- /* driver :: A handle to a driver object. */
- /* */
- /* <Input> */
- /* interface :: A string designing the interface. Examples are */
- /* `sfnt', `post_names', `charmaps', etc. */
- /* */
- /* <Return> */
- /* A typeless pointer to the extension's interface (normally a table */
- /* of function pointers). Returns NULL if the requested extension */
- /* isn't available (i.e., wasn't compiled in the driver at build */
- /* time). */
- /* */
- typedef FTDriver_Interface (*FTDriver_getInterface)
- ( FT_Driver driver,
- const FT_String* interface );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_FormatInterface */
- /* */
- /* <Description> */
- /* A driver interface field whose value is a driver-specific */
- /* interface method table. This table contains entry points to */
- /* various functions that are strictly related to the driver's */
- /* format. */
- /* */
- typedef void* FT_FormatInterface;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Attach_Reader */
- /* */
- /* <Description> */
- /* This function is associated to the `attach_file' driver-specific */
- /* interface. It is used to read additional data for a given face */
- /* from another input stream/file. For example, it is used to */
- /* attach a Type 1 AFM file to a given Type 1 face. */
- /* */
- typedef FT_Error (*FT_Attach_Reader)( FT_Face face, FT_Stream stream );
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** F A C E S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_initFace */
- /* */
- /* <Description> */
- /* A driver method used to initialize a new face object. The object */
- /* must be created by the caller. */
- /* */
- /* <InOut> */
- /* stream :: The input stream. */
- /* */
- /* <Input> */
- /* typeface_index :: The face index in the font resource. Used to */
- /* access individual faces in collections. */
- /* */
- /* <Output> */
- /* face :: A handle to the new target face. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The `typeface_index' parameter field will be set to -1 if the */
- /* engine only wants to test the format of the resource. This means */
- /* that font drivers should simply check the font format, then return */
- /* immediately with an error code of 0 (meaning success). The field */
- /* `num_faces' should be set. */
- /* */
- /* FTDriver_doneFace() will be called subsequently, whatever the */
- /* result was. */
- /* */
- typedef FT_Error (*FTDriver_initFace)( FT_Stream stream,
- FT_Long typeface_index,
- FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_doneFace */
- /* */
- /* <Description> */
- /* A driver method used to finalize a given face object. This */
- /* function does NOT destroy the object, that is the responsibility */
- /* of the caller. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef void (*FTDriver_doneFace)( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_getKerning */
- /* */
- /* <Description> */
- /* A driver method used to return the kerning vector between two */
- /* glyphs of the same face. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* left_glyph :: The index of the left glyph in the kern pair. */
- /* right_glyph :: The index of the right glyph in the kern pair. */
- /* */
- /* <Output> */
- /* kerning :: A pointer to the kerning vector. This is in font */
- /* units for scalable formats, and in pixels for */
- /* fixed-sizes formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this method. Other layouts, or more sophisticated */
- /* kernings are out of the scope of this method (the basic driver */
- /* interface is meant to be simple). */
- /* */
- /* They can be implemented by format-specific interfaces. */
- /* */
- typedef FT_Error (*FTDriver_getKerning)( FT_Face face,
- FT_UInt left_glyph,
- FT_UInt right_glyph,
- FT_Vector* kerning );
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** S I Z E S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_initSize */
- /* */
- /* <Description> */
- /* A driver method used to initialize a new size object. The object */
- /* must be created by the caller. */
- /* */
- /* <InOut> */
- /* size :: A handle to the new size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function should return an error if the face's format isn't */
- /* scalable. */
- /* */
- typedef FT_Error (*FTDriver_initSize)( FT_Size size );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_setCharSizes */
- /* */
- /* <Description> */
- /* A driver method used to reset a size's character sizes (horizontal */
- /* and vertical) expressed in fractional points. */
- /* */
- /* <InOut> */
- /* size :: A handle to the target size object. */
- /* */
- /* <Input> */
- /* char_width :: The character width expressed in 26.6 */
- /* fractional points. */
- /* char_height :: The character height expressed in 26.6 */
- /* fractional points. */
- /* horz_resolution :: The horizontal resolution. */
- /* vert_resolution :: The vertical resolution. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function should always FAIL if the face format isn't */
- /* scalable! */
- /* */
- typedef FT_Error (*FTDriver_setCharSizes)( FT_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_setPixelSizes */
- /* */
- /* <Description> */
- /* A driver method used to reset a size's character sizes (horizontal */
- /* and vertical) expressed in integer pixels. */
- /* */
- /* <InOut> */
- /* size :: A handle to the target size object. */
- /* */
- /* <Input> */
- /* pixel_width :: The character width expressed in 26.6 fractional */
- /* pixels. */
- /* pixel_height :: The character height expressed in 26.6 fractional */
- /* pixels. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function should work with all kinds of `size' objects, either */
- /* fixed or scalable ones. */
- /* */
- typedef FT_Error (*FTDriver_setPixelSizes)( FT_Size size,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_doneSize */
- /* */
- /* <Description> */
- /* A driver method used to finalize a given size object. This method */
- /* does NOT destroy the object; this is the responsibility of the */
- /* caller. */
- /* */
- /* <InOut> */
- /* size :: A handle to the target size object. */
- /* */
- typedef void (*FTDriver_doneSize)( FT_Size size );
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** G L Y P H S L O T S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_initGlyphSlot */
- /* */
- /* <Description> */
- /* A driver method used to initialize a new glyph slot object. The */
- /* object must be created by the caller. The glyph slot is a */
- /* container where a single glyph can be loaded, either in outline or */
- /* bitmap format. */
- /* */
- /* <InOut> */
- /* slot :: A handle to the new glyph slot object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error (*FTDriver_initGlyphSlot)( FT_GlyphSlot slot );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_doneGlyphSlot */
- /* */
- /* <Description> */
- /* A driver method used to finalize a given glyph slot. The object */
- /* is not destroyed by this function. */
- /* */
- /* <InOut> */
- /* slot :: A handle to the new glyph slot object. */
- /* */
- typedef void (*FTDriver_doneGlyphSlot)( FT_GlyphSlot slot );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_loadGlyph */
- /* */
- /* <Description> */
- /* A driver method used to load a glyph within a given glyph slot. */
- /* */
- /* <InOut> */
- /* slot :: A handle to target slot object where the glyph will */
- /* be loaded. */
- /* size :: A handle to the source face size at which the glyph */
- /* must be scaled/loaded. */
- /* */
- /* <Input> */
- /* glyph_index :: The index of the glyph in the font file. */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FTLOAD_??? constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error (*FTDriver_loadGlyph)( FT_GlyphSlot slot,
- FT_Size size,
- FT_UInt glyph_index,
- FT_Int load_flags );
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** C H A R A C T E R M A P S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FTDriver_getCharIndex */
- /* */
- /* <Description> */
- /* Uses a charmap to return a given character code's glyph index. */
- /* */
- /* <Input> */
- /* charmap :: A handle to the source charmap object. */
- /* charcode :: The character code. */
- /* */
- /* <Return> */
- /* The glyph index. 0 means `undefined character code'. */
- /* */
- typedef FT_UInt (*FTDriver_getCharIndex)( FT_CharMap charmap,
- FT_Long charcode );
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** I N T E R F A C E ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_DriverInterface */
- /* */
- /* <Description> */
- /* A structure which holds a font driver's basic interface used by */
- /* the high-level parts of FreeType (or other applications). */
- /* */
- /* Most scalable drivers provide a specialized interface to access */
- /* format specific features. It can be retrieved with a call to */
- /* `get_format_interface()', and should be defined in each font */
- /* driver header (e.g., ttdriver.h, t1driver.h, etc). */
- /* */
- /* All fields are function pointers. */
- /* */
- /* <Fields> */
- /* driver_object_size :: The size in bytes of a single driver */
- /* object. */
- /* face_object_size :: The size in bytes of a single face object. */
- /* size_object_size :: The size in bytes of a single size object. */
- /* slot_object_size :: The size in bytes of a single glyph slot */
- /* object. */
- /* */
- /* driver_name :: A string to describe the driver to the */
- /* system. It doesn't necessarily describe */
- /* in detail all the font formats the driver */
- /* may support. */
- /* driver_version :: The driver version number. Starts at 1. */
- /* driver_requires :: The FreeType major version this driver is */
- /* written for. This number should be equal */
- /* to or greater than 2! */
- /* */
- /* format_interface :: A pointer to the driver's format-specific */
- /* interface. */
- /* */
- /* init_driver :: Used to initialize a given driver object. */
- /* done_driver :: Used to finalize and destroy a given */
- /* driver object. */
- /* get_interface :: Returns an interface for a given driver */
- /* extension. */
- /* */
- /* init_face :: Initializes a given face object. */
- /* done_face :: Discards a face object, as well as all */
- /* child objects (sizes, charmaps, glyph */
- /* slots). */
- /* get_kerning :: Returns the kerning vector corresponding */
- /* to a pair of glyphs, expressed in unscaled */
- /* font units. */
- /* */
- /* init_size :: Initializes a given size object. */
- /* done_size :: Finalizes a given size object. */
- /* set_size_char_sizes :: Resets a scalable size object's character */
- /* size. */
- /* set_pixel_sizes :: Resets a face size object's pixel */
- /* dimensions. Applies to both scalable and */
- /* fixed faces. */
- /* */
- /* init_glyph_slot :: Initializes a given glyph slot object. */
- /* done_glyph_slot :: Finalizes a given glyph slot. */
- /* load_glyph :: Loads a given glyph into a given slot. */
- /* */
- /* get_char_index :: Returns the glyph index for a given */
- /* charmap. */
- /* */
- typedef struct FT_DriverInterface_
- {
- FT_Int driver_object_size;
- FT_Int face_object_size;
- FT_Int size_object_size;
- FT_Int slot_object_size;
-
- FT_String* driver_name;
- FT_Int driver_version;
- FT_Int driver_requires;
-
- void* format_interface;
-
- FTDriver_initDriver init_driver;
- FTDriver_doneDriver done_driver;
- FTDriver_getInterface get_interface;
-
- FTDriver_initFace init_face;
- FTDriver_doneFace done_face;
- FTDriver_getKerning get_kerning;
-
- FTDriver_initSize init_size;
- FTDriver_doneSize done_size;
- FTDriver_setCharSizes set_char_sizes;
- FTDriver_setPixelSizes set_pixel_sizes;
-
- FTDriver_initGlyphSlot init_glyph_slot;
- FTDriver_doneGlyphSlot done_glyph_slot;
- FTDriver_loadGlyph load_glyph;
-
- FTDriver_getCharIndex get_char_index;
-
- } FT_DriverInterface;
-
-
-#endif /* FTDRIVER_H */
-
-
-/* END */
diff --git a/src/base/ftextend.c b/src/base/ftextend.c
index 9bbe0bf2a..5cddfcde1 100644
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -24,7 +24,7 @@
/* */
/*************************************************************************/
-#include <ftextend.h>
+#include <freetype/internal/ftextend.h>
/* required by the tracing mode */
#undef FT_COMPONENT
diff --git a/src/base/ftextend.h b/src/base/ftextend.h
deleted file mode 100644
index ddd891d96..000000000
--- a/src/base/ftextend.h
+++ /dev/null
@@ -1,167 +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 <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;
-
-
- 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
-
-
- /* Returns an extension's data & interface according to its ID */
- EXPORT_DEF
- void* FT_Get_Extension( FT_Face face,
- const char* extension_id,
- void* *extension_interface );
-
-#ifdef __cplusplus
- }
-#endif
-
-
-#endif /* FTEXTEND_H */
-
-
-/* END */
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 248c38645..17e698e93 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -23,8 +23,8 @@
/* */
/***************************************************************************/
-#include <ftglyph.h>
-#include <ftobjs.h>
+#include <freetype/ftglyph.h>
+#include <freetype/internal/ftobjs.h>
static
void ft_prepare_glyph( FT_Glyph glyph,
diff --git a/src/base/ftgrays.c b/src/base/ftgrays.c
index 9362f0bc6..9228fde6e 100644
--- a/src/base/ftgrays.c
+++ b/src/base/ftgrays.c
@@ -46,7 +46,7 @@
/* - faster than the standard renderer for small (< 20) pixel sizes */
/* */
-#include <ftgrays.h>
+#include <freetype/ftgrays.h>
#if 1
#include <string.h> /* for memcpy */
@@ -57,7 +57,7 @@
#ifdef _STANDALONE_
#error "implementation of FT_Outline_Decompose missing !!!"
#else
-#include <freetype.h> /* to link to FT_Outline_Decompose */
+#include <freetype/freetype.h> /* to link to FT_Outline_Decompose */
#endif
/* define this to dump debugging information */
@@ -1428,7 +1428,7 @@ int check_sort( PCell cells, int count )
#else
-#include "ftobjs.h"
+#include <freetype/internal/ftobjs.h>
static
int grays_raster_new( FT_Memory memory, FT_Raster* araster )
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 01e145453..0399dc486 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -41,10 +41,10 @@
/*************************************************************************/
-#include <ftobjs.h>
-#include <ftconfig.h>
-#include <ftdebug.h>
-#include <ftdriver.h>
+#include <freetype/config/ftconfig.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftdriver.h>
#undef FT_COMPONENT
#define FT_COMPONENT trace_init
@@ -52,7 +52,7 @@
#undef FT_DRIVER
#define FT_DRIVER( x ) extern FT_DriverInterface x;
-#include <ftmodule.h>
+#include <freetype/config/ftmodule.h>
#undef FT_DRIVER
#define FT_DRIVER( x ) &x,
@@ -60,7 +60,7 @@
static
const FT_DriverInterface* ft_default_drivers[] =
{
-#include <ftmodule.h>
+#include <freetype/config/ftmodule.h>
0
};
diff --git a/src/base/ftlist.c b/src/base/ftlist.c
index a7db2231f..ddcba9aa4 100644
--- a/src/base/ftlist.c
+++ b/src/base/ftlist.c
@@ -23,9 +23,9 @@
/*************************************************************************/
-#include <ftlist.h>
-#include <ftdebug.h>
-#include <ftobjs.h>
+#include <freetype/internal/ftlist.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftobjs.h>
/*************************************************************************/
diff --git a/src/base/ftlist.h b/src/base/ftlist.h
deleted file mode 100644
index 6241115ec..000000000
--- a/src/base/ftlist.h
+++ /dev/null
@@ -1,116 +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.h>
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
- EXPORT_DEF
- FT_ListNode FT_List_Find( FT_List list,
- void* data );
-
- EXPORT_DEF
- void FT_List_Add( FT_List list,
- FT_ListNode node );
-
- EXPORT_DEF
- void FT_List_Insert( FT_List list,
- FT_ListNode node );
-
- EXPORT_DEF
- void FT_List_Remove( FT_List list,
- FT_ListNode node );
-
- 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 );
-
-
- 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 );
-
-
- 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 */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 121ab1187..436cee36a 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -15,12 +15,12 @@
/* */
/***************************************************************************/
-#include <ftobjs.h>
-#include <ftlist.h>
-#include <ftdebug.h>
-#include <ftstream.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/ftlist.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
-#include <tttables.h>
+#include <freetype/tttables.h>
/*************************************************************************/
/*************************************************************************/
diff --git a/src/base/ftobjs.h b/src/base/ftobjs.h
deleted file mode 100644
index afdda1975..000000000
--- a/src/base/ftobjs.h
+++ /dev/null
@@ -1,447 +0,0 @@
-/***************************************************************************/
-/* */
-/* ftobjs.h */
-/* */
-/* The FreeType private base classes (specification). */
-/* */
-/* Copyright 1996-1999 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 <ftconfig.h>
-#include <ftsystem.h>
-#include <ftdriver.h>
-
- /*************************************************************************/
- /* */
- /* 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 ) ( (void)(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
-
-
- /*************************************************************************/
- /* */
- /* <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 every platform we know !! */
-#include <string.h>
-
-#define MEM_Set( dest, byte, count ) memset( dest, byte, count )
-
-#ifdef HAVE_MEMCPY
-#define MEM_Copy( dest, source, count ) memcpy( dest, source, count )
-#else
-#define MEM_Copy( dest, source, count ) bcopy( source, dest, count )
-#endif
-
-#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. */
- /* */
-
- /* */
- /* Note that ALL memory allocation functions need an IMPLICIT argument */
- /* called `memory' to point to the current memory object. */
- /* */
-#define MEM_Alloc( _pointer_, _size_ ) \
- FT_Alloc( memory, _size_, (void**)&(_pointer_) )
-
-#define MEM_Realloc( _pointer_, _current_, _size_ ) \
- FT_Realloc( memory, _current_, _size_, (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_) )
-
-
-
- EXPORT_DEF
- FT_Error FT_New_Size( FT_Face face,
- FT_Size* size );
-
- EXPORT_DEF
- FT_Error FT_Done_Size( FT_Size size );
-
- EXPORT_DEF
- FT_Error FT_New_GlyphSlot( FT_Face face,
- FT_GlyphSlot* aslot );
-
- EXPORT_DEF
- void FT_Done_GlyphSlot( FT_GlyphSlot slot );
-
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** D R I V E R S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <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> */
- /* library :: A handle to the driver's parent library. */
- /* */
- /* memory :: A handle to the driver's memory object. This is a */
- /* duplicate of `library->memory'. */
- /* */
- /* interface :: A set of driver methods that implement its */
- /* behaviour. These methods are called by the */
- /* various FreeType functions like FT_New_Face(), */
- /* FT_Load_Glyph(), etc. */
- /* */
- /* format :: A typeless pointer, used to store the address of */
- /* the driver's format specific interface. This is a */
- /* table of other driver methods that are specific to */
- /* its format. Format specific interfaces are */
- /* defined in the driver's header files (e.g., */
- /* `freetype/drivers/ttlib/ttdriver.h'). */
- /* */
- /* version :: The driver's version. It can be used for */
- /* versioning and dynamic driver update if needed. */
- /* */
- /* description :: An ASCII string describing the driver's supported */
- /* format, like `truetype', `type1', etc. */
- /* */
- /* faces_list :: The list of faces currently opened by this driver. */
- /* */
- /* extensions :: a typeless pointer to the driver's extensions */
- /* registry, when they are supported through the */
- /* config macro FT_CONFIG_OPTION_EXTENSIONS */
- /* */
- typedef struct FT_DriverRec_
- {
- FT_Library library;
- FT_Memory memory;
-
- FT_Generic generic;
-
- FT_DriverInterface interface;
- FT_FormatInterface format;
-
- FT_Int version; /* driver version */
- FT_String* description; /* format description */
-
- FT_ListRec faces_list; /* driver's faces list */
-
- void* extensions;
-
- } FT_DriverRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** G L Y P H Z O N E S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /************************************************************************
- *
- * <Struct>
- * FT_GlyphZone
- *
- * <Description>
- * A glyph zone is used to load, scale and hint glyph outline
- * coordinates.
- *
- * <Fields>
- * memory :: handle to memory manager
- * max_points :: max size in points of zone
- * max_contours :: max size in contours of zone
- * n_points :: current number of points in zone
- * n_contours :: current number of contours in zone
- * org :: original glyph coordinates (font units/scaled)
- * cur :: current glyph coordinates (scaled/hinted)
- * tags :: point control tags
- * contours :: contour end points
- *
- ***********************************************************************/
-
- typedef struct FT_GlyphZone_
- {
- FT_Memory memory;
- FT_UShort max_points;
- FT_UShort max_contours;
- FT_UShort n_points; /* number of points in zone */
- FT_Short n_contours; /* number of contours */
-
- FT_Vector* org; /* original point coordinates */
- FT_Vector* cur; /* current point coordinates */
-
- FT_Byte* tags; /* current touch flags */
- FT_UShort* contours; /* contour end points */
-
- } FT_GlyphZone;
-
-
- BASE_DEF
- FT_Error FT_New_GlyphZone( FT_Memory memory,
- FT_UShort maxPoints,
- FT_Short maxContours,
- FT_GlyphZone* zone );
-
- BASE_DEF
- void FT_Done_GlyphZone( FT_GlyphZone* zone );
-
- BASE_DEF
- FT_Error FT_Update_GlyphZone( FT_GlyphZone* zone,
- FT_UShort num_points,
- FT_Short num_contours );
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** 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_drivers :: The number of drivers currently registered */
- /* within this library. This is set to 0 for new */
- /* libraries. New drivers are added through the */
- /* FT_Add_Driver() API function. */
- /* */
- /* drivers :: A table used to store handles to the currently */
- /* registered font drivers. Note that each driver */
- /* contains a list of its opened faces. */
- /* */
- /* raster_pool :: The raster object's render pool. This can */
- /* ideally be changed dynamically at run-time. */
- /* */
- typedef void (*FT_DebugHook_Func)( void* arg );
-
- typedef struct FT_LibraryRec_
- {
- FT_Memory memory; /* library's memory object */
-
- FT_Generic generic;
-
- FT_Int num_drivers;
- FT_Driver drivers[ FT_MAX_DRIVERS ]; /* driver objects */
-
- FT_Raster_Funcs raster_funcs[ FT_MAX_GLYPH_FORMATS ];
- FT_Raster rasters [ FT_MAX_GLYPH_FORMATS ];
-
- void* raster_pool; /* scan-line conversion render pool */
- long raster_pool_size; /* size of render pool in bytes */
-
- FT_DebugHook_Func debug_hooks[4];
-
- } FT_LibraryRec;
-
-
- EXPORT_DEF
- FT_Error FT_New_Library( FT_Memory memory,
- FT_Library* library );
-
-
- EXPORT_DEF
- FT_Error FT_Done_Library( FT_Library library );
-
-
-
- EXPORT_DEF
- void FT_Set_Debug_Hook( FT_Library library,
- FT_UInt hook_index,
- FT_DebugHook_Func debug_hook );
-
-
- EXPORT_DEF
- FT_Error FT_Add_Driver( FT_Library library,
- const FT_DriverInterface* driver_interface );
-
-
- EXPORT_DEF
- FT_Error FT_Remove_Driver( FT_Driver driver );
-
-
- EXPORT_DEF
- FT_Driver FT_Get_Driver( FT_Library library,
- char* driver_name );
-
-#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
-
- EXPORT_DEF
- FT_Error FT_New_Stream( const char* filepathname,
- FT_Stream astream );
-
- EXPORT_DEF
- void FT_Done_Stream( FT_Stream stream );
-
- extern
- FT_Memory FT_New_Memory( void );
-
-#endif
-
-/* 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
- extern
- FT_Raster_Funcs ft_default_raster;
-#endif
-
-
-#endif /* FTOBJS_H */
-
-
-/* END */
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index f63115f6c..40181689a 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -23,11 +23,10 @@
/*************************************************************************/
-#include <freetype.h>
-#include <ftconfig.h>
-#include <ftobjs.h>
-#include <ftimage.h>
-#include <ftoutln.h>
+#include <freetype/freetype.h>
+#include <freetype/config/ftconfig.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/ftoutln.h>
static
const FT_Outline null_outline = { 0, 0, 0, 0, 0, 0 };
diff --git a/src/base/ftoutln.h b/src/base/ftoutln.h
deleted file mode 100644
index 438d00b2c..000000000
--- a/src/base/ftoutln.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef FTOUTLN_H
-#define FTOUTLN_H
-
-#include <ftobjs.h>
-
-#endif /* FTOUTLN_H */
diff --git a/src/base/ftraster.c b/src/base/ftraster.c
index 82ecd0e2f..c0c444aaf 100644
--- a/src/base/ftraster.c
+++ b/src/base/ftraster.c
@@ -61,10 +61,9 @@
#endif
-#include <ftraster.h>
+#include <freetype/ftraster.h>
#ifndef _STANDALONE_
-#include <ftconfig.h>
-#include <ftdebug.h>
+#include <freetype/internal/ftdebug.h>
#endif
#ifndef EXPORT_FUNC
@@ -167,8 +166,8 @@
#else /* _STANDALONE_ */
-#include <freetype.h>
-#include <ftconfig.h>
+#include <freetype/freetype.h>
+#include <freetype/config/ftconfig.h>
/*************************************************************************/
/* */
@@ -3924,7 +3923,7 @@ Scan_DropOuts :
#else
-#include "ftobjs.h"
+#include <freetype/internal/ftobjs.h>
static
int ft_raster_new( FT_Memory memory, FT_Raster* araster )
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index a39106808..03abfb5ca 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -1,5 +1,5 @@
-#include <ftstream.h>
-#include <ftdebug.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/ftdebug.h>
#undef FT_COMPONENT
#define FT_COMPONENT trace_stream
diff --git a/src/base/ftstream.h b/src/base/ftstream.h
deleted file mode 100644
index dc6017ef5..000000000
--- a/src/base/ftstream.h
+++ /dev/null
@@ -1,285 +0,0 @@
-#ifndef FTSTREAM_H
-#define FTSTREAM_H
-
-#include <ftobjs.h>
-
-/* format of an 8-bit frame_op value = [ xxxxx | e | s ] */
-/* where s is set to 1 when the value is signed.. */
-/* where e is set to 1 when 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 */
-
-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_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 )
-
- /*************************************************************************/
- /* */
- /* 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 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 )
-
-
-
- BASE_DEF
- void FT_New_Memory_Stream( FT_Library library,
- void* base,
- unsigned long 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,
- void* buffer,
- FT_ULong count );
-
- BASE_DEF
- FT_Error FT_Read_Stream_At( FT_Stream stream,
- FT_ULong pos,
- void* 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_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_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_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 ACCESS_Compressed_Frame( size ) \
- FT_SET_ERROR( FT_Access_Compressed_Frame( stream, size ) )
-
-
-#define FORGET_Frame() \
- FT_Forget_Frame( stream )
-
-
-#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_Char*)buffer, \
- count ) )
-
-#define FILE_Read_At( position, buffer, count ) \
- FT_SET_ERROR( FT_Read_Stream_At( stream, \
- position, \
- (FT_Char*)buffer, \
- count ) )
-
-#define READ_Fields( fields, object ) \
- ((error = FT_Read_Fields( stream, fields, object )) != FT_Err_Ok)
-
-#endif /* FTSTREAM_H */
diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c
index 0da26b84a..9836e414b 100644
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -20,8 +20,8 @@
*
**************************************************************************/
-#include <ftsystem.h>
-#include <fterrors.h>
+#include <freetype/ftsystem.h>
+#include <freetype/fterrors.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 875bd0d66..7ea7488ef 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -39,13 +39,13 @@ BASE_SRC := $(BASE_)ftcalc.c \
# Base layer headers
#
-BASE_H := $(BASE_)ftcalc.h \
- $(BASE_)ftdebug.h \
- $(BASE_)ftdriver.h \
- $(BASE_)ftextend.h \
- $(BASE_)ftlist.h \
- $(BASE_)ftobjs.h \
- $(BASE_)ftstream.h
+BASE_H := $(INTERNAL_)ftcalc.h \
+ $(INTERNAL_)ftdebug.h \
+ $(INTERNAL_)ftdriver.h \
+ $(INTERNAL_)ftextend.h \
+ $(INTERNAL_)ftlist.h \
+ $(INTERNAL_)ftobjs.h \
+ $(INTERNAL_)ftstream.h
# Base layer `extensions' sources
diff --git a/src/macfond/fonddrvr.c b/src/macfond/fonddrvr.c
index f004f5fe6..b0a03f353 100644
--- a/src/macfond/fonddrvr.c
+++ b/src/macfond/fonddrvr.c
@@ -63,8 +63,8 @@
change to ftobjs.c to make this work.
*/
-#include <ttobjs.h>
-#include <t1objs.h>
+#include <freetype/internal/ttobjs.h>
+#include <freetype/internal/t1objs.h>
#include <Resources.h>
#include <Fonts.h>
diff --git a/src/oldapi/ttapi.c b/src/oldapi/ttapi.c
index ae31f02dd..6367251d6 100644
--- a/src/oldapi/ttapi.c
+++ b/src/oldapi/ttapi.c
@@ -21,17 +21,17 @@
*
******************************************************************/
-#include <freetype.h>
+#include <freetype/freetype.h>
-#include <ftdebug.h>
-#include <ftstream.h>
-#include <ftcalc.h>
-#include <ftlist.h>
-#include <ftraster.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/ftcalc.h>
+#include <freetype/internal/ftlist.h>
+#include <freetype/internal/ftraster.h>
-#include <ttdriver.h>
-#include <ttobjs.h>
-#include <ttcmap.h>
+#include <../truetype/ttdriver.h>
+#include <../truetype/ttobjs.h>
+#include <../truetype/ttcmap.h>
#define _TRUETYPE_
#include <truetype.h> /* backwards compatible interface */
diff --git a/src/psnames/psdriver.c b/src/psnames/psdriver.c
index 8162bd495..23d59b8e8 100644
--- a/src/psnames/psdriver.c
+++ b/src/psnames/psdriver.c
@@ -1,6 +1,6 @@
+#include <freetype/internal/psnames.h>
+#include <freetype/internal/ftobjs.h>
#include <psdriver.h>
-#include <psnames.h>
-#include <ftobjs.h>
#include <stdlib.h>
#ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES
diff --git a/src/psnames/psdriver.h b/src/psnames/psdriver.h
index 4349457ef..615eb9352 100644
--- a/src/psnames/psdriver.h
+++ b/src/psnames/psdriver.h
@@ -19,8 +19,8 @@
#ifndef PSDRIVER_H
#define PSDRIVER_H
-#include <freetype.h>
-#include <ftdriver.h>
+#include <freetype/freetype.h>
+#include <freetype/internal/ftdriver.h>
EXPORT_DEF
const FT_DriverInterface psnames_driver_interface;
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index 93472d9a6..0273067d6 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -1,9 +1,9 @@
+#include <freetype/internal/sfnt.h>
#include <sfdriver.h>
#include <ttload.h>
#include <ttsbit.h>
#include <ttpost.h>
#include <ttcmap.h>
-#include <sfnt.h>
static const SFNT_Interface sfnt_interface =
{
diff --git a/src/sfnt/sfdriver.h b/src/sfnt/sfdriver.h
index b0eb25850..43640eb35 100644
--- a/src/sfnt/sfdriver.h
+++ b/src/sfnt/sfdriver.h
@@ -19,8 +19,7 @@
#ifndef SFDRIVER_H
#define SFDRIVER_H
-#include <freetype.h>
-#include <ftdriver.h>
+#include <freetype/internal/ftdriver.h>
EXPORT_DEF
const FT_DriverInterface sfnt_driver_interface;
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 7a1a2ad70..32604e0b1 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -16,11 +16,11 @@
/***************************************************************************/
-#include <ftdebug.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/tterrors.h>
#include <ttload.h>
#include <ttcmap.h>
-#include <tterrors.h>
/* required by the tracing mode */
#undef FT_COMPONENT
diff --git a/src/sfnt/ttcmap.h b/src/sfnt/ttcmap.h
index d5da24000..49ac80d35 100644
--- a/src/sfnt/ttcmap.h
+++ b/src/sfnt/ttcmap.h
@@ -19,7 +19,7 @@
#ifndef TTCMAP_H
#define TTCMAP_H
-#include <tttypes.h>
+#include <freetype/internal/tttypes.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 211ee4a36..0a7f0874e 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -21,13 +21,12 @@
/***************************************************************************/
-#include <ftdebug.h>
-#include <ftconfig.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/tterrors.h>
+#include <freetype/tttags.h>
#include <ttload.h>
-#include <tttags.h>
#include <ttcmap.h>
-#include <tterrors.h>
/* required by the tracing mode */
#undef FT_COMPONENT
diff --git a/src/sfnt/ttload.h b/src/sfnt/ttload.h
index 28902e733..7a6d69af5 100644
--- a/src/sfnt/ttload.h
+++ b/src/sfnt/ttload.h
@@ -21,8 +21,8 @@
#define TTLOAD_H
-#include <ftstream.h>
-#include <tttypes.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/tttypes.h>
/*
#include <ttobjs.h>
*/
diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c
index b55eb5b61..9055da50e 100644
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -24,17 +24,17 @@
/* */
/*************************************************************************/
-#include <ftstream.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/tterrors.h>
+#include <freetype/tttags.h>
#include <ttpost.h>
-#include <tterrors.h>
#include <ttload.h>
-#include <tttags.h>
/* When this configuration macro is defined, we rely on the "psnames" */
/* module to grab the glyph names.. */
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
-#include <psnames.h>
+#include <freetype/internal/psnames.h>
#define MAC_NAME(x) ((TT_String*)psnames->macintosh_name(x))
#else
diff --git a/src/sfnt/ttpost.h b/src/sfnt/ttpost.h
index eeb0bf1a5..944c00c65 100644
--- a/src/sfnt/ttpost.h
+++ b/src/sfnt/ttpost.h
@@ -29,8 +29,8 @@
#ifndef TTPOST_H
#define TTPOST_H
-#include <ftconfig.h>
-#include <tttypes.h>
+#include <freetype/config/ftconfig.h>
+#include <freetype/internal/tttypes.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index b7020bbd4..1e63db20d 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -21,11 +21,11 @@
/***************************************************************************/
-#include <ftdebug.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/tterrors.h>
+#include <freetype/tttags.h>
#include <ttsbit.h>
-#include <tttags.h>
-#include <tterrors.h>
/*************************************************************************/
diff --git a/src/shared/autohint.h b/src/shared/autohint.h
deleted file mode 100644
index 288d1e470..000000000
--- a/src/shared/autohint.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/***************************************************************************/
-/* */
-/* autohint.h */
-/* */
-/* High-level `autohint" 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. */
-/* */
-/* */
-/* The auto-hinter is used to load and automatically hint glyphs */
-/* when 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 require a lot more horsepower.
- *
- * Because a sufficiently sophisticated font management system would
- * typically implement a 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 :o)
- *
- * I initially though that it'd be a good idea to cache the glyph hints too,
- * however, if my general idea now is that if you really need to cache these
- * too, you're 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.h>
-
- typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
-
- /***********************************************************************
- *
- * <FuncType>
- * FT_AutoHinter_Get_Global_Func
- *
- * <Description>
- * Retrieve 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 :: handle to source auto-hinter
- * face :: handle to source face object
- *
- * <Output>
- * global_hints :: typeless pointer to the global hints
- * global_len :: size in bytes of 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 :: handle to auto-hinter module
- * global :: pointer to retrieved global hints to discard
- */
- typedef void (*FT_AutoHinter_Done_Global_Func)( FT_AutoHinter hinter,
- void* global );
-
- /***********************************************************************
- *
- * <FuncType>
- * FT_AutoHinter_Init_Func
- *
- * <Description>
- * Compute or set the global hints for a given face object.
- *
- * <Input>
- * hinter :: handle to source auto-hinter module
- * face :: handle to target face object.
- * global_hints :: typeless pointer to global hints. If 0, the
- * hints are computed for the face
- *
- * <Note>
- * it is up to client applications to ensure that the global hints
- * were retrieved for the same face object. Strange results may occur
- * otherwise..
- *
- */
- typedef FT_Error (*FT_AutoHinter_Init_Func)( FT_AutoHinter hinter,
- FT_Face face,
- void* global_hints );
-
- /***********************************************************************
- *
- * <FuncType>
- * FT_AutoHinter_Done_Func
- *
- * <Description>
- * Discards the global hints for a given face..
- *
- * <Input>
- * hinter :: handle to source auto-hinter module
- * face :: handle to target face object.
- *
- */
- typedef FT_Error (*FT_AutoHinter_Done_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 :: handle to the face.
- * glyph_index :: glyph index
- * load_flags :: 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_Face face,
- 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_Init_Func init_autohinter;
- FT_AutoHinter_Done_Func done_autohinter;
- 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 */
-
diff --git a/src/shared/psnames.h b/src/shared/psnames.h
deleted file mode 100644
index 86fdba2a7..000000000
--- a/src/shared/psnames.h
+++ /dev/null
@@ -1,214 +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.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. 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 :: number of glyphs in face
- * glyph_names :: array of glyph name pointers
- * uncode :: unicode value.
- *
- * <Return>
- * The glyph index. 0xFFFF is no glyph correspond to this Unicode
- * value..
- *
- * <Note>
- * This function is able to recognize several glyph names per
- * unicode values, 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 one
- * Apple glyph name index.
- *
- * <Input>
- * name_index :: index of the Mac name
- *
- * <Return>
- * The glyph name, or 0 if the index is incorrect.
- *
- * <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 );
-
- /***************************************************************************
- *
- * <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 :: number of glyphs in the font that match a given Unicode
- * value..
- *
- * unicodes :: array of unicode values, sorted in increasing order
- * gindex :: array of glyph indices, corresponding to each unicode
- *
- * <Note>
- * Use the function PS_Lookup_Unicode to retrieve the glyph index
- * corresponding to a given Unicode character code.
- *
- ***************************************************************************/
-
- typedef struct PS_UniMap_
- {
- FT_UInt unicode;
- FT_UInt glyph_index;
-
- } PS_UniMap;
-
- 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 holds pointers to the functions used to load and
- * free the basic tables that are required in a `sfnt' font file.
- *
- * <Field>
- * unicode_value :: a function used to convert a glyph name into
- * a Unicode character code
- *
- * unicode_index :: 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 given
- * Adobe Standard Strings given a 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>
- * The 'unicode_value' and 'unicode_index' will be set to 0 if the
- * configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined
- *
- * The '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 */
diff --git a/src/shared/readme.txt b/src/shared/readme.txt
deleted file mode 100644
index b48163a30..000000000
--- a/src/shared/readme.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-WARNING:
-
-The files in these subdirectories are shared by several font drivers.
-
-All C source files are included by at least one of the drivers, and
-thus should _never_ be compiled directly.
diff --git a/src/shared/rules.mk b/src/shared/rules.mk
deleted file mode 100644
index 6fc1d58ee..000000000
--- a/src/shared/rules.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# FreeType 2 shared files configuration 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.
-
-
-ifndef SHARED_RULES
- SHARED_RULES := 1
-
- SHARED := $(SRC_)shared
- SHARED_ := $(SHARED)$(SEP)
-
- SHARED_H := $(wildcard $(SHARED_)*.h)
- SHARED_SRC := $(wildcard $(SHARED_)*.c)
-
-endif
-
-# EOF
diff --git a/src/shared/sfnt.h b/src/shared/sfnt.h
deleted file mode 100644
index d08f7f905..000000000
--- a/src/shared/sfnt.h
+++ /dev/null
@@ -1,380 +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.h>
-#include <tttypes.h>
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Format_Tag */
- /* */
- /* <Description> */
- /* Loads the first 4 bytes of the font file. This is a tag that */
- /* identifies the font format used. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* stream :: The input stream. */
- /* faceIndex :: The index of the TrueType font, if we're opening a */
- /* collection. */
- /* <Output> */
- /* format_tag :: a 4-byte tag */
- /* */
- /* <Return> */
- /* TrueType 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" */
- /* */
- typedef
- TT_Error (*TT_Load_Format_Tag_Func)( TT_Face face,
- FT_Stream stream,
- TT_Long faceIndex,
- TT_ULong *format_tag );
-
- /*************************************************************************/
- /* */
- /* <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. */
- /* faceIndex :: The index of the TrueType font, if we're opening a */
- /* collection. */
- /* */
- /* <Return> */
- /* TrueType 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
- TT_Error (*TT_Load_Directory_Func)( TT_Face face,
- FT_Stream stream,
- TT_Long faceIndex );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Any_Func */
- /* */
- /* <Description> */
- /* Loads any font table into client memory. Used by the */
- /* TT_Get_Font_Data() API function. */
- /* */
- /* <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
- TT_Error (*TT_Load_Any_Func)( TT_Face face,
- TT_ULong tag,
- TT_Long offset,
- void* buffer,
- TT_Long* 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> */
- /* TrueType 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
- TT_Error (*TT_Load_SBit_Image_Func)( TT_Face face,
- TT_Int x_ppem,
- TT_Int y_ppem,
- TT_UInt glyph_index,
- 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> */
- /* TrueType error code. 0 means success. */
- /* */
- typedef
- TT_Error (*TT_Get_PS_Name_Func)( TT_Face face,
- TT_UInt index,
- TT_String** PSname );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Metrics */
- /* */
- /* <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> */
- /* TrueType error code. 0 means success. */
- /* */
- typedef
- TT_Error (*TT_Load_Metrics_Func)( TT_Face face,
- FT_Stream stream,
- TT_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> */
- /* 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
- TT_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> */
- /* Error code. 0 means success. */
- /* */
- typedef
- TT_Error (*TT_CharMap_Free_Func)( TT_Face face,
- TT_CMapTable* cmap );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Table */
- /* */
- /* <Description> */
- /* Loads a given TrueType table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* TrueType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The function will use `face->goto_table' to seek the stream to */
- /* the start of the table */
- /* */
- typedef
- TT_Error (*TT_Load_Table_Func)( TT_Face face,
- FT_Stream stream );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Table */
- /* */
- /* <Description> */
- /* Loads a given TrueType table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* stream :: The input stream. */
- /* */
- /* <Return> */
- /* TrueType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The function will use `face->goto_table' to seek the stream to */
- /* the start of the table */
- /* */
- 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> */
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
- /* */
- typedef struct SFNT_Interface_
- {
- TT_Goto_Table_Func goto_table;
-
- TT_Load_Any_Func load_any;
- TT_Load_Format_Tag_Func load_format_tag;
- TT_Load_Directory_Func load_directory;
-
- 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;
-
-
- /* 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 */
diff --git a/src/shared/t1types.h b/src/shared/t1types.h
deleted file mode 100644
index cdcfd8897..000000000
--- a/src/shared/t1types.h
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************
- *
- * t1types.h 1.0
- *
- * Basic Type1/Type2 type definitions and interface.
- *
- * This code is shared by the Type1 and Type2 drivers
- *
- *
- * 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 <t1tables.h>
-#include <psnames.h>
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
-
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-/*** ***/
-/*** ***/
-/*** DEFINITIONS OF BASIC DATA TYPES ***/
-/*** ***/
-/*** ***/
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-
-
-/* The REDEFINE macro is used to convert a FreeType generic type into */
-/* a TrueType-specific one. It simply replaces the "FT_" prefix by "T1_" */
-/* in order to define compatible T1_Long, T1_Error, T1_Outline, etc.. */
-/* */
-#undef REDEFINE
-#define REDEFINE( type ) typedef FT_##type T1_##type
-
-
- /* <Type> T1_Bool */
- /* */
- /* <Description> */
- /* A simple typedef of unsigned char, used for simple booleans. */
- /* */
- REDEFINE( Bool );
-
-
- /* <Type> T1_FWord */
- /* */
- /* <Description> */
- /* a signed 16-bit integer used to store a distance in original */
- /* font units. */
- /* */
- REDEFINE( FWord );
-
-
- /* <Type> T1_UFWord */
- /* */
- /* <Description> */
- /* an unsigned 16-bit integer used to store a distance in original */
- /* font units. */
- /* */
- REDEFINE( UFWord );
-
-
- /* <Type> T1_Char */
- /* */
- /* <Description> */
- /* a simple typedef for the _signed_ char type. */
- /* */
- REDEFINE( Char );
-
-
- /* <Type> T1_Byte */
- /* */
- /* <Description> */
- /* a simple typedef for the _unsigned_ char type. */
- /* */
- REDEFINE( Byte );
-
-
- /* <Type> T1_String */
- /* */
- /* <Description> */
- /* a simple typedef for the char type, used for strings usually. */
- /* */
- REDEFINE( String );
-
-
- /* <Type> T1_Short */
- /* */
- /* <Description> */
- /* a typedef for signed short */
- /* */
- REDEFINE( Short );
-
-
- /* <Type> T1_UShort */
- /* */
- /* <Description> */
- /* a typedef for unsigned short */
- /* */
- REDEFINE( UShort );
-
-
- /* <Type> FT_Int */
- /* */
- /* <Description> */
- /* a typedef for the int type */
- /* */
- REDEFINE( Int );
-
-
- /* <Type> FT_UInt */
- /* */
- /* <Description> */
- /* a typedef for the unsigned int type */
- /* */
- REDEFINE( UInt );
-
-
- /* <Type> T1_Long */
- /* */
- /* <Description> */
- /* a typedef for signed long */
- /* */
- REDEFINE( Long );
-
-
- /* <Type> T1_ULong */
- /* */
- /* <Description> */
- /* a typedef for unsigned long */
- /* */
- REDEFINE( ULong );
-
-
- /* <Type> T1_F2Dot14 */
- /* */
- /* <Description> */
- /* a signed 2.14 fixed float used for unit vectors */
- /* */
- REDEFINE( F2Dot14 );
-
-
- /* <Type> T1_F26Dot6 */
- /* */
- /* <Description> */
- /* a signed 26.6 fixed float used for vectorial pixel coordinates */
- /* */
- REDEFINE( F26Dot6 );
-
-
- /* <Type> T1_Fixed */
- /* */
- /* <Description> */
- /* This type is used to store 16.16 fixed float values, like */
- /* scales or matrix coefficients.. */
- /* */
- REDEFINE( Fixed );
-
-
- /* <Type> T1_Pos */
- /* */
- /* <Description> */
- /* The type T1_Pos is a 32-bits integer used to store vectorial */
- /* coordinates. Depending on the context, these can represent */
- /* distances in integer font units, or 26.6 fixed float pixel */
- /* coordinates.. */
- /* */
- REDEFINE( Pos );
-
-
- /* <Struct> T1_Vector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2d vector, coordinates */
- /* are of the T1_Pos type. */
- /* */
- /* <Fields> */
- /* x :: horizontal coordinate */
- /* y :: vertical coordinate */
- /* */
- REDEFINE( Vector );
-
- /* <Struct> T1_UnitVector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2d vector unit vector. */
- /* uses T1_F2Dot14 types. */
- /* */
- /* <Fields> */
- /* x :: horizontal coordinate */
- /* y :: vertical coordinate */
- /* */
- REDEFINE( UnitVector );
-
-
- /* <Struct> T1_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 */
- /* */
- REDEFINE( Matrix );
-
-
- /* <Struct> T1_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) */
- /* */
- REDEFINE( BBox );
-
-
- /* <Type> T1_Error */
- /* */
- /* <Description> */
- /* The FreeType error code type. A value of 0 is always */
- /* interpreted as a succesful operation. */
- /* */
- REDEFINE( Error );
-
-
-
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-/*** ***/
-/*** ***/
-/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
-/*** ***/
-/*** ***/
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-
- /***********************************************************************/
- /* */
- /* <Struct> T1_Encoding */
- /* */
- /* <Description> */
- /* A structure modeling a custom encoding */
- /* */
- /* <Fields> */
- /* num_chars :: number of char codes in encoding. Usually 256 */
- /* code_first :: lower char code in encoding */
- /* code_last :: higher char code in encoding */
- /* */
- /* char_code :: array of character codes */
- /* char_index :: array of correpsonding glyph indices */
- /* char_name :: array of correpsonding glyph names */
- /* */
- typedef struct T1_Encoding_
- {
- T1_Int num_chars;
- T1_Int code_first;
- T1_Int code_last;
-
- T1_UShort* char_index;
- T1_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;
-
- T1_Byte* subrs_block;
- T1_Byte* charstrings_block;
- T1_Byte* glyph_names_block;
-
- T1_Int num_subrs;
- T1_Byte** subrs;
- T1_Int* subrs_len;
-
- T1_Int num_glyphs;
- T1_String** glyph_names; /* array of glyph names */
- T1_Byte** charstrings; /* array of glyph charstrings */
- T1_Int* charstrings_len;
-
- T1_Byte paint_type;
- T1_Byte font_type;
- T1_Matrix font_matrix;
- T1_BBox font_bbox;
- T1_Long font_id;
-
- T1_Int stroke_width;
-
- } T1_Font;
-
-
-
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-/*** ***/
-/*** ***/
-/*** 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 "drivers/truetype/ttobjs.h" ***/
-/*** ***/
-/*** ***/
-/*************************************************************************/
-/*************************************************************************/
-/*************************************************************************/
-
-
- typedef struct T1_FaceRec_* T1_Face;
-
-
- /***************************************************/
- /* */
- /* T1_Face : */
- /* */
- /* Type1 face record.. */
- /* */
-
- 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;
-
- } T1_FaceRec;
-
-
-#endif /* T1TYPES_H */
diff --git a/src/shared/tterrors.h b/src/shared/tterrors.h
deleted file mode 100644
index 81bcbde0c..000000000
--- a/src/shared/tterrors.h
+++ /dev/null
@@ -1,126 +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_Unavailable_Outline FT_Err_Unavailable_Outline
-#define TT_Err_Unavailable_Bitmap FT_Err_Unavailable_Bitmap
-#define TT_Err_Unavailable_Pixmap FT_Err_Unavailable_Pixmap
-#define TT_Err_File_Is_Not_Collection FT_Err_File_Is_Not_Collection
-
-#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_Points FT_Err_Too_Many_Points
-#define TT_Err_Too_Many_Contours FT_Err_Too_Many_Contours
-#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 /* FTERRID_H */
-
-
-/* END */
diff --git a/src/shared/tttags.h b/src/shared/tttags.h
deleted file mode 100644
index 3cb3bc9a3..000000000
--- a/src/shared/tttags.h
+++ /dev/null
@@ -1,60 +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.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_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_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_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 */
diff --git a/src/shared/tttypes.h b/src/shared/tttypes.h
deleted file mode 100644
index 29136fed8..000000000
--- a/src/shared/tttypes.h
+++ /dev/null
@@ -1,2073 +0,0 @@
-/***************************************************************************/
-/* */
-/* tttypes.h */
-/* */
-/* Basic SFNT/TrueType type definitions and interface (specification */
-/* only). */
-/* */
-/* This code is shared by all TrueType and OpenType drivers. */
-/* */
-/* */
-/* 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 TTTYPES_H
-#define TTTYPES_H
-
-
-#include <tttables.h>
-
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** DEFINITIONS OF BASIC DATA TYPES ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* The REDEFINE() macro is used to convert a FreeType generic type into */
- /* a TrueType-specific one. It simply replaces the `FT_' prefix by */
- /* `TT_' in order to define compatible types like TT_Long, TT_Error, */
- /* TT_Outline, etc. */
- /* */
-#undef REDEFINE
-#define REDEFINE( type ) typedef FT_##type TT_##type
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Bool */
- /* */
- /* <Description> */
- /* A typedef of unsigned char, used for simple booleans. */
- /* */
- REDEFINE( Bool );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_FWord */
- /* */
- /* <Description> */
- /* A signed 16-bit integer used to store a distance in original font */
- /* units. */
- /* */
- REDEFINE( FWord );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_UFWord */
- /* */
- /* <Description> */
- /* An unsigned 16-bit integer used to store a distance in original */
- /* font units. */
- /* */
- REDEFINE( UFWord );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Char */
- /* */
- /* <Description> */
- /* A simple typedef for the _signed_ char type. */
- /* */
- REDEFINE( Char );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Byte */
- /* */
- /* <Description> */
- /* A simple typedef for the _unsigned_ char type. */
- /* */
- REDEFINE( Byte );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_String */
- /* */
- /* <Description> */
- /* A simple typedef for the char type, usually used for strings. */
- /* */
- REDEFINE( String );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Short */
- /* */
- /* <Description> */
- /* A typedef for signed short. */
- /* */
- REDEFINE( Short );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_UShort */
- /* */
- /* <Description> */
- /* A typedef for unsigned short. */
- /* */
- REDEFINE( UShort );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Int */
- /* */
- /* <Description> */
- /* A typedef for the int type. */
- /* */
- REDEFINE( Int );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_UInt */
- /* */
- /* <Description> */
- /* A typedef for the unsigned int type. */
- /* */
- REDEFINE( UInt );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Long */
- /* */
- /* <Description> */
- /* A typedef for signed long. */
- /* */
- REDEFINE( Long );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_ULong */
- /* */
- /* <Description> */
- /* A typedef for unsigned long. */
- /* */
- REDEFINE( ULong );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_F2Dot14 */
- /* */
- /* <Description> */
- /* A signed 2.14 fixed float type used for unit vectors. */
- /* */
- REDEFINE( F2Dot14 );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_F26Dot6 */
- /* */
- /* <Description> */
- /* A signed 26.6 fixed float type used for vectorial pixel */
- /* coordinates. */
- /* */
- REDEFINE( F26Dot6 );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Fixed */
- /* */
- /* <Description> */
- /* This type is used to store 16.16 fixed float values, like scales */
- /* or matrix coefficients. */
- /* */
- REDEFINE( Fixed );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Pos */
- /* */
- /* <Description> */
- /* The type FT_Pos is a 32-bit integer used to store vectorial */
- /* coordinates. Depending on the context, these can represent */
- /* distances in integer font units, or 26.6 fixed float pixel */
- /* coordinates. */
- /* */
- REDEFINE( Pos );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Vector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2d vector; coordinates are of */
- /* the TT_Pos type. */
- /* */
- /* <Fields> */
- /* x :: The horizontal coordinate. */
- /* y :: The vertical coordinate. */
- /* */
- REDEFINE( Vector );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_UnitVector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2d vector unit vector. Uses */
- /* TT_F2Dot14 types. */
- /* */
- /* <Fields> */
- /* x :: Horizontal coordinate. */
- /* y :: Vertical coordinate. */
- /* */
- REDEFINE( UnitVector );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_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. */
- /* */
- REDEFINE( Matrix );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_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). */
- /* */
- REDEFINE( BBox );
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Error */
- /* */
- /* <Description> */
- /* The TrueType error code type. A value of 0 is always interpreted */
- /* as a successful operation. */
- /* */
- REDEFINE( Error );
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TTC_Header */
- /* */
- /* <Description> */
- /* TrueType collection header. This table contains the offsets of */
- /* the font headers of each distinct TrueType face in the file. */
- /* */
- /* <Fields> */
- /* tag :: Must be `ttc ' to indicate a TrueType collection. */
- /* version :: The version number. */
- /* count :: The number of faces in the collection. The */
- /* specification says this should be an unsigned long, but */
- /* we use a signed long since we need the value -1 for */
- /* specific purposes. */
- /* offsets :: The offsets of the font headers, one per face. */
- /* */
- typedef struct TTC_Header_
- {
- TT_ULong Tag;
- TT_Fixed version;
- TT_Long DirCount;
- TT_ULong* TableDirectory;
-
- } TTC_Header;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_TableDir */
- /* */
- /* <Description> */
- /* This structure models a TrueType table directory. It is used to */
- /* access the various tables of the font face. */
- /* */
- /* <Fields> */
- /* version :: The version number; starts with 0x00010000. */
- /* numTables :: The number of tables. */
- /* */
- /* searchRange :: Unused. */
- /* entrySelector :: Unused. */
- /* rangeShift :: Unused. */
- /* */
- /* <Note> */
- /* This structure is only used during font opening. */
- /* */
- typedef struct TT_TableDir_
- {
- TT_Fixed version; /* should be 0x10000 */
- TT_UShort numTables; /* number of tables */
-
- TT_UShort searchRange; /* These parameters are only used */
- TT_UShort entrySelector; /* for a dichotomy search in the */
- TT_UShort rangeShift; /* directory. We ignore them. */
-
- } TT_TableDir;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Table */
- /* */
- /* <Description> */
- /* This structure describes a given table of a TrueType font. */
- /* */
- /* <Fields> */
- /* Tag :: A four-bytes tag describing the table. */
- /* CheckSum :: The table checksum. This value can be ignored. */
- /* Offset :: The offset of the table from the start of the TrueType */
- /* font in its resource. */
- /* Length :: The table length (in bytes). */
- /* */
- typedef struct TT_Table_
- {
- TT_ULong Tag; /* table type */
- TT_ULong CheckSum; /* table checksum */
- TT_ULong Offset; /* table file offset */
- TT_ULong Length; /* table length */
-
- } TT_Table;
-
-
-#if 0
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Header */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType font header table. All */
- /* fields follow the TrueType specification. */
- /* */
- typedef struct TT_Header_
- {
- TT_Fixed Table_Version;
- TT_Fixed Font_Revision;
-
- TT_Long CheckSum_Adjust;
- TT_Long Magic_Number;
-
- TT_UShort Flags;
- TT_UShort Units_Per_EM;
-
- TT_Long Created [2];
- TT_Long Modified[2];
-
- TT_FWord xMin;
- TT_FWord yMin;
- TT_FWord xMax;
- TT_FWord yMax;
-
- TT_UShort Mac_Style;
- TT_UShort Lowest_Rec_PPEM;
-
- TT_Short Font_Direction;
- TT_Short Index_To_Loc_Format;
- TT_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_
- {
- TT_Fixed Version;
- TT_FWord Ascender;
- TT_FWord Descender;
- TT_FWord Line_Gap;
-
- TT_UFWord advance_Width_Max; /* advance width maximum */
-
- TT_FWord min_Left_Side_Bearing; /* minimum left-sb */
- TT_FWord min_Right_Side_Bearing; /* minimum right-sb */
- TT_FWord xMax_Extent; /* xmax extents */
- TT_FWord caret_Slope_Rise;
- TT_FWord caret_Slope_Run;
- TT_FWord caret_Offset;
-
- TT_Short Reserved[4];
-
- TT_Short metric_Data_Format;
- TT_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_
- {
- TT_Fixed Version;
- TT_FWord Ascender;
- TT_FWord Descender;
- TT_FWord Line_Gap;
-
- TT_UFWord advance_Height_Max; /* advance height maximum */
-
- TT_FWord min_Top_Side_Bearing; /* minimum left-sb or top-sb */
- TT_FWord min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
- TT_FWord yMax_Extent; /* xmax or ymax extents */
- TT_FWord caret_Slope_Rise;
- TT_FWord caret_Slope_Run;
- TT_FWord caret_Offset;
-
- TT_Short Reserved[4];
-
- TT_Short metric_Data_Format;
- TT_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_
- {
- TT_UShort version; /* 0x0001 - more or 0xFFFF */
- TT_FWord xAvgCharWidth;
- TT_UShort usWeightClass;
- TT_UShort usWidthClass;
- TT_Short fsType;
- TT_FWord ySubscriptXSize;
- TT_FWord ySubscriptYSize;
- TT_FWord ySubscriptXOffset;
- TT_FWord ySubscriptYOffset;
- TT_FWord ySuperscriptXSize;
- TT_FWord ySuperscriptYSize;
- TT_FWord ySuperscriptXOffset;
- TT_FWord ySuperscriptYOffset;
- TT_FWord yStrikeoutSize;
- TT_FWord yStrikeoutPosition;
- TT_Short sFamilyClass;
-
- TT_Byte panose[10];
-
- TT_ULong ulUnicodeRange1; /* Bits 0-31 */
- TT_ULong ulUnicodeRange2; /* Bits 32-63 */
- TT_ULong ulUnicodeRange3; /* Bits 64-95 */
- TT_ULong ulUnicodeRange4; /* Bits 96-127 */
-
- TT_Char achVendID[4];
-
- TT_UShort fsSelection;
- TT_UShort usFirstCharIndex;
- TT_UShort usLastCharIndex;
- TT_Short sTypoAscender;
- TT_Short sTypoDescender;
- TT_Short sTypoLineGap;
- TT_UShort usWinAscent;
- TT_UShort usWinDescent;
-
- /* only version 1 tables: */
-
- TT_ULong ulCodePageRange1; /* Bits 0-31 */
- TT_ULong ulCodePageRange2; /* Bits 32-63 */
-
- } 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_
- {
- TT_Fixed FormatType;
- TT_Fixed italicAngle;
- TT_FWord underlinePosition;
- TT_FWord underlineThickness;
- TT_ULong isFixedPitch;
- TT_ULong minMemType42;
- TT_ULong maxMemType42;
- TT_ULong minMemType1;
- TT_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_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_
- {
- TT_Fixed version;
- TT_UShort numGlyphs;
- TT_UShort maxPoints;
- TT_UShort maxContours;
- TT_UShort maxCompositePoints;
- TT_UShort maxCompositeContours;
- TT_UShort maxZones;
- TT_UShort maxTwilightPoints;
- TT_UShort maxStorage;
- TT_UShort maxFunctionDefs;
- TT_UShort maxInstructionDefs;
- TT_UShort maxStackElements;
- TT_UShort maxSizeOfInstructions;
- TT_UShort maxComponentElements;
- TT_UShort maxComponentDepth;
-
- } TT_MaxProfile;
-
-
-#endif
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_CMapDir */
- /* */
- /* <Description> */
- /* This structure describes the directory of the `cmap' table, */
- /* containing the font's character mappings table. */
- /* */
- /* <Fields> */
- /* tableVersionNumber :: The version number. */
- /* numCMaps :: The number of charmaps in the font. */
- /* */
- /* <Note> */
- /* This structure is only used during font loading. */
- /* */
- typedef struct TT_CMapDir_
- {
- TT_UShort tableVersionNumber;
- TT_UShort numCMaps;
-
- } TT_CMapDir;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_CMapDirEntry */
- /* */
- /* <Description> */
- /* This structure describes a charmap in a TrueType font. */
- /* */
- /* <Fields> */
- /* platformID :: An ID used to specify for which platform this */
- /* charmap is defined (FreeType manages all platforms). */
- /* */
- /* encodingID :: A platform-specific ID used to indicate which source */
- /* encoding is used in this charmap. */
- /* */
- /* offset :: The offset of the charmap relative to the start of */
- /* the `cmap' table. */
- /* */
- /* <Note> */
- /* This structure is only used during font loading. */
- /* */
- typedef struct TT_CMapDirEntry_
- {
- TT_UShort platformID;
- TT_UShort platformEncodingID;
- TT_Long offset;
-
- } TT_CMapDirEntry;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_LongMetrics */
- /* */
- /* <Description> */
- /* A structure modeling the long metrics of the `hmtx' and `vmtx' */
- /* TrueType tables. The values are expressed in font units. */
- /* */
- /* <Fields> */
- /* advance :: The advance width or height for the glyph. */
- /* bearing :: The left-side or top-side bearing for the glyph. */
- /* */
- typedef struct TT_LongMetrics_
- {
- TT_UShort advance;
- TT_Short bearing;
-
- } TT_LongMetrics;
-
-
- /*************************************************************************/
- /* */
- /* <Type> TT_ShortMetrics */
- /* */
- /* <Description> */
- /* A simple type to model the short metrics of the `hmtx' and `vmtx' */
- /* tables. */
- /* */
- typedef TT_Short TT_ShortMetrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_NameRec */
- /* */
- /* <Description> */
- /* A structure modeling TrueType name records. Name records are used */
- /* to store important strings like family name, style name, */
- /* copyright, etc. in _localized_ versions (i.e., language, encoding, */
- /* etc). */
- /* */
- /* <Fields> */
- /* platformID :: The ID of the name's encoding platform. */
- /* */
- /* encodingID :: The platform-specific ID for the name's encoding. */
- /* */
- /* languageID :: The platform-specific ID for the name's language. */
- /* */
- /* nameID :: The ID specifying what kind of name this is. */
- /* */
- /* stringLength :: The length of the string in bytes. */
- /* */
- /* stringOffset :: The offset to the string in the `name' table. */
- /* */
- /* string :: A pointer to the string's bytes. Note that these */
- /* are usually UTF-16 encoded characters. */
- /* */
- typedef struct TT_NameRec_
- {
- TT_UShort platformID;
- TT_UShort encodingID;
- TT_UShort languageID;
- TT_UShort nameID;
- TT_UShort stringLength;
- TT_UShort stringOffset;
-
- /* this last field is not defined in the spec */
- /* but used by the FreeType engine */
-
- TT_Byte* string;
-
- } TT_NameRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_NameTable */
- /* */
- /* <Description> */
- /* A structure modeling the TrueType name table. */
- /* */
- /* <Fields> */
- /* format :: The format of the name table. */
- /* */
- /* numNameRecords :: The number of names in table. */
- /* */
- /* storageOffset :: The offset of the name table in the `name' */
- /* TrueType table. */
- /* */
- /* names :: An array of name records. */
- /* */
- /* storage :: The names storage area. */
- /* */
- typedef struct TT_NameTable_
- {
- TT_UShort format;
- TT_UShort numNameRecords;
- TT_UShort storageOffset;
- TT_NameRec* names;
- TT_Byte* storage;
-
- } TT_NameTable;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_GaspRange */
- /* */
- /* <Description> */
- /* A tiny structure used to model a gasp range according to the */
- /* TrueType specification. */
- /* */
- /* <Fields> */
- /* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */
- /* */
- /* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */
- /* modes to be used. */
- /* */
- typedef struct TT_GaspRange_
- {
- TT_UShort maxPPEM;
- TT_UShort gaspFlag;
-
- } TT_GaspRange;
-
-
-#define TT_GASP_GRIDFIT 0x01
-#define TT_GASP_DOGRAY 0x02
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Gasp */
- /* */
- /* <Description> */
- /* A structure modeling the TrueType `gasp' table used to specify */
- /* grid-fitting and anti-aliasing behaviour. */
- /* */
- /* <Fields> */
- /* version :: The version number. */
- /* numRanges :: The number of gasp ranges in table. */
- /* gaspRanges :: An array of gasp ranges. */
- /* */
- typedef struct TT_Gasp_
- {
- TT_UShort version;
- TT_UShort numRanges;
- TT_GaspRange* gaspRanges;
-
- } TT_Gasp;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_HdmxRec */
- /* */
- /* <Description> */
- /* A small structure used to model the pre-computed widths of a given */
- /* size. They're found in the `hdmx' table. */
- /* */
- /* <Fields> */
- /* ppem :: The pixels per EM value at which these metrics apply. */
- /* */
- /* max_width :: The maximum advance width for this metric. */
- /* */
- /* widths :: An array of widths. Note: These are 8-bit bytes. */
- /* */
- typedef struct TT_HdmxRec_
- {
- TT_Byte ppem;
- TT_Byte max_width;
- TT_Byte* widths;
-
- } TT_HdmxRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_HdmxRec */
- /* */
- /* <Description> */
- /* A structure used to model the `hdmx' table, which contains */
- /* pre-computed widths for a set of given sizes/dimensions. */
- /* */
- /* <Fields> */
- /* version :: The version number. */
- /* num_records :: The number of hdmx records. */
- /* records :: An array of hdmx records. */
- /* */
- typedef struct TT_Hdmx_
- {
- TT_UShort version;
- TT_Short num_records;
- TT_HdmxRec* records;
-
- } TT_Hdmx;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Kern_0_Pair */
- /* */
- /* <Description> */
- /* A structure used to model a kerning pair for the kerning table */
- /* format 0. The engine now loads this table if it finds one in the */
- /* font file. */
- /* */
- /* <Fields> */
- /* left :: The index of the left glyph in pair. */
- /* right :: The index of the right glyph in pair. */
- /* value :: The kerning distance. A positive value spaces the */
- /* glyphs, a negative one makes them closer. */
- /* */
- typedef struct TT_Kern_0_Pair_
- {
- TT_UShort left; /* index of left glyph in pair */
- TT_UShort right; /* index of right glyph in pair */
- TT_FWord value; /* kerning value */
-
- } TT_Kern_0_Pair;
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** EMBEDDED BITMAPS SUPPORT ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_Metrics */
- /* */
- /* <Description> */
- /* A structure used to hold the big metrics of a given glyph bitmap */
- /* in a TrueType or OpenType font. These are usually found in the */
- /* `EBDT' (Microsoft) or `bdat' (Apple) table. */
- /* */
- /* <Fields> */
- /* height :: The glyph height in pixels. */
- /* */
- /* width :: The glyph width in pixels. */
- /* */
- /* horiBearingX :: The horizontal left bearing. */
- /* */
- /* horiBearingY :: The horizontal top bearing. */
- /* */
- /* horiAdvance :: The horizontal advance. */
- /* */
- /* vertBearingX :: The vertical left bearing. */
- /* */
- /* vertBearingY :: The vertical top bearing. */
- /* */
- /* vertAdvance :: The vertical advance. */
- /* */
- typedef struct TT_SBit_Metrics_
- {
- TT_Byte height;
- TT_Byte width;
-
- TT_Char horiBearingX;
- TT_Char horiBearingY;
- TT_Byte horiAdvance;
-
- TT_Char vertBearingX;
- TT_Char vertBearingY;
- TT_Byte vertAdvance;
-
- } TT_SBit_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_Small_Metrics */
- /* */
- /* <Description> */
- /* A structure used to hold the small metrics of a given glyph bitmap */
- /* in a TrueType or OpenType font. These are usually found in the */
- /* `EBDT' (Microsoft) or the `bdat' (Apple) table. */
- /* */
- /* <Fields> */
- /* height :: The glyph height in pixels. */
- /* */
- /* width :: The glyph width in pixels. */
- /* */
- /* bearingX :: The left-side bearing. */
- /* */
- /* bearingY :: The top-side bearing. */
- /* */
- /* advance :: The advance width or height. */
- /* */
- typedef struct TT_SBit_Small_Metrics_
- {
- TT_Byte height;
- TT_Byte width;
-
- TT_Char bearingX;
- TT_Char bearingY;
- TT_Byte advance;
-
- } TT_SBit_Small_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_Line_Metrics */
- /* */
- /* <Description> */
- /* A structure used to describe the text line metrics of a given */
- /* bitmap strike, for either a horizontal or vertical layout. */
- /* */
- /* <Fields> */
- /* ascender :: The ascender in pixels. */
- /* */
- /* descender :: The descender in pixels. */
- /* */
- /* max_width :: The maximum glyph width in pixels. */
- /* */
- /* caret_slope_enumerator :: Rise of the caret slope, typically set */
- /* to 1 for non-italic fonts. */
- /* */
- /* caret_slope_denominator :: Rise of the caret slope, typically set */
- /* to 0 for non-italic fonts. */
- /* */
- /* caret_offset :: Offset in pixels to move the caret for */
- /* proper positioning. */
- /* */
- /* min_origin_SB :: Minimum of horiBearingX (resp. */
- /* vertBearingY). */
- /* min_advance_SB :: Minimum of */
- /* */
- /* horizontal advance - */
- /* ( horiBearingX + width ) */
- /* */
- /* resp. */
- /* */
- /* vertical advance - */
- /* ( vertBearingY + height ) */
- /* */
- /* max_before_BL :: Maximum of horiBearingY (resp. */
- /* vertBearingY). */
- /* */
- /* min_after_BL :: Minimum of */
- /* */
- /* horiBearingY - height */
- /* */
- /* resp. */
- /* */
- /* vertBearingX - width */
- /* */
- typedef struct TT_SBit_Line_Metrics_
- {
- TT_Char ascender;
- TT_Char descender;
- TT_Byte max_width;
- TT_Char caret_slope_numerator;
- TT_Char caret_slope_denominator;
- TT_Char caret_offset;
- TT_Char min_origin_SB;
- TT_Char min_advance_SB;
- TT_Char max_before_BL;
- TT_Char min_after_BL;
- TT_Char pads[2];
-
- } TT_SBit_Line_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_Range */
- /* */
- /* <Description> */
- /* A TrueType/OpenType subIndexTable as defined in the `EBLC' */
- /* (Microsoft) or `bloc' (Apple) tables. */
- /* */
- /* <Fields> */
- /* first_glyph :: The first glyph index in the range. */
- /* */
- /* last_glyph :: The last glyph index in the range. */
- /* */
- /* index_format :: The format of index table. Valid values are 1 */
- /* to 5. */
- /* */
- /* image_format :: The format of `EBDT' image data. */
- /* */
- /* image_offset :: The offset to image data in `EBDT'. */
- /* */
- /* image_size :: For index formats 2 and 5. This is the size in */
- /* bytes of each glyph bitmap. */
- /* */
- /* big_metrics :: For index formats 2 and 5. This is the big */
- /* metrics for each glyph bitmap. */
- /* */
- /* num_glyphs :: For index formats 4 and 5. This is the number of */
- /* glyphs in the code array. */
- /* */
- /* glyph_offsets :: For index formats 1 and 3. */
- /* */
- /* glyph_codes :: For index formats 4 and 5. */
- /* */
- /* table_offset :: The offset of the index table in the `EBLC' */
- /* table. Only used during strike loading. */
- /* */
- typedef struct TT_SBit_Range
- {
- TT_UShort first_glyph;
- TT_UShort last_glyph;
-
- TT_UShort index_format;
- TT_UShort image_format;
- TT_ULong image_offset;
-
- TT_ULong image_size;
- TT_SBit_Metrics metrics;
- TT_ULong num_glyphs;
-
- TT_ULong* glyph_offsets;
- TT_UShort* glyph_codes;
-
- TT_ULong table_offset;
-
- } TT_SBit_Range;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_Strike */
- /* */
- /* <Description> */
- /* A structure used describe a given bitmap strike in the `EBLC' */
- /* (Microsoft) or `bloc' (Apple) tables. */
- /* */
- /* <Fields> */
- /* num_index_ranges :: The number of index ranges. */
- /* */
- /* index_ranges :: An array of glyph index ranges. */
- /* */
- /* color_ref :: Unused. A color reference? */
- /* */
- /* hori :: The line metrics for horizontal layouts. */
- /* */
- /* vert :: The line metrics for vertical layouts. */
- /* */
- /* start_glyph :: The lowest glyph index for this strike. */
- /* */
- /* end_glyph :: The highest glyph index for this strike. */
- /* */
- /* x_ppem :: The number of horizontal pixels per EM. */
- /* */
- /* y_ppem :: The number of vertical pixels per EM. */
- /* */
- /* bit_depth :: The bit depth. Valid values are 1, 2, 4, */
- /* and 8. */
- /* */
- /* flags :: Is this a vertical or horizontal strike? */
- /* */
- typedef struct TT_SBit_Strike_
- {
- TT_Int num_ranges;
- TT_SBit_Range* sbit_ranges;
- TT_ULong ranges_offset;
-
- TT_ULong color_ref;
-
- TT_SBit_Line_Metrics hori;
- TT_SBit_Line_Metrics vert;
-
- TT_UShort start_glyph;
- TT_UShort end_glyph;
-
- TT_Byte x_ppem;
- TT_Byte y_ppem;
-
- TT_Byte bit_depth;
- TT_Char flags;
-
- } TT_SBit_Strike;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_Component */
- /* */
- /* <Description> */
- /* A simple structure to describe a compound sbit element. */
- /* */
- /* <Fields> */
- /* glyph_code :: The element's glyph index. */
- /* x_offset :: The element's left bearing. */
- /* y_offset :: The element's top bearing. */
- /* */
- typedef struct TT_SBit_Component_
- {
- TT_UShort glyph_code;
-
- TT_Char x_offset;
- TT_Char y_offset;
-
- } TT_SBit_Component;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_SBit_Scale */
- /* */
- /* <Description> */
- /* A structure used describe a given bitmap scaling table, as defined */
- /* in the `EBSC' table. */
- /* */
- /* <Fields> */
- /* hori :: The horizontal line metrics. */
- /* */
- /* vert :: The vertical line metrics. */
- /* */
- /* x_ppem :: The number of horizontal pixels per EM. */
- /* */
- /* y_ppem :: The number of vertical pixels per EM. */
- /* */
- /* x_ppem_substitute :: Substitution x_ppem value. */
- /* */
- /* y_ppem_substitute :: Substitution y_ppem value. */
- /* */
- typedef struct TT_SBit_Scale_
- {
- TT_SBit_Line_Metrics hori;
- TT_SBit_Line_Metrics vert;
-
- TT_Byte x_ppem;
- TT_Byte y_ppem;
-
- TT_Byte x_ppem_substitute;
- TT_Byte y_ppem_substitute;
-
- } TT_SBit_Scale;
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** POSTSCRIPT GLYPH NAMES SUPPORT ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Post_20 */
- /* */
- /* <Description> */
- /* Postscript names sub-table, format 2.0. Stores the PS name of */
- /* each glyph in the font face. */
- /* */
- /* <Fields> */
- /* num_glyphs :: The number of named glyphs in the table. */
- /* */
- /* num_names :: The number of PS names stored in the table. */
- /* */
- /* glyph_indices :: The indices of the glyphs in the names arrays. */
- /* */
- /* glyph_names :: The PS names not in Mac Encoding. */
- /* */
- typedef struct TT_Post_20_
- {
- TT_UShort num_glyphs;
- TT_UShort num_names;
- TT_UShort* glyph_indices;
- TT_Char** glyph_names;
-
- } TT_Post_20;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Post_25 */
- /* */
- /* <Description> */
- /* Postscript names sub-table, format 2.5. Stores the PS name of */
- /* each glyph in the font face. */
- /* */
- /* <Fields> */
- /* num_glyphs :: The number of glyphs in the table. */
- /* */
- /* offsets :: An array of signed offsets in a normal Mac */
- /* Postscript name encoding. */
- /* */
- typedef struct TT_Post_25_
- {
- TT_UShort num_glyphs;
- TT_Char* offsets;
-
- } TT_Post_25;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Post_Names */
- /* */
- /* <Description> */
- /* Postscript names table, either format 2.0 or 2.5. */
- /* */
- /* <Fields> */
- /* loaded :: A flag to indicate whether the PS names are loaded. */
- /* */
- /* format_20 :: The sub-table used for format 2.0. */
- /* */
- /* format_25 :: The sub-table used for format 2.5. */
- /* */
- typedef struct TT_Post_Names_
- {
- TT_Bool loaded;
-
- union
- {
- TT_Post_20 format_20;
- TT_Post_25 format_25;
-
- } names;
-
- } TT_Post_Names;
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** TRUETYPE CHARMAPS SUPPORT ***/
- /*** ***/
- /*** ***/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /* format 0 */
- typedef struct TT_CMap0_
- {
- TT_Byte* glyphIdArray;
-
- } TT_CMap0;
-
-
- /* format 2 */
- typedef struct TT_CMap2SubHeader_
- {
- TT_UShort firstCode; /* first valid low byte */
- TT_UShort entryCount; /* number of valid low bytes */
- TT_Short idDelta; /* delta value to glyphIndex */
- TT_UShort idRangeOffset; /* offset from here to 1st code */
-
- } TT_CMap2SubHeader;
-
-
- typedef struct TT_CMap2_
- {
- TT_UShort* subHeaderKeys;
- /* high byte mapping table */
- /* value = subHeader index * 8 */
-
- TT_CMap2SubHeader* subHeaders;
- TT_UShort* glyphIdArray;
- TT_UShort numGlyphId; /* control value */
-
- } TT_CMap2;
-
-
- /* format 4 */
- typedef struct TT_CMap4Segment_
- {
- TT_UShort endCount;
- TT_UShort startCount;
- TT_Short idDelta;
- TT_UShort idRangeOffset;
-
- } TT_CMap4Segment;
-
-
- typedef struct TT_CMap4_
- {
- TT_UShort segCountX2; /* number of segments * 2 */
- TT_UShort searchRange; /* these parameters can be used */
- TT_UShort entrySelector; /* for a binary search */
- TT_UShort rangeShift;
-
- TT_CMap4Segment* segments;
- TT_UShort* glyphIdArray;
- TT_UShort numGlyphId; /* control value */
-
- } TT_CMap4;
-
-
- /* format 6 */
- typedef struct TT_CMap6_
- {
- TT_UShort firstCode; /* first character code of subrange */
- TT_UShort entryCount; /* number of character codes in subrange */
-
- TT_UShort* glyphIdArray;
-
- } TT_CMap6;
-
- typedef struct TT_CMapTable_ TT_CMapTable;
-
- typedef
- TT_UInt (*TT_CharMap_Func)( TT_CMapTable* charmap,
- TT_ULong char_code );
-
- /* charmap table */
- struct TT_CMapTable_
- {
- TT_UShort platformID;
- TT_UShort platformEncodingID;
- TT_UShort format;
- TT_UShort length;
- TT_UShort version;
-
- TT_Bool loaded;
- TT_ULong offset;
-
- union
- {
- TT_CMap0 cmap0;
- TT_CMap2 cmap2;
- TT_CMap4 cmap4;
- TT_CMap6 cmap6;
- } c;
-
- TT_CharMap_Func get_index;
- };
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_CharMapRec */
- /* */
- /* <Description> */
- /* The TrueType character map object type. */
- /* */
- /* <Fields> */
- /* root :: The parent character map structure. */
- /* cmap :: The used character map. */
- /* */
- typedef struct TT_CharMapRec_
- {
- FT_CharMapRec root;
- TT_CMapTable cmap;
-
- } TT_CharMapRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /*** ***/
- /*** ***/
- /*** ORIGINAL TT_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 */
- /* `drivers/truetype/ttobjs.h'. */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_Face */
- /* */
- /* <Description> */
- /* A handle to a TrueType face/font object. A TT_Face encapsulates */
- /* the resolution and scaling independent parts of a TrueType font */
- /* resource. */
- /* */
- /* <Note> */
- /* The TT_Face structure is also used as a `parent class' for the */
- /* OpenType-CFF class (T2_Face). */
- /* */
- typedef struct TT_FaceRec_* TT_Face;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* TT_CharMap */
- /* */
- /* <Description> */
- /* A handle to a TrueType character mapping object. */
- /* */
- typedef struct TT_CharMapRec_* TT_CharMap;
-
-
- /* a function type used for the truetype bytecode interpreter hooks */
- typedef TT_Error (*TT_Interpreter)( void* exec_context );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Goto_Table_Func */
- /* */
- /* <Description> */
- /* Seeks a stream to the start of a given TrueType table. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* tag :: a 4-byte tag used to name the table */
- /* stream :: The input stream. */
- /* */
- /* <Output> */
- /* length :: length of table in bytes. Set to 0 when not needed */
- /* */
- /* <Return> */
- /* TrueType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The stream cursor must be at the font file's origin */
- /* */
- typedef
- TT_Error (*TT_Goto_Table_Func)( TT_Face face,
- TT_ULong tag,
- FT_Stream stream,
- TT_ULong *length );
-
- /*************************************************************************/
- /* */
- /* TrueType Face Type */
- /* */
- /* <Struct> */
- /* TT_Face */
- /* */
- /* <Description> */
- /* The TrueType face class. These objects model the resolution and */
- /* point-size independent data found in a TrueType font file. */
- /* */
- /* <Fields> */
- /* root :: The base FT_Face structure, managed by the */
- /* base layer. */
- /* */
- /* ttcHeader :: The TrueType collection header, used when the */
- /* file is a `ttc' rather than a `ttf'. For */
- /* ordinary font files, the field */
- /* `ttcHeader.DirCount' is set to 0. */
- /* */
- /* num_tables :: The number of TrueType tables in this font */
- /* file. */
- /* */
- /* dir_tables :: The directory of TrueType tables for this */
- /* font file. */
- /* */
- /* header :: The font's font header (`head' table). Read */
- /* on font opening. */
- /* */
- /* horizontal :: The font's horizontal header (`hhea' table). */
- /* This field also contains the associated */
- /* horizontal metrics table (`hmtx'). */
- /* */
- /* max_profile :: The font's maximum profile table. Read on */
- /* font opening. Note that some maximum values */
- /* cannot be taken directly from this table. We */
- /* thus define additional fields below to hold */
- /* the computed maxima. */
- /* */
- /* max_components :: The maximum number of glyph components */
- /* required to load any composite glyph from */
- /* this font. Used to size the load stack. */
- /* */
- /* vertical_info :: A boolean which is set when the font file */
- /* contains vertical metrics. If not, the value */
- /* of the `vertical' field is undefined. */
- /* */
- /* vertical :: The font's vertical header (`vhea' table). */
- /* This field also contains the associated */
- /* vertical metrics table (`vmtx'), if found. */
- /* IMPORTANT: The contents of this field is */
- /* undefined if the `verticalInfo' field is */
- /* unset. */
- /* */
- /* num_names :: The number of name records within this */
- /* TrueType font. */
- /* */
- /* name_table :: The table of name records (`name'). */
- /* */
- /* os2 :: The font's OS/2 table (`OS/2'). */
- /* */
- /* postscript :: The font's PostScript table (`post' table). */
- /* The PostScript glyph names are not loaded by */
- /* the driver on face opening. See the `ttpost' */
- /* module for more details. */
- /* */
- /* num_charmaps :: The number of character mappings in the font. */
- /* */
- /* charmaps :: The array of charmap objects for this font */
- /* file. Note that this field is a typeless */
- /* pointer. The Reason is that the format of */
- /* charmaps varies with the underlying font */
- /* format and cannot be determined here. */
- /* */
- /* goto_face :: a function called by each TrueType table */
- /* loader to position a stream's cursor to the */
- /* start of a given table according to its tag. */
- /* it defaults to TT_Goto_Face but can be */
- /* different for strange formats (e.g. Type 42) */
- /* */
- /* sfnt :: a pointer to the SFNT `driver' interface. */
- /* */
- /* hdmx :: The face's horizontal device metrics (`hdmx' */
- /* table). This table is optional in */
- /* TrueType/OpenType fonts. */
- /* */
- /* gasp :: The grid-fitting and scaling properties table */
- /* (`gasp'). This table is optional in */
- /* TrueType/OpenType fonts. */
- /* */
- /* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */
- /* sizes, embedded in this font. */
- /* */
- /* sbit_strikes :: An array of sbit strikes embedded in this */
- /* font. This table is optional in a */
- /* TrueType/OpenType font. */
- /* */
- /* num_sbit_scales :: The number of sbit scales for this font. */
- /* */
- /* sbit_scales :: Array of sbit scales embedded in this font. */
- /* This table is optional in a TrueType/OpenType */
- /* font. */
- /* */
- /* postscript_names :: A table used to store the Postscript names of */
- /* the glyphs for this font. See the file */
- /* `ttconfig.h' for comments on the */
- /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
- /* */
- /* num_locations :: The number of glyph locations in this */
- /* TrueType file. This should be identical to */
- /* the number of glyphs. Ignored for Type 2 */
- /* fonts. */
- /* */
- /* glyph_locations :: An array of longs. These are offsets to */
- /* glyph data within the `glyf' table. Ignored */
- /* for Type 2 font faces. */
- /* */
- /* font_program_size :: Size in bytecodes of the face's font program. */
- /* 0 if none defined. Ignored for Type 2 fonts. */
- /* */
- /* font_program :: The face's font program (bytecode stream) */
- /* executed at load time, also used during glyph */
- /* rendering. Comes from the `fpgm' table. */
- /* Ignored for Type 2 font fonts. */
- /* */
- /* cvt_program_size :: Size in bytecodes of the face's cvt program. */
- /* Ignored for Type 2 fonts. */
- /* */
- /* cvt_program :: The face's cvt program (bytecode stream) */
- /* executed each time an instance/size is */
- /* changed/reset. Comes from the `prep' table. */
- /* Ignored for Type 2 fonts. */
- /* */
- /* cvt_size :: Size of the control value table (in entries). */
- /* Ignored for Type 2 fonts. */
- /* */
- /* cvt :: The face's original control value table. */
- /* Coordinates are expressed in unscaled font */
- /* units. Comes from the `cvt ` table. Ignored */
- /* for Type 2 fonts. */
- /* */
- /* num_kern_pairs :: The number of kerning pairs present in the */
- /* font file. The engine only loads the first */
- /* horizontal format 0 kern table it finds in */
- /* the font file. You should use the `ttxkern' */
- /* structures if you want to access other */
- /* kerning tables. Ignored for Type 2 fonts. */
- /* */
- /* kern_table_index :: The index of the kerning table in the font */
- /* kerning directory. Only used by the ttxkern */
- /* extension to avoid data duplication. Ignored */
- /* for Type 2 fonts. */
- /* */
- /* kern_pairs :: Array of kerning pairs, if any. Ignored for */
- /* Type 2 fonts. */
- /* */
- /* interpreter :: Pointer to the TrueType bytecode interpreter */
- /* this field is also used to hook the debugger */
- /* in `ttdebug' */
- /* */
- typedef struct TT_FaceRec_
- {
- FT_FaceRec root;
-
- TTC_Header ttc_header;
-
- TT_UShort num_tables;
- TT_Table* dir_tables;
-
- TT_Header header; /* TrueType header table */
- TT_HoriHeader horizontal; /* TrueType horizontal header */
-
- TT_MaxProfile max_profile;
- TT_ULong max_components;
-
- TT_Bool vertical_info;
- TT_VertHeader vertical; /* TT Vertical header, if present */
-
- TT_Int num_names; /* number of name records */
- TT_NameTable name_table; /* name table */
-
- TT_OS2 os2; /* TrueType OS/2 table */
- TT_Postscript postscript; /* TrueType Postscript table */
-
- TT_Int num_charmaps;
- TT_CharMap charmaps; /* array of TT_CharMapRec */
-
- /* a pointer to the function used to seek a stream to the start of */
- /* a given TrueType table. This should default to the function */
- /* TT_Goto_Table defined in `ttload.h', but some font drivers */
- /* might need something different, e.g. Type 42 fonts */
- TT_Goto_Table_Func goto_table;
-
- /* a typeless pointer to the SFNT_Interface table used to load */
- /* the basic TrueType tables in the face object */
- void* sfnt;
-
- /* a typeless pointer to the PSNames_Interface table used to */
- /* handle glyph names <-> unicode & Mac values */
- void* psnames;
-
- /***********************************************************************/
- /* */
- /* Optional TrueType/OpenType tables */
- /* */
- /***********************************************************************/
-
- /* horizontal device metrics */
- TT_Hdmx hdmx;
-
- /* grid-fitting and scaling table */
- TT_Gasp gasp; /* the `gasp' table */
-
- /* embedded bitmaps support */
- TT_Int num_sbit_strikes;
- TT_SBit_Strike* sbit_strikes;
-
- TT_Int num_sbit_scales;
- TT_SBit_Scale* sbit_scales;
-
- /* postscript names table */
- TT_Post_Names postscript_names;
-
- /***********************************************************************/
- /* */
- /* TrueType-specific fields (ignored by the OTF-Type2 driver) */
- /* */
- /***********************************************************************/
-
- /* the glyph locations */
- TT_UShort num_locations;
- TT_Long* glyph_locations;
-
- /* the font program, if any */
- TT_ULong font_program_size;
- TT_Byte* font_program;
-
- /* the cvt program, if any */
- TT_ULong cvt_program_size;
- TT_Byte* cvt_program;
-
- /* the original, unscaled, control value table */
- TT_ULong cvt_size;
- TT_Short* cvt;
-
- /* the format 0 kerning table, if any */
- TT_Int num_kern_pairs;
- TT_Int kern_table_index;
- TT_Kern_0_Pair* kern_pairs;
-
- /* a pointer to the bytecode interpreter to use. This is also */
- /* used to hook the debugger for the `ttdebug' utility.. */
- TT_Interpreter interpreter;
-
- } TT_FaceRec;
-
-
-#ifdef __cplusplus
- }
-#endif
-
-
-#endif /* TTTYPES_H */
-
-
-/* END */
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 7673f6a47..82bcd6ccb 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -16,10 +16,10 @@
/***************************************************************************/
-#include <ftdebug.h>
-#include <ftstream.h>
-#include <ttnameid.h>
-#include <sfnt.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/sfnt.h>
+#include <freetype/ttnameid.h>
#include <ttdriver.h>
#include <ttgload.h>
diff --git a/src/truetype/ttdriver.h b/src/truetype/ttdriver.h
index 062e70187..5e31b751f 100644
--- a/src/truetype/ttdriver.h
+++ b/src/truetype/ttdriver.h
@@ -19,11 +19,10 @@
#ifndef TTDRIVER_H
#define TTDRIVER_H
-#include <freetype.h>
-#include <ftdriver.h>
+#include <freetype/internal/ftdriver.h>
+#include <freetype/ttnameid.h>
#include <ttobjs.h>
#include <tterrors.h>
-#include <ttnameid.h>
EXPORT_DEF
diff --git a/src/truetype/tterrors.h b/src/truetype/tterrors.h
index 90286e3ed..c8b272c62 100644
--- a/src/truetype/tterrors.h
+++ b/src/truetype/tterrors.h
@@ -19,7 +19,6 @@
#ifndef TTERRORS_H
#define TTERRORS_H
-
/*************************************************************************/
/* */
/* Error codes declaration */
@@ -92,6 +91,9 @@
#define TT_Err_Invalid_Displacement 0x410
#define TT_Err_Execution_Too_Long 0x411
+#define TT_Err_Too_Many_Instruction_Defs 0x412
+#define TT_Err_Too_Many_Function_Defs 0x412
+
/* Other TrueType specific error codes. */
#define TT_Err_Table_Missing 0x420
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index e824f62e9..bd66e8f2d 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -16,15 +16,14 @@
/***************************************************************************/
-#include <freetype.h>
-#include <ftdebug.h>
-#include <ftcalc.h>
-#include <ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftcalc.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/sfnt.h>
+#include <freetype/tttags.h>
-#include <sfnt.h>
-#include <ttgload.h>
-#include <tttags.h>
+#include <ttgload.h>
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#include <ttinterp.h>
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 8f84abd34..d26293d5c 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -16,11 +16,12 @@
/***************************************************************************/
-#include <ftdebug.h>
-#include <ftsystem.h>
-#include <ftcalc.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftcalc.h>
+#include <freetype/ftsystem.h>
#include <ttobjs.h>
+#include <tterrors.h>
#include <ttinterp.h>
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index abb95995f..2023f36f2 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -16,15 +16,14 @@
/***************************************************************************/
-#include <freetype.h>
-#include <ftdebug.h>
-#include <ftcalc.h>
-#include <ftstream.h>
-#include <ttnameid.h>
-#include <tttags.h>
-
-#include <sfnt.h>
-#include <psnames.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftcalc.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/ttnameid.h>
+#include <freetype/tttags.h>
+
+#include <freetype/internal/sfnt.h>
+#include <freetype/internal/psnames.h>
#include <ttobjs.h>
#include <ttpload.h>
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index e22d3f61b..ac57b7b44 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -20,8 +20,8 @@
#define TTOBJS_H
-#include <ftobjs.h>
-#include <tttypes.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/tttypes.h>
#include <tterrors.h>
diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c
index 4293b9379..56d61cc65 100644
--- a/src/truetype/ttpload.c
+++ b/src/truetype/ttpload.c
@@ -16,12 +16,12 @@
/***************************************************************************/
-#include <ftdebug.h>
-#include <ftobjs.h>
-#include <ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/tttags.h>
#include <ttpload.h>
-#include <tttags.h>
#include <tterrors.h>
#undef FT_COMPONENT
diff --git a/src/truetype/ttpload.h b/src/truetype/ttpload.h
index bb7c51777..30b2972ed 100644
--- a/src/truetype/ttpload.h
+++ b/src/truetype/ttpload.h
@@ -19,7 +19,7 @@
#ifndef TTPLOAD_H
#define TTPLOAD_H
-#include <tttypes.h>
+#include <freetype/internal/tttypes.h>
#ifdef __cplusplus
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index f619e28e5..2b904af83 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -5,10 +5,10 @@
*
***************************************************************************/
-#include <t1afm.h>
-#include <ftstream.h>
-#include <t1types.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/t1types.h>
#include <stdlib.h> /* for qsort */
+#include <t1afm.h>
LOCAL_FUNC
void T1_Done_AFM( FT_Memory memory, T1_AFM* afm )
diff --git a/src/type1/t1afm.h b/src/type1/t1afm.h
index 567ed6325..61e18b82c 100644
--- a/src/type1/t1afm.h
+++ b/src/type1/t1afm.h
@@ -8,7 +8,7 @@
#ifndef T1AFM_H
#define T1AFM_H
-#include <ftobjs.h>
+#include <freetype/internal/ftobjs.h>
/* In this version, we only read the kerning table from the */
/* AFM file. We may add support for ligatures a bit later.. */
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index ed5920118..78fe415bc 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -19,9 +19,9 @@
#include <t1gload.h>
#include <t1afm.h>
-#include <ftdebug.h>
-#include <ftstream.h>
-#include <psnames.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/psnames.h>
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1driver
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index d644267aa..e9cd8a3e5 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -16,8 +16,8 @@
******************************************************************/
#include <t1gload.h>
-#include <ftdebug.h>
-#include <ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER
#include <t1hinter.h>
diff --git a/src/type1/t1hinter.c b/src/type1/t1hinter.c
index 3a09ed7a5..f9d5db9b5 100644
--- a/src/type1/t1hinter.c
+++ b/src/type1/t1hinter.c
@@ -20,7 +20,7 @@
*
******************************************************************/
-#include <ftdebug.h>
+#include <freetype/internal/ftdebug.h>
#include <t1objs.h>
#include <t1hinter.h>
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 87c2d1fee..e4802da9c 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1,7 +1,7 @@
-#include <ftconfig.h>
-#include <ftdebug.h>
+#include <freetype/config/ftconfig.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/t1types.h>
-#include <t1types.h>
#include <t1tokens.h>
#include <t1parse.h>
diff --git a/src/type1/t1load.h b/src/type1/t1load.h
index 9e0ee4736..673316a03 100644
--- a/src/type1/t1load.h
+++ b/src/type1/t1load.h
@@ -18,7 +18,7 @@
#ifndef T1LOAD_H
#define T1LOAD_H
-#include <ftstream.h>
+#include <freetype/internal/ftstream.h>
#include <t1parse.h>
#ifdef __cplusplus
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 79d26db9b..23b6a900c 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -15,8 +15,8 @@
*
******************************************************************/
-#include <ftdebug.h>
-#include <ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
#include <t1gload.h>
#include <t1load.h>
@@ -26,7 +26,7 @@
#include <t1hinter.h>
#endif
-#include <psnames.h>
+#include <freetype/internal/psnames.h>
/* Required by tracing mode */
#undef FT_COMPONENT
diff --git a/src/type1/t1objs.h b/src/type1/t1objs.h
index e11a3a1c3..51c71861a 100644
--- a/src/type1/t1objs.h
+++ b/src/type1/t1objs.h
@@ -18,11 +18,11 @@
#ifndef T1OBJS_H
#define T1OBJS_H
-#include <ftobjs.h>
-#include <ftconfig.h>
+#include <freetype/config/ftconfig.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/t1types.h>
#include <t1errors.h>
-#include <t1types.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c
index e3710b07f..d897d7446 100644
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -1,5 +1,5 @@
-#include <ftdebug.h>
-#include <t1types.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/t1types.h>
#include <t1parse.h>
#include <stdio.h> /* for sscanf */
diff --git a/src/type1/t1parse.h b/src/type1/t1parse.h
index b124c08e9..99666807a 100644
--- a/src/type1/t1parse.h
+++ b/src/type1/t1parse.h
@@ -25,7 +25,7 @@
#ifndef T1PARSE_H
#define T1PARSE_H
-#include <ftstream.h>
+#include <freetype/internal/ftstream.h>
#include <t1tokens.h>
#ifdef __cplusplus
diff --git a/src/type1/t1tokens.c b/src/type1/t1tokens.c
index 92a16d7e1..f4aca2831 100644
--- a/src/type1/t1tokens.c
+++ b/src/type1/t1tokens.c
@@ -23,8 +23,8 @@
*
******************************************************************/
-#include <ftstream.h>
-#include <ftdebug.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/ftdebug.h>
#include <t1tokens.h>
#include <t1load.h>
diff --git a/src/type1z/t1afm.c b/src/type1z/t1afm.c
index f619e28e5..b9f8d8398 100644
--- a/src/type1z/t1afm.c
+++ b/src/type1z/t1afm.c
@@ -6,8 +6,8 @@
***************************************************************************/
#include <t1afm.h>
-#include <ftstream.h>
-#include <t1types.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/t1types.h>
#include <stdlib.h> /* for qsort */
LOCAL_FUNC
diff --git a/src/type1z/t1afm.h b/src/type1z/t1afm.h
index 567ed6325..61e18b82c 100644
--- a/src/type1z/t1afm.h
+++ b/src/type1z/t1afm.h
@@ -8,7 +8,7 @@
#ifndef T1AFM_H
#define T1AFM_H
-#include <ftobjs.h>
+#include <freetype/internal/ftobjs.h>
/* In this version, we only read the kerning table from the */
/* AFM file. We may add support for ligatures a bit later.. */
diff --git a/src/type1z/t1driver.c b/src/type1z/t1driver.c
index d25b95700..3cef9b5d0 100644
--- a/src/type1z/t1driver.c
+++ b/src/type1z/t1driver.c
@@ -19,9 +19,9 @@
#include <t1gload.h>
#include <t1afm.h>
-#include <ftdebug.h>
-#include <ftstream.h>
-#include <psnames.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/psnames.h>
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1driver
diff --git a/src/type1z/t1errors.h b/src/type1z/t1errors.h
index f268d8770..93731c11d 100644
--- a/src/type1z/t1errors.h
+++ b/src/type1z/t1errors.h
@@ -18,7 +18,7 @@
#ifndef T1ERRORS_H
#define T1ERRORS_H
-#include <fterrors.h>
+#include <freetype/fterrors.h>
/************************ error codes declaration **************/
diff --git a/src/type1z/t1gload.c b/src/type1z/t1gload.c
index 200ed35a3..b75098ed6 100644
--- a/src/type1z/t1gload.c
+++ b/src/type1z/t1gload.c
@@ -16,8 +16,8 @@
******************************************************************/
#include <t1gload.h>
-#include <ftdebug.h>
-#include <ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1gload
diff --git a/src/type1z/t1load.c b/src/type1z/t1load.c
index 3e4ef921e..2566419f8 100644
--- a/src/type1z/t1load.c
+++ b/src/type1z/t1load.c
@@ -59,10 +59,10 @@
*
******************************************************************/
-#include <ftdebug.h>
-#include <ftconfig.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/config/ftconfig.h>
-#include <t1types.h>
+#include <freetype/internal/t1types.h>
#include <t1errors.h>
#include <t1load.h>
#include <stdio.h>
diff --git a/src/type1z/t1load.h b/src/type1z/t1load.h
index 6a1a45c03..093096c86 100644
--- a/src/type1z/t1load.h
+++ b/src/type1z/t1load.h
@@ -18,7 +18,7 @@
#ifndef T1LOAD_H
#define T1LOAD_H
-#include <ftstream.h>
+#include <freetype/internal/ftstream.h>
#include <t1parse.h>
#ifdef __cplusplus
diff --git a/src/type1z/t1objs.c b/src/type1z/t1objs.c
index c034c160c..43d876b38 100644
--- a/src/type1z/t1objs.c
+++ b/src/type1z/t1objs.c
@@ -15,12 +15,12 @@
*
******************************************************************/
-#include <ftdebug.h>
-#include <ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftstream.h>
#include <t1gload.h>
#include <t1load.h>
-#include <psnames.h>
+#include <freetype/internal/psnames.h>
#include <t1afm.h>
/* Required by tracing mode */
diff --git a/src/type1z/t1objs.h b/src/type1z/t1objs.h
index 8a168636b..5b41f3a8d 100644
--- a/src/type1z/t1objs.h
+++ b/src/type1z/t1objs.h
@@ -18,10 +18,10 @@
#ifndef T1OBJS_H
#define T1OBJS_H
-#include <ftobjs.h>
-#include <ftconfig.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/config/ftconfig.h>
#include <t1errors.h>
-#include <t1types.h>
+#include <freetype/internal/t1types.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/type1z/t1parse.c b/src/type1z/t1parse.c
index a1f4be993..3cb47a928 100644
--- a/src/type1z/t1parse.c
+++ b/src/type1z/t1parse.c
@@ -28,10 +28,10 @@
*
******************************************************************/
-#include <ftdebug.h>
-#include <ftcalc.h>
-#include <ftobjs.h>
-#include <ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftcalc.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/ftstream.h>
#include <t1errors.h>
#include <t1parse.h>
diff --git a/src/type1z/t1parse.h b/src/type1z/t1parse.h
index 4487193d6..686691862 100644
--- a/src/type1z/t1parse.h
+++ b/src/type1z/t1parse.h
@@ -31,7 +31,7 @@
#ifndef T1PARSE_H
#define T1PARSE_H
-#include <t1types.h>
+#include <freetype/internal/t1types.h>
#ifdef __cplusplus
extern "C" {