ref: efce08d67c1c2a8bf0d0d58463e754c746433d23
parent: 5d6b82d9c9671c396a3402cb900814e32de13459
author: David Turner <[email protected]>
date: Thu May 11 14:23:52 EDT 2000
major re-organisation of the FreeType 2 directory hierarchy
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,31 @@
-LASTEST CHANGES - 14-apr-2000
+LATEST CHANGES -
+
+
+
+ - updated the structure of FT_Outline_Funcs in order to allow
+ direct coordinate scaling within the outline decomposition routine
+ (this is important for virtual "on" points with TrueType outlines)
+ + updates to the rasters to support this..
+
+ - updated the OS/2 table loading code in "src/sfnt/ttload.c" in order
+ to support version 2 of the table (see OpenType 1.2 spec)
+
+ - created "include/tttables.h" and "include/t1tables.h" to allow
+ client applications to access some of the SFNT and T1 tables of a
+ face with a procedural interface (see FT_Get_Sfnt_Table())
+ + updates to internal source files to reflect the change..
+
+ - some cleanups in the source code to get rid of warnings when compiling
+ with the "-Wall -W -ansi -pedantic" options in gcc.
+
+ - debugged and moved the smooth renderer to "src/base/ftgrays.c" and
+ its header to "include/ftgrays.h"
+
+ - updated TT_MAX_SUBGLYPHS to 96 as some CJK fonts have composites with
+ up to 80 sub-glyphs !! Thanks to Werner
+
+================================================================================
+OLD CHANGES - 14-apr-2000
- fixed a bug in the TrueType glyph loader that prevented the correct
loading of some CJK glyphs in mingli.ttf
--- a/config/freetype.mk
+++ /dev/null
@@ -1,226 +1,0 @@
-#
-# FreeType 2 library sub-Makefile
-#
-
-
-# Copyright 1996-2000 by
-# David Turner, Robert Wilhelm, and Werner Lemberg.
-#
-# This file is part of the FreeType project, and may only be used modified
-# and distributed under the terms of the FreeType project license,
-# LICENSE.TXT. By continuing to use, modify, or distribute this file you
-# indicate that you have read the license and understand and accept it
-# fully.
-
-
-# DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY
-# OTHER MAKEFILES.
-
-
-# The targets `objects' and `library' are defined at the end of this
-# Makefile when all rules have been included.
-#
-.PHONY: build_freetype objects library
-
-# default target -- build objects and library
-#
-build_freetype: objects library
-
-# `multi' target -- build multiple objects and library
-#
-multi: objects library
-
-
-# The FreeType source directory.
-#
-SRC := $(TOP)$(SEP)src
-
-
-# The directory where the base layer components are placed. By default,
-# this is `freetype/src/base'.
-#
-BASE_DIR := $(SRC)$(SEP)base
-
-
-# A few short-cuts in order to avoid typing $(SEP) all the time for the
-# directory separator.
-#
-# For example: SRC_ equals to `./src/' where `.' is $(TOP).
-#
-#
-SRC_ := $(SRC)$(SEP)
-BASE_ := $(BASE_DIR)$(SEP)
-OBJ_ := $(OBJ_DIR)$(SEP)
-LIB_ := $(LIB_DIR)$(SEP)
-PUBLIC_ := $(TOP)$(SEP)include$(SEP)
-CONFIG_ := $(TOP)$(SEP)config$(SEP)
-
-
-# The name of the final library file.
-#
-FT_LIBRARY := $(LIB_)$(LIBRARY).$A
-
-
-# include paths
-#
-# IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed
-# in front of the include list. Porters are then able to
-# put their own version of some of the FreeType components
-# in the `freetype/config/<system>' directory, as these
-# files will override the default sources.
-#
-INCLUDES := $(BUILD) $(TOP)$(SEP)config $(TOP)$(SEP)include $(INCLUDES)
-
-INCLUDE_FLAGS = $(INCLUDES:%=$I%)
-
-
-# C flags used for the compilation of an object file. This must include at
-# least the paths for the `base' and `config/<system>' directories,
-# debug/optimization/warning flags + ansi compliance if needed.
-#
-FT_CFLAGS = $(CFLAGS) $(INCLUDE_FLAGS)
-FT_CC = $(CC) $(FT_CFLAGS)
-FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
-
-
-# include the `modules' rules file
-#
-include $(CONFIG_)modules.mk
-
-
-# Free the lists of driver objects.
-#
-COMPONENTS_LIST :=
-DRIVERS_LIST :=
-OBJECTS_LIST :=
-
-# System-specific component -- this must be defined in this Makefile for
-# easy updates. The default ANSI ftsystem.c is located in
-# `freetype/config/ftsystem.c'. However, some system-specific configuration
-# might define $(FTSYS_SRC) to fetch it in other places, like
-# `freetype/config/<system>/ftsystem.c'.
-#
-# $(BASE_H) is defined in `src/base/rules.mk' and contains the list of all
-# base layer header files.
-#
-ifndef FTSYS_SRC
- FTSYS_SRC = $(BASE_)ftsystem.c
-endif
-FTSYS_OBJ = $(OBJ_)ftsystem.$O
-
-OBJECTS_LIST += $(FTSYS_OBJ)
-
-$(FTSYS_OBJ): $(FTSYS_SRC) $(BASE_H)
- $(FT_COMPILE) $T$@ $<
-
-
-# ftdebug component
-#
-# FTDebug contains code used to print traces and errors. It is normally
-# empty for a release build (see ftoption.h).
-#
-FTDEBUG_SRC = $(BASE_)ftdebug.c
-FTDEBUG_OBJ = $(OBJ_)ftdebug.$O
-
-OBJECTS_LIST += $(FTDEBUG_OBJ)
-
-$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(BASE_H)
- $(FT_COMPILE) $T$@ $<
-
-
-# Define $(PUBLIC_H) as the list of all public header files located in
-# `$(TOP)/include'.
-#
-PUBLIC_H := $(wildcard $(PUBLIC_)*.h)
-
-
-# Include all rule files from FreeType components.
-#
-include $(wildcard $(SRC)/*/rules.mk)
-
-
-# FTInit file
-#
-# The C source `ftinit.c' contains the FreeType initialization routines.
-# It is able to automatically register one or more drivers when the API
-# function FT_Init_FreeType() is called.
-#
-# The set of initial drivers is determined by the driver Makefiles
-# includes above. Each driver Makefile updates the FTINIT_xxxx lists
-# which contain additional include paths and macros used to compile the
-# single `ftinit.c' source.
-#
-FTINIT_SRC := $(BASE_)ftinit.c
-FTINIT_OBJ := $(OBJ_)ftinit.$O
-
-OBJECTS_LIST += $(FTINIT_OBJ)
-
-$(FTINIT_OBJ): $(FTINIT_SRC) $(BASE_H) $(FT_MODULE_LIST)
- $(FT_COMPILE) $T$@ $<
-
-
-# All FreeType library objects
-#
-# By default, we include the base layer extensions. These could be
-# omitted on builds which do not want them.
-#
-OBJ_M = $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
-OBJ_S = $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
-
-
-# The target `multi' on the Make command line indicates that we want to
-# compile each source file independently.
-#
-# Otherwise, each module/driver is compiled in a single object file through
-# source file inclusion (see `src/base/ftbase.c' or
-# `src/truetype/truetype.c' for examples).
-#
-BASE_OBJECTS := $(OBJECTS_LIST)
-
-ifneq ($(findstring multi,$(MAKECMDGOALS)),)
- OBJECTS_LIST += $(OBJ_M)
-else
- OBJECTS_LIST += $(OBJ_S)
-endif
-
-objects: $(OBJECTS_LIST)
-
-library: $(FT_LIBRARY)
-
-.c.$O:
- $(FT_COMPILE) $T$@ $<
-
-
-# Standard cleaning and distclean rules. These are not accepted
-# on all systems though.
-#
-clean_freetype_std:
- -$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)
-
-distclean_freetype_std: clean_freetype_std
- -$(DELETE) $(FT_LIBRARY)
- -$(DELETE) *.orig *~ core *.core
-
-# The Dos command shell does not support very long list of arguments, so
-# we are stuck with wildcards.
-#
-clean_freetype_dos:
- -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(OBJ_))*.$O 2> nul
-
-distclean_freetype_dos: clean_freetype_dos
- -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
-
-# Remove configuration file (used for distclean).
-#
-remove_config_mk:
- -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(CONFIG_MK))
-
-
-# The `config.mk' file must define `clean_freetype' and
-# `distclean_freetype'. Implementations may use to relay these to either
-# the `std' or `dos' versions, or simply provide their own implementation.
-#
-clean: clean_freetype
-distclean: distclean_freetype remove_config_mk
-
-# EOF
--- a/config/ftmodule.h
+++ /dev/null
@@ -1,5 +1,0 @@
-FT_DRIVER(psnames_driver_interface)
-FT_DRIVER(sfnt_driver_interface)
-FT_DRIVER(tt_driver_interface)
-FT_DRIVER(t1_driver_interface)
-FT_DRIVER(t1z_driver_interface)
--- a/config/ftoption.h
+++ /dev/null
@@ -1,374 +1,0 @@
-/***************************************************************************/
-/* */
-/* ftoption.h */
-/* */
-/* User-selectable configuration macros. */
-/* */
-/* Copyright 1996-2000 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used */
-/* modified and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-#ifndef FTOPTION_H
-#define FTOPTION_H
-
- /*************************************************************************/
- /* */
- /* USER-SELECTABLE CONFIGURATION MACROS */
- /* */
- /* These macros can be toggled by developers to enable or disable */
- /* certain aspects of FreeType. This is a default file, where all major */
- /* options are enabled. */
- /* */
- /* Note that if some modifications are required for your build, we */
- /* advise you to put a modified copy of this file in your build */
- /* directory, rather than modifying it in-place. */
- /* */
- /* The build directory is normally "freetype/config/<system>" and */
- /* contains build or system-specific files that are included in */
- /* priority when building the library. */
- /* */
- /*************************************************************************/
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Convenience functions support */
- /* */
- /* Some functions of the FreeType 2 API are provided as a convenience */
- /* for client applications and developers. However, they are not */
- /* required to build and run the library itself. */
- /* */
- /* By defining this configuration macro, you'll disable the */
- /* compilation of these functions at build time. This can be useful */
- /* to reduce the library's code size when you don't need any of */
- /* these functions.. */
- /* */
- /* All convenience functions are declared as such in their */
- /* documentation. */
- /* */
-#undef FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS
-
- /*************************************************************************/
- /* */
- /* Alternate Glyph Image Format support */
- /* */
- /* By default, the glyph images returned by the FreeType glyph loader */
- /* can either be a pixmap or a vectorial outline defined through */
- /* bezier control points. When defining the following configuration */
- /* macro, some font drivers will be able to register alternate */
- /* glyph image formats. */
- /* */
- /* Unset this macro if you're sure that you'll never use a font driver */
- /* with an alternate glyph format, this will reduce the size of the */
- /* base layer code. */
- /* */
- /* Note that a few Type 1 fonts, as well as Windows "Vector" fonts */
- /* use a vector "plotter" format that isn't supported when this */
- /* macro is undefined.. */
- /* */
-#define FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS
-
-
- /*************************************************************************/
- /* */
- /* Glyph Postscript Names handling */
- /* */
- /* By default, FreeType 2 is built with the "psnames" module compiled */
- /* in. This module is in charge of converting a glyph name string into */
- /* a Unicode value, or return a Macintosh standard glyph name for the */
- /* use with the TrueType "post" table. */
- /* */
- /* Undefine this macro if you do not want the "psnames" compiled in */
- /* your build of FreeType. This has the following effects : */
- /* */
- /* - the TrueType driver will provide its own set of glyph names, */
- /* if you build it to support postscript names in the TrueType */
- /* "post" table. */
- /* */
- /* - the Type 1 driver will not be able to synthetize a */
- /* Unicode charmap out of the glyphs found in the fonts. */
- /* */
- /* You would normally undefine this configuration macro when */
- /* building a version of FreeType that doesn't contain a Type 1 */
- /* or CFF driver. */
- /* */
-#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
- /*************************************************************************/
- /* */
- /* Postscript Names to Unicode Values support */
- /* */
- /* By default, FreeType 2 is built with the "psnames" module compiled */
- /* in. Among other things, the module is used to convert a glyph */
- /* name into a unicode value. This is especially useful in order to */
- /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
- /* through a big table named the "Adobe Glyph List". */
- /* */
- /* Undefine this macro if you do not want the Adobe Glyph List */
- /* compiled in your "psnames" module. The Type 1 driver will not */
- /* be able to synthetize a Unicode charmap out of the glyphs found */
- /* in the fonts.. */
- /* */
-#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
-
-
- /*************************************************************************/
- /* */
- /* many compilers provide the non-ANSI 'long long' 64-bit type. You can */
- /* activate it by defining the FTCALC_USE_LONG_LONG macro in `ftoption.h'*/
- /* Note that this will produce many -ansi warnings during library */
- /* compilation, and that in many cases, the generated code will not be */
- /* smaller or faster !! */
- /* */
-#undef FTCALC_USE_LONG_LONG
-
-
- /*************************************************************************/
- /* */
- /* When compiling FreeType as a DLL, some systems/compilers need a */
- /* special keyword in front of each function definition instead of */
- /* `extern'. */
- /* */
- /* The macros EXPORT_DEF and EXPORT_FUNC are thus used to define */
- /* exported library function interfaces and exported library functions */
- /* implementations respectively. */
- /* */
- /* If not defined here, they automatically default to `extern' and void */
- /* later in this header file. */
- /* */
-#undef EXPORT_DEF
-#undef EXPORT_FUNC
-
-
- /*************************************************************************/
- /* */
- /* Debug level */
- /* */
- /* FreeType can be compiled in debug or trace mode. In debug mode, */
- /* errors are reported through the `ftdebug' component. In trace */
- /* mode, additional messages are sent to the standard output during */
- /* execution. */
- /* */
- /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
- /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
- /* */
- /* Don't define any of these macros to compile in `release' mode. */
- /* */
-#undef FT_DEBUG_LEVEL_ERROR
-#define FT_DEBUG_LEVEL_TRACE
-
-
- /*************************************************************************/
- /* */
- /* Anti-aliasing support */
- /* */
- /* Undefine this macro only if you want to disable the anti-aliasing */
- /* support in FreeType. This will save you about 5 Kb of code. It */
- /* may be important for some embedded systems. */
- /* */
-#define FT_CONFIG_OPTION_ANTI_ALIAS
-
-
- /*************************************************************************/
- /* */
- /* Endianess performance improvement */
- /* */
- /* FreeType is completely endian-independent, and can thus be compiled */
- /* directly on _any_ machine. However, some components of the library */
- /* provide improved routines for the cases where endianess is known. */
- /* */
- /* It usually results in speed-ups and reduced code size. Note that */
- /* you should not define both of these macros. */
- /* */
- /* */
- /* NOTE: For now, only the scan-line converter (base/ftraster.c) uses */
- /* these macros to speed-up some anti-alias rendering routines. */
- /* */
-#undef FT_CONFIG_OPTION_LITTLE_ENDIAN
-#undef FT_CONFIG_OPTION_BIG_ENDIAN
-
-
- /*************************************************************************/
- /* */
- /* Computation Algorithms */
- /* */
- /* Used for debugging, this configuration macro should disappear */
- /* soon.. */
- /* */
-#define FT_CONFIG_OPTION_OLD_CALCS
-
- /*************************************************************************/
- /* */
- /* The size in bytes of the render pool used by the scan-line */
- /* converter to do all of its work. */
- /* */
- /* This must be greater than 4 Kb */
- /* */
-#define FT_RENDER_POOL_SIZE 8192
-
-
- /*************************************************************************/
- /* */
- /* FT_MAX_DRIVERS */
- /* */
- /* The maximum number of font drivers that can be registered in a */
- /* single FreeType library object. 8 seems to be a good choice due */
- /* to the relative low actual number of drivers ;-) */
- /* */
- /* If you don't intend to register new drivers at runtime, you */
- /* certainly do not need to change this value.. */
- /* */
-#define FT_MAX_DRIVERS 8
-
-
- /*************************************************************************/
- /* */
- /* FT_MAX_EXTENSIONS */
- /* */
- /* The maximum number of extensions that can be registered in a */
- /* single font driver. 8 seems to be a good choice for now.. */
- /* */
- /* If you don't know what this means, you certainly do not need to */
- /* change this value.. */
- /* */
-#define FT_MAX_EXTENSIONS 8
-
-
- /*************************************************************************/
- /* */
- /* FT_MAX_GLYPH_FORMATS */
- /* */
- /* The maximum number of glyph image formats that might be registered */
- /* in a given library instance. 8 seems to be a good choice due to */
- /* the relatively low number of current formats ;-) */
- /* */
-#define FT_MAX_GLYPH_FORMATS 8
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
- /* embedded bitmaps in all formats using the SFNT module (namely */
- /* TrueType & OpenType). */
- /* */
-#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
- /* load and enumerate the glyph Postscript names in a TrueType or */
- /* OpenType file. */
- /* */
- /* Note that when you do not compile the "psnames" module by undefining */
- /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the "sfnt" module will */
- /* contain additional code used to read the PS Names table from a font. */
- /* */
- /* (by default, the module uses "psnames" to extract glyph names).. */
- /* */
-#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
- /* a bytecode interpreter in the TrueType driver. Note that there are */
- /* important patent issues related to the use of the interpreter. */
- /* */
- /* By undefining this, you'll only compile the code necessary to load */
- /* TrueType glyphs without hinting.. */
- /* */
-#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
- /* bytecode interpreter with a huge switch statement, rather than a */
- /* call table. This results in smaller and faster code for a number of */
- /* architectures. */
- /* */
- /* Note however that on some compiler/processor combinations, undefining */
- /* this macro will generate a faster, though larger, code. */
- /* */
-#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
-
- /* The maximum number of sub-glyphs in a TrueType composite glyph */
-#define TT_MAX_SUBGLYPHS 96
-
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
-
-/********************************************************************/
-/* T1_MAX_STACK_DEPTH is the maximal depth of the token stack used */
-/* by the Type 1 parser (see t1load.c). A minimum of 16 is required */
-/* */
-#define T1_MAX_STACK_DEPTH 16
-
-/*******************************************************************/
-/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
-/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
-/* required */
-#define T1_MAX_DICT_DEPTH 5
-
-/***********************************************************************/
-/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
-/* calls during glyph loading */
-#define T1_MAX_SUBRS_CALLS 8
-
-/*****************************************************************/
-/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity */
-#define T1_MAX_CHARSTRINGS_OPERANDS 32
-
-
-/*******************************************************************/
-/* Define T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate */
-/* a driver with no hinter. This can be useful to debug the parser */
-/* */
-#undef T1_CONFIG_OPTION_DISABLE_HINTER
-
-/*******************************************************************/
-/* Define this configuration macro if you want to prevent the */
-/* compilation of "t1afm", which is in charge of reading Type1 */
-/* AFM files into an existing face. Note that when set, the T1 */
-/* driver will be unable to produce kerning distances.. */
-/* */
-#undef T1_CONFIG_OPTION_NO_AFM
-
-
-
-#endif /* FTOPTION_H */
--- a/config/modules.mk
+++ b/config/modules.mk
@@ -2,7 +2,6 @@
# FreeType 2 modules sub-Makefile
#
-
# Copyright 1996-2000 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
--- a/demos/Makefile
+++ b/demos/Makefile
@@ -267,8 +267,8 @@
$(LINK)
- $(BIN_)ftview$E: $(OBJ_)ftview.$O $(FTLIB) $(GRAPH_LIB) $(COMMON_OBJ) $(OBJ_)ftrast2.$O
- $(GRAPH_LINK) $(OBJ_)ftrast2.$O
+ $(BIN_)ftview$E: $(OBJ_)ftview.$O $(FTLIB) $(GRAPH_LIB) $(COMMON_OBJ) $(OBJ_)ftrast2.$O $(OBJ_)ftrast.$O
+ $(GRAPH_LINK) $(OBJ_)ftrast2.$O $(OBJ_)ftrast.$O
$(BIN_)ftstring$E: $(OBJ_)ftstring.$O $(FTLIB) $(GRAPH_LIB) $(COMMON_OBJ)
$(GRAPH_LINK)
--- a/demos/src/compos.c
+++ b/demos/src/compos.c
@@ -13,9 +13,7 @@
/* */
/****************************************************************************/
-#include "freetype.h"
-#include "ftobjs.h"
-#include "ftdriver.h"
+#include <freetype/freetype.h>
#include <stdio.h>
#include <stdlib.h>
--- a/demos/src/ftlint.c
+++ b/demos/src/ftlint.c
@@ -13,9 +13,7 @@
/* */
/****************************************************************************/
-#include "freetype.h"
-#include "ftobjs.h"
-#include "ftdriver.h"
+#include <freetype/freetype.h>
#include <stdio.h>
#include <stdlib.h>
--- a/demos/src/ftrast.c
+++ b/demos/src/ftrast.c
@@ -21,7 +21,7 @@
******************************************************************/
#include "ftrast.h"
-#include <ftcalc.h> /* for FT_MulDiv only */
+#include <freetype/internal/ftcalc.h> /* for FT_MulDiv only */
/*************************************************************************/
/* */
@@ -107,7 +107,7 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_raster
-#include <ftdebug.h>
+#include <freetype/internal/ftdebug.h>
/* The default render pool size */
@@ -2941,7 +2941,7 @@
#else
-#include <ftobjs.h>
+#include <freetype/internal/ftobjs.h>
static
int ft_black_new( FT_Memory memory, TRaster_Instance* *araster )
--- a/demos/src/ftrast.h
+++ b/demos/src/ftrast.h
@@ -1,7 +1,7 @@
#ifndef FTRASTER_H
#define FTRASTER_H
-#include <ftimage.h>
+#include <freetype/ftimage.h>
extern FT_Raster_Funcs ft_black_raster;
--- a/demos/src/ftrast2.c
+++ b/demos/src/ftrast2.c
@@ -37,8 +37,8 @@
*
******************************************************************/
-#include "ftraster.h"
-#include <freetype.h> /* for FT_Outline_Decompose */
+#include "ftrast2.h"
+#include <freetype/freetype.h> /* for FT_Outline_Decompose */
#ifndef EXPORT_FUNC
#define EXPORT_FUNC /* nothing */
@@ -45,6 +45,27 @@
#endif
+/**************************************************************************/
+/* */
+/* We need a 32-bit unsigned word for our optimized 2x2 filter.. The */
+/* following uses the ANSI <limits.h> header file to compute exactly */
+/* wether to use unsigned int or unsigned long */
+/* */
+#include <limits.h>
+
+/* The number of bytes in an `int' type. */
+#if UINT_MAX == 0xFFFFFFFF
+typedef unsigned int Word32;
+typedef int Int32;
+#elif ULONG_MAX == 0xFFFFFFFF
+typedef unsigned long Word32;
+typedef long Int32;
+#else
+#error "could not find a 32-bit word on this machine !!"
+#endif
+
+
+
#ifndef _xxFREETYPE_
/**************************************************************************/
@@ -98,7 +119,7 @@
/* anti-aliasing mode.. Ignored if FT_RASTER_OPTION_ANTI_ALIAS isn't */
/* defined.. */
/* */
-#define FT_RASTER_ANTI_ALIAS_17
+#undef FT_RASTER_ANTI_ALIAS_17
/**************************************************************************/
/* */
@@ -250,7 +271,7 @@
/* or high). These are ideals in order to subdivise bezier arcs in halves */
/* though simple additions and shifts. */
- typedef long TPos, *PPos;
+ typedef Int32 TPos, *PPos;
/* The type of a scanline position/coordinate within a map */
@@ -472,7 +493,7 @@
long grays[20]; /* Palette of gray levels used for render */
- int gray_width; /* length in bytes of the onochrome */
+ int gray_width; /* length in bytes of the monochrome */
/* intermediate scanline of gray_lines. */
/* Each gray pixel takes 2 or 4 bits long */
@@ -1070,367 +1091,6 @@
#endif
-
-
-#ifdef FT_RASTER_CONIC_BEZIERS
-/****************************************************************************/
-/* */
-/* <Function> Conic_Up */
-/* */
-/* <Description> */
-/* Computes the scan-line intersections of an ascending second-order */
-/* Bezier arc and stores them in the render pool. The arc is taken */
-/* from the top of the stack.. */
-/* */
-/* <Input> */
-/* miny :: minimum vertical grid coordinate */
-/* maxy :: maximum vertical grid coordinate */
-/* */
-/* <Return> */
-/* SUCCESS or FAILURE */
-/* */
-/****************************************************************************/
-
- static
- TBool Conic_Up( RAS_ARGS TPos miny, TPos maxy )
- {
- TPos y1, y2, e, e2, e0;
- int f1;
-
- TPoint* arc;
- TPoint* start_arc;
-
- PPos top;
-
-
- arc = ras.arc;
- y1 = arc[2].y;
- y2 = arc[0].y;
- top = ras.cursor;
-
- if ( y2 < miny || y1 > maxy )
- goto Fin;
-
- e2 = FLOOR( y2 );
-
- if ( e2 > maxy )
- e2 = maxy;
-
- e0 = miny;
-
- if ( y1 < miny )
- e = miny;
- else
- {
- e = CEILING( y1 );
- f1 = FRAC( y1 );
- e0 = e;
-
- if ( f1 == 0 )
- {
- if ( ras.joint )
- {
- top--;
- ras.joint = FALSE;
- }
-
- *top++ = arc[2].x;
-
- DEBUG_PSET;
-
- e += ras.precision;
- }
- }
-
- if ( ras.fresh )
- {
- ras.cur_prof->start = TRUNC( e0 );
- ras.fresh = FALSE;
- }
-
- if ( e2 < e )
- goto Fin;
-
- if ( ( top+TRUNC(e2-e)+1 ) >= ras.pool_limit )
- {
- ras.cursor = top;
- ras.error = ErrRaster_Overflow;
- return FAILURE;
- }
-
- start_arc = arc;
-
- while ( arc >= start_arc && e <= e2 )
- {
- ras.joint = FALSE;
-
- y2 = arc[0].y;
-
- if ( y2 > e )
- {
- y1 = arc[2].y;
- if ( y2 - y1 >= ras.precision_step )
- {
- Split_Conic( arc );
- arc += 2;
- }
- else
- {
- *top++ = arc[2].x +
- FMulDiv( arc[0].x-arc[2].x,
- e - y1,
- y2 - y1 );
- DEBUG_PSET;
-
- arc -= 2;
- e += ras.precision;
- }
- }
- else
- {
- if ( y2 == e )
- {
- ras.joint = TRUE;
- *top++ = arc[0].x;
-
- DEBUG_PSET;
-
- e += ras.precision;
- }
- arc -= 2;
- }
- }
-
- Fin:
- ras.cursor = top;
- ras.arc -= 2;
- return SUCCESS;
- }
-
-
-/****************************************************************************/
-/* */
-/* <Function> Conic_Down */
-/* */
-/* <Description> */
-/* Computes the scan-line intersections of a descending second-order */
-/* Bezier arc and stores them in the render pool. The arc is taken */
-/* from the top of the stack.. */
-/* */
-/* <Input> */
-/* miny :: minimum vertical grid coordinate */
-/* maxy :: maximum vertical grid coordinate */
-/* */
-/* <Return> */
-/* SUCCESS or FAILURE */
-/* */
-/****************************************************************************/
-
- static
- TBool Conic_Down( RAS_ARGS TPos miny, TPos maxy )
- {
- TPoint* arc = ras.arc;
- TBool result, fresh;
-
-
- arc[0].y = -arc[0].y;
- arc[1].y = -arc[1].y;
- arc[2].y = -arc[2].y;
-
- fresh = ras.fresh;
-
- result = Conic_Up( RAS_VARS -maxy, -miny );
-
- if ( fresh && !ras.fresh )
- ras.cur_prof->start = -ras.cur_prof->start;
-
- arc[0].y = -arc[0].y;
- return result;
- }
-
-#endif /* FT_RASTER_CONIC_BEZIERS */
-
-
-
-#ifdef FT_RASTER_CUBIC_BEZIERS
-/****************************************************************************/
-/* */
-/* <Function> Cubic_Up */
-/* */
-/* <Description> */
-/* Computes the scan-line intersections of an ascending third-order */
-/* bezier arc and stores them in the render pool */
-/* */
-/* <Input> */
-/* miny :: minimum vertical grid coordinate */
-/* maxy :: maximum vertical grid coordinate */
-/* */
-/* <Return> */
-/* SUCCESS or FAILURE */
-/* */
-/****************************************************************************/
- static
- TBool Cubic_Up( RAS_ARGS TPos miny, TPos maxy )
- {
- TPos y1, y2, e, e2, e0;
- int f1;
-
- TPoint* arc;
- TPoint* start_arc;
-
- TPos* top;
-
-
- arc = ras.arc;
- y1 = arc[3].y;
- y2 = arc[0].y;
- top = ras.cursor;
-
- if ( y2 < miny || y1 > maxy )
- goto Fin;
-
- e2 = FLOOR( y2 );
-
- if ( e2 > maxy )
- e2 = maxy;
-
- e0 = miny;
-
- if ( y1 < miny )
- e = miny;
- else
- {
- e = CEILING( y1 );
- f1 = FRAC( y1 );
- e0 = e;
-
- if ( f1 == 0 )
- {
- if ( ras.joint )
- {
- top--;
- ras.joint = FALSE;
- }
-
- *top++ = arc[3].x;
-
- DEBUG_PSET;
-
- e += ras.precision;
- }
- }
-
- if ( ras.fresh )
- {
- ras.cur_prof->start = TRUNC( e0 );
- ras.fresh = FALSE;
- }
-
- if ( e2 < e )
- goto Fin;
-
- if ( ( top+TRUNC(e2-e)+1 ) >= ras.pool_limit )
- {
- ras.cursor = top;
- ras.error = ErrRaster_Overflow;
- return FAILURE;
- }
-
- start_arc = arc;
-
- while ( arc >= start_arc && e <= e2 )
- {
- ras.joint = FALSE;
-
- y2 = arc[0].y;
-
- if ( y2 > e )
- {
- y1 = arc[3].y;
- if ( y2 - y1 >= ras.precision_step )
- {
- Split_Cubic( arc );
- arc += 3;
- }
- else
- {
- *top++ = arc[3].x +
- FMulDiv( arc[0].x-arc[3].x,
- e - y1,
- y2 - y1 );
- DEBUG_PSET;
-
- arc -= 3;
- e += ras.precision;
- }
- }
- else
- {
- if ( y2 == e )
- {
- ras.joint = TRUE;
- *top++ = arc[0].x;
-
- DEBUG_PSET;
-
- e += ras.precision;
- }
- arc -= 3;
- }
- }
-
- Fin:
- ras.cursor = top;
- ras.arc -= 3;
- return SUCCESS;
- }
-
-
-/****************************************************************************/
-/* */
-/* <Function> Cubic_Down */
-/* */
-/* <Description> */
-/* Computes the scan-line intersections of a descending third-order */
-/* bezier arc and stores them in the render pool */
-/* */
-/* <Input> */
-/* miny :: minimum vertical grid coordinate */
-/* maxy :: maximum vertical grid coordinate */
-/* */
-/* <Return> */
-/* SUCCESS or FAILURE */
-/* */
-/****************************************************************************/
- static
- TBool Cubic_Down( RAS_ARGS TPos miny, TPos maxy )
- {
- TPoint* arc = ras.arc;
- TBool result, fresh;
-
-
- arc[0].y = -arc[0].y;
- arc[1].y = -arc[1].y;
- arc[2].y = -arc[2].y;
- arc[3].y = -arc[3].y;
-
- fresh = ras.fresh;
-
- result = Cubic_Up( RAS_VARS -maxy, -miny );
-
- if ( fresh && !ras.fresh )
- ras.cur_prof->start = -ras.cur_prof->start;
-
- arc[0].y = -arc[0].y;
- return result;
- }
-
-#endif /* FT_RASTER_CUBIC_BEZIERS */
-
-
-
-
-
/* A function type describing the functions used to split bezier arcs */
typedef void (*TSplitter)( TPoint* base );
@@ -2756,6 +2416,21 @@
/* */
/***********************************************************************/
+ static
+ const Word32 LMask5[17] =
+ { 0xF0F0F0F0, 0xF0F0F070, 0xF0F0F030, 0xF0F0F010,
+ 0xF0F0F000, 0xF0F07000, 0xF0F03000, 0xF0F01000,
+ 0xF0F00000, 0xF0700000, 0xF0300000, 0xF0100000,
+ 0xF0000000, 0x70000000, 0x30000000, 0x10000000,
+ 0x00000000 };
+
+ static
+ const Word32 LPos5[17] =
+ { 0x80000000, 0x40000000, 0x20000000, 0x10000000,
+ 0x00800000, 0x00400000, 0x00200000, 0x00100000,
+ 0x00008000, 0x00004000, 0x00002000, 0x00001000,
+ 0x00000080, 0x00000040, 0x00000020, 0x00000010 };
+
static void Vertical_Gray5_Sweep_Init( RAS_ARGS int* min, int* max )
{
long pitch;
@@ -2775,29 +2450,12 @@
ras.gray_max_x = -32000;
}
-
static void Vertical_Gray5_Sweep_Span( RAS_ARGS TScan y,
TPos x1,
TPos x2 )
{
- static
- const unsigned int LMask[17] =
-#ifdef FT_RASTER_LITTLE_ENDIAN
- { 0xF0F0F0F0, 0xF0F0F070, 0xF0F0F030, 0xF0F0F010,
- 0xF0F0F000, 0xF0F07000, 0xF0F03000, 0xF0F01000,
- 0xF0F00000, 0xF0700000, 0xF0300000, 0xF0100000,
- 0xF0000000, 0x70000000, 0x30000000, 0x10000000,
- 0x00000000 };
-#else
- { 0xF0F0F0F0, 0x70F0F0F0, 0x30F0F0F0, 0x10F0F0F0,
- 0x00F0F0F0, 0x0070F0F0, 0x0030F0F0, 0x0010F0F0,
- 0x0000F0F0, 0x000070F0, 0x000030F0, 0x000010F0,
- 0x000000F0, 0x00000070, 0x00000030, 0x00000010,
- 0x00000000 };
-#endif
-
- TPos e1, e2;
- int c1, c2;
+ TPos e1, e2;
+ int c1, c2;
TByte* target;
unsigned int f1, f2;
@@ -2823,9 +2481,9 @@
c1 = e1 >> 4;
c2 = e2 >> 4;
- fill = LMask[0];
- f1 = LMask[ e1 & 15 ];
- f2 = fill ^ LMask[ 1+(e2 & 15) ];
+ fill = LMask5[0];
+ f1 = LMask5[ e1 & 15 ];
+ f2 = fill ^ LMask5[ 1+(e2 & 15) ];
f1 >>= shift;
f2 >>= shift;
@@ -2839,7 +2497,7 @@
if (c2 > 0)
{
- int* slice = (int*)target;
+ Word32* slice = (Word32*)target;
slice[0] |= f1;
c2--;
@@ -2851,7 +2509,7 @@
slice[1] |= f2;
}
else
- ((int*)target)[0] |= ( f1 & f2 );
+ ((Word32*)target)[0] |= ( f1 & f2 );
}
}
@@ -2860,15 +2518,14 @@
int Vertical_Gray5_Test_Pixel( RAS_ARGS int y,
int x )
{
- int c1 = x >> 2;
- int f1 = x & 3;
- int mask = (0x80 >> f1) >> ((y & 1)*4);
+ int c1 = x >> 4;
+ Word32 mask = LPos5[ x & 15 ] >> ((y & 1)*4);
(void)y;
return ( x >= 0 &&
x < ras.bit_width &&
- ras.bit_buffer[c1] & mask );
+ ((Word32*)ras.bit_buffer + c1)[0] & mask );
}
@@ -2882,14 +2539,13 @@
if ( x >= 0 && x < ras.bit_width )
{
- int c1 = x >> 2;
- int f1 = x & 3;
- int mask = (0x80 >> f1) >> ((y & 1)*4);
+ int c1 = x >> 4;
+ Word32 mask = LPos5[ x & 15 ] >> ((y & 1)*4);
- if ( ras.gray_min_x > c1/4 ) ras.gray_min_x = c1/4;
- if ( ras.gray_max_x < c1/4 ) ras.gray_max_x = c1/4;
+ if ( ras.gray_min_x > c1 ) ras.gray_min_x = c1;
+ if ( ras.gray_max_x < c1 ) ras.gray_max_x = c1;
- ras.bit_buffer[c1] |= mask;
+ ((Word32*)ras.bit_buffer + c1)[0] |= mask;
}
}
@@ -3886,6 +3542,7 @@
static
int Raster_Render8( FT_Raster raster )
{
+ UNUSED_RASTER
return ErrRaster_Unimplemented;
}
@@ -4004,6 +3661,9 @@
int count,
const char* palette )
{
+ (void)raster;
+ (void)palette;
+
switch (count)
{
#ifdef FT_RASTER_OPTION_ANTI_ALIAS
@@ -4077,7 +3737,7 @@
#else
-#include <ftobjs.h>
+#include <freetype/internal/ftobjs.h>
static
int ft_black2_new( FT_Memory memory, FT_Raster *araster )
--- a/demos/src/ftrast2.h
+++ b/demos/src/ftrast2.h
@@ -19,7 +19,7 @@
#ifndef FTRAST2_H
#define FTRAST2_H
-#include <ftimage.h>
+#include <freetype/ftimage.h>
#ifdef __cplusplus
extern "C" {
--- a/demos/src/ftstring.c
+++ b/demos/src/ftstring.c
@@ -10,8 +10,8 @@
/* */
/****************************************************************************/
-#include "freetype.h"
-#include "ftglyph.h"
+#include <freetype/freetype.h>
+#include <freetype/ftglyph.h>
#include "common.h"
#include <stdio.h>
@@ -23,7 +23,7 @@
#include "graph.h"
#include "grfont.h"
-#include "ftgrays.h"
+#include <freetype/ftgrays.h>
#define DIM_X 500
#define DIM_Y 400
--- a/demos/src/fttimer.c
+++ b/demos/src/fttimer.c
@@ -19,8 +19,7 @@
/* */
/****************************************************************************/
-#include "freetype.h"
-#include "ftoutln.h"
+#include <freetype/freetype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -28,7 +27,7 @@
#include <time.h> /* for clock() */
#include "graph.h"
-#include "ftgrays.h"
+#include <freetype/ftgrays.h>
/* SunOS 4.1.* does not define CLOCKS_PER_SEC, so include <sys/param.h> */
/* to get the HZ macro which is the equivalent. */
--- a/demos/src/ftview.c
+++ b/demos/src/ftview.c
@@ -15,8 +15,7 @@
/* */
/****************************************************************************/
-#include "freetype.h"
-#include "ftoutln.h"
+#include <freetype/freetype.h>
#include "common.h"
#include <stdio.h>
@@ -27,7 +26,8 @@
#include "graph.h"
#include "grfont.h"
-#include "ftgrays.h"
+#include <freetype/ftgrays.h>
+#include "ftrast.h"
#include "ftrast2.h"
#define DIM_X 500
@@ -60,9 +60,9 @@
int ptsize; /* current point size */
int hinted = 1; /* is glyph hinting active ? */
- int antialias = 1; /* is anti-aliasing active ? */
+ int antialias = 0; /* is anti-aliasing active ? */
int use_sbits = 1; /* do we use embedded bitmaps ? */
- int low_prec = 1; /* force low precision */
+ int low_prec = 0; /* force low precision */
int Num; /* current first glyph index */
int res = 72;
@@ -425,8 +425,10 @@
error = 1;
if ( !antialias)
- error = FT_Set_Raster( library, &ft_black2_raster );
-
+ {
+ error = FT_Set_Raster( library, use_grays ? &ft_black2_raster
+ : &ft_black_raster );
+ }
else if ( use_grays && antialias )
error = FT_Set_Raster( library, &ft_grays_raster );
--- a/demos/src/ttdebug.c
+++ b/demos/src/ttdebug.c
@@ -26,7 +26,7 @@
#endif
-#include "freetype.h"
+#include <freetype/freetype.h>
#include "ttobjs.h"
#include "ttdriver.h"
#include "ttinterp.h"
--- a/include/freetype.h
+++ /dev/null
@@ -1,2550 +1,0 @@
-/***************************************************************************/
-/* */
-/* freetype.h */
-/* */
-/* FreeType high-level API and common types (specification only). */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
-
-#ifndef FREETYPE_H
-#define FREETYPE_H
-
-
- /*************************************************************************/
- /* */
- /* The `raster' component duplicates some of the declarations in */
- /* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */
- /* */
-#define _FREETYPE_
-
-
- /*************************************************************************/
- /* */
- /* The FREETYPE_MAJOR and FREETYPE_MINOR macros are used to version the */
- /* new FreeType design, which is able to host several kinds of font */
- /* drivers. It starts at 2.0. Note that each driver has its own */
- /* version number (for example, the TrueType driver is at 1.2, as */
- /* defined by the macros TT_FREETYPE_MAJOR and TT_FREETYPE_MINOR in the */
- /* file `ttlib/truetype.h'. */
- /* */
-#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 0
-
-
- /*************************************************************************/
- /* */
- /* To make freetype.h independent from configuration files we check */
- /* whether EXPORT_DEF has been defined already. */
- /* */
- /* On some systems and compilers (Win32 mostly), an extra keyword is */
- /* necessary to compile the library as a DLL. */
- /* */
-#ifndef EXPORT_DEF
-#define EXPORT_DEF extern
-#endif
-
-#include <fterrors.h>
-#include <ftsystem.h>
-#include <ftimage.h>
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Bool */
- /* */
- /* <Description> */
- /* A typedef of unsigned char, used for simple booleans. */
- /* */
- typedef unsigned char FT_Bool;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_FWord */
- /* */
- /* <Description> */
- /* A signed 16-bit integer used to store a distance in original font */
- /* units. */
- /* */
- typedef signed short FT_FWord; /* Distance in FUnits */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UFWord */
- /* */
- /* <Description> */
- /* An unsigned 16-bit integer used to store a distance in original */
- /* font units. */
- /* */
- typedef unsigned short FT_UFWord; /* Unsigned distance */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Char */
- /* */
- /* <Description> */
- /* A simple typedef for the _signed_ char type. */
- /* */
- typedef signed char FT_Char;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Byte */
- /* */
- /* <Description> */
- /* A simple typedef for the _unsigned_ char type. */
- /* */
- typedef unsigned char FT_Byte;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_String */
- /* */
- /* <Description> */
- /* A simple typedef for the char type, usually used for strings. */
- /* */
- typedef char FT_String;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Short */
- /* */
- /* <Description> */
- /* A typedef for signed short. */
- /* */
- typedef signed short FT_Short;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UShort */
- /* */
- /* <Description> */
- /* A typedef for unsigned short. */
- /* */
- typedef unsigned short FT_UShort;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int */
- /* */
- /* <Description> */
- /* A typedef for the int type. */
- /* */
- typedef int FT_Int;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt */
- /* */
- /* <Description> */
- /* A typedef for the unsigned int type. */
- /* */
- typedef unsigned int FT_UInt;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Long */
- /* */
- /* <Description> */
- /* A typedef for signed long. */
- /* */
- typedef signed long FT_Long;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ULong */
- /* */
- /* <Description> */
- /* A typedef for unsigned long. */
- /* */
- typedef unsigned long FT_ULong;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F2Dot14 */
- /* */
- /* <Description> */
- /* A signed 2.14 fixed float type used for unit vectors. */
- /* */
- typedef signed short FT_F2Dot14;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F26Dot6 */
- /* */
- /* <Description> */
- /* A signed 26.6 fixed float type used for vectorial pixel */
- /* coordinates. */
- /* */
- typedef signed long FT_F26Dot6;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Fixed */
- /* */
- /* <Description> */
- /* This type is used to store 16.16 fixed float values, like scales */
- /* or matrix coefficients. */
- /* */
- typedef signed long FT_Fixed;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Error */
- /* */
- /* <Description> */
- /* The FreeType error code type. A value of 0 is always interpreted */
- /* as a successful operation. */
- /* */
- typedef int FT_Error;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Pointer */
- /* */
- /* <Description> */
- /* A simple typedef for a typeless pointer. */
- /* */
- typedef void* FT_Pointer;
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_UnitVector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2d vector unit vector. Uses */
- /* FT_F2Dot14 types. */
- /* */
- /* <Fields> */
- /* x :: Horizontal coordinate. */
- /* y :: Vertical coordinate. */
- /* */
- typedef struct FT_UnitVector_
- {
- FT_F2Dot14 x;
- FT_F2Dot14 y;
-
- } FT_UnitVector;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Matrix */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2x2 matrix. Coefficients are */
- /* in 16.16 fixed float format. The computation performed is: */
- /* */
- /* { */
- /* x' = x*xx + y*xy */
- /* y' = x*yx + y*yy */
- /* } */
- /* */
- /* <Fields> */
- /* xx :: Matrix coefficient. */
- /* xy :: Matrix coefficient. */
- /* yx :: Matrix coefficient. */
- /* yy :: Matrix coefficient. */
- /* */
- typedef struct FT_Matrix_
- {
- FT_Fixed xx, xy;
- FT_Fixed yx, yy;
-
- } FT_Matrix;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_BBox */
- /* */
- /* <Description> */
- /* A structure used to hold an outline's bounding box, i.e., the */
- /* coordinates of its extrema in the horizontal and vertical */
- /* directions. */
- /* */
- /* <Fields> */
- /* xMin :: The horizontal minimum (left-most). */
- /* yMin :: The vertical minimum (bottom-most). */
- /* xMax :: The horizontal maximum (right-most). */
- /* yMax :: The vertical maximum (top-most). */
- /* */
- typedef struct FT_BBox_
- {
- FT_Pos xMin, yMin;
- FT_Pos xMax, yMax;
-
- } FT_BBox;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_MAKE_TAG */
- /* */
- /* <Description> */
- /* This macro converts four letter tags which are used to label */
- /* TrueType tables into an unsigned long to be used within FreeType. */
- /* */
-#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
- (((FT_ULong)_x1 << 24) | \
- ((FT_ULong)_x2 << 16) | \
- ((FT_ULong)_x3 << 8) | \
- (FT_ULong)_x4)
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* L I S T M A N A G E M E N T */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ListNode */
- /* */
- /* <Description> */
- /* Many elements and objects in FreeType are listed through a */
- /* FT_List record (see FT_ListRec). As its name suggests, a */
- /* FT_ListNode is a handle to a single list element. */
- /* */
- typedef struct FT_ListNodeRec_* FT_ListNode;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_List */
- /* */
- /* <Description> */
- /* A handle to a list record (see FT_ListRec). */
- /* */
- typedef struct FT_ListRec_* FT_List;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListNodeRec */
- /* */
- /* <Description> */
- /* A structure used to hold a single list element. */
- /* */
- /* <Fields> */
- /* prev :: Previous element in the list. NULL if first. */
- /* next :: Next element in the list. NULL if last. */
- /* data :: Typeless pointer to the listed object. */
- /* */
- typedef struct FT_ListNodeRec_
- {
- FT_ListNode prev;
- FT_ListNode next;
- void* data;
-
- } FT_ListNodeRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListRec */
- /* */
- /* <Description> */
- /* A structure used to hold a simple doubly-linked list. These are */
- /* used in many parts of FreeType. */
- /* */
- /* <Fields> */
- /* head :: Head (first element) of doubly-linked list. */
- /* tail :: Tail (last element) of doubly-linked list. */
- /* */
- typedef struct FT_ListRec_
- {
- FT_ListNode head;
- FT_ListNode tail;
-
- } FT_ListRec;
-
-
-#define FT_IS_EMPTY(list) ( (list).head == 0 )
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S I C T Y P E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Glyph_Metrics */
- /* */
- /* <Description> */
- /* A structure used to model the metrics of a single glyph. Note */
- /* that values are expressed in 26.6 fractional pixel format or in */
- /* font units, depending on context. */
- /* */
- /* <Fields> */
- /* width :: The glyph's width. */
- /* height :: The glyph's height. */
- /* */
- /* horiBearingX :: Horizontal left side bearing. */
- /* horiBearingY :: Horizontal top side bearing. */
- /* horiAdvance :: Horizontal advance width. */
- /* */
- /* vertBearingX :: Vertical left side bearing. */
- /* vertBearingY :: Vertical top side bearing. */
- /* vertAdvance :: Vertical advance height. */
- /* */
- typedef struct FT_Glyph_Metrics_
- {
- FT_Pos width; /* glyph width */
- FT_Pos height; /* glyph height */
-
- FT_Pos horiBearingX; /* left side bearing in horizontal layouts */
- FT_Pos horiBearingY; /* top side bearing in horizontal layouts */
- FT_Pos horiAdvance; /* advance width for horizontal layout */
-
- FT_Pos vertBearingX; /* left side bearing in vertical layouts */
- FT_Pos vertBearingY; /* top side bearing in vertical layouts */
- FT_Pos vertAdvance; /* advance height for vertical layout */
-
- } FT_Glyph_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Generic_Finalizer */
- /* */
- /* <Description> */
- /* Describes a function used to destroy the `client' data of any */
- /* FreeType object. See the description of the FT_Generic type for */
- /* details of usage. */
- /* */
- /* <Input> */
- /* The address of the FreeType object which is under finalisation. */
- /* Its client data is accessed through its `generic' field. */
- /* */
- typedef void (*FT_Generic_Finalizer)(void* object);
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Generic */
- /* */
- /* <Description> */
- /* Client applications often need to associate their own data to a */
- /* variety of FreeType core objects. For example, a text layout API */
- /* might want to associate a glyph cache to a given size object. */
- /* */
- /* Most FreeType object contains a `generic' field, of type */
- /* FT_Generic, which usage is left to client applications and font */
- /* servers. */
- /* */
- /* It can be used to store a pointer to client-specific data, as well */
- /* as the address of a `finalizer' function, which will be called by */
- /* FreeType when the object is destroyed (for example, the previous */
- /* client example would put the address of the glyph cache destructor */
- /* in the `finalizer' field). */
- /* */
- /* <Fields> */
- /* data :: A typeless pointer to any client-specified data. This */
- /* field is completely ignored by the FreeType library. */
- /* */
- /* finalizer :: A pointer to a `generic finalizer' function, which */
- /* will be called when the object is destroyed. If this */
- /* field is set to NULL, no code will be called. */
- /* */
- typedef struct FT_Generic_
- {
- void* data;
- FT_Generic_Finalizer finalizer;
-
- } FT_Generic;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Bitmap_Size */
- /* */
- /* <Description> */
- /* An extremely simple structure used to model the size of a bitmap */
- /* strike (i.e., a bitmap instance of the font for a given */
- /* resolution) in a fixed-size font face. This is used for the */
- /* `available_sizes' field of the FT_Face_Properties structure. */
- /* */
- /* <Fields> */
- /* height :: The character height in pixels. */
- /* width :: The character width in pixels. */
- /* */
- typedef struct FT_Bitmap_Size_
- {
- FT_Short height;
- FT_Short width;
-
- } FT_Bitmap_Size;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Library */
- /* */
- /* <Description> */
- /* A handle to a FreeType library instance. Each `library' is */
- /* completely independent from the others; it is the `root' of a set */
- /* of objects like fonts, faces, sizes, etc. */
- /* */
- /* It also embeds a system object (see FT_System), as well as a */
- /* scan-line converter object (see FT_Raster). */
- /* */
- /* <Note> */
- /* Library objects are created through FT_Init_FreeType(). */
- /* */
- typedef struct FT_LibraryRec_ *FT_Library;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Driver */
- /* */
- /* <Description> */
- /* A handle to a given FreeType font driver object. Each font driver */
- /* is able to create faces, sizes, glyph slots, and charmaps from the */
- /* resources whose format it supports. */
- /* */
- /* A driver can support either bitmap, graymap, or scalable font */
- /* formats. */
- /* */
- typedef struct FT_DriverRec_* FT_Driver;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Face */
- /* */
- /* <Description> */
- /* A handle to a given driver face object. A face object contains */
- /* all the instance and glyph independent data of a font file */
- /* typeface. */
- /* */
- /* A face object is created from a resource object through the */
- /* new_face() method of a given driver. */
- /* */
- typedef struct FT_FaceRec_* FT_Face;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Size */
- /* */
- /* <Description> */
- /* A handle to a given driver size object. Such an object models the */
- /* _resolution_ AND _size_ dependent state of a given driver face */
- /* size. */
- /* */
- /* A size object is always created from a given face object. It is */
- /* discarded automatically by its parent face. */
- /* */
- typedef struct FT_SizeRec_* FT_Size;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a given `glyph slot'. A slot is a container where it */
- /* is possible to load any of the glyphs contained within its parent */
- /* face. */
- /* */
- /* A glyph slot is created from a given face object. It is discarded */
- /* automatically by its parent face. */
- /* */
- typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_CharMap */
- /* */
- /* <Description> */
- /* A handle to a given character map. A charmap is used to translate */
- /* character codes in a given encoding into glyph indexes for its */
- /* parent's face. Some font formats may provide several charmaps per */
- /* font. */
- /* */
- /* A charmap is created from a given face object. It is discarded */
- /* automatically by its parent face. */
- /* */
- typedef struct FT_CharMapRec_* FT_CharMap;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Encoding */
- /* */
- /* <Description> */
- /* An enumeration used to specify encodings supported by charmaps. */
- /* Used in the FT_Select_CharMap() API function. */
- /* */
- /* <Note> */
- /* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
- /* all character codes must be expressed as FT_Longs. */
- /* */
- typedef enum FT_Encoding_
- {
- ft_encoding_none = 0,
- ft_encoding_symbol = 0,
- ft_encoding_unicode = FT_MAKE_TAG('u','n','i','c'),
- ft_encoding_latin_2 = FT_MAKE_TAG('l','a','t','2'),
- ft_encoding_sjis = FT_MAKE_TAG('s','j','i','s'),
- ft_encoding_big5 = FT_MAKE_TAG('b','i','g','5'),
-
- ft_encoding_adobe_standard = FT_MAKE_TAG('a','d','o','b'),
- ft_encoding_adobe_expert = FT_MAKE_TAG('a','d','b','e'),
- ft_encoding_adobe_custom = FT_MAKE_TAG('a','d','b','c'),
-
- ft_encoding_apple_roman = FT_MAKE_TAG('a','r','m','n')
-
- /* other encodings might be defined in the future */
-
- } FT_Encoding;
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_CharMapRec */
- /* */
- /* <Description> */
- /* The base charmap class. */
- /* */
- /* <Fields> */
- /* face :: A handle to the parent face object. */
- /* */
- /* flags :: A set of bit flags used to describe the charmap. */
- /* Each bit indicates that a given encoding is */
- /* supported. */
- /* */
- /* platform_id :: An ID number describing the platform for the */
- /* following encoding ID. This comes directly from */
- /* the TrueType specification and should be emulated */
- /* for other formats. */
- /* */
- /* encoding_id :: A platform specific encoding number. This also */
- /* comes from the TrueType specification and should be */
- /* emulated similarly. */
- /* */
- /* <Note> */
- /* We STRONGLY recommmend emulating a Unicode charmap for drivers */
- /* that do not support TrueType or OpenType. */
- /* */
- typedef struct FT_CharMapRec_
- {
- FT_Face face;
- FT_Encoding encoding;
- FT_UShort platform_id;
- FT_UShort encoding_id;
-
- } FT_CharMapRec;
-
-
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S E O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
-
- /*************************************************************************/
- /* */
- /* FreeType base face class */
- /* */
- /* <Struct> */
- /* FT_FaceRec */
- /* */
- /* <Description> */
- /* FreeType root face class structure. A face object models the */
- /* resolution and point-size independent data found in a font file. */
- /* */
- /* <Fields> */
- /* num_faces :: In the case where the face is located in a */
- /* collection (i.e., a resource which embeds */
- /* several faces), this is the total number of */
- /* faces found in the resource. 1 by default. */
- /* */
- /* face_index :: The index of the face in its resource. */
- /* Usually, this is 0 for all normal font */
- /* formats. It can be more in the case of */
- /* collections (which embed several fonts in a */
- /* single resource/file). */
- /* */
- /* face_flags :: A set of bit flags that give important */
- /* information about the face; see the */
- /* FT_FACE_FLAG_XXX macros for details. */
- /* */
- /* style_flags :: A set of bit flags indicating the style of */
- /* the face (i.e., italic, bold, underline, */
- /* etc). */
- /* */
- /* num_glyphs :: The total number of glyphs in the face. */
- /* */
- /* family_name :: The face's family name. This is an ASCII */
- /* string, usually in English, which describes */
- /* the typeface's family (like `Times New */
- /* Roman', `Bodoni', `Garamond', etc). This */
- /* is a least common denominator used to list */
- /* fonts. Some formats (TrueType & OpenType) */
- /* provide localized and Unicode versions of */
- /* this string. Applications should use the */
- /* format specific interface to access them. */
- /* */
- /* style_name :: The face's style name. This is an ASCII */
- /* string, usually in English, which describes */
- /* the typeface's style (like `Italic', */
- /* `Bold', `Condensed', etc). Not all font */
- /* formats provide a style name, so this field */
- /* is optional, and can be set to NULL. As */
- /* for `family_name', some formats provide */
- /* localized/Unicode versions of this string. */
- /* Applications should use the format specific */
- /* interface to access them. */
- /* */
- /* num_fixed_sizes :: The number of fixed sizes available in this */
- /* face. This should be set to 0 for scalable */
- /* fonts, unless its resource includes a */
- /* complete set of glyphs (called a `strike') */
- /* for the specified size. */
- /* */
- /* available_sizes :: An array of sizes specifying the available */
- /* bitmap/graymap sizes that are contained in */
- /* in the font resource. Should be set to */
- /* NULL if the field `num_fixed_sizes' is set */
- /* to 0. */
- /* */
- /* num_charmaps :: The total number of character maps in the */
- /* face. */
- /* */
- /* charmaps :: A table of pointers to the face's charmaps */
- /* Used to scan the list of available charmaps */
- /* this table might change after a call to */
- /* FT_Attach_File/Stream (e.g. when it used */
- /* to hook and additional encoding/CMap to */
- /* the face object). */
- /* */
- /* generic :: A field reserved for client uses. See the */
- /* FT_Generic type description. */
- /* */
- /* bbox :: The font bounding box. Coordinates are */
- /* expressed in font units (see units_per_EM). */
- /* The box is large enough to contain any */
- /* glyph from the font. Thus, bbox.yMax can */
- /* be seen as the `maximal ascender', */
- /* bbox.yMin as the `minimal descender', and */
- /* the maximum glyph width is given by */
- /* `bbox.xMax-bbox.xMin' (not to be confused */
- /* with the maximum _advance_width_). Only */
- /* relevant for scalable formats. */
- /* */
- /* units_per_EM :: The number of font units per EM square for */
- /* this face. This is typically 2048 for */
- /* TrueType fonts, 1000 for Type1 fonts, and */
- /* should be set to the (unrealistic) value 1 */
- /* for fixed-sizes fonts. Only relevant for */
- /* scalable formats. */
- /* */
- /* ascender :: The face's ascender is the vertical */
- /* distance from the baseline to the topmost */
- /* point of any glyph in the face. This */
- /* field's value is positive, expressed in */
- /* font units. Some font designs use a value */
- /* different from `bbox.yMax'. Only relevant */
- /* for scalable formats. */
- /* */
- /* descender :: The face's descender is the vertical */
- /* distance from the baseline to the */
- /* bottommost point of any glyph in the face. */
- /* This field's value is positive, expressed */
- /* in font units. Some font designs use a */
- /* value different from `-bbox.yMin'. Only */
- /* relevant for scalable formats. */
- /* */
- /* height :: The face's height is the vertical distance */
- /* from one baseline to the next when writing */
- /* several lines of text. Its value is always */
- /* positive, expressed in font units. The */
- /* value can be computed as */
- /* `ascender+descender+line_gap' where the */
- /* value of `line_gap' is also called */
- /* `external leading'. Only relevant for */
- /* scalable formats. */
- /* */
- /* max_advance_width :: The maximum advance width, in font units, */
- /* for all glyphs in this face. This can be */
- /* used to make word wrapping computations */
- /* faster. Only relevant for scalable */
- /* formats. */
- /* */
- /* max_advance_height :: The maximum advance height, in font units, */
- /* for all glyphs in this face. This is only */
- /* relevant for vertical layouts, and should */
- /* be set to the `height' for fonts that do */
- /* not provide vertical metrics. Only */
- /* relevant for scalable formats. */
- /* */
- /* underline_position :: The position, in font units, of the */
- /* underline line for this face. It's the */
- /* center of the underlining stem. Only */
- /* relevant for scalable formats. */
- /* */
- /* underline_thickness :: The thickness, in font units, of the */
- /* underline for this face. Only relevant for */
- /* scalable formats. */
- /* */
- /* driver :: A handle to the face's parent driver */
- /* object. */
- /* */
- /* memory :: A handle to the face's parent memory */
- /* object. Used for the allocation of */
- /* subsequent objects. */
- /* */
- /* stream :: A handle to the face's stream. */
- /* */
- /* glyph :: The face's associated glyph slot(s). This */
- /* object is created automatically with a new */
- /* face object. However, certain kinds of */
- /* applications (mainly tools like converters) */
- /* can need more than one slot to ease their */
- /* task. */
- /* */
- /* sizes_list :: The list of child sizes for this face. */
- /* */
- /* max_points :: The maximum number of points used to store */
- /* the vectorial outline of any glyph in this */
- /* face. If this value cannot be known in */
- /* advance, or if the face isn't scalable, */
- /* this should be set to 0. Only relevant for */
- /* scalable formats. */
- /* */
- /* max_contours :: The maximum number of contours used to */
- /* store the vectorial outline of any glyph in */
- /* this face. If this value cannot be known */
- /* in advance, or if the face isn't scalable, */
- /* this should be set to 0. Only relevant for */
- /* scalable formats. */
- /* */
- /* transform_matrix :: a 2x2 matrix of 16.16 coefficients used */
- /* to transform glyph outlines after they're */
- /* loaded from the font. Only used by the */
- /* convenience functions. */
- /* */
- /* transform_delta :: a translation vector used to transform */
- /* glyph outlines after they're loaded from */
- /* the font. Only used by the convenience */
- /* functions. */
- /* */
- /* transform_flags :: some flags used to classify the transform. */
- /* Only used by the convenience functions. */
- /* */
- typedef struct FT_FaceRec_
- {
- FT_Long num_faces;
- FT_Long face_index;
-
- FT_Long face_flags;
- FT_Long style_flags;
-
- FT_Long num_glyphs;
-
- FT_String* family_name;
- FT_String* style_name;
-
- FT_Int num_fixed_sizes;
- FT_Bitmap_Size* available_sizes;
-
- /* the face's table of available charmaps */
- FT_Int num_charmaps;
- FT_CharMap* charmaps;
-
- FT_Generic generic;
-
- /* the following are only relevant for scalable outlines */
- FT_BBox bbox;
-
- FT_UShort units_per_EM;
- FT_Short ascender;
- FT_Short descender;
- FT_Short height;
-
- FT_Short max_advance_width;
- FT_Short max_advance_height;
-
- FT_Short underline_position;
- FT_Short underline_thickness;
-
- /************************************************************/
- /* The following fields should be considered private and */
- /* rarely, if ever, used by client applications.. */
-
- FT_Driver driver;
- FT_Memory memory;
- FT_Stream stream;
-
- FT_GlyphSlot glyph;
- FT_Size size;
- FT_CharMap charmap;
- FT_ListRec sizes_list;
-
- void* extensions;
-
- FT_UShort max_points;
- FT_Short max_contours;
-
- FT_Matrix transform_matrix;
- FT_Vector transform_delta;
- FT_Int transform_flags;
-
- } FT_FaceRec;
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_SCALABLE */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face provides */
- /* vectorial outlines (i.e., TrueType or Type1). This doesn't */
- /* prevent embedding of bitmap strikes though, i.e., a given face can */
- /* have both this bit set, and a `num_fixed_sizes' property > 0. */
- /* */
-#define FT_FACE_FLAG_SCALABLE 1
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_FIXED_WIDTH */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face contains */
- /* fixed-width characters (like Courier, MonoType, etc). */
- /* */
-#define FT_FACE_FLAG_FIXED_WIDTH 4
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_FIXED_WIDTH */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face contains */
- /* `fixed sizes', i.e., bitmap strikes for some given pixel sizes. */
- /* See the `num_fixed_sizes' and `available_sizes' face properties */
- /* for more information. */
- /* */
-#define FT_FACE_FLAG_FIXED_SIZES 2
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_SFNT */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face uses the */
- /* `sfnt' storage fomat. For now, this means TrueType or OpenType. */
- /* */
-#define FT_FACE_FLAG_SFNT 8
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_HORIZONTAL */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face contains */
- /* horizontal glyph metrics. This should be set for all common */
- /* formats, but who knows... */
- /* */
-#define FT_FACE_FLAG_HORIZONTAL 0x10
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_VERTICAL */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face contains */
- /* vertical glyph metrics. If not set, the glyph loader will */
- /* synthetize vertical metrics itself to help display vertical text */
- /* correctly. */
- /* */
-#define FT_FACE_FLAG_VERTICAL 0x20
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_KERNING */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face contains */
- /* kerning information. When set, this information can be retrieved */
- /* through the function FT_Get_Kerning(). Note that when unset, this */
- /* function will always return the kerning vector (0,0). */
- /* */
-#define FT_FACE_FLAG_KERNING 0x40
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_FACE_FLAG_FAST_GLYPHS */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that the glyphs in a given */
- /* font can be retrieved very quickly, and that a glyph cache is thus */
- /* not necessary for any of its child size objects. */
- /* */
- /* This flag should really be set for fixed-size formats like FNT, */
- /* where each glyph bitmap is available directly in binary form */
- /* without any kind of compression. */
- /* */
-#define FT_FACE_FLAG_FAST_GLYPHS 0x80
-
-
-#define FT_HAS_HORIZONTAL(face) (face->face_flags & FT_FACE_FLAG_HORIZONTAL)
-#define FT_HAS_VERTICAL(face) (face->face_flags & FT_FACE_FLAG_VERTICAL)
-#define FT_HAS_KERNING(face) (face->face_flags & FT_FACE_FLAG_KERNING)
-#define FT_IS_SCALABLE(face) (face->face_flags & FT_FACE_FLAG_SCALABLE)
-#define FT_IS_SFNT(face) (face->face_flags & FT_FACE_FLAG_SFNT)
-#define FT_IS_FIXED_WIDTH(face) (face->face_flags & FT_FACE_FLAG_FIXED_WIDTH)
-#define FT_HAS_FIXED_SIZES(face) (face->face_flags & FT_FACE_FLAG_FIXED_SIZES)
-#define FT_HAS_FAST_GLYPHS(face) (face->face_flags & FT_FACE_FLAG_FAST_GLYPHS)
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_STYLE_FLAG_ITALIC */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face is */
- /* italicized. */
- /* */
-#define FT_STYLE_FLAG_ITALIC 1
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_STYLE_FLAG_BOLD */
- /* */
- /* <Description> */
- /* A bit-field constant, used to indicate that a given face is */
- /* emboldened. */
- /* */
-#define FT_STYLE_FLAG_BOLD 2
-
-
-
- /*************************************************************************/
- /* */
- /* FreeType base size metrics */
- /* */
- /* <Struct> */
- /* FT_Size_Metrics */
- /* */
- /* <Description> */
- /* The size metrics structure returned scaled important distances for */
- /* a given size object. */
- /* */
- /* <Fields> */
- /* pointSize :: The current point size in 26.6 points, where */
- /* 1 point equals 1/72 inch. */
- /* */
- /* x_ppem :: The character width, expressed in integer pixels. */
- /* This is the width of the EM square expressed in */
- /* pixels, hence the term `ppem' (pixels per EM). */
- /* */
- /* y_ppem :: The character height, expressed in integer pixels. */
- /* This is the height of the EM square expressed in */
- /* pixels, hence the term `ppem' (pixels per EM). */
- /* */
- /* x_scale :: A simple 16.16 fixed point format coefficient used */
- /* to scale horizontal distances expressed in font */
- /* units to fractional (26.6) pixel coordinates. */
- /* */
- /* y_scale :: A simple 16.16 fixed point format coefficient used */
- /* to scale vertical distances expressed in font */
- /* units to fractional (26.6) pixel coordinates. */
- /* */
- /* x_resolution :: The horizontal device resolution for this size */
- /* object, expressed in integer dots per inches */
- /* (dpi). As a convention, fixed font formats set */
- /* this value to 72. */
- /* */
- /* y_resolution :: The vertical device resolution for this size */
- /* object, expressed in integer dots per inches */
- /* (dpi). As a convention, fixed font formats set */
- /* this value to 72. */
- /* */
- /* ascender :: The ascender, expressed in 26.6 fixed point */
- /* pixels. Always positive. */
- /* */
- /* descender :: The descender, expressed in 26.6 fixed point */
- /* pixels. Always positive. */
- /* */
- /* height :: The text height, expressed in 26.6 fixed point */
- /* pixels. Always positive. */
- /* */
- /* max_advance :: Maximum horizontal advance, expressed in 26.6 */
- /* fixed point pixels. Always positive. */
- /* */
- /* <Note> */
- /* This structure doesn't return the vertical ascender, descender, */
- /* and height, as well as a few other esoteric properties. One can */
- /* however compute these through the size's x_scale and y_scale, */
- /* applied to the relevant face properties. */
- /* */
- typedef struct FT_Size_Metrics_
- {
- FT_UShort x_ppem; /* horizontal pixels per EM */
- FT_UShort y_ppem; /* vertical pixels per EM */
-
- FT_Fixed x_scale; /* two scales used to convert font units */
- FT_Fixed y_scale; /* to 26.6 frac. pixel coordinates.. */
-
- FT_Pos ascender; /* ascender in 26.6 frac. pixels */
- FT_Pos descender; /* descender in 26.6 frac. pixels */
- FT_Pos height; /* text height in 26.6 frac. pixels */
- FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
-
- } FT_Size_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* FreeType base size class */
- /* */
- /* <Struct> */
- /* FT_SizeRec */
- /* */
- /* <Description> */
- /* FreeType root size class structure. A size object models the */
- /* resolution and pointsize dependent data of a given face. */
- /* */
- /* <Fields> */
- /* face :: Handle to the parent face object. */
- /* */
- /* generic :: A typeless pointer, which is unused by the FreeType */
- /* library or any of its drivers. It can be used by */
- /* client applications to link their own data to each size */
- /* object. */
- /* */
- /* metrics :: Metrics for this size object. This field is read-only. */
- /* */
- typedef struct FT_SizeRec_
- {
- FT_Face face; /* parent face object */
- FT_Generic generic; /* generic pointer for client uses */
- FT_Size_Metrics metrics; /* size metrics */
-
- } FT_SizeRec;
-
-
-
- typedef struct FT_SubGlyph_ FT_SubGlyph;
-
- struct FT_SubGlyph_
- {
- FT_Int index;
- FT_UShort flags;
- FT_Int arg1;
- FT_Int arg2;
- FT_Matrix transform;
- };
-
-
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
-#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
-#define FT_SUBGLYPH_FLAG_SCALE 8
-#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
-#define FT_SUBGLYPH_FLAG_2X2 0x80
-#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
-
-
- /*************************************************************************/
- /* */
- /* FreeType Glyph Slot base class */
- /* */
- /* <Struct> */
- /* FT_GlyphSlotRec */
- /* */
- /* <Description> */
- /* FreeType root glyph slot class structure. A glyph slot is a */
- /* container where individual glyphs can be loaded, be they */
- /* vectorial or bitmap/graymaps.. */
- /* */
- /* <Fields> */
- /* face :: A handle to the parent face object. */
- /* */
- /* next :: In some cases (like some font tools), several glyph */
- /* slots per face object can be a good thing. As this is */
- /* rare, the glyph slots are listed through a direct, */
- /* single-linked list using its `next' field. */
- /* */
- /* metrics :: The metrics of the last loaded glyph in the slot. The */
- /* returned values depend on the last load flags (see the */
- /* FT_Load_Glyph() API function) and can be expressed */
- /* either in 26.6 fractional pixels or font units. */
- /* */
- /* metrics2 :: This field can be used to return alternate glyph */
- /* metrics after a single load. It can contain either */
- /* the glyph's metrics in font units, or the scaled but */
- /* unhinted ones. See the load flags that apply when */
- /* calling the API function FT_Load_Glyph(). */
- /* */
- /* generic :: A typeless pointer which is unused by the FreeType */
- /* library or any of its drivers. It can be used by */
- /* client applications to link their own data to each */
- /* size object. */
- /* */
- /* outline :: The outline descriptor for the current glyph, if it */
- /* is a vectorial one. The nature of the last loaded */
- /* glyph can be retrieved through the result value */
- /* returned by FT_Load_Glyph(). */
- /* */
- /* bitmap :: The bitmap/graymap descriptor for the current glyph, */
- /* if it is a fixed-width one. The nature of the last */
- /* loaded glyph can be retrieved through the result value */
- /* returned by FT_Load_Glyph(). */
- /* */
- /* */
- typedef struct FT_GlyphSlotRec_
- {
- FT_Face face;
- FT_GlyphSlot next;
-
- FT_Glyph_Metrics metrics;
- FT_Glyph_Metrics metrics2;
-
- FT_Glyph_Format format;
- FT_Bitmap bitmap;
- FT_Outline outline;
-
- FT_Int num_subglyphs;
- FT_Int max_subglyphs;
- FT_SubGlyph* subglyphs;
-
- void* control_data;
- long control_len;
-
- void* other;
-
- } FT_GlyphSlotRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* F U N C T I O N S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Init_FreeType */
- /* */
- /* <Description> */
- /* Initializes a new FreeType library object. The set of drivers */
- /* that are registered by this function is determined at build time. */
- /* */
- /* <Output> */
- /* library :: A handle to a new library object. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- EXPORT_DEF
- FT_Error FT_Init_FreeType( FT_Library* library );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_FreeType */
- /* */
- /* <Description> */
- /* Destroys a given FreeType library object, and all of its childs, */
- /* including resources, drivers, faces, sizes, etc. */
- /* */
- /* <Input> */
- /* library :: A handle to a target library object. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- EXPORT_DEF
- FT_Error FT_Done_FreeType( FT_Library library );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Stream_Type */
- /* */
- /* <Description> */
- /* An enumeration used to list the possible ways to open a new */
- /* input stream. It is used by the FT_Open_Args structure.. */
- /* */
- /* <Fields> */
- /* ft_stream_memory :: this is a memory-based stream */
- /* ft_stream_copy :: copy the stream from the "stream" field */
- /* ft_stream_pathname :: create a new input stream from a C pathname */
- /* */
- typedef enum {
-
- ft_stream_memory = 1,
- ft_stream_copy = 2,
- ft_stream_pathname = 3
-
- } FT_Stream_Type;
-
- /*************************************************************************
- *
- * <Struct>
- * FT_Open_Args
- *
- * <Description>
- * A structure used to indicate how to open a new font file/stream.
- * A pointer to such a structure can be used as a parameter for the
- * function FT_Open_Face & FT_Attach_Stream.
- *
- * <Fields>
- * stream_type :: type of input stream
- *
- * memory_base :: first byte of file in memory
- * memory_size :: size in bytes of file in memory
- *
- * pathname :: a pointer to an 8-bit file pathname
- *
- * stream :: handle to a source stream object
- *
- * driver :: this field is exclusively used by FT_Open_Face,
- * it simply specifies the font driver to use to open
- * the face. If set to 0, FreeType will try to load
- * the face with each one of the drivers in its list.
- *
- * <Note>
- * The stream_type determines which fields are used to create a new
- * input stream.
- *
- * If it is ft_stream_memory, a new memory-based stream will be created
- * using the memory block specified by "memory_base" and "memory_size"
- *
- * If it is ft_stream_pathname, a new stream will be created with the
- * "pathname" field, calling the system-specific FT_New_Stream function
- *
- * It is is ft_stream_copy, then the content of "stream" will be copied
- * to a new input stream object. The object will be closed and destroyed
- * when the face is destroyed itself.. Note that this means that you
- * should not close the stream before the library does !!
- *
- *************************************************************************/
-
- typedef struct FT_Open_Args_
- {
- FT_Stream_Type stream_type;
- FT_Byte* memory_base;
- FT_Long memory_size;
- FT_String* pathname;
- FT_Stream stream;
- FT_Driver driver;
-
- } FT_Open_Args;
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face */
- /* */
- /* <Description> */
- /* Creates a new face object from a given font file and typeface */
- /* index. */
- /* */
- /* <Input> */
- /* library :: handle to the root FreeType library instance */
- /* */
- /* filepathname :: an 8-bit pathname naming the font file */
- /* */
- /* face_index :: the index of the face within the font file. */
- /* The first face has index 0. */
- /* <Output> */
- /* face :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- /* <Note> */
- /* If your font file is in memory, or if you want to provide your */
- /* own input stream object, see FT_Open_Face below. */
- /* */
- /* FT_New_Face creates a new stream object. The stream will be */
- /* closed with the face (when calling FT_Done_Face or even */
- /* FT_Done_FreeType). */
- /* */
- /* Unlike FreeType 1.1, this function automatically creates a glyph */
- /* slot for the face object which can be accessed directly through */
- /* `face->slot'. Note that additional slots can be added to each face */
- /* through the FT_New_GlyphSlot() API function. Slots are linked in */
- /* a single list through their `next' field. */
- /* */
- EXPORT_DEF
- FT_Error FT_New_Face( FT_Library library,
- const char* filepathname,
- FT_Long face_index,
- FT_Face* face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Open_Face */
- /* */
- /* <Description> */
- /* Creates a new face object from a given input stream & typeface */
- /* index. This function is very similar to FT_New_Face, except that */
- /* it can accept any form of input stream.. */
- /* */
- /* <Input> */
- /* library :: handle to the root FreeType library instance */
- /* */
- /* args :: an FT_Open_Args structure used to describe the */
- /* input stream to FreeType. */
- /* */
- /* face_index :: the index of the face within the font file. */
- /* The first face has index 0. */
- /* <Output> */
- /* face :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- /* <Note> */
- /* Note that if the stream is in-memory or specified through an */
- /* 8-bit pathname, a new stream is created by this function. It */
- /* is only closed when the face is destroyed (FT_Done_Face). */
- /* */
- /* Note that when specifying directly an existing FT_Stream, this */
- /* function creates a new FT_Stream object and copies the contents */
- /* of the original stream within it. The stream will be closed */
- /* when the face is destroyed. This means calling the stream's */
- /* "close" function. */
- /* */
- EXPORT_DEF
- FT_Error FT_Open_Face( FT_Library library,
- FT_Open_Args* args,
- FT_Long face_index,
- FT_Face* face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_File */
- /* */
- /* <Description> */
- /* "Attach" a given font file to an existing face. This is usually */
- /* to read additionnal information for a single face object. For */
- /* example, it is used to read the AFM files that come with Type 1 */
- /* fonts in order to add kerning data and other metrics.. */
- /* */
- /* <Input> */
- /* face :: target face object */
- /* */
- /* filepathname :: an 8-bit pathname naming the 'metrics' file. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- /* <Note> */
- /* If your font file is in memory, or if you want to provide your */
- /* own input stream object, see FT_Attach_Stream. */
- /* */
- /* The meaning of the "attach" (i.e. what really happens when the */
- /* new file is read) is not fixed by FreeType itself. It really */
- /* depends on the font format (and thus the font driver). */
- /* */
- /* Client applications are expected to know what they're doing */
- /* when invoking this function. Most drivers simply do not implement */
- /* file attachments.. */
- /* */
- EXPORT_DEF
- FT_Error FT_Attach_File( FT_Face face,
- const char* filepathname );
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_Stream */
- /* */
- /* <Description> */
- /* This function is similar to FT_Attach_File with the exception */
- /* that it reads the attachment from an arbitrary stream. */
- /* */
- /* <Input> */
- /* face :: target face object */
- /* */
- /* args :: a pointer to an FT_Open_Args structure used to describe */
- /* the input stream to FreeType */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- /* The meaning of the "attach" (i.e. what really happens when the */
- /* new file is read) is not fixed by FreeType itself. It really */
- /* depends on the font format (and thus the font driver). */
- /* */
- /* Client applications are expected to know what they're doing */
- /* when invoking this function. Most drivers simply do not implement */
- /* file attachments.. */
- /* */
- EXPORT_DEF
- FT_Error FT_Attach_Stream( FT_Face face,
- FT_Open_Args* parameters );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Face */
- /* */
- /* <Description> */
- /* Discards a given face object, as well as all of its child slots */
- /* and sizes. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- EXPORT_DEF
- FT_Error FT_Done_Face( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Char_Size */
- /* */
- /* <Description> */
- /* Sets the character dimensions of a given size object. The */
- /* `char_size' value is used for the width and height, expressed in */
- /* 26.6 fractional points. 1 point = 1/72 inch. */
- /* */
- /* <Input> */
- /* size :: A handle to a target size object. */
- /* char_size :: The character size, in 26.6 fractional points. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- /* <Note> */
- /* When dealing with fixed-size faces (i.e., non-scalable formats), */
- /* use the function FT_Set_Pixel_Sizes(). */
- /* */
- EXPORT_DEF
- FT_Error FT_Set_Char_Size( FT_Face face,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Pixel_Sizes */
- /* */
- /* <Description> */
- /* Sets the character dimensions of a given size object. The width */
- /* and height are expressed in integer pixels. */
- /* */
- /* <Input> */
- /* size :: A handle to a target size object. */
- /* pixel_width :: The character width, in integer pixels. */
- /* pixel_height :: The character height, in integer pixels. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- EXPORT_DEF
- FT_Error FT_Set_Pixel_Sizes( FT_Face face,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Glyph */
- /* */
- /* <Description> */
- /* A function used to load a single glyph within a given glyph slot, */
- /* for a given size. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object where the glyph */
- /* will be loaded. */
- /* */
- /* glyph_index :: The index of the glyph in the font file. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FT_LOAD_XXX 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. */
- /* */
- EXPORT_DEF
- FT_Error FT_Load_Glyph( FT_Face face,
- FT_UInt glyph_index,
- FT_Int load_flags );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Char */
- /* */
- /* <Description> */
- /* A function used to load a single glyph within a given glyph slot, */
- /* for a given size, according to its character code ! */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object where the glyph */
- /* will be loaded. */
- /* */
- /* char_code :: The glyph's character code, according to the */
- /* current charmap used in the face. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FT_LOAD_XXX 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. */
- /* */
- /* <Note> */
- /* If the face has no current charmap, or if the character code */
- /* is not defined in the charmap, this function will return an */
- /* error.. */
- /* */
- EXPORT_DEF
- FT_Error FT_Load_Char( FT_Face face,
- FT_ULong char_code,
- FT_Int load_flags );
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_NO_SCALE */
- /* */
- /* <Description> */
- /* A bit field constant, used with FT_Load_Glyph() to indicate that */
- /* the vector outline being loaded should not be scaled to 26.6 */
- /* fractional pixels, but kept in notional units. */
- /* */
-#define FT_LOAD_NO_SCALE 1
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_NO_HINTING */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the vector outline being loaded should not be fitted to the pixel */
- /* grid but simply scaled to 26.6 fractional pixels. */
- /* */
- /* This flag is ignored when FT_LOAD_NO_SCALE is set. */
- /* */
-#define FT_LOAD_NO_HINTING 2
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_NO_OUTLINE */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the function should not load the vector outline of a given glyph. */
- /* If an embedded bitmap exists for the glyph in the font, it will be */
- /* loaded, otherwise nothing is returned and an error is produced. */
- /* */
-#define FT_LOAD_NO_OUTLINE 4
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_NO_BITMAP */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the function should not load the bitmap or pixmap of a given */
- /* glyph. If an outline exists for the glyph in the font, it is */
- /* loaded, otherwise nothing is returned and an error is produced. */
- /* */
-#define FT_LOAD_NO_BITMAP 8
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_LINEAR */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the function should return the linearly scaled metrics for the */
- /* glyph in `slot->metrics2' (these metrics are not grid-fitted). */
- /* Otherwise, `metrics2' gives the original font units values. */
- /* */
-#define FT_LOAD_LINEAR 16
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_FORCE_AUTOHINT */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the function should try to auto-hint the glyphs, even if a driver- */
- /* -specific hinter is available.. */
- /* */
-#define FT_LOAD_FORCE_AUTOHINT 32
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_PEDANTIC */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the glyph loader should perform a pedantic bytecode. */
- /* interpretation. Many popular fonts come with broken glyph */
- /* programs. When this flag is set, loading them will return an */
- /* error. Otherwise, errors are ignored by the loader, sometimes */
- /* resulting in ugly glyphs. */
- /* */
-#define FT_LOAD_PEDANTIC 128
-
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the glyph loader should ignore the global advance width defined */
- /* in the font. As far as we know, this is only used by the */
- /* X-TrueType font server, in order to deal correctly with the */
- /* incorrect metrics contained in DynaLab's TrueType CJK fonts.. */
- /* */
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 512
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_NO_RECURSE */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the glyph loader should not load composite glyph recursively. */
- /* Rather, when a composite glyph is encountered, it should set */
- /* the values of `num_subglyphs' and `subglyphs', as well as set */
- /* `face->glyph.format' to ft_glyph_format_composite. */
- /* */
- /* This is for use by the auto-hinter and possibly other tools */
- /* For nearly all applications, this flags should be left unset */
- /* when invoking FT_Load_Glyph(). */
- /* */
- /* Note that the flag forces the load of unscaled glyphs */
- /* */
-#define FT_LOAD_NO_RECURSE 1024
-
- /*************************************************************************/
- /* */
- /* <Constant> */
- /* FT_LOAD_DEFAULT */
- /* */
- /* <Description> */
- /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
- /* the function should try to load the glyph normally, i.e., */
- /* embedded bitmaps are favored over outlines, vectors are always */
- /* scaled and grid-fitted. */
- /* */
-#define FT_LOAD_DEFAULT 0
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Kerning */
- /* */
- /* <Description> */
- /* Returns the kerning vector between two glyphs of a same face. */
- /* */
- /* <Input> */
- /* face :: A handle to a 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 :: 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 API function -- they can be */
- /* implemented through format-specific interfaces. */
- /* */
- EXPORT_DEF
- FT_Error FT_Get_Kerning( FT_Face face,
- FT_UInt left_glyph,
- FT_UInt right_glyph,
- FT_Vector* kerning );
-
-
-
-/* XXX : Not implemented yet, but should come soon */
-#if 0
- EXPORT_DEF
- FT_Error FT_Select_Charmap( FT_Face face,
- FT_Encoding encoding );
-
-
- EXPORT_DEF
- FT_Error FT_Set_Charmap( FT_Face face,
- FT_CharMap charmap );
-#endif
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Char_Index */
- /* */
- /* <Description> */
- /* Returns the glyph index of a given character code. This function */
- /* uses a charmap object to do the translation. */
- /* */
- /* <Input> */
- /* charmap :: A handle to a filter charmap object. */
- /* charcode :: The character code. */
- /* */
- /* <Return> */
- /* The glyph index. 0 means `undefined character code'. */
- /* */
- EXPORT_DEF
- FT_UInt FT_Get_Char_Index( FT_Face face,
- FT_ULong charcode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulDiv */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation `(A*B)/C' */
- /* with maximum accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
- /* */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero, it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
- /* */
- EXPORT_DEF
- FT_Long FT_MulDiv( FT_Long a,
- FT_Long b,
- FT_Long c );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(A*B)/0x10000' with maximum accuracy. Most of the time, this is */
- /* used to multiply a given value by a 16.16 fixed float factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*b)/0x10000'. */
- /* */
- /* <Note> */
- /* This function has been optimized for the case where the absolute */
- /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
- /* As this happens mainly when scaling from notional units to */
- /* fractional pixels in FreeType, it resulted in noticeable speed */
- /* improvements between versions 2.0 and 1.x. */
- /* */
- /* As a conclusion, always try to place a 16.16 factor as the */
- /* _second_ argument of this function; this can make a great */
- /* difference. */
- /* */
- EXPORT_DEF
- FT_Long FT_MulFix( FT_Long a,
- FT_Long b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_DivFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(A*0x10000)/B' with maximum accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed float factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*0x10000)/b'. */
- /* */
- /* <Note> */
- /* The optimisation for FT_DivFix() is simple : if (a << 16) fits */
- /* in 32 bits, then the division is computed directly. Otherwise, */
- /* we use a specialised version of the old FT_MulDiv64 */
- /* */
- EXPORT_DEF
- FT_Long FT_DivFix( FT_Long a,
- FT_Long b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_Bitmap */
- /* */
- /* <Description> */
- /* Renders an outline within a bitmap. The outline's image is simply */
- /* or-ed to the target bitmap. */
- /* */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* outline :: A pointer to the source outline descriptor. */
- /* map :: A pointer to the target bitmap descriptor. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* YES. Rendering is synchronized, so that concurrent calls to the */
- /* scan-line converter will be serialized. */
- /* */
- /* <Note> */
- /* This function does NOT CREATE the bitmap, it only renders an */
- /* outline image within the one you pass to it! */
- /* */
- /* It will use the raster correponding to the default glyph format. */
- /* */
- EXPORT_DEF
- FT_Error FT_Outline_Get_Bitmap( FT_Library library,
- FT_Outline* outline,
- FT_Bitmap* map );
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Render */
- /* */
- /* <Description> */
- /* Renders an outline within a bitmap using the current scan-convert */
- /* This functions uses a FT_Raster_Params as argument, allowing */
- /* advanced features like direct composition/translucency, etc.. */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* outline :: A pointer to the source outline descriptor. */
- /* params :: A pointer to a FT_Raster_Params used to describe */
- /* the rendering operation */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* YES. Rendering is synchronized, so that concurrent calls to the */
- /* scan-line converter will be serialized. */
- /* */
- /* <Note> */
- /* You should know what you're doing and the role of FT_Raster_Params */
- /* to use this function. */
- /* */
- /* the field "params.source" will be set to "outline" before the */
- /* scan converter is called, which means that the value you give it */
- /* is actually ignored.. */
- /* */
- EXPORT_DEF
- FT_Error FT_Outline_Render( FT_Library library,
- FT_Outline* outline,
- FT_Raster_Params* params );
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Decompose */
- /* */
- /* <Description> */
- /* Walks over an outline's structure to decompose it into individual */
- /* segments and Bezier arcs. This function is also able to emit */
- /* `move to' and `close to' operations to indicate the start and end */
- /* of new contours in the outline. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source target. */
- /* */
- /* funcs :: A table of `emitters', i.e,. function pointers called */
- /* during decomposition to indicate path operations. */
- /* */
- /* user :: A typeless pointer which is passed to each emitter */
- /* during the decomposition. It can be used to store */
- /* the state during the decomposition. */
- /* */
- /* <Return> */
- /* Error code. 0 means sucess. */
- /* */
- EXPORT_DEF
- int FT_Outline_Decompose( FT_Outline* outline,
- FT_Outline_Funcs* funcs,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_New */
- /* */
- /* <Description> */
- /* Creates a new outline of a given size. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object from where the */
- /* outline is allocated. Note however that the new */
- /* outline will NOT necessarily be FREED when */
- /* destroying the library, by FT_Done_FreeType(). */
- /* */
- /* numPoints :: The maximum number of points within the outline. */
- /* */
- /* numContours :: The maximum number of contours within the outline. */
- /* */
- /* <Output> */
- /* outline :: A handle to the new outline. NULL in case of */
- /* error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* No. */
- /* */
- /* <Note> */
- /* The reason why this function takes a `library' parameter is simply */
- /* to use the library's memory allocator. You can copy the source */
- /* code of this function, replacing allocations with `malloc()' if */
- /* you want to control where the objects go. */
- /* */
- EXPORT_DEF
- FT_Error FT_Outline_New( FT_Library library,
- FT_UInt numPoints,
- FT_Int numContours,
- FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Done */
- /* */
- /* <Description> */
- /* Destroys an outline created with FT_Outline_New(). */
- /* */
- /* <Input> */
- /* library :: A handle of the library object used to allocate the */
- /* outline. */
- /* */
- /* outline :: A pointer to the outline object to be discarded. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* No. */
- /* */
- /* <Note> */
- /* If the outline's `owner' field is not set, only the outline */
- /* descriptor will be released. */
- /* */
- /* The reason why this function takes an `outline' parameter is */
- /* simply to use FT_Alloc()/FT_Free(). You can copy the source code */
- /* of this function, replacing allocations with `malloc()' in your */
- /* application if you want something simpler. */
- /* */
- EXPORT_DEF
- FT_Error FT_Outline_Done( FT_Library library,
- FT_Outline* outline );
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_CBox */
- /* */
- /* <Description> */
- /* Returns an outline's `control box'. The control box encloses all */
- /* the outline's points, including Bezier control points. Though it */
- /* coincides with the exact bounding box for most glyphs, it can be */
- /* slightly larger in some situations (like when rotating an outline */
- /* which contains Bezier outside arcs). */
- /* */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component which is dedicated to this single task. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <Output> */
- /* cbox :: The outline's control box. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- EXPORT_DEF
- void FT_Outline_Get_CBox( FT_Outline* outline,
- FT_BBox* cbox );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Translate */
- /* */
- /* <Description> */
- /* Applies a simple translation to the points of an outline. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the target outline descriptor. */
- /* xOffset :: The horizontal offset. */
- /* yOffset :: The vertical offset. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- EXPORT_DEF
- void FT_Outline_Translate( FT_Outline* outline,
- FT_Pos xOffset,
- FT_Pos yOffset );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Raster */
- /* */
- /* <Description> */
- /* Register a given raster to the library. */
- /* */
- /* <Input> */
- /* library :: A handle to a target library object. */
- /* raster_funcs :: pointer to the raster's interface */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function will do the following: */
- /* */
- /* - a new raster object is created through raster_func.raster_new */
- /* if this fails, then the function returns */
- /* */
- /* - if a raster is already registered for the glyph format */
- /* specified in raster_funcs, it will be destroyed */
- /* */
- /* - the new raster is registered for the glyph format */
- /* */
- EXPORT_DEF
- FT_Error FT_Set_Raster( FT_Library library,
- FT_Raster_Funcs* raster_funcs );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Unset_Raster */
- /* */
- /* <Description> */
- /* Removes a given raster from the library. */
- /* */
- /* <Input> */
- /* library :: A handle to a target library object. */
- /* raster_funcs :: pointer to the raster's interface */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function should never be used by a normal client application */
- /* as FT_Set_Raster unregisters the previous raster for a given */
- /* glyph format.. */
- /* */
- EXPORT_DEF
- FT_Error FT_Unset_Raster( FT_Library library,
- FT_Raster_Funcs* raster_funcs );
-
-
- /*************************************************************************
- *
- * <Function>
- * FT_Get_Raster
- *
- * <Description>
- * Return a pointer to the raster corresponding to a given glyph
- * format tag.
- *
- * <Input>
- * library :: handle to source library object
- * glyph_format :: glyph format tag
- *
- * <Output>
- * raster_funcs :: if this field is not 0, returns a pointer to the
- * raster's interface/descriptor..
- *
- * <Return>
- * a pointer to the corresponding raster object.
- *
- *************************************************************************/
-
- EXPORT_DEF
- FT_Raster FT_Get_Raster( FT_Library library,
- FT_Glyph_Format glyph_format,
- FT_Raster_Funcs *raster_funcs );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Raster_Mode */
- /* */
- /* <Description> */
- /* Set a raster-specific mode. */
- /* */
- /* <Input> */
- /* library :: A handle to a target library object. */
- /* format :: the glyph format used to select the raster */
- /* mode :: the raster-specific mode descriptor */
- /* args :: the mode arguments */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- EXPORT_DEF
- FT_Error FT_Set_Raster_Mode( FT_Library library,
- FT_Glyph_Format format,
- unsigned long mode,
- void* args );
-
-
- /***************************************************************************/
- /***************************************************************************/
- /***************************************************************************/
- /***** *****/
- /***** C O N V E N I E N C E F U N C T I O N S *****/
- /***** *****/
- /***** *****/
- /***** The following functions are provided as a convenience *****/
- /***** to client applications. However, their compilation might *****/
- /***** be discarded if FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS *****/
- /***** is defined in "config/ftoption.h". *****/
- /***** *****/
- /***************************************************************************/
- /***************************************************************************/
- /***************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Copy */
- /* */
- /* <Description> */
- /* Copies an outline into another one. Both objects must have the */
- /* same sizes (number of points & number of contours) when this */
- /* function is called. */
- /* */
- /* <Input> */
- /* source :: A handle to the source outline. */
- /* target :: A handle to the target outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- EXPORT_DEF
- FT_Error FT_Outline_Copy( FT_Outline* source,
- FT_Outline* target );
-
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Transform */
- /* */
- /* <Description> */
- /* Applies a simple 2x2 matrix to all of an outline's points. Useful */
- /* for applying rotations, slanting, flipping, etc. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the target outline descriptor. */
- /* matrix :: A pointer to the transformation matrix. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- /* <Note> */
- /* You can use FT_Outline_Translate() if you need to translate the */
- /* outline's points. */
- /* */
- EXPORT_DEF
- void FT_Outline_Transform( FT_Outline* outline,
- FT_Matrix* matrix );
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Reverse */
- /* */
- /* <Description> */
- /* Reverse the drawing direction of an outline. This is used to */
- /* ensure consistent fill conventions for mirrored glyphs.. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Note> */
- /* This functions toggles the bit flag ft_outline_reverse_fill in */
- /* the outline's "flags" field.. */
- /* */
- /* It shouldn't be used by a normal client application, unless it */
- /* knows what it's doing.. */
- /* */
- EXPORT_DEF
- void FT_Outline_Reverse( FT_Outline* outline );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Vector_Transform */
- /* */
- /* <Description> */
- /* Transforms a single vector through a 2x2 matrix. */
- /* */
- /* <InOut> */
- /* vector :: The target vector to transform */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the source 2x2 matrix. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- EXPORT_DEF
- void FT_Vector_Transform( FT_Vector* vector,
- FT_Matrix* matrix );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Multiply */
- /* */
- /* <Description> */
- /* Performs the matrix operation `b = a*b'. */
- /* */
- /* <Input> */
- /* a :: A pointer to matrix `a'. */
- /* */
- /* <InOut> */
- /* b :: A pointer to matrix `b'. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- EXPORT_DEF
- void FT_Matrix_Multiply( FT_Matrix* a,
- FT_Matrix* b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Invert */
- /* */
- /* <Description> */
- /* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */
- /* */
- /* <InOut> */
- /* matrix :: A pointer to the target matrix. Remains untouched in */
- /* case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- EXPORT_DEF
- FT_Error FT_Matrix_Invert( FT_Matrix* matrix );
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Default_Drivers */
- /* */
- /* <Description> */
- /* Adds the set of default drivers to a given library object. */
- /* */
- /* <InOut> */
- /* library :: A handle to a new library object. */
- /* */
- EXPORT_DEF
- void FT_Default_Drivers( FT_Library library );
-
-#ifdef __cplusplus
- }
-#endif
-
-
-#endif /* FREETYPE_H */
-
-
-/* END */
--- /dev/null
+++ b/include/freetype/config/ftconfig.h
@@ -1,0 +1,186 @@
+/***************************************************************************/
+/* */
+/* ftconfig.h */
+/* */
+/* ANSI-specific configuration file (specification only). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This header file contains a number of macro definitions that are used */
+ /* by the rest of the engine. Most of the macros here are automatically */
+ /* determined at compile time, and you should not need to change it to */
+ /* port FreeType, except to compile the library with a non ANSI compiler */
+ /* */
+ /* Note however that if some specific modifications are needed, we */
+ /* advise you to place a modified copy in your build directory. */
+ /* */
+ /* The build directory is usually "freetype/config/<system>", and */
+ /* contains system-specific files that are always included first when */
+ /* building the library.. */
+ /* */
+ /* This ANSI version should stay in "freetype/config" */
+ /* */
+ /*************************************************************************/
+
+#ifndef FTCONFIG_H
+#define FTCONFIG_H
+
+/* Include the header file containing all developer build options */
+#include <freetype/config/ftoption.h>
+
+ /*************************************************************************/
+ /* */
+ /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
+ /* */
+ /* These macros can be toggled to suit a specific system. The current */
+ /* ones are defaults used to compile FreeType in an ANSI C environment */
+ /* (16bit compilers are also supported). Copy this file to your own */
+ /* `freetype/arch/<system>' directory, and edit it to port the engine. */
+ /* */
+ /*************************************************************************/
+
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* We use <limits.h> values to know the sizes of the types. */
+#include <limits.h>
+
+/* The number of bytes in an `int' type. */
+#if UINT_MAX == 0xFFFFFFFF
+#define SIZEOF_INT 4
+#elif UINT_MAX == 0xFFFF
+#define SIZEOF_INT 2
+#elif UINT_MAX > 0xFFFFFFFF && UINT_MAX == 0xFFFFFFFFFFFFFFFF
+#define SIZEOF_INT 8
+#else
+#error "Unsupported number of bytes in `int' type!"
+#endif
+
+/* The number of bytes in a `long' type. */
+#if ULONG_MAX == 0xFFFFFFFF
+#define SIZEOF_LONG 4
+#elif ULONG_MAX > 0xFFFFFFFF && ULONG_MAX == 0xFFFFFFFFFFFFFFFF
+#define SIZEOF_LONG 8
+#else
+#error "Unsupported number of bytes in `long' type!"
+#endif
+
+/* Define if you have the memcpy function. */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 0
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 0
+
+
+/* Preferred alignment of data */
+#define FT_ALIGNMENT 8
+
+
+
+ /*************************************************************************/
+ /* */
+ /* AUTOMATIC CONFIGURATION MACROS */
+ /* */
+ /* These macros are computed from the ones defined above. Don't touch */
+ /* their definition, unless you know precisely what you're doing. No */
+ /* porter should need to mess with them. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* IntN types */
+ /* */
+ /* Used to guarantee the size of some specific integers. */
+ /* */
+ typedef signed short FT_Int16;
+ typedef unsigned short FT_Word16;
+
+#if SIZEOF_INT == 4
+
+ typedef signed int FT_Int32;
+ typedef unsigned int FT_Word32;
+
+#elif SIZEOF_LONG == 4
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_Word32;
+
+#else
+#error "no 32bit type found - please check your configuration files"
+#endif
+
+#if SIZEOF_LONG == 8
+
+ /* LONG64 must be defined when a 64-bit type is available */
+#define LONG64
+#define INT64 long
+
+#else
+
+
+ /*************************************************************************/
+ /* */
+ /* many compilers provide the non-ANSI 'long long' 64-bit type. You can */
+ /* activate it by defining the FTCALC_USE_LONG_LONG macro in `ftoption.h'*/
+ /* Note that this will produce many -ansi warnings during library */
+ /* compilation, and that in many cases, the generated code will not be */
+ /* smaller or faster !! */
+ /* */
+#ifdef FTCALC_USE_LONG_LONG
+
+#define LONG64
+#define INT64 long long
+
+#endif /* FTCALC_USE_LONG_LONG */
+#endif
+
+
+#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
+#define LOCAL_DEF static
+#define LOCAL_FUNC static
+#else
+#define LOCAL_DEF extern
+#define LOCAL_FUNC /* nothing */
+#endif
+
+#ifdef FT_MAKE_OPTION_SINGLE_LIBRARY_OBJECT
+#define BASE_DEF LOCAL_DEF
+#define BASE_FUNC LOCAL_FUNC
+#else
+#define BASE_DEF extern
+#define BASE_FUNC /* nothing */
+#endif
+
+#ifndef EXPORT_DEF
+#define EXPORT_DEF extern
+#endif
+
+#ifndef EXPORT_FUNC
+#define EXPORT_FUNC /* nothing */
+#endif
+
+#endif /* FTCONFIG_H */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/config/ftmodule.h
@@ -1,0 +1,5 @@
+FT_DRIVER(psnames_driver_interface)
+FT_DRIVER(sfnt_driver_interface)
+FT_DRIVER(tt_driver_interface)
+FT_DRIVER(t1_driver_interface)
+FT_DRIVER(t1z_driver_interface)
--- /dev/null
+++ b/include/freetype/config/ftoption.h
@@ -1,0 +1,374 @@
+/***************************************************************************/
+/* */
+/* ftoption.h */
+/* */
+/* User-selectable configuration macros. */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef FTOPTION_H
+#define FTOPTION_H
+
+ /*************************************************************************/
+ /* */
+ /* USER-SELECTABLE CONFIGURATION MACROS */
+ /* */
+ /* These macros can be toggled by developers to enable or disable */
+ /* certain aspects of FreeType. This is a default file, where all major */
+ /* options are enabled. */
+ /* */
+ /* Note that if some modifications are required for your build, we */
+ /* advise you to put a modified copy of this file in your build */
+ /* directory, rather than modifying it in-place. */
+ /* */
+ /* The build directory is normally "freetype/config/<system>" and */
+ /* contains build or system-specific files that are included in */
+ /* priority when building the library. */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Convenience functions support */
+ /* */
+ /* Some functions of the FreeType 2 API are provided as a convenience */
+ /* for client applications and developers. However, they are not */
+ /* required to build and run the library itself. */
+ /* */
+ /* By defining this configuration macro, you'll disable the */
+ /* compilation of these functions at build time. This can be useful */
+ /* to reduce the library's code size when you don't need any of */
+ /* these functions.. */
+ /* */
+ /* All convenience functions are declared as such in their */
+ /* documentation. */
+ /* */
+#undef FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS
+
+ /*************************************************************************/
+ /* */
+ /* Alternate Glyph Image Format support */
+ /* */
+ /* By default, the glyph images returned by the FreeType glyph loader */
+ /* can either be a pixmap or a vectorial outline defined through */
+ /* bezier control points. When defining the following configuration */
+ /* macro, some font drivers will be able to register alternate */
+ /* glyph image formats. */
+ /* */
+ /* Unset this macro if you're sure that you'll never use a font driver */
+ /* with an alternate glyph format, this will reduce the size of the */
+ /* base layer code. */
+ /* */
+ /* Note that a few Type 1 fonts, as well as Windows "Vector" fonts */
+ /* use a vector "plotter" format that isn't supported when this */
+ /* macro is undefined.. */
+ /* */
+#define FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS
+
+
+ /*************************************************************************/
+ /* */
+ /* Glyph Postscript Names handling */
+ /* */
+ /* By default, FreeType 2 is built with the "psnames" module compiled */
+ /* in. This module is in charge of converting a glyph name string into */
+ /* a Unicode value, or return a Macintosh standard glyph name for the */
+ /* use with the TrueType "post" table. */
+ /* */
+ /* Undefine this macro if you do not want the "psnames" compiled in */
+ /* your build of FreeType. This has the following effects : */
+ /* */
+ /* - the TrueType driver will provide its own set of glyph names, */
+ /* if you build it to support postscript names in the TrueType */
+ /* "post" table. */
+ /* */
+ /* - the Type 1 driver will not be able to synthetize a */
+ /* Unicode charmap out of the glyphs found in the fonts. */
+ /* */
+ /* You would normally undefine this configuration macro when */
+ /* building a version of FreeType that doesn't contain a Type 1 */
+ /* or CFF driver. */
+ /* */
+#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
+
+ /*************************************************************************/
+ /* */
+ /* Postscript Names to Unicode Values support */
+ /* */
+ /* By default, FreeType 2 is built with the "psnames" module compiled */
+ /* in. Among other things, the module is used to convert a glyph */
+ /* name into a unicode value. This is especially useful in order to */
+ /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
+ /* through a big table named the "Adobe Glyph List". */
+ /* */
+ /* Undefine this macro if you do not want the Adobe Glyph List */
+ /* compiled in your "psnames" module. The Type 1 driver will not */
+ /* be able to synthetize a Unicode charmap out of the glyphs found */
+ /* in the fonts.. */
+ /* */
+#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
+
+
+ /*************************************************************************/
+ /* */
+ /* many compilers provide the non-ANSI 'long long' 64-bit type. You can */
+ /* activate it by defining the FTCALC_USE_LONG_LONG macro in `ftoption.h'*/
+ /* Note that this will produce many -ansi warnings during library */
+ /* compilation, and that in many cases, the generated code will not be */
+ /* smaller or faster !! */
+ /* */
+#undef FTCALC_USE_LONG_LONG
+
+
+ /*************************************************************************/
+ /* */
+ /* When compiling FreeType as a DLL, some systems/compilers need a */
+ /* special keyword in front of each function definition instead of */
+ /* `extern'. */
+ /* */
+ /* The macros EXPORT_DEF and EXPORT_FUNC are thus used to define */
+ /* exported library function interfaces and exported library functions */
+ /* implementations respectively. */
+ /* */
+ /* If not defined here, they automatically default to `extern' and void */
+ /* later in this header file. */
+ /* */
+#undef EXPORT_DEF
+#undef EXPORT_FUNC
+
+
+ /*************************************************************************/
+ /* */
+ /* Debug level */
+ /* */
+ /* FreeType can be compiled in debug or trace mode. In debug mode, */
+ /* errors are reported through the `ftdebug' component. In trace */
+ /* mode, additional messages are sent to the standard output during */
+ /* execution. */
+ /* */
+ /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
+ /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
+ /* */
+ /* Don't define any of these macros to compile in `release' mode. */
+ /* */
+#undef FT_DEBUG_LEVEL_ERROR
+#define FT_DEBUG_LEVEL_TRACE
+
+
+ /*************************************************************************/
+ /* */
+ /* Anti-aliasing support */
+ /* */
+ /* Undefine this macro only if you want to disable the anti-aliasing */
+ /* support in FreeType. This will save you about 5 Kb of code. It */
+ /* may be important for some embedded systems. */
+ /* */
+#define FT_CONFIG_OPTION_ANTI_ALIAS
+
+
+ /*************************************************************************/
+ /* */
+ /* Endianess performance improvement */
+ /* */
+ /* FreeType is completely endian-independent, and can thus be compiled */
+ /* directly on _any_ machine. However, some components of the library */
+ /* provide improved routines for the cases where endianess is known. */
+ /* */
+ /* It usually results in speed-ups and reduced code size. Note that */
+ /* you should not define both of these macros. */
+ /* */
+ /* */
+ /* NOTE: For now, only the scan-line converter (base/ftraster.c) uses */
+ /* these macros to speed-up some anti-alias rendering routines. */
+ /* */
+#undef FT_CONFIG_OPTION_LITTLE_ENDIAN
+#undef FT_CONFIG_OPTION_BIG_ENDIAN
+
+
+ /*************************************************************************/
+ /* */
+ /* Computation Algorithms */
+ /* */
+ /* Used for debugging, this configuration macro should disappear */
+ /* soon.. */
+ /* */
+#define FT_CONFIG_OPTION_OLD_CALCS
+
+ /*************************************************************************/
+ /* */
+ /* The size in bytes of the render pool used by the scan-line */
+ /* converter to do all of its work. */
+ /* */
+ /* This must be greater than 4 Kb */
+ /* */
+#define FT_RENDER_POOL_SIZE 8192
+
+
+ /*************************************************************************/
+ /* */
+ /* FT_MAX_DRIVERS */
+ /* */
+ /* The maximum number of font drivers that can be registered in a */
+ /* single FreeType library object. 8 seems to be a good choice due */
+ /* to the relative low actual number of drivers ;-) */
+ /* */
+ /* If you don't intend to register new drivers at runtime, you */
+ /* certainly do not need to change this value.. */
+ /* */
+#define FT_MAX_DRIVERS 8
+
+
+ /*************************************************************************/
+ /* */
+ /* FT_MAX_EXTENSIONS */
+ /* */
+ /* The maximum number of extensions that can be registered in a */
+ /* single font driver. 8 seems to be a good choice for now.. */
+ /* */
+ /* If you don't know what this means, you certainly do not need to */
+ /* change this value.. */
+ /* */
+#define FT_MAX_EXTENSIONS 8
+
+
+ /*************************************************************************/
+ /* */
+ /* FT_MAX_GLYPH_FORMATS */
+ /* */
+ /* The maximum number of glyph image formats that might be registered */
+ /* in a given library instance. 8 seems to be a good choice due to */
+ /* the relatively low number of current formats ;-) */
+ /* */
+#define FT_MAX_GLYPH_FORMATS 8
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
+ /* embedded bitmaps in all formats using the SFNT module (namely */
+ /* TrueType & OpenType). */
+ /* */
+#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
+ /* load and enumerate the glyph Postscript names in a TrueType or */
+ /* OpenType file. */
+ /* */
+ /* Note that when you do not compile the "psnames" module by undefining */
+ /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the "sfnt" module will */
+ /* contain additional code used to read the PS Names table from a font. */
+ /* */
+ /* (by default, the module uses "psnames" to extract glyph names).. */
+ /* */
+#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
+ /* a bytecode interpreter in the TrueType driver. Note that there are */
+ /* important patent issues related to the use of the interpreter. */
+ /* */
+ /* By undefining this, you'll only compile the code necessary to load */
+ /* TrueType glyphs without hinting.. */
+ /* */
+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
+ /* bytecode interpreter with a huge switch statement, rather than a */
+ /* call table. This results in smaller and faster code for a number of */
+ /* architectures. */
+ /* */
+ /* Note however that on some compiler/processor combinations, undefining */
+ /* this macro will generate a faster, though larger, code. */
+ /* */
+#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
+
+ /* The maximum number of sub-glyphs in a TrueType composite glyph */
+#define TT_MAX_SUBGLYPHS 96
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+/********************************************************************/
+/* T1_MAX_STACK_DEPTH is the maximal depth of the token stack used */
+/* by the Type 1 parser (see t1load.c). A minimum of 16 is required */
+/* */
+#define T1_MAX_STACK_DEPTH 16
+
+/*******************************************************************/
+/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
+/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
+/* required */
+#define T1_MAX_DICT_DEPTH 5
+
+/***********************************************************************/
+/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
+/* calls during glyph loading */
+#define T1_MAX_SUBRS_CALLS 8
+
+/*****************************************************************/
+/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity */
+#define T1_MAX_CHARSTRINGS_OPERANDS 32
+
+
+/*******************************************************************/
+/* Define T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate */
+/* a driver with no hinter. This can be useful to debug the parser */
+/* */
+#undef T1_CONFIG_OPTION_DISABLE_HINTER
+
+/*******************************************************************/
+/* Define this configuration macro if you want to prevent the */
+/* compilation of "t1afm", which is in charge of reading Type1 */
+/* AFM files into an existing face. Note that when set, the T1 */
+/* driver will be unable to produce kerning distances.. */
+/* */
+#undef T1_CONFIG_OPTION_NO_AFM
+
+
+
+#endif /* FTOPTION_H */
--- /dev/null
+++ b/include/freetype/freetype.h
@@ -1,0 +1,2550 @@
+/***************************************************************************/
+/* */
+/* freetype.h */
+/* */
+/* FreeType high-level API and common types (specification only). */
+/* */
+/* 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. */
+/* */
+/***************************************************************************/
+
+#ifndef FREETYPE_H
+#define FREETYPE_H
+
+
+ /*************************************************************************/
+ /* */
+ /* The `raster' component duplicates some of the declarations in */
+ /* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */
+ /* */
+#define _FREETYPE_
+
+
+ /*************************************************************************/
+ /* */
+ /* The FREETYPE_MAJOR and FREETYPE_MINOR macros are used to version the */
+ /* new FreeType design, which is able to host several kinds of font */
+ /* drivers. It starts at 2.0. Note that each driver has its own */
+ /* version number (for example, the TrueType driver is at 1.2, as */
+ /* defined by the macros TT_FREETYPE_MAJOR and TT_FREETYPE_MINOR in the */
+ /* file `ttlib/truetype.h'. */
+ /* */
+#define FREETYPE_MAJOR 2
+#define FREETYPE_MINOR 0
+
+
+ /*************************************************************************/
+ /* */
+ /* To make freetype.h independent from configuration files we check */
+ /* whether EXPORT_DEF has been defined already. */
+ /* */
+ /* On some systems and compilers (Win32 mostly), an extra keyword is */
+ /* necessary to compile the library as a DLL. */
+ /* */
+#ifndef EXPORT_DEF
+#define EXPORT_DEF extern
+#endif
+
+#include <freetype/fterrors.h>
+#include <freetype/ftsystem.h>
+#include <freetype/ftimage.h>
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Bool */
+ /* */
+ /* <Description> */
+ /* A typedef of unsigned char, used for simple booleans. */
+ /* */
+ typedef unsigned char FT_Bool;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_FWord */
+ /* */
+ /* <Description> */
+ /* A signed 16-bit integer used to store a distance in original font */
+ /* units. */
+ /* */
+ typedef signed short FT_FWord; /* Distance in FUnits */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UFWord */
+ /* */
+ /* <Description> */
+ /* An unsigned 16-bit integer used to store a distance in original */
+ /* font units. */
+ /* */
+ typedef unsigned short FT_UFWord; /* Unsigned distance */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Char */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the _signed_ char type. */
+ /* */
+ typedef signed char FT_Char;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Byte */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the _unsigned_ char type. */
+ /* */
+ typedef unsigned char FT_Byte;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_String */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the char type, usually used for strings. */
+ /* */
+ typedef char FT_String;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Short */
+ /* */
+ /* <Description> */
+ /* A typedef for signed short. */
+ /* */
+ typedef signed short FT_Short;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UShort */
+ /* */
+ /* <Description> */
+ /* A typedef for unsigned short. */
+ /* */
+ typedef unsigned short FT_UShort;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int */
+ /* */
+ /* <Description> */
+ /* A typedef for the int type. */
+ /* */
+ typedef int FT_Int;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UInt */
+ /* */
+ /* <Description> */
+ /* A typedef for the unsigned int type. */
+ /* */
+ typedef unsigned int FT_UInt;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Long */
+ /* */
+ /* <Description> */
+ /* A typedef for signed long. */
+ /* */
+ typedef signed long FT_Long;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_ULong */
+ /* */
+ /* <Description> */
+ /* A typedef for unsigned long. */
+ /* */
+ typedef unsigned long FT_ULong;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_F2Dot14 */
+ /* */
+ /* <Description> */
+ /* A signed 2.14 fixed float type used for unit vectors. */
+ /* */
+ typedef signed short FT_F2Dot14;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_F26Dot6 */
+ /* */
+ /* <Description> */
+ /* A signed 26.6 fixed float type used for vectorial pixel */
+ /* coordinates. */
+ /* */
+ typedef signed long FT_F26Dot6;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Fixed */
+ /* */
+ /* <Description> */
+ /* This type is used to store 16.16 fixed float values, like scales */
+ /* or matrix coefficients. */
+ /* */
+ typedef signed long FT_Fixed;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Error */
+ /* */
+ /* <Description> */
+ /* The FreeType error code type. A value of 0 is always interpreted */
+ /* as a successful operation. */
+ /* */
+ typedef int FT_Error;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Pointer */
+ /* */
+ /* <Description> */
+ /* A simple typedef for a typeless pointer. */
+ /* */
+ typedef void* FT_Pointer;
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_UnitVector */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2d vector unit vector. Uses */
+ /* FT_F2Dot14 types. */
+ /* */
+ /* <Fields> */
+ /* x :: Horizontal coordinate. */
+ /* y :: Vertical coordinate. */
+ /* */
+ typedef struct FT_UnitVector_
+ {
+ FT_F2Dot14 x;
+ FT_F2Dot14 y;
+
+ } FT_UnitVector;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Matrix */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2x2 matrix. Coefficients are */
+ /* in 16.16 fixed float format. The computation performed is: */
+ /* */
+ /* { */
+ /* x' = x*xx + y*xy */
+ /* y' = x*yx + y*yy */
+ /* } */
+ /* */
+ /* <Fields> */
+ /* xx :: Matrix coefficient. */
+ /* xy :: Matrix coefficient. */
+ /* yx :: Matrix coefficient. */
+ /* yy :: Matrix coefficient. */
+ /* */
+ typedef struct FT_Matrix_
+ {
+ FT_Fixed xx, xy;
+ FT_Fixed yx, yy;
+
+ } FT_Matrix;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_BBox */
+ /* */
+ /* <Description> */
+ /* A structure used to hold an outline's bounding box, i.e., the */
+ /* coordinates of its extrema in the horizontal and vertical */
+ /* directions. */
+ /* */
+ /* <Fields> */
+ /* xMin :: The horizontal minimum (left-most). */
+ /* yMin :: The vertical minimum (bottom-most). */
+ /* xMax :: The horizontal maximum (right-most). */
+ /* yMax :: The vertical maximum (top-most). */
+ /* */
+ typedef struct FT_BBox_
+ {
+ FT_Pos xMin, yMin;
+ FT_Pos xMax, yMax;
+
+ } FT_BBox;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_MAKE_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four letter tags which are used to label */
+ /* TrueType tables into an unsigned long to be used within FreeType. */
+ /* */
+#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
+ (((FT_ULong)_x1 << 24) | \
+ ((FT_ULong)_x2 << 16) | \
+ ((FT_ULong)_x3 << 8) | \
+ (FT_ULong)_x4)
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* L I S T M A N A G E M E N T */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_ListNode */
+ /* */
+ /* <Description> */
+ /* Many elements and objects in FreeType are listed through a */
+ /* FT_List record (see FT_ListRec). As its name suggests, a */
+ /* FT_ListNode is a handle to a single list element. */
+ /* */
+ typedef struct FT_ListNodeRec_* FT_ListNode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_List */
+ /* */
+ /* <Description> */
+ /* A handle to a list record (see FT_ListRec). */
+ /* */
+ typedef struct FT_ListRec_* FT_List;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_ListNodeRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold a single list element. */
+ /* */
+ /* <Fields> */
+ /* prev :: Previous element in the list. NULL if first. */
+ /* next :: Next element in the list. NULL if last. */
+ /* data :: Typeless pointer to the listed object. */
+ /* */
+ typedef struct FT_ListNodeRec_
+ {
+ FT_ListNode prev;
+ FT_ListNode next;
+ void* data;
+
+ } FT_ListNodeRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_ListRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold a simple doubly-linked list. These are */
+ /* used in many parts of FreeType. */
+ /* */
+ /* <Fields> */
+ /* head :: Head (first element) of doubly-linked list. */
+ /* tail :: Tail (last element) of doubly-linked list. */
+ /* */
+ typedef struct FT_ListRec_
+ {
+ FT_ListNode head;
+ FT_ListNode tail;
+
+ } FT_ListRec;
+
+
+#define FT_IS_EMPTY(list) ( (list).head == 0 )
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S I C T Y P E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Glyph_Metrics */
+ /* */
+ /* <Description> */
+ /* A structure used to model the metrics of a single glyph. Note */
+ /* that values are expressed in 26.6 fractional pixel format or in */
+ /* font units, depending on context. */
+ /* */
+ /* <Fields> */
+ /* width :: The glyph's width. */
+ /* height :: The glyph's height. */
+ /* */
+ /* horiBearingX :: Horizontal left side bearing. */
+ /* horiBearingY :: Horizontal top side bearing. */
+ /* horiAdvance :: Horizontal advance width. */
+ /* */
+ /* vertBearingX :: Vertical left side bearing. */
+ /* vertBearingY :: Vertical top side bearing. */
+ /* vertAdvance :: Vertical advance height. */
+ /* */
+ typedef struct FT_Glyph_Metrics_
+ {
+ FT_Pos width; /* glyph width */
+ FT_Pos height; /* glyph height */
+
+ FT_Pos horiBearingX; /* left side bearing in horizontal layouts */
+ FT_Pos horiBearingY; /* top side bearing in horizontal layouts */
+ FT_Pos horiAdvance; /* advance width for horizontal layout */
+
+ FT_Pos vertBearingX; /* left side bearing in vertical layouts */
+ FT_Pos vertBearingY; /* top side bearing in vertical layouts */
+ FT_Pos vertAdvance; /* advance height for vertical layout */
+
+ } FT_Glyph_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Generic_Finalizer */
+ /* */
+ /* <Description> */
+ /* Describes a function used to destroy the `client' data of any */
+ /* FreeType object. See the description of the FT_Generic type for */
+ /* details of usage. */
+ /* */
+ /* <Input> */
+ /* The address of the FreeType object which is under finalisation. */
+ /* Its client data is accessed through its `generic' field. */
+ /* */
+ typedef void (*FT_Generic_Finalizer)(void* object);
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Generic */
+ /* */
+ /* <Description> */
+ /* Client applications often need to associate their own data to a */
+ /* variety of FreeType core objects. For example, a text layout API */
+ /* might want to associate a glyph cache to a given size object. */
+ /* */
+ /* Most FreeType object contains a `generic' field, of type */
+ /* FT_Generic, which usage is left to client applications and font */
+ /* servers. */
+ /* */
+ /* It can be used to store a pointer to client-specific data, as well */
+ /* as the address of a `finalizer' function, which will be called by */
+ /* FreeType when the object is destroyed (for example, the previous */
+ /* client example would put the address of the glyph cache destructor */
+ /* in the `finalizer' field). */
+ /* */
+ /* <Fields> */
+ /* data :: A typeless pointer to any client-specified data. This */
+ /* field is completely ignored by the FreeType library. */
+ /* */
+ /* finalizer :: A pointer to a `generic finalizer' function, which */
+ /* will be called when the object is destroyed. If this */
+ /* field is set to NULL, no code will be called. */
+ /* */
+ typedef struct FT_Generic_
+ {
+ void* data;
+ FT_Generic_Finalizer finalizer;
+
+ } FT_Generic;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Bitmap_Size */
+ /* */
+ /* <Description> */
+ /* An extremely simple structure used to model the size of a bitmap */
+ /* strike (i.e., a bitmap instance of the font for a given */
+ /* resolution) in a fixed-size font face. This is used for the */
+ /* `available_sizes' field of the FT_Face_Properties structure. */
+ /* */
+ /* <Fields> */
+ /* height :: The character height in pixels. */
+ /* width :: The character width in pixels. */
+ /* */
+ typedef struct FT_Bitmap_Size_
+ {
+ FT_Short height;
+ FT_Short width;
+
+ } FT_Bitmap_Size;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Library */
+ /* */
+ /* <Description> */
+ /* A handle to a FreeType library instance. Each `library' is */
+ /* completely independent from the others; it is the `root' of a set */
+ /* of objects like fonts, faces, sizes, etc. */
+ /* */
+ /* It also embeds a system object (see FT_System), as well as a */
+ /* scan-line converter object (see FT_Raster). */
+ /* */
+ /* <Note> */
+ /* Library objects are created through FT_Init_FreeType(). */
+ /* */
+ typedef struct FT_LibraryRec_ *FT_Library;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Driver */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType font driver object. Each font driver */
+ /* is able to create faces, sizes, glyph slots, and charmaps from the */
+ /* resources whose format it supports. */
+ /* */
+ /* A driver can support either bitmap, graymap, or scalable font */
+ /* formats. */
+ /* */
+ typedef struct FT_DriverRec_* FT_Driver;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Face */
+ /* */
+ /* <Description> */
+ /* A handle to a given driver face object. A face object contains */
+ /* all the instance and glyph independent data of a font file */
+ /* typeface. */
+ /* */
+ /* A face object is created from a resource object through the */
+ /* new_face() method of a given driver. */
+ /* */
+ typedef struct FT_FaceRec_* FT_Face;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Size */
+ /* */
+ /* <Description> */
+ /* A handle to a given driver size object. Such an object models the */
+ /* _resolution_ AND _size_ dependent state of a given driver face */
+ /* size. */
+ /* */
+ /* A size object is always created from a given face object. It is */
+ /* discarded automatically by its parent face. */
+ /* */
+ typedef struct FT_SizeRec_* FT_Size;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_GlyphSlot */
+ /* */
+ /* <Description> */
+ /* A handle to a given `glyph slot'. A slot is a container where it */
+ /* is possible to load any of the glyphs contained within its parent */
+ /* face. */
+ /* */
+ /* A glyph slot is created from a given face object. It is discarded */
+ /* automatically by its parent face. */
+ /* */
+ typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_CharMap */
+ /* */
+ /* <Description> */
+ /* A handle to a given character map. A charmap is used to translate */
+ /* character codes in a given encoding into glyph indexes for its */
+ /* parent's face. Some font formats may provide several charmaps per */
+ /* font. */
+ /* */
+ /* A charmap is created from a given face object. It is discarded */
+ /* automatically by its parent face. */
+ /* */
+ typedef struct FT_CharMapRec_* FT_CharMap;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Encoding */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify encodings supported by charmaps. */
+ /* Used in the FT_Select_CharMap() API function. */
+ /* */
+ /* <Note> */
+ /* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
+ /* all character codes must be expressed as FT_Longs. */
+ /* */
+ typedef enum FT_Encoding_
+ {
+ ft_encoding_none = 0,
+ ft_encoding_symbol = 0,
+ ft_encoding_unicode = FT_MAKE_TAG('u','n','i','c'),
+ ft_encoding_latin_2 = FT_MAKE_TAG('l','a','t','2'),
+ ft_encoding_sjis = FT_MAKE_TAG('s','j','i','s'),
+ ft_encoding_big5 = FT_MAKE_TAG('b','i','g','5'),
+
+ ft_encoding_adobe_standard = FT_MAKE_TAG('a','d','o','b'),
+ ft_encoding_adobe_expert = FT_MAKE_TAG('a','d','b','e'),
+ ft_encoding_adobe_custom = FT_MAKE_TAG('a','d','b','c'),
+
+ ft_encoding_apple_roman = FT_MAKE_TAG('a','r','m','n')
+
+ /* other encodings might be defined in the future */
+
+ } FT_Encoding;
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_CharMapRec */
+ /* */
+ /* <Description> */
+ /* The base charmap class. */
+ /* */
+ /* <Fields> */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* flags :: A set of bit flags used to describe the charmap. */
+ /* Each bit indicates that a given encoding is */
+ /* supported. */
+ /* */
+ /* platform_id :: An ID number describing the platform for the */
+ /* following encoding ID. This comes directly from */
+ /* the TrueType specification and should be emulated */
+ /* for other formats. */
+ /* */
+ /* encoding_id :: A platform specific encoding number. This also */
+ /* comes from the TrueType specification and should be */
+ /* emulated similarly. */
+ /* */
+ /* <Note> */
+ /* We STRONGLY recommmend emulating a Unicode charmap for drivers */
+ /* that do not support TrueType or OpenType. */
+ /* */
+ typedef struct FT_CharMapRec_
+ {
+ FT_Face face;
+ FT_Encoding encoding;
+ FT_UShort platform_id;
+ FT_UShort encoding_id;
+
+ } FT_CharMapRec;
+
+
+
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S E O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+
+ /*************************************************************************/
+ /* */
+ /* FreeType base face class */
+ /* */
+ /* <Struct> */
+ /* FT_FaceRec */
+ /* */
+ /* <Description> */
+ /* FreeType root face class structure. A face object models the */
+ /* resolution and point-size independent data found in a font file. */
+ /* */
+ /* <Fields> */
+ /* num_faces :: In the case where the face is located in a */
+ /* collection (i.e., a resource which embeds */
+ /* several faces), this is the total number of */
+ /* faces found in the resource. 1 by default. */
+ /* */
+ /* face_index :: The index of the face in its resource. */
+ /* Usually, this is 0 for all normal font */
+ /* formats. It can be more in the case of */
+ /* collections (which embed several fonts in a */
+ /* single resource/file). */
+ /* */
+ /* face_flags :: A set of bit flags that give important */
+ /* information about the face; see the */
+ /* FT_FACE_FLAG_XXX macros for details. */
+ /* */
+ /* style_flags :: A set of bit flags indicating the style of */
+ /* the face (i.e., italic, bold, underline, */
+ /* etc). */
+ /* */
+ /* num_glyphs :: The total number of glyphs in the face. */
+ /* */
+ /* family_name :: The face's family name. This is an ASCII */
+ /* string, usually in English, which describes */
+ /* the typeface's family (like `Times New */
+ /* Roman', `Bodoni', `Garamond', etc). This */
+ /* is a least common denominator used to list */
+ /* fonts. Some formats (TrueType & OpenType) */
+ /* provide localized and Unicode versions of */
+ /* this string. Applications should use the */
+ /* format specific interface to access them. */
+ /* */
+ /* style_name :: The face's style name. This is an ASCII */
+ /* string, usually in English, which describes */
+ /* the typeface's style (like `Italic', */
+ /* `Bold', `Condensed', etc). Not all font */
+ /* formats provide a style name, so this field */
+ /* is optional, and can be set to NULL. As */
+ /* for `family_name', some formats provide */
+ /* localized/Unicode versions of this string. */
+ /* Applications should use the format specific */
+ /* interface to access them. */
+ /* */
+ /* num_fixed_sizes :: The number of fixed sizes available in this */
+ /* face. This should be set to 0 for scalable */
+ /* fonts, unless its resource includes a */
+ /* complete set of glyphs (called a `strike') */
+ /* for the specified size. */
+ /* */
+ /* available_sizes :: An array of sizes specifying the available */
+ /* bitmap/graymap sizes that are contained in */
+ /* in the font resource. Should be set to */
+ /* NULL if the field `num_fixed_sizes' is set */
+ /* to 0. */
+ /* */
+ /* num_charmaps :: The total number of character maps in the */
+ /* face. */
+ /* */
+ /* charmaps :: A table of pointers to the face's charmaps */
+ /* Used to scan the list of available charmaps */
+ /* this table might change after a call to */
+ /* FT_Attach_File/Stream (e.g. when it used */
+ /* to hook and additional encoding/CMap to */
+ /* the face object). */
+ /* */
+ /* generic :: A field reserved for client uses. See the */
+ /* FT_Generic type description. */
+ /* */
+ /* bbox :: The font bounding box. Coordinates are */
+ /* expressed in font units (see units_per_EM). */
+ /* The box is large enough to contain any */
+ /* glyph from the font. Thus, bbox.yMax can */
+ /* be seen as the `maximal ascender', */
+ /* bbox.yMin as the `minimal descender', and */
+ /* the maximum glyph width is given by */
+ /* `bbox.xMax-bbox.xMin' (not to be confused */
+ /* with the maximum _advance_width_). Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* units_per_EM :: The number of font units per EM square for */
+ /* this face. This is typically 2048 for */
+ /* TrueType fonts, 1000 for Type1 fonts, and */
+ /* should be set to the (unrealistic) value 1 */
+ /* for fixed-sizes fonts. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* ascender :: The face's ascender is the vertical */
+ /* distance from the baseline to the topmost */
+ /* point of any glyph in the face. This */
+ /* field's value is positive, expressed in */
+ /* font units. Some font designs use a value */
+ /* different from `bbox.yMax'. Only relevant */
+ /* for scalable formats. */
+ /* */
+ /* descender :: The face's descender is the vertical */
+ /* distance from the baseline to the */
+ /* bottommost point of any glyph in the face. */
+ /* This field's value is positive, expressed */
+ /* in font units. Some font designs use a */
+ /* value different from `-bbox.yMin'. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* height :: The face's height is the vertical distance */
+ /* from one baseline to the next when writing */
+ /* several lines of text. Its value is always */
+ /* positive, expressed in font units. The */
+ /* value can be computed as */
+ /* `ascender+descender+line_gap' where the */
+ /* value of `line_gap' is also called */
+ /* `external leading'. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* max_advance_width :: The maximum advance width, in font units, */
+ /* for all glyphs in this face. This can be */
+ /* used to make word wrapping computations */
+ /* faster. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* max_advance_height :: The maximum advance height, in font units, */
+ /* for all glyphs in this face. This is only */
+ /* relevant for vertical layouts, and should */
+ /* be set to the `height' for fonts that do */
+ /* not provide vertical metrics. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* underline_position :: The position, in font units, of the */
+ /* underline line for this face. It's the */
+ /* center of the underlining stem. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* underline_thickness :: The thickness, in font units, of the */
+ /* underline for this face. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* driver :: A handle to the face's parent driver */
+ /* object. */
+ /* */
+ /* memory :: A handle to the face's parent memory */
+ /* object. Used for the allocation of */
+ /* subsequent objects. */
+ /* */
+ /* stream :: A handle to the face's stream. */
+ /* */
+ /* glyph :: The face's associated glyph slot(s). This */
+ /* object is created automatically with a new */
+ /* face object. However, certain kinds of */
+ /* applications (mainly tools like converters) */
+ /* can need more than one slot to ease their */
+ /* task. */
+ /* */
+ /* sizes_list :: The list of child sizes for this face. */
+ /* */
+ /* max_points :: The maximum number of points used to store */
+ /* the vectorial outline of any glyph in this */
+ /* face. If this value cannot be known in */
+ /* advance, or if the face isn't scalable, */
+ /* this should be set to 0. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* max_contours :: The maximum number of contours used to */
+ /* store the vectorial outline of any glyph in */
+ /* this face. If this value cannot be known */
+ /* in advance, or if the face isn't scalable, */
+ /* this should be set to 0. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* transform_matrix :: a 2x2 matrix of 16.16 coefficients used */
+ /* to transform glyph outlines after they're */
+ /* loaded from the font. Only used by the */
+ /* convenience functions. */
+ /* */
+ /* transform_delta :: a translation vector used to transform */
+ /* glyph outlines after they're loaded from */
+ /* the font. Only used by the convenience */
+ /* functions. */
+ /* */
+ /* transform_flags :: some flags used to classify the transform. */
+ /* Only used by the convenience functions. */
+ /* */
+ typedef struct FT_FaceRec_
+ {
+ FT_Long num_faces;
+ FT_Long face_index;
+
+ FT_Long face_flags;
+ FT_Long style_flags;
+
+ FT_Long num_glyphs;
+
+ FT_String* family_name;
+ FT_String* style_name;
+
+ FT_Int num_fixed_sizes;
+ FT_Bitmap_Size* available_sizes;
+
+ /* the face's table of available charmaps */
+ FT_Int num_charmaps;
+ FT_CharMap* charmaps;
+
+ FT_Generic generic;
+
+ /* the following are only relevant for scalable outlines */
+ FT_BBox bbox;
+
+ FT_UShort units_per_EM;
+ FT_Short ascender;
+ FT_Short descender;
+ FT_Short height;
+
+ FT_Short max_advance_width;
+ FT_Short max_advance_height;
+
+ FT_Short underline_position;
+ FT_Short underline_thickness;
+
+ /************************************************************/
+ /* The following fields should be considered private and */
+ /* rarely, if ever, used by client applications.. */
+
+ FT_Driver driver;
+ FT_Memory memory;
+ FT_Stream stream;
+
+ FT_GlyphSlot glyph;
+ FT_Size size;
+ FT_CharMap charmap;
+ FT_ListRec sizes_list;
+
+ void* extensions;
+
+ FT_UShort max_points;
+ FT_Short max_contours;
+
+ FT_Matrix transform_matrix;
+ FT_Vector transform_delta;
+ FT_Int transform_flags;
+
+ } FT_FaceRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_SCALABLE */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face provides */
+ /* vectorial outlines (i.e., TrueType or Type1). This doesn't */
+ /* prevent embedding of bitmap strikes though, i.e., a given face can */
+ /* have both this bit set, and a `num_fixed_sizes' property > 0. */
+ /* */
+#define FT_FACE_FLAG_SCALABLE 1
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_FIXED_WIDTH */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face contains */
+ /* fixed-width characters (like Courier, MonoType, etc). */
+ /* */
+#define FT_FACE_FLAG_FIXED_WIDTH 4
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_FIXED_WIDTH */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face contains */
+ /* `fixed sizes', i.e., bitmap strikes for some given pixel sizes. */
+ /* See the `num_fixed_sizes' and `available_sizes' face properties */
+ /* for more information. */
+ /* */
+#define FT_FACE_FLAG_FIXED_SIZES 2
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_SFNT */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face uses the */
+ /* `sfnt' storage fomat. For now, this means TrueType or OpenType. */
+ /* */
+#define FT_FACE_FLAG_SFNT 8
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_HORIZONTAL */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face contains */
+ /* horizontal glyph metrics. This should be set for all common */
+ /* formats, but who knows... */
+ /* */
+#define FT_FACE_FLAG_HORIZONTAL 0x10
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_VERTICAL */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face contains */
+ /* vertical glyph metrics. If not set, the glyph loader will */
+ /* synthetize vertical metrics itself to help display vertical text */
+ /* correctly. */
+ /* */
+#define FT_FACE_FLAG_VERTICAL 0x20
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_KERNING */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face contains */
+ /* kerning information. When set, this information can be retrieved */
+ /* through the function FT_Get_Kerning(). Note that when unset, this */
+ /* function will always return the kerning vector (0,0). */
+ /* */
+#define FT_FACE_FLAG_KERNING 0x40
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_FACE_FLAG_FAST_GLYPHS */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that the glyphs in a given */
+ /* font can be retrieved very quickly, and that a glyph cache is thus */
+ /* not necessary for any of its child size objects. */
+ /* */
+ /* This flag should really be set for fixed-size formats like FNT, */
+ /* where each glyph bitmap is available directly in binary form */
+ /* without any kind of compression. */
+ /* */
+#define FT_FACE_FLAG_FAST_GLYPHS 0x80
+
+
+#define FT_HAS_HORIZONTAL(face) (face->face_flags & FT_FACE_FLAG_HORIZONTAL)
+#define FT_HAS_VERTICAL(face) (face->face_flags & FT_FACE_FLAG_VERTICAL)
+#define FT_HAS_KERNING(face) (face->face_flags & FT_FACE_FLAG_KERNING)
+#define FT_IS_SCALABLE(face) (face->face_flags & FT_FACE_FLAG_SCALABLE)
+#define FT_IS_SFNT(face) (face->face_flags & FT_FACE_FLAG_SFNT)
+#define FT_IS_FIXED_WIDTH(face) (face->face_flags & FT_FACE_FLAG_FIXED_WIDTH)
+#define FT_HAS_FIXED_SIZES(face) (face->face_flags & FT_FACE_FLAG_FIXED_SIZES)
+#define FT_HAS_FAST_GLYPHS(face) (face->face_flags & FT_FACE_FLAG_FAST_GLYPHS)
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_STYLE_FLAG_ITALIC */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face is */
+ /* italicized. */
+ /* */
+#define FT_STYLE_FLAG_ITALIC 1
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_STYLE_FLAG_BOLD */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used to indicate that a given face is */
+ /* emboldened. */
+ /* */
+#define FT_STYLE_FLAG_BOLD 2
+
+
+
+ /*************************************************************************/
+ /* */
+ /* FreeType base size metrics */
+ /* */
+ /* <Struct> */
+ /* FT_Size_Metrics */
+ /* */
+ /* <Description> */
+ /* The size metrics structure returned scaled important distances for */
+ /* a given size object. */
+ /* */
+ /* <Fields> */
+ /* pointSize :: The current point size in 26.6 points, where */
+ /* 1 point equals 1/72 inch. */
+ /* */
+ /* x_ppem :: The character width, expressed in integer pixels. */
+ /* This is the width of the EM square expressed in */
+ /* pixels, hence the term `ppem' (pixels per EM). */
+ /* */
+ /* y_ppem :: The character height, expressed in integer pixels. */
+ /* This is the height of the EM square expressed in */
+ /* pixels, hence the term `ppem' (pixels per EM). */
+ /* */
+ /* x_scale :: A simple 16.16 fixed point format coefficient used */
+ /* to scale horizontal distances expressed in font */
+ /* units to fractional (26.6) pixel coordinates. */
+ /* */
+ /* y_scale :: A simple 16.16 fixed point format coefficient used */
+ /* to scale vertical distances expressed in font */
+ /* units to fractional (26.6) pixel coordinates. */
+ /* */
+ /* x_resolution :: The horizontal device resolution for this size */
+ /* object, expressed in integer dots per inches */
+ /* (dpi). As a convention, fixed font formats set */
+ /* this value to 72. */
+ /* */
+ /* y_resolution :: The vertical device resolution for this size */
+ /* object, expressed in integer dots per inches */
+ /* (dpi). As a convention, fixed font formats set */
+ /* this value to 72. */
+ /* */
+ /* ascender :: The ascender, expressed in 26.6 fixed point */
+ /* pixels. Always positive. */
+ /* */
+ /* descender :: The descender, expressed in 26.6 fixed point */
+ /* pixels. Always positive. */
+ /* */
+ /* height :: The text height, expressed in 26.6 fixed point */
+ /* pixels. Always positive. */
+ /* */
+ /* max_advance :: Maximum horizontal advance, expressed in 26.6 */
+ /* fixed point pixels. Always positive. */
+ /* */
+ /* <Note> */
+ /* This structure doesn't return the vertical ascender, descender, */
+ /* and height, as well as a few other esoteric properties. One can */
+ /* however compute these through the size's x_scale and y_scale, */
+ /* applied to the relevant face properties. */
+ /* */
+ typedef struct FT_Size_Metrics_
+ {
+ FT_UShort x_ppem; /* horizontal pixels per EM */
+ FT_UShort y_ppem; /* vertical pixels per EM */
+
+ FT_Fixed x_scale; /* two scales used to convert font units */
+ FT_Fixed y_scale; /* to 26.6 frac. pixel coordinates.. */
+
+ FT_Pos ascender; /* ascender in 26.6 frac. pixels */
+ FT_Pos descender; /* descender in 26.6 frac. pixels */
+ FT_Pos height; /* text height in 26.6 frac. pixels */
+ FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
+
+ } FT_Size_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* FreeType base size class */
+ /* */
+ /* <Struct> */
+ /* FT_SizeRec */
+ /* */
+ /* <Description> */
+ /* FreeType root size class structure. A size object models the */
+ /* resolution and pointsize dependent data of a given face. */
+ /* */
+ /* <Fields> */
+ /* face :: Handle to the parent face object. */
+ /* */
+ /* generic :: A typeless pointer, which is unused by the FreeType */
+ /* library or any of its drivers. It can be used by */
+ /* client applications to link their own data to each size */
+ /* object. */
+ /* */
+ /* metrics :: Metrics for this size object. This field is read-only. */
+ /* */
+ typedef struct FT_SizeRec_
+ {
+ FT_Face face; /* parent face object */
+ FT_Generic generic; /* generic pointer for client uses */
+ FT_Size_Metrics metrics; /* size metrics */
+
+ } FT_SizeRec;
+
+
+
+ typedef struct FT_SubGlyph_ FT_SubGlyph;
+
+ struct FT_SubGlyph_
+ {
+ FT_Int index;
+ FT_UShort flags;
+ FT_Int arg1;
+ FT_Int arg2;
+ FT_Matrix transform;
+ };
+
+
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
+#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
+#define FT_SUBGLYPH_FLAG_SCALE 8
+#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
+#define FT_SUBGLYPH_FLAG_2X2 0x80
+#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
+
+
+ /*************************************************************************/
+ /* */
+ /* FreeType Glyph Slot base class */
+ /* */
+ /* <Struct> */
+ /* FT_GlyphSlotRec */
+ /* */
+ /* <Description> */
+ /* FreeType root glyph slot class structure. A glyph slot is a */
+ /* container where individual glyphs can be loaded, be they */
+ /* vectorial or bitmap/graymaps.. */
+ /* */
+ /* <Fields> */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* next :: In some cases (like some font tools), several glyph */
+ /* slots per face object can be a good thing. As this is */
+ /* rare, the glyph slots are listed through a direct, */
+ /* single-linked list using its `next' field. */
+ /* */
+ /* metrics :: The metrics of the last loaded glyph in the slot. The */
+ /* returned values depend on the last load flags (see the */
+ /* FT_Load_Glyph() API function) and can be expressed */
+ /* either in 26.6 fractional pixels or font units. */
+ /* */
+ /* metrics2 :: This field can be used to return alternate glyph */
+ /* metrics after a single load. It can contain either */
+ /* the glyph's metrics in font units, or the scaled but */
+ /* unhinted ones. See the load flags that apply when */
+ /* calling the API function FT_Load_Glyph(). */
+ /* */
+ /* generic :: A typeless pointer which is unused by the FreeType */
+ /* library or any of its drivers. It can be used by */
+ /* client applications to link their own data to each */
+ /* size object. */
+ /* */
+ /* outline :: The outline descriptor for the current glyph, if it */
+ /* is a vectorial one. The nature of the last loaded */
+ /* glyph can be retrieved through the result value */
+ /* returned by FT_Load_Glyph(). */
+ /* */
+ /* bitmap :: The bitmap/graymap descriptor for the current glyph, */
+ /* if it is a fixed-width one. The nature of the last */
+ /* loaded glyph can be retrieved through the result value */
+ /* returned by FT_Load_Glyph(). */
+ /* */
+ /* */
+ typedef struct FT_GlyphSlotRec_
+ {
+ FT_Face face;
+ FT_GlyphSlot next;
+
+ FT_Glyph_Metrics metrics;
+ FT_Glyph_Metrics metrics2;
+
+ FT_Glyph_Format format;
+ FT_Bitmap bitmap;
+ FT_Outline outline;
+
+ FT_Int num_subglyphs;
+ FT_Int max_subglyphs;
+ FT_SubGlyph* subglyphs;
+
+ void* control_data;
+ long control_len;
+
+ void* other;
+
+ } FT_GlyphSlotRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* F U N C T I O N S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Init_FreeType */
+ /* */
+ /* <Description> */
+ /* Initializes a new FreeType library object. The set of drivers */
+ /* that are registered by this function is determined at build time. */
+ /* */
+ /* <Output> */
+ /* library :: A handle to a new library object. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Init_FreeType( FT_Library* library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_FreeType */
+ /* */
+ /* <Description> */
+ /* Destroys a given FreeType library object, and all of its childs, */
+ /* including resources, drivers, faces, sizes, etc. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a target library object. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Done_FreeType( FT_Library library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Stream_Type */
+ /* */
+ /* <Description> */
+ /* An enumeration used to list the possible ways to open a new */
+ /* input stream. It is used by the FT_Open_Args structure.. */
+ /* */
+ /* <Fields> */
+ /* ft_stream_memory :: this is a memory-based stream */
+ /* ft_stream_copy :: copy the stream from the "stream" field */
+ /* ft_stream_pathname :: create a new input stream from a C pathname */
+ /* */
+ typedef enum {
+
+ ft_stream_memory = 1,
+ ft_stream_copy = 2,
+ ft_stream_pathname = 3
+
+ } FT_Stream_Type;
+
+ /*************************************************************************
+ *
+ * <Struct>
+ * FT_Open_Args
+ *
+ * <Description>
+ * A structure used to indicate how to open a new font file/stream.
+ * A pointer to such a structure can be used as a parameter for the
+ * function FT_Open_Face & FT_Attach_Stream.
+ *
+ * <Fields>
+ * stream_type :: type of input stream
+ *
+ * memory_base :: first byte of file in memory
+ * memory_size :: size in bytes of file in memory
+ *
+ * pathname :: a pointer to an 8-bit file pathname
+ *
+ * stream :: handle to a source stream object
+ *
+ * driver :: this field is exclusively used by FT_Open_Face,
+ * it simply specifies the font driver to use to open
+ * the face. If set to 0, FreeType will try to load
+ * the face with each one of the drivers in its list.
+ *
+ * <Note>
+ * The stream_type determines which fields are used to create a new
+ * input stream.
+ *
+ * If it is ft_stream_memory, a new memory-based stream will be created
+ * using the memory block specified by "memory_base" and "memory_size"
+ *
+ * If it is ft_stream_pathname, a new stream will be created with the
+ * "pathname" field, calling the system-specific FT_New_Stream function
+ *
+ * It is is ft_stream_copy, then the content of "stream" will be copied
+ * to a new input stream object. The object will be closed and destroyed
+ * when the face is destroyed itself.. Note that this means that you
+ * should not close the stream before the library does !!
+ *
+ *************************************************************************/
+
+ typedef struct FT_Open_Args_
+ {
+ FT_Stream_Type stream_type;
+ FT_Byte* memory_base;
+ FT_Long memory_size;
+ FT_String* pathname;
+ FT_Stream stream;
+ FT_Driver driver;
+
+ } FT_Open_Args;
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face */
+ /* */
+ /* <Description> */
+ /* Creates a new face object from a given font file and typeface */
+ /* index. */
+ /* */
+ /* <Input> */
+ /* library :: handle to the root FreeType library instance */
+ /* */
+ /* filepathname :: an 8-bit pathname naming the font file */
+ /* */
+ /* face_index :: the index of the face within the font file. */
+ /* The first face has index 0. */
+ /* <Output> */
+ /* face :: A handle to a new face object. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If your font file is in memory, or if you want to provide your */
+ /* own input stream object, see FT_Open_Face below. */
+ /* */
+ /* FT_New_Face creates a new stream object. The stream will be */
+ /* closed with the face (when calling FT_Done_Face or even */
+ /* FT_Done_FreeType). */
+ /* */
+ /* Unlike FreeType 1.1, this function automatically creates a glyph */
+ /* slot for the face object which can be accessed directly through */
+ /* `face->slot'. Note that additional slots can be added to each face */
+ /* through the FT_New_GlyphSlot() API function. Slots are linked in */
+ /* a single list through their `next' field. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_New_Face( FT_Library library,
+ const char* filepathname,
+ FT_Long face_index,
+ FT_Face* face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Open_Face */
+ /* */
+ /* <Description> */
+ /* Creates a new face object from a given input stream & typeface */
+ /* index. This function is very similar to FT_New_Face, except that */
+ /* it can accept any form of input stream.. */
+ /* */
+ /* <Input> */
+ /* library :: handle to the root FreeType library instance */
+ /* */
+ /* args :: an FT_Open_Args structure used to describe the */
+ /* input stream to FreeType. */
+ /* */
+ /* face_index :: the index of the face within the font file. */
+ /* The first face has index 0. */
+ /* <Output> */
+ /* face :: A handle to a new face object. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* Note that if the stream is in-memory or specified through an */
+ /* 8-bit pathname, a new stream is created by this function. It */
+ /* is only closed when the face is destroyed (FT_Done_Face). */
+ /* */
+ /* Note that when specifying directly an existing FT_Stream, this */
+ /* function creates a new FT_Stream object and copies the contents */
+ /* of the original stream within it. The stream will be closed */
+ /* when the face is destroyed. This means calling the stream's */
+ /* "close" function. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Open_Face( FT_Library library,
+ FT_Open_Args* args,
+ FT_Long face_index,
+ FT_Face* face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_File */
+ /* */
+ /* <Description> */
+ /* "Attach" a given font file to an existing face. This is usually */
+ /* to read additionnal information for a single face object. For */
+ /* example, it is used to read the AFM files that come with Type 1 */
+ /* fonts in order to add kerning data and other metrics.. */
+ /* */
+ /* <Input> */
+ /* face :: target face object */
+ /* */
+ /* filepathname :: an 8-bit pathname naming the 'metrics' file. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If your font file is in memory, or if you want to provide your */
+ /* own input stream object, see FT_Attach_Stream. */
+ /* */
+ /* The meaning of the "attach" (i.e. what really happens when the */
+ /* new file is read) is not fixed by FreeType itself. It really */
+ /* depends on the font format (and thus the font driver). */
+ /* */
+ /* Client applications are expected to know what they're doing */
+ /* when invoking this function. Most drivers simply do not implement */
+ /* file attachments.. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Attach_File( FT_Face face,
+ const char* filepathname );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_Stream */
+ /* */
+ /* <Description> */
+ /* This function is similar to FT_Attach_File with the exception */
+ /* that it reads the attachment from an arbitrary stream. */
+ /* */
+ /* <Input> */
+ /* face :: target face object */
+ /* */
+ /* args :: a pointer to an FT_Open_Args structure used to describe */
+ /* the input stream to FreeType */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* The meaning of the "attach" (i.e. what really happens when the */
+ /* new file is read) is not fixed by FreeType itself. It really */
+ /* depends on the font format (and thus the font driver). */
+ /* */
+ /* Client applications are expected to know what they're doing */
+ /* when invoking this function. Most drivers simply do not implement */
+ /* file attachments.. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Attach_Stream( FT_Face face,
+ FT_Open_Args* parameters );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Face */
+ /* */
+ /* <Description> */
+ /* Discards a given face object, as well as all of its child slots */
+ /* and sizes. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Done_Face( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Char_Size */
+ /* */
+ /* <Description> */
+ /* Sets the character dimensions of a given size object. The */
+ /* `char_size' value is used for the width and height, expressed in */
+ /* 26.6 fractional points. 1 point = 1/72 inch. */
+ /* */
+ /* <Input> */
+ /* size :: A handle to a target size object. */
+ /* char_size :: The character size, in 26.6 fractional points. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* When dealing with fixed-size faces (i.e., non-scalable formats), */
+ /* use the function FT_Set_Pixel_Sizes(). */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Set_Char_Size( FT_Face face,
+ FT_F26Dot6 char_width,
+ FT_F26Dot6 char_height,
+ FT_UInt horz_resolution,
+ FT_UInt vert_resolution );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Pixel_Sizes */
+ /* */
+ /* <Description> */
+ /* Sets the character dimensions of a given size object. The width */
+ /* and height are expressed in integer pixels. */
+ /* */
+ /* <Input> */
+ /* size :: A handle to a target size object. */
+ /* pixel_width :: The character width, in integer pixels. */
+ /* pixel_height :: The character height, in integer pixels. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Set_Pixel_Sizes( FT_Face face,
+ FT_UInt pixel_width,
+ FT_UInt pixel_height );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Glyph */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph within a given glyph slot, */
+ /* for a given size. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the target face object where the glyph */
+ /* will be loaded. */
+ /* */
+ /* glyph_index :: The index of the glyph in the font file. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* FT_LOAD_XXX 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. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Load_Glyph( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Int load_flags );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Char */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph within a given glyph slot, */
+ /* for a given size, according to its character code ! */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a target face object where the glyph */
+ /* will be loaded. */
+ /* */
+ /* char_code :: The glyph's character code, according to the */
+ /* current charmap used in the face. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* FT_LOAD_XXX 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. */
+ /* */
+ /* <Note> */
+ /* If the face has no current charmap, or if the character code */
+ /* is not defined in the charmap, this function will return an */
+ /* error.. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Load_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_Int load_flags );
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_NO_SCALE */
+ /* */
+ /* <Description> */
+ /* A bit field constant, used with FT_Load_Glyph() to indicate that */
+ /* the vector outline being loaded should not be scaled to 26.6 */
+ /* fractional pixels, but kept in notional units. */
+ /* */
+#define FT_LOAD_NO_SCALE 1
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_NO_HINTING */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the vector outline being loaded should not be fitted to the pixel */
+ /* grid but simply scaled to 26.6 fractional pixels. */
+ /* */
+ /* This flag is ignored when FT_LOAD_NO_SCALE is set. */
+ /* */
+#define FT_LOAD_NO_HINTING 2
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_NO_OUTLINE */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the function should not load the vector outline of a given glyph. */
+ /* If an embedded bitmap exists for the glyph in the font, it will be */
+ /* loaded, otherwise nothing is returned and an error is produced. */
+ /* */
+#define FT_LOAD_NO_OUTLINE 4
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_NO_BITMAP */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the function should not load the bitmap or pixmap of a given */
+ /* glyph. If an outline exists for the glyph in the font, it is */
+ /* loaded, otherwise nothing is returned and an error is produced. */
+ /* */
+#define FT_LOAD_NO_BITMAP 8
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_LINEAR */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the function should return the linearly scaled metrics for the */
+ /* glyph in `slot->metrics2' (these metrics are not grid-fitted). */
+ /* Otherwise, `metrics2' gives the original font units values. */
+ /* */
+#define FT_LOAD_LINEAR 16
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_FORCE_AUTOHINT */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the function should try to auto-hint the glyphs, even if a driver- */
+ /* -specific hinter is available.. */
+ /* */
+#define FT_LOAD_FORCE_AUTOHINT 32
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_PEDANTIC */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the glyph loader should perform a pedantic bytecode. */
+ /* interpretation. Many popular fonts come with broken glyph */
+ /* programs. When this flag is set, loading them will return an */
+ /* error. Otherwise, errors are ignored by the loader, sometimes */
+ /* resulting in ugly glyphs. */
+ /* */
+#define FT_LOAD_PEDANTIC 128
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the glyph loader should ignore the global advance width defined */
+ /* in the font. As far as we know, this is only used by the */
+ /* X-TrueType font server, in order to deal correctly with the */
+ /* incorrect metrics contained in DynaLab's TrueType CJK fonts.. */
+ /* */
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 512
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_NO_RECURSE */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the glyph loader should not load composite glyph recursively. */
+ /* Rather, when a composite glyph is encountered, it should set */
+ /* the values of `num_subglyphs' and `subglyphs', as well as set */
+ /* `face->glyph.format' to ft_glyph_format_composite. */
+ /* */
+ /* This is for use by the auto-hinter and possibly other tools */
+ /* For nearly all applications, this flags should be left unset */
+ /* when invoking FT_Load_Glyph(). */
+ /* */
+ /* Note that the flag forces the load of unscaled glyphs */
+ /* */
+#define FT_LOAD_NO_RECURSE 1024
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_LOAD_DEFAULT */
+ /* */
+ /* <Description> */
+ /* A bit-field constant, used with FT_Load_Glyph() to indicate that */
+ /* the function should try to load the glyph normally, i.e., */
+ /* embedded bitmaps are favored over outlines, vectors are always */
+ /* scaled and grid-fitted. */
+ /* */
+#define FT_LOAD_DEFAULT 0
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Kerning */
+ /* */
+ /* <Description> */
+ /* Returns the kerning vector between two glyphs of a same face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a 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 :: 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 API function -- they can be */
+ /* implemented through format-specific interfaces. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Get_Kerning( FT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph,
+ FT_Vector* kerning );
+
+
+
+/* XXX : Not implemented yet, but should come soon */
+#if 0
+ EXPORT_DEF
+ FT_Error FT_Select_Charmap( FT_Face face,
+ FT_Encoding encoding );
+
+
+ EXPORT_DEF
+ FT_Error FT_Set_Charmap( FT_Face face,
+ FT_CharMap charmap );
+#endif
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Char_Index */
+ /* */
+ /* <Description> */
+ /* Returns the glyph index of a given character code. This function */
+ /* uses a charmap object to do the translation. */
+ /* */
+ /* <Input> */
+ /* charmap :: A handle to a filter charmap object. */
+ /* charcode :: The character code. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0 means `undefined character code'. */
+ /* */
+ EXPORT_DEF
+ FT_UInt FT_Get_Char_Index( FT_Face face,
+ FT_ULong charcode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulDiv */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation `(A*B)/C' */
+ /* with maximum accuracy (it uses a 64-bit intermediate integer */
+ /* whenever necessary). */
+ /* */
+ /* This function isn't necessarily as fast as some processor specific */
+ /* operations, but is at least completely portable. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. */
+ /* c :: The divisor. */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/c'. This function never traps when trying to */
+ /* divide by zero, it simply returns `MaxInt' or `MinInt' depending */
+ /* on the signs of `a' and `b'. */
+ /* */
+ EXPORT_DEF
+ FT_Long FT_MulDiv( FT_Long a,
+ FT_Long b,
+ FT_Long c );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(A*B)/0x10000' with maximum accuracy. Most of the time, this is */
+ /* used to multiply a given value by a 16.16 fixed float factor. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. Use a 16.16 factor here whenever */
+ /* possible (see note below). */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/0x10000'. */
+ /* */
+ /* <Note> */
+ /* This function has been optimized for the case where the absolute */
+ /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
+ /* As this happens mainly when scaling from notional units to */
+ /* fractional pixels in FreeType, it resulted in noticeable speed */
+ /* improvements between versions 2.0 and 1.x. */
+ /* */
+ /* As a conclusion, always try to place a 16.16 factor as the */
+ /* _second_ argument of this function; this can make a great */
+ /* difference. */
+ /* */
+ EXPORT_DEF
+ FT_Long FT_MulFix( FT_Long a,
+ FT_Long b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_DivFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(A*0x10000)/B' with maximum accuracy. Most of the time, this is */
+ /* used to divide a given value by a 16.16 fixed float factor. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. Use a 16.16 factor here whenever */
+ /* possible (see note below). */
+ /* */
+ /* <Return> */
+ /* The result of `(a*0x10000)/b'. */
+ /* */
+ /* <Note> */
+ /* The optimisation for FT_DivFix() is simple : if (a << 16) fits */
+ /* in 32 bits, then the division is computed directly. Otherwise, */
+ /* we use a specialised version of the old FT_MulDiv64 */
+ /* */
+ EXPORT_DEF
+ FT_Long FT_DivFix( FT_Long a,
+ FT_Long b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_Bitmap */
+ /* */
+ /* <Description> */
+ /* Renders an outline within a bitmap. The outline's image is simply */
+ /* or-ed to the target bitmap. */
+ /* */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* map :: A pointer to the target bitmap descriptor. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <MT-Note> */
+ /* YES. Rendering is synchronized, so that concurrent calls to the */
+ /* scan-line converter will be serialized. */
+ /* */
+ /* <Note> */
+ /* This function does NOT CREATE the bitmap, it only renders an */
+ /* outline image within the one you pass to it! */
+ /* */
+ /* It will use the raster correponding to the default glyph format. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Outline_Get_Bitmap( FT_Library library,
+ FT_Outline* outline,
+ FT_Bitmap* map );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Render */
+ /* */
+ /* <Description> */
+ /* Renders an outline within a bitmap using the current scan-convert */
+ /* This functions uses a FT_Raster_Params as argument, allowing */
+ /* advanced features like direct composition/translucency, etc.. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* params :: A pointer to a FT_Raster_Params used to describe */
+ /* the rendering operation */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <MT-Note> */
+ /* YES. Rendering is synchronized, so that concurrent calls to the */
+ /* scan-line converter will be serialized. */
+ /* */
+ /* <Note> */
+ /* You should know what you're doing and the role of FT_Raster_Params */
+ /* to use this function. */
+ /* */
+ /* the field "params.source" will be set to "outline" before the */
+ /* scan converter is called, which means that the value you give it */
+ /* is actually ignored.. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Outline_Render( FT_Library library,
+ FT_Outline* outline,
+ FT_Raster_Params* params );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Decompose */
+ /* */
+ /* <Description> */
+ /* Walks over an outline's structure to decompose it into individual */
+ /* segments and Bezier arcs. This function is also able to emit */
+ /* `move to' and `close to' operations to indicate the start and end */
+ /* of new contours in the outline. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source target. */
+ /* */
+ /* funcs :: A table of `emitters', i.e,. function pointers called */
+ /* during decomposition to indicate path operations. */
+ /* */
+ /* user :: A typeless pointer which is passed to each emitter */
+ /* during the decomposition. It can be used to store */
+ /* the state during the decomposition. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means sucess. */
+ /* */
+ EXPORT_DEF
+ int FT_Outline_Decompose( FT_Outline* outline,
+ FT_Outline_Funcs* funcs,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_New */
+ /* */
+ /* <Description> */
+ /* Creates a new outline of a given size. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object from where the */
+ /* outline is allocated. Note however that the new */
+ /* outline will NOT necessarily be FREED when */
+ /* destroying the library, by FT_Done_FreeType(). */
+ /* */
+ /* numPoints :: The maximum number of points within the outline. */
+ /* */
+ /* numContours :: The maximum number of contours within the outline. */
+ /* */
+ /* <Output> */
+ /* outline :: A handle to the new outline. NULL in case of */
+ /* error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <MT-Note> */
+ /* No. */
+ /* */
+ /* <Note> */
+ /* The reason why this function takes a `library' parameter is simply */
+ /* to use the library's memory allocator. You can copy the source */
+ /* code of this function, replacing allocations with `malloc()' if */
+ /* you want to control where the objects go. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Outline_New( FT_Library library,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Done */
+ /* */
+ /* <Description> */
+ /* Destroys an outline created with FT_Outline_New(). */
+ /* */
+ /* <Input> */
+ /* library :: A handle of the library object used to allocate the */
+ /* outline. */
+ /* */
+ /* outline :: A pointer to the outline object to be discarded. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <MT-Note> */
+ /* No. */
+ /* */
+ /* <Note> */
+ /* If the outline's `owner' field is not set, only the outline */
+ /* descriptor will be released. */
+ /* */
+ /* The reason why this function takes an `outline' parameter is */
+ /* simply to use FT_Alloc()/FT_Free(). You can copy the source code */
+ /* of this function, replacing allocations with `malloc()' in your */
+ /* application if you want something simpler. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Outline_Done( FT_Library library,
+ FT_Outline* outline );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_CBox */
+ /* */
+ /* <Description> */
+ /* Returns an outline's `control box'. The control box encloses all */
+ /* the outline's points, including Bezier control points. Though it */
+ /* coincides with the exact bounding box for most glyphs, it can be */
+ /* slightly larger in some situations (like when rotating an outline */
+ /* which contains Bezier outside arcs). */
+ /* */
+ /* Computing the control box is very fast, while getting the bounding */
+ /* box can take much more time as it needs to walk over all segments */
+ /* and arcs in the outline. To get the latter, you can use the */
+ /* `ftbbox' component which is dedicated to this single task. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <Output> */
+ /* cbox :: The outline's control box. */
+ /* */
+ /* <MT-Note> */
+ /* Yes. */
+ /* */
+ EXPORT_DEF
+ void FT_Outline_Get_CBox( FT_Outline* outline,
+ FT_BBox* cbox );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Translate */
+ /* */
+ /* <Description> */
+ /* Applies a simple translation to the points of an outline. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* xOffset :: The horizontal offset. */
+ /* yOffset :: The vertical offset. */
+ /* */
+ /* <MT-Note> */
+ /* Yes. */
+ /* */
+ EXPORT_DEF
+ void FT_Outline_Translate( FT_Outline* outline,
+ FT_Pos xOffset,
+ FT_Pos yOffset );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Raster */
+ /* */
+ /* <Description> */
+ /* Register a given raster to the library. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a target library object. */
+ /* raster_funcs :: pointer to the raster's interface */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function will do the following: */
+ /* */
+ /* - a new raster object is created through raster_func.raster_new */
+ /* if this fails, then the function returns */
+ /* */
+ /* - if a raster is already registered for the glyph format */
+ /* specified in raster_funcs, it will be destroyed */
+ /* */
+ /* - the new raster is registered for the glyph format */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Set_Raster( FT_Library library,
+ FT_Raster_Funcs* raster_funcs );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Unset_Raster */
+ /* */
+ /* <Description> */
+ /* Removes a given raster from the library. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a target library object. */
+ /* raster_funcs :: pointer to the raster's interface */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function should never be used by a normal client application */
+ /* as FT_Set_Raster unregisters the previous raster for a given */
+ /* glyph format.. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Unset_Raster( FT_Library library,
+ FT_Raster_Funcs* raster_funcs );
+
+
+ /*************************************************************************
+ *
+ * <Function>
+ * FT_Get_Raster
+ *
+ * <Description>
+ * Return a pointer to the raster corresponding to a given glyph
+ * format tag.
+ *
+ * <Input>
+ * library :: handle to source library object
+ * glyph_format :: glyph format tag
+ *
+ * <Output>
+ * raster_funcs :: if this field is not 0, returns a pointer to the
+ * raster's interface/descriptor..
+ *
+ * <Return>
+ * a pointer to the corresponding raster object.
+ *
+ *************************************************************************/
+
+ EXPORT_DEF
+ FT_Raster FT_Get_Raster( FT_Library library,
+ FT_Glyph_Format glyph_format,
+ FT_Raster_Funcs *raster_funcs );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Raster_Mode */
+ /* */
+ /* <Description> */
+ /* Set a raster-specific mode. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a target library object. */
+ /* format :: the glyph format used to select the raster */
+ /* mode :: the raster-specific mode descriptor */
+ /* args :: the mode arguments */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Set_Raster_Mode( FT_Library library,
+ FT_Glyph_Format format,
+ unsigned long mode,
+ void* args );
+
+
+ /***************************************************************************/
+ /***************************************************************************/
+ /***************************************************************************/
+ /***** *****/
+ /***** C O N V E N I E N C E F U N C T I O N S *****/
+ /***** *****/
+ /***** *****/
+ /***** The following functions are provided as a convenience *****/
+ /***** to client applications. However, their compilation might *****/
+ /***** be discarded if FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS *****/
+ /***** is defined in "config/ftoption.h". *****/
+ /***** *****/
+ /***************************************************************************/
+ /***************************************************************************/
+ /***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Copy */
+ /* */
+ /* <Description> */
+ /* Copies an outline into another one. Both objects must have the */
+ /* same sizes (number of points & number of contours) when this */
+ /* function is called. */
+ /* */
+ /* <Input> */
+ /* source :: A handle to the source outline. */
+ /* target :: A handle to the target outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Outline_Copy( FT_Outline* source,
+ FT_Outline* target );
+
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Transform */
+ /* */
+ /* <Description> */
+ /* Applies a simple 2x2 matrix to all of an outline's points. Useful */
+ /* for applying rotations, slanting, flipping, etc. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* matrix :: A pointer to the transformation matrix. */
+ /* */
+ /* <MT-Note> */
+ /* Yes. */
+ /* */
+ /* <Note> */
+ /* You can use FT_Outline_Translate() if you need to translate the */
+ /* outline's points. */
+ /* */
+ EXPORT_DEF
+ void FT_Outline_Transform( FT_Outline* outline,
+ FT_Matrix* matrix );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Reverse */
+ /* */
+ /* <Description> */
+ /* Reverse the drawing direction of an outline. This is used to */
+ /* ensure consistent fill conventions for mirrored glyphs.. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Note> */
+ /* This functions toggles the bit flag ft_outline_reverse_fill in */
+ /* the outline's "flags" field.. */
+ /* */
+ /* It shouldn't be used by a normal client application, unless it */
+ /* knows what it's doing.. */
+ /* */
+ EXPORT_DEF
+ void FT_Outline_Reverse( FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Vector_Transform */
+ /* */
+ /* <Description> */
+ /* Transforms a single vector through a 2x2 matrix. */
+ /* */
+ /* <InOut> */
+ /* vector :: The target vector to transform */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the source 2x2 matrix. */
+ /* */
+ /* <MT-Note> */
+ /* Yes. */
+ /* */
+ EXPORT_DEF
+ void FT_Vector_Transform( FT_Vector* vector,
+ FT_Matrix* matrix );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Matrix_Multiply */
+ /* */
+ /* <Description> */
+ /* Performs the matrix operation `b = a*b'. */
+ /* */
+ /* <Input> */
+ /* a :: A pointer to matrix `a'. */
+ /* */
+ /* <InOut> */
+ /* b :: A pointer to matrix `b'. */
+ /* */
+ /* <MT-Note> */
+ /* Yes. */
+ /* */
+ EXPORT_DEF
+ void FT_Matrix_Multiply( FT_Matrix* a,
+ FT_Matrix* b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Matrix_Invert */
+ /* */
+ /* <Description> */
+ /* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */
+ /* */
+ /* <InOut> */
+ /* matrix :: A pointer to the target matrix. Remains untouched in */
+ /* case of error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <MT-Note> */
+ /* Yes. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Matrix_Invert( FT_Matrix* matrix );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Default_Drivers */
+ /* */
+ /* <Description> */
+ /* Adds the set of default drivers to a given library object. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to a new library object. */
+ /* */
+ EXPORT_DEF
+ void FT_Default_Drivers( FT_Library library );
+
+#ifdef __cplusplus
+ }
+#endif
+
+
+#endif /* FREETYPE_H */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftbbox.h
@@ -1,0 +1,73 @@
+/***************************************************************************/
+/* */
+/* ftbbox.h */
+/* */
+/* FreeType bbox computation (specification). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This component has a _single_ role: to compute exact outline bounding */
+ /* boxes. */
+ /* */
+ /* It is separated from the rest of the engine for various technical */
+ /* reasons. It may well be integrated in `ftoutln' later. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef FTBBOX_H
+#define FTBBOX_H
+
+#include <freetype/freetype.h>
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Raster_GetBBox */
+ /* */
+ /* <Description> */
+ /* Computes the exact bounding box of an outline. This is slower */
+ /* than computing the control box. However, it uses an advanced */
+ /* algorithm which returns _very_ quickly when the two boxes */
+ /* coincide. Otherwise, the outline Bezier arcs are walked over to */
+ /* extract their extrema. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source outline. */
+ /* */
+ /* <Output> */
+ /* bbox :: The outline's exact bounding box. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ EXPORT_DEF
+ FT_Error FT_Raster_GetBBox( FT_Outline* outline,
+ FT_BBox* abbox );
+
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* FTBBOX_H */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/fterrors.h
@@ -1,0 +1,115 @@
+/***************************************************************************/
+/* */
+/* fterrors.h */
+/* */
+/* FreeType error codes (specification). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/* This file is used to define the FreeType error enumeration constants */
+/* It can also be used to create an error message table easily with */
+/* something like: */
+/* */
+/* { */
+/* */
+/* #undef FTERRORS_H */
+/* #define FT_ERRORDEF( e, v, s ) { e, s ], */
+/* #define FT_ERROR_START_LIST { */
+/* #define FT_ERROR_END_LIST { 0, 0 } }; */
+/* */
+/* const struct { int err_code; const char* err_msg } ft_errors[] = */
+/* #include <freetype/fterrors.h> */
+/* } */
+/* */
+/***************************************************************************/
+
+#ifndef FTERRORS_H
+#define FTERRORS_H
+
+#ifndef FT_ERRORDEF
+#define FT_ERRORDEF( e, v, s ) e = v,
+#define FT_ERROR_START_LIST enum {
+#define FT_ERROR_END_LIST FT_Err_Max };
+#endif /* FT_ERRORDEF */
+
+#ifdef FT_ERROR_START_LIST
+FT_ERROR_START_LIST
+#endif
+
+ FT_ERRORDEF( FT_Err_Ok, 0x0000, "no error" )
+ FT_ERRORDEF( FT_Err_Cannot_Open_Resource, 0x0001, "can't open stream" )
+ FT_ERRORDEF( FT_Err_Unknown_File_Format, 0x0002, "unknown file format" )
+ FT_ERRORDEF( FT_Err_Invalid_File_Format, 0x0003, "broken file" )
+
+ FT_ERRORDEF( FT_Err_Invalid_Argument, 0x0010, "invalid argument" )
+ FT_ERRORDEF( FT_Err_Invalid_Handle, 0x0011, "invalid object handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Glyph_Index, 0x0012, "invalid glyph index" )
+ FT_ERRORDEF( FT_Err_Invalid_Character_Code, 0x0013, "invalid character code" )
+
+ FT_ERRORDEF( FT_Err_Unimplemented_Feature, 0x0020, "unimplemented feature" )
+ FT_ERRORDEF( FT_Err_Invalid_Glyph_Format, 0x0021, "invalid glyph image format" )
+
+ FT_ERRORDEF( FT_Err_Invalid_Library_Handle, 0x0030, "invalid library handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Driver_Handle, 0x0031, "invalid module handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Face_Handle, 0x0032, "invalid face handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Size_Handle, 0x0033, "invalid size handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Slot_Handle, 0x0034, "invalid glyph slot handle" )
+ FT_ERRORDEF( FT_Err_Invalid_CharMap_Handle, 0x0035, "invalid charmap handle" )
+ FT_ERRORDEF( FT_Err_Invalid_Outline, 0x0036, "invalid outline" )
+ FT_ERRORDEF( FT_Err_Invalid_Dimensions, 0x0037, "invalid dimensions" )
+
+ FT_ERRORDEF( FT_Err_Unavailable_Outline, 0x0040, "unavailable outline" )
+ FT_ERRORDEF( FT_Err_Unavailable_Bitmap, 0x0041, "unavailable bitmap" )
+ FT_ERRORDEF( FT_Err_File_Is_Not_Collection, 0x0042, "file is not a font collection" )
+ FT_ERRORDEF( FT_Err_Too_Many_Drivers, 0x0043, "too many modules" )
+ FT_ERRORDEF( FT_Err_Too_Many_Glyph_Formats, 0x0044, "too many glyph formats" )
+ FT_ERRORDEF( FT_Err_Too_Many_Extensions, 0x0045, "too many extensions" )
+
+ FT_ERRORDEF( FT_Err_Out_Of_Memory, 0x0050, "out of memory" )
+ FT_ERRORDEF( FT_Err_Unlisted_Object, 0x0051, "unlisted object" )
+
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Handle, 0x0060, "invalid stream handle" )
+ FT_ERRORDEF( FT_Err_Cannot_Open_Stream, 0x0061, "cannot open stream" )
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Seek, 0x0062, "invalid stream seek" )
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Skip, 0x0063, "invalid stream skip" )
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Read, 0x0064, "invalid stream read" )
+ FT_ERRORDEF( FT_Err_Invalid_Stream_Operation, 0x0065, "invalid stream operation" )
+ FT_ERRORDEF( FT_Err_Invalid_Frame_Operation, 0x0066, "invalid frame operation" )
+ FT_ERRORDEF( FT_Err_Nested_Frame_Access, 0x0067, "nested frame access" )
+ FT_ERRORDEF( FT_Err_Invalid_Frame_Read, 0x0068, "invalid frame read" )
+
+ FT_ERRORDEF( FT_Err_Too_Many_Points, 0x0070, "too many points in glyph" )
+ FT_ERRORDEF( FT_Err_Too_Many_Contours, 0x0071, "too many contours in glyph" )
+ FT_ERRORDEF( FT_Err_Invalid_Composite, 0x0072, "invalid composite glyph" )
+ FT_ERRORDEF( FT_Err_Too_Many_Hints, 0x0073, "too many hints in glyph" )
+ FT_ERRORDEF( FT_Err_Too_Many_Edges, 0x0074, "too many edges in glyph" )
+ FT_ERRORDEF( FT_Err_Too_Many_Strokes, 0x0075, "too many strokes in glyph" )
+
+/* range 0x400 - 0x4FF is reserved for TrueType specific stuff */
+
+/* range 0x500 - 0x5FF is reserved for TrueDoc specific stuff */
+
+/* range 0x600 - 0x6FF is reserved for Type1 specific stuff */
+
+ FT_ERRORDEF( FT_Err_Raster_Uninitialized, 0x0080, "raster uninitialized" )
+ FT_ERRORDEF( FT_Err_Raster_Corrupted, 0x0081, "raster corrupted !!" )
+ FT_ERRORDEF( FT_Err_Raster_Overflow, 0x0082, "raster overflow !!" )
+
+#ifdef FT_ERROR_END_LIST
+FT_ERROR_END_LIST
+#endif
+
+#undef FT_ERROR_START_LIST
+#undef FT_ERROR_END_LIST
+#undef FT_ERRORDEF
+
+#endif /* FTERRORS_H */
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftglyph.h
@@ -1,0 +1,320 @@
+/***************************************************************************/
+/* */
+/* ftglyph.h */
+/* */
+/* FreeType convenience functions to handle glyphs.. */
+/* */
+/* 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 several convenience functions */
+/* that can be used by client applications to easily retrieve glyph */
+/* bitmaps and outlines from a given face. */
+/* */
+/* These functions should be optional if you're writing a font server */
+/* or text layout engine on top of FreeType. However, they are pretty */
+/* handy for many other simple uses of the library.. */
+/* */
+/***************************************************************************/
+
+#ifndef FTGLYPH_H
+#define FTGLYPH_H
+
+#include <freetype/freetype.h>
+
+ typedef enum {
+
+ ft_glyph_type_none = 0,
+ ft_glyph_type_bitmap = 1,
+ ft_glyph_type_outline = 2
+
+ } FT_GlyphType;
+
+ /***********************************************************************
+ *
+ * <Struct>
+ * FT_GlyphRec
+ *
+ * <Description>
+ * The root glyph structure contains a given glyph image's metrics.
+ * Note that the FT_Glyph type is a pointer to FT_GlyphRec
+ *
+ * <Field>
+ * memory :: a handle to the memory allocator that is used to
+ * create/clone/destroy this glyph..
+ *
+ * glyph_type :: the glyph type..
+ *
+ * height :: height of glyph image
+ * width :: width of glyph image
+ *
+ * bearingX :: horizontal bearing, this is the distance from the
+ * the current pen position to the left of the glyph
+ *
+ * bearingY :: vertical bearing, this is the distance from the
+ * current pen position to the top of the glyph
+ *
+ * advance :: this is the horizontal or vertical advance for the
+ * glyph
+ *
+ * <Note>
+ * the distances expressed in the metrics are expressed in 26.6 fixed
+ * float sub-pixels (i.e. 1/64th of pixels).
+ *
+ * the vertical bearing has a positive value when the glyph top is
+ * above the baseline, and negative when it is under..
+ *
+ ***********************************************************************/
+
+ typedef struct FT_GlyphRec_
+ {
+ FT_Memory memory;
+ FT_GlyphType glyph_type;
+ FT_Int height;
+ FT_Int width;
+ FT_Int bearingX;
+ FT_Int bearingY;
+ FT_Int advance;
+
+ } FT_GlyphRec, *FT_Glyph;
+
+
+ /***********************************************************************
+ *
+ * <Struct>
+ * FT_BitmapGlyphRec
+ *
+ * <Description>
+ * A structure used to describe a bitmap glyph image..
+ * Note that the FT_BitmapGlyph type is a pointer to FT_BitmapGlyphRec
+ *
+ * <Field>
+ * metrics :: the corresponding glyph metrics
+ * bitmap :: a descriptor for the bitmap.
+ *
+ * <Note>
+ * the "width" and "height" fields of the metrics are expressed in
+ * 26.6 sub-pixels. However, the width and height in pixels can be
+ * read directly from "bitmap.width" and "bitmap.height"
+ *
+ * this structure is used for both monochrome and anti-aliased
+ * bitmaps (the bitmap descriptor contains field describing the
+ * format of the pixel buffer)
+ *
+ * the corresponding pixel buffer is always owned by the BitmapGlyph
+ * and is thus creatde and destroyed with it..
+ *
+ ***********************************************************************/
+
+ typedef struct FT_BitmapGlyphRec_
+ {
+ FT_GlyphRec metrics;
+ FT_Int left;
+ FT_Int top;
+ FT_Bitmap bitmap;
+
+ } FT_BitmapGlyphRec_, *FT_BitmapGlyph;
+
+
+ /***********************************************************************
+ *
+ * <Struct>
+ * FT_OutlineGlyphRec
+ *
+ * <Description>
+ * A structure used to describe a vectorial outline glyph image..
+ * Note that the FT_OutlineGlyph type is a pointer to FT_OutlineGlyphRec
+ *
+ * <Field>
+ * metrics :: the corresponding glyph metrics
+ * outline :: a descriptor for the outline
+ *
+ * <Note>
+ * the "width" and "height" fields of the metrics are expressed in
+ * 26.6 sub-pixels. However, the width and height in pixels can be
+ * read directly from "bitmap.width" and "bitmap.rows"
+ *
+ * the corresponding outline points tables is always owned by the
+ * object and are destroyed with it..
+ *
+ * an OutlineGlyph can be used to generate a BitmapGlyph with the
+ * function FT_OutlineGlyph_Render()
+ *
+ ***********************************************************************/
+
+ typedef struct FT_OutlineGlyphRec_
+ {
+ FT_GlyphRec metrics;
+ FT_Outline outline;
+
+ } FT_OutlineGlyphRec_, *FT_OutlineGlyph;
+
+
+ /***********************************************************************
+ *
+ * <Function>
+ * FT_Get_Glyph_Bitmap
+ *
+ * <Description>
+ * A function used to directly return a monochrome bitmap glyph image
+ * from a face.
+ *
+ * <Input>
+ * face :: handle to source face object
+ * glyph_index :: glyph index in face
+ * load_flags :: load flags, see FT_LOAD_FLAG_XXXX constants..
+ * grays :: number of gray levels for anti-aliased bitmaps,
+ * set to 0 if you want to render a monochrome bitmap
+ * origin :: a pointer to the origin's position. Set to 0
+ * if the current transform is the identity..
+ *
+ * <Output>
+ * bitglyph :: pointer to the new bitmap glyph
+ *
+ * <Return>
+ * Error code. 0 means success.
+ *
+ * <Note>
+ * If the font contains glyph outlines, these will be automatically
+ * converted to a bitmap according to the value of "grays"
+ *
+ * If "grays" is set to 0, the result is a 1-bit monochrome bitmap
+ * otherwise, it is an 8-bit gray-level bitmap
+ *
+ * The number of gray levels in the result anti-aliased bitmap might
+ * not be "grays", depending on the current scan-converter implementation
+ *
+ * Note that it is not possible to generate 8-bit monochrome bitmaps
+ * with this function. Rather, use FT_Get_Glyph_Outline, then
+ * FT_Glyph_Render_Outline and provide your own span callbacks..
+ *
+ * When the face doesn't contain scalable outlines, this function will
+ * fail if the current transform is not the identity, or if the glyph
+ * origin's phase to the pixel grid is not 0 in both directions !!
+ *
+ ***********************************************************************/
+
+ EXPORT_DEF
+ FT_Error FT_Get_Glyph_Bitmap( FT_Face face,
+ FT_UInt glyph_index,
+ FT_UInt load_flags,
+ FT_Int grays,
+ FT_Vector* origin,
+ FT_BitmapGlyph *abitglyph );
+
+
+ /***********************************************************************
+ *
+ * <Function>
+ * FT_Get_Glyph_Outline
+ *
+ * <Description>
+ * A function used to directly return a bitmap glyph image from a
+ * face. This is faster than calling FT_Load_Glyph+FT_Get_Outline_Bitmap..
+ *
+ * <Input>
+ * face :: handle to source face object
+ * glyph_index :: glyph index in face
+ * load_flags :: load flags, see FT_LOAD_FLAG_XXXX constants..
+ *
+ * <Output>
+ * vecglyph :: pointer to the new outline glyph
+ *
+ * <Return>
+ * Error code. 0 means success.
+ *
+ * <Note>
+ * If the glyph is not an outline in the face, this function will
+ * fail..
+ *
+ * This function will fail if the load flags FT_LOAD_NO_OUTLINE and
+ * FT_LOAD_NO_RECURSE are set..
+ *
+ ***********************************************************************/
+
+ EXPORT_DEF
+ FT_Error FT_Get_Glyph_Outline( FT_Face face,
+ FT_UInt glyph_index,
+ FT_UInt load_flags,
+ FT_OutlineGlyph *vecglyph );
+
+
+ /***********************************************************************
+ *
+ * <Function>
+ * FT_Set_Transform
+ *
+ * <Description>
+ * A function used to set the transform that is applied to glyph images
+ * just after they're loaded in the face's glyph slot, and before they're
+ * returned by either FT_Get_Glyph_Bitmap or FT_Get_Glyph_Outline
+ *
+ * <Input>
+ * face :: handle to source face object
+ * matrix :: pointer to the transform's 2x2 matrix. 0 for identity
+ * delta :: pointer to the transform's translation. 0 for null vector
+ *
+ * <Note>
+ * The transform is only applied to glyph outlines when they are found
+ * in a font face. It is unable to transform embedded glyph bitmaps
+ *
+ ***********************************************************************/
+
+ EXPORT_DEF
+ void FT_Set_Transform( FT_Face face,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+ /***********************************************************************
+ *
+ * <Function>
+ * FT_Done_Glyph
+ *
+ * <Description>
+ * Destroys a given glyph..
+ *
+ * <Input>
+ * glyph :: handle to target glyph object
+ *
+ ***********************************************************************/
+
+ EXPORT_DEF
+ void FT_Done_Glyph( FT_Glyph glyph );
+
+
+ /***********************************************************************
+ *
+ * <Function>
+ * FT_Glyph_Get_Box
+ *
+ * <Description>
+ * Returns the glyph image's bounding box in pixels.
+ *
+ * <Input>
+ * glyph :: handle to target glyph object
+ *
+ * <Output>
+ * box :: the glyph bounding box. Coordinates are expressed in
+ * _integer_ pixels, with exclusive max bounds
+ *
+ * <Note>
+ * Coordinates are relative to the glyph origin, using the Y-upwards
+ * convention..
+ *
+ * The width of the box in pixels is box.xMax-box.xMin
+ * The height is box.yMax - box.yMin
+ *
+ ***********************************************************************/
+
+ EXPORT_DEF
+ void FT_Glyph_Get_Box( FT_Glyph glyph,
+ FT_BBox *box );
+
+#endif /* FTGLYPH_H */
--- /dev/null
+++ b/include/freetype/ftgrays.h
@@ -1,0 +1,20 @@
+#ifndef FTGRAYS_H
+#define FTGRAYS_H
+
+#include <freetype/ftimage.h>
+
+ /*************************************************************************/
+ /* */
+ /* To make ftgrays.h independent from configuration files we check */
+ /* whether EXPORT_DEF has been defined already. */
+ /* */
+ /* On some systems and compilers (Win32 mostly), an extra keyword is */
+ /* necessary to compile the library as a DLL. */
+ /* */
+#ifndef EXPORT_DEF
+#define EXPORT_DEF extern
+#endif
+
+ EXPORT_DEF FT_Raster_Funcs ft_grays_raster;
+
+#endif
--- /dev/null
+++ b/include/freetype/ftimage.h
@@ -1,0 +1,938 @@
+/***************************************************************************/
+/* */
+/* ftimage.h */
+/* */
+/* This file defines the glyph image formats recognized by FreeType, as */
+/* well as the default raster interface. */
+/* */
+/* 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. */
+/* */
+/***************************************************************************/
+
+#ifndef FTIMAGE_H
+#define FTIMAGE_H
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_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. */
+ /* */
+ typedef signed long FT_Pos;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Vector */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2d vector; coordinates are of */
+ /* the FT_Pos type. */
+ /* */
+ /* <Fields> */
+ /* x :: The horizontal coordinate. */
+ /* y :: The vertical coordinate. */
+ /* */
+ typedef struct FT_Vector_
+ {
+ FT_Pos x;
+ FT_Pos y;
+
+ } FT_Vector;
+
+
+ /*************************************************************************
+ *
+ * <Enum>
+ * FT_Pixel_Mode
+ *
+ * <Description>
+ * An enumeration type used to describe the format of pixels
+ * in a given bitmap. Note that additional formats may be added
+ * in the future.
+ *
+ * <Fields>
+ * ft_pixel_mode_mono :: a monochrome bitmap (1 bit/pixel)
+ *
+ * ft_pixel_mode_grays :: an 8-bit gray-levels bitmap. Note that
+ * the total number of gray levels is given
+ * in the `num_grays' field of the FT_Bitmap
+ * structure.
+ *
+ * ft_pixel_mode_pal2 :: a 2-bit paletted bitmap.
+ * currently unused by FreeType.
+ *
+ * ft_pixel_mode_pal4 :: a 4-bit paletted bitmap.
+ * currently unused by FreeType.
+ *
+ * ft_pixel_mode_pal8 :: an 8-bit paletted bitmap.
+ * currently unused by FreeType.
+ *
+ * ft_pixel_mode_rgb15 :: a 15-bit RGB bitmap. Uses 5:5:5 encoding
+ * currently unused by FreeType.
+ *
+ * ft_pixel_mode_rgb16 :: a 16-bit RGB bitmap. Uses 5:6:5 encoding
+ * currently unused by FreeType.
+ *
+ * ft_pixel_mode_rgb24 :: a 24-bit RGB bitmap.
+ * currently unused by FreeType.
+ *
+ * ft_pixel_mode_rgb32 :: a 32-bit RGB bitmap.
+ * currently unused by FreeType.
+ *
+ * <Note>
+ * Some anti-aliased bitmaps might be embedded in TrueType fonts
+ * using formats pal2 or pal4, though no fonts presenting those
+ * have been found to date..
+ *
+ *************************************************************************/
+
+ typedef enum FT_Pixel_Mode_
+ {
+ ft_pixel_mode_none = 0,
+ ft_pixel_mode_mono,
+ ft_pixel_mode_grays,
+ ft_pixel_mode_pal2,
+ ft_pixel_mode_pal4,
+ ft_pixel_mode_pal8,
+ ft_pixel_mode_rgb15,
+ ft_pixel_mode_rgb16,
+ ft_pixel_mode_rgb24,
+ ft_pixel_mode_rgb32,
+
+ ft_pixel_mode_max /* do not remove */
+
+ } FT_Pixel_Mode;
+
+
+
+ /*************************************************************************
+ *
+ * <Enum>
+ * FT_Palette_Mode
+ *
+ * <Description>
+ * An enumeration type used to describe the format of a bitmap
+ * palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8
+ *
+ * <Fields>
+ * ft_palette_mode_rgb :: the palette is an array of 3-bytes RGB records
+ *
+ * ft_palette_mode_rgba :: the palette is an array of 4-bytes RGBA records
+ *
+ * <Note>
+ * As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by
+ * FreeType, these types are not handled by the library itself.
+ *
+ *************************************************************************/
+
+ typedef enum FT_Palette_Mode_
+ {
+ ft_palette_mode_rgb = 0,
+ ft_palette_mode_rgba,
+
+ ft_palettte_mode_max /* do not remove */
+
+ } FT_Palette_Mode;
+
+
+ /*************************************************************************
+ *
+ * <Struct>
+ * FT_Bitmap
+ *
+ * <Description>
+ * A structure used to describe a bitmap or pixmap to the raster.
+ * Note that we now manage pixmaps of various depths through the
+ * `pixel_mode' field.
+ *
+ * <Fields>
+ * rows :: The number of bitmap rows.
+ *
+ * width :: The number of pixels in bitmap row.
+ *
+ * pitch :: The pitch's absolute value is the number of bytes
+ * taken by one bitmap row, including padding. However,
+ * the pitch is positive when the bitmap has a `down'
+ * flow, and negative when it has an `up' flow. In all
+ * cases, the pitch is an offset to add to a bitmap
+ * pointer in order to go down one row.
+ *
+ * buffer :: A typeless pointer to the bitmap buffer. This value
+ * should be aligned on 32-bit boundaries in most cases.
+ *
+ * num_grays :: this field is only used with ft_pixel_mode_grays,
+ * it gives the number of gray levels used in the
+ * bitmap.
+ *
+ * pixel_mode :: the pixel_mode, i.e. how pixel bits are stored
+ *
+ * palette_mode :: this field is only used with paletted pixel modes,
+ * it indicates how the palette is stored
+ *
+ * palette :: a typeless pointer to the bitmap palette. only used
+ * for paletted pixel modes.
+ *
+ * <Note>
+ * When using pixel modes pal2, pal4 and pal8 with a void `palette'
+ * field, a gray pixmap with respectively 4, 16 and 256 levels of gray
+ * is assumed. This, in order to be compatible with some embedded bitmap
+ * formats defined in the TrueType spec.
+ *
+ * Note that no font was found presenting such embedded bitmaps, so this
+ * is currently completely unhandled by the library.
+ *
+ *
+ *************************************************************************/
+
+ typedef struct FT_Bitmap_
+ {
+ int rows;
+ int width;
+ int pitch;
+ void* buffer;
+ short num_grays;
+ char pixel_mode;
+ char palette_mode;
+ void* palette;
+
+ } FT_Bitmap;
+
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Outline */
+ /* */
+ /* <Description> */
+ /* This structure is used to describe an outline to the scan-line */
+ /* converter. It's a copy of the TT_Outline type that was defined */
+ /* in FreeType 1.x. */
+ /* */
+ /* <Fields> */
+ /* n_contours :: The number of contours in the outline. */
+ /* */
+ /* n_points :: The number of points in the outline. */
+ /* */
+ /* points :: A pointer to an array of `n_points' FT_Vector */
+ /* elements, giving the outline's point */
+ /* coordinates. */
+ /* */
+ /* tags :: A pointer to an array of `n_points' chars, */
+ /* giving each outline point's type. If bit 0 is */
+ /* unset, the point is 'off' the curve, i.e. a */
+ /* Bezier control point, while it is `on' when */
+ /* unset. */
+ /* */
+ /* Bit 1 is meaningful for `off' points only. If */
+ /* set, it indicates a third-order Bezier arc */
+ /* control point; and a second-order control point */
+ /* if unset. */
+ /* */
+ /* contours :: An array of `n_contours' shorts, giving the end */
+ /* point of each contour within the outline. For */
+ /* example, the first contour is defined by the */
+ /* points `0' to `contours[0]', the second one is */
+ /* defined by the points `contours[0]+1' to */
+ /* `contours[1]', etc. */
+ /* */
+ /* flags :: a set of bit flags used to characterize the */
+ /* outline and give hints to the scan-converter */
+ /* and hinter on how to convert/grid-fit it.. */
+ /* see FT_Outline_Flags.. */
+ /* */
+ typedef struct FT_Outline_
+ {
+ short n_contours; /* number of contours in glyph */
+ short n_points; /* number of points in the glyph */
+
+ FT_Vector* points; /* the outline's points */
+ char* tags; /* the points flags */
+ short* contours; /* the contour end points */
+
+ int flags; /* outline masks */
+
+ } FT_Outline;
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Outline_Flags */
+ /* */
+ /* <Description> */
+ /* A simple type used to enumerates the flags in an outline's */
+ /* "outline_flags" field. */
+ /* */
+ /* <Fields> */
+ /* ft_outline_owner :: */
+ /* when set, this flag indicates that the outline's field arrays */
+ /* (i.e. "points", "flags" & "contours") are "owned" by the */
+ /* outline object, and should thus be freed when it is destroyed. */
+ /* */
+ /* ft_outline_even_odd_fill :: */
+ /* by default, outlines are filled using the non-zero winding */
+ /* rule. When set to 1, the outline will be filled using the */
+ /* even-odd fill rule.. (XXX: unimplemented) */
+ /* */
+ /* ft_outline_reverse_fill :: */
+ /* By default, outside contours of an outline are oriented in */
+ /* clock-wise direction, as defined in the TrueType specification. */
+ /* This flag is set when the outline uses the opposite direction, */
+ /* (typically for Type 1 fonts). This flag is ignored by the */
+ /* scan-converter. However, it is very important for the */
+ /* auto-hinter.. */
+ /* */
+ /* ft_outline_ignore_dropouts :: */
+ /* By default, the scan converter will try to detect drop-outs */
+ /* in an outline and correct the glyph bitmap to ensure consistent */
+ /* shape continuity. When set, this flag hints the scan-line */
+ /* converter to ignore such cases. */
+ /* */
+ /* ft_outline_high_precision :: */
+ /* this flag indicates that the scan-line converter should try */
+ /* to convert this outline to bitmaps with the highest possible */
+ /* quality. It is typically set for small character sizes. Note */
+ /* that this is only a hint, that might be completely ignored */
+ /* by a given scan-converter. */
+ /* */
+ /* ft_outline_single_pass :: */
+ /* this flag is set to force a given scan-converter to only */
+ /* use a single pass over the outline to render a bitmap glyph */
+ /* image. Normally, it is set for very large character sizes. */
+ /* It is only a hint, that might be completely ignored by a */
+ /* given scan-converter. */
+ /* */
+ typedef enum FT_Outline_Flags_
+ {
+ ft_outline_none = 0,
+ ft_outline_owner = 1,
+ ft_outline_even_odd_fill = 2,
+ ft_outline_reverse_fill = 4,
+ ft_outline_ignore_dropouts = 8,
+ ft_outline_high_precision = 256,
+ ft_outline_single_pass = 512
+
+ } FT_Outline_Flags;
+
+
+
+#define FT_CURVE_TAG( flag ) (flag & 3)
+
+#define FT_Curve_Tag_On 1
+#define FT_Curve_Tag_Conic 0
+#define FT_Curve_Tag_Cubic 2
+
+#define FT_Curve_Tag_Touch_X 8 /* reserved for the TrueType hinter */
+#define FT_Curve_Tag_Touch_Y 16 /* reserved for the TrueType hinter */
+
+#define FT_Curve_Tag_Touch_Both ( FT_Curve_Tag_Touch_X | \
+ FT_Curve_Tag_Touch_Y)
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_MoveTo_Func */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `move */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `move to' is emitted to start a new contour in an outline. */
+ /* */
+ /* <Input> */
+ /* to :: A pointer to the target point of the `move to'. */
+ /* user :: A typeless pointer which is passed from the caller of the */
+ /* decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int (*FT_Outline_MoveTo_Func)( FT_Vector* to,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_LineTo_Func */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `line */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `line to' is emitted to indicate a segment in the outline. */
+ /* */
+ /* <Input> */
+ /* to :: A pointer to the target point of the `line to'. */
+ /* user :: A typeless pointer which is passed from the caller of the */
+ /* decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int (*FT_Outline_LineTo_Func)( FT_Vector* to,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_ConicTo_Func */
+ /* */
+ /* <Description> */
+ /* A function pointer type use to describe the signature of a `conic */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `conic to' is emitted to indicate a second-order Bezier arc in */
+ /* the outline. */
+ /* */
+ /* <Input> */
+ /* control :: An intermediate control point between the last position */
+ /* and the new target in `to'. */
+ /* */
+ /* to :: A pointer to the target end point of the conic arc. */
+ /* */
+ /* user :: A typeless pointer which is passed from the caller of */
+ /* the decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int (*FT_Outline_ConicTo_Func)( FT_Vector* control,
+ FT_Vector* to,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_CubicTo_Func */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `cubic */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `cubic to' is emitted to indicate a third-order Bezier arc. */
+ /* */
+ /* <Input> */
+ /* control1 :: A pointer to the first Bezier control point. */
+ /* control2 :: A pointer to the second Bezier control point. */
+ /* to :: A pointer to the target end point. */
+ /* user :: A typeless pointer which is passed from the caller of */
+ /* the decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int (*FT_Outline_CubicTo_Func)( FT_Vector* control1,
+ FT_Vector* control2,
+ FT_Vector* to,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Outline_Funcs */
+ /* */
+ /* <Description> */
+ /* A structure to hold various function pointers used during outline */
+ /* decomposition in order to emit segments, conic, and cubic Beziers, */
+ /* as well as `move to' and `close to' operations. */
+ /* */
+ /* <Fields> */
+ /* move_to :: The `move to' emitter. */
+ /* line_to :: The segment emitter. */
+ /* conic_to :: The second-order Bezier arc emitter. */
+ /* cubic_to :: The third-order Bezier arc emitter. */
+ /* */
+ typedef struct FT_Outline_Funcs_
+ {
+ FT_Outline_MoveTo_Func move_to;
+ FT_Outline_LineTo_Func line_to;
+ FT_Outline_ConicTo_Func conic_to;
+ FT_Outline_CubicTo_Func cubic_to;
+
+ int shift;
+ FT_Pos delta;
+
+ } FT_Outline_Funcs;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_IMAGE_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four letter tags which are used to label */
+ /* TrueType tables into an unsigned long to be used within FreeType. */
+ /* */
+#define FT_IMAGE_TAG( _x1, _x2, _x3, _x4 ) \
+ (((unsigned long)_x1 << 24) | \
+ ((unsigned long)_x2 << 16) | \
+ ((unsigned long)_x3 << 8) | \
+ (unsigned long)_x4)
+
+
+ /***********************************************************************
+ *
+ * <Enum>
+ * FT_Glyph_Format
+ *
+ * <Description>
+ * An enumeration type used to describethe format of a given glyph
+ * image. Note that this version of FreeType only supports two image
+ * formats, even though future font drivers will be able to register
+ * their own format.
+ *
+ * <Fields>
+ * ft_glyph_format_composite :: the glyph image is a composite of several
+ * other images. This glyph format is _only_
+ * used with the FT_LOAD_FLAG_NO_RECURSE flag
+ * (XXX: Which is currently iunimplemented)
+ *
+ * ft_glyph_format_bitmap :: the glyph image is a bitmap, and can
+ * be described as a FT_Bitmap
+ *
+ * ft_glyph_format_outline :: the glyph image is a vectorial image
+ * made of bezier control points, and can
+ * be described as a FT_Outline
+ *
+ * ft_glyph_format_plotter :: the glyph image is a vectorial image
+ * made of plotter lines (some T1 fonts like
+ * Hershey contain glyph in this format).
+ *
+ ***********************************************************************/
+
+ typedef enum FT_Glyph_Format_
+ {
+ ft_glyph_format_none = 0,
+ ft_glyph_format_composite = FT_IMAGE_TAG('c','o','m','p'),
+ ft_glyph_format_bitmap = FT_IMAGE_TAG('b','i','t','s'),
+ ft_glyph_format_outline = FT_IMAGE_TAG('o','u','t','l'),
+ ft_glyph_format_plotter = FT_IMAGE_TAG('p','l','o','t')
+
+ } FT_Glyph_Format;
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** R A S T E R D E F I N I T I O N S *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /**************************************************************************
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ **************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Raster */
+ /* */
+ /* <Description> */
+ /* A handle (pointer) to a raster object. Each object can be used */
+ /* independently to convert an outline into a bitmap or pixmap. */
+ /* */
+ typedef struct FT_RasterRec_* FT_Raster;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Span */
+ /* */
+ /* <Description> */
+ /* A structure used to model a single span of gray (or black) pixels */
+ /* when rendering a monocrhome or anti-aliased bitmap. */
+ /* */
+ /* <Fields> */
+ /* x :: the span's horizontal start position */
+ /* len :: the span's length in pixels */
+ /* coverage :: the span color/coverage, ranging from 0 (background) */
+ /* to 255 (foreground). Only used for anti-aliased */
+ /* rendering.. */
+ /* */
+ /* <Note> */
+ /* This structure is used by the span drawing callback type */
+ /* named FT_Raster_Span_Func, which takes the y coordinate of the */
+ /* span as a paremeter.. */
+ /* */
+ /* The coverage value is always between 0 and 255, even if the */
+ /* number of gray levels have been set through FT_Set_Gray_Levels() */
+ /* */
+ typedef struct FT_Span_
+ {
+ short x;
+ unsigned short len;
+ unsigned char coverage;
+
+ } FT_Span;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_Span_Func */
+ /* */
+ /* <Description> */
+ /* A function used as a call-back by the anti-aliased renderer in */
+ /* order to let client applications draw themselves the gray pixel */
+ /* spans on each scan line. */
+ /* */
+ /* <Input> */
+ /* y :: the scanline's y coordinate */
+ /* count :: the number of spans to draw on this scanline */
+ /* spans :: a table of 'count' spans to draw on the scanline */
+ /* user :: user-supplied data that is passed to the callback */
+ /* */
+ /* <Note> */
+ /* This callback allows client applications to directly render the */
+ /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
+ /* */
+ /* This can be used to write anti-aliased outlines directly to a */
+ /* given background bitmap, and even perform translucency.. */
+ /* */
+ /* Note that the "count" field cannot be greater than a fixed value */
+ /* defined by the FT_MAX_GRAY_SPANS configuration macro in ftoption.h */
+ /* */
+ /* By default, this value is set to 32, which means that if there are */
+ /* more than 32 spans on a given scanline, the callback will be called */
+ /* several times with the same "y" parameter in order to draw all */
+ /* callbacks.. */
+ /* */
+ /* Otherwise, the callback is only called once per scan-line, and */
+ /* only for those scanlines that do have "gray" pixels on them.. */
+ /* */
+ typedef void (*FT_Raster_Span_Func)( int y,
+ int count,
+ FT_Span* spans,
+ void* user );
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_BitTest_Func */
+ /* */
+ /* <Description> */
+ /* A function used as a call-back by the monochrome scan-converter */
+ /* to test wether a given target pixel is already set to the drawing */
+ /* "color". These tests are crucial to implement drop-out control */
+ /* per-se the TrueType spec.. */
+ /* */
+ /* <Input> */
+ /* y :: the pixel's y coordinate */
+ /* x :: the pixel's x coordinate */
+ /* user :: user-supplied data that is passed to the callback */
+ /* */
+ /* <Return> */
+ /* 1 if the pixel is "set", 0 otherwise */
+ /* */
+ typedef int (*FT_Raster_BitTest_Func)( int y,
+ int x,
+ void* user );
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_BitSet_Func */
+ /* */
+ /* <Description> */
+ /* A function used as a call-back by the monochrome scan-converter */
+ /* used to set an individual target pixel. This is crucial to */
+ /* implement drop-out control per-se the TrueType spec.. */
+ /* */
+ /* <Input> */
+ /* y :: the pixel's y coordinate */
+ /* x :: the pixel's x coordinate */
+ /* user :: user-supplied data that is passed to the callback */
+ /* */
+ /* <Return> */
+ /* 1 if the pixel is "set", 0 otherwise */
+ /* */
+ typedef void (*FT_Raster_BitSet_Func)( int y,
+ int x,
+ void* user );
+
+
+ /**************************************************************************
+ *
+ * <Enum>
+ * FT_Raster_Flag
+ *
+ * <Description>
+ * An enumeration used to list the bit flags used in the "flags"
+ * field of a FT_Raster_Params function.
+ *
+ * <Fields>
+ * ft_raster_flag_default :: this value is 0
+ *
+ * ft_raster_flag_aa :: resquests the rendering of an anti-aliased
+ * glyph bitmap. If unset, a monchrome bitmap
+ * will be rendered.
+ *
+ * ft_raster_flag_direct :: requests direct rendering over the target
+ * bitmap. Direct rendering uses user-provided
+ * callbacks in order to perform direct
+ * drawing or composition over an existing
+ * bitmap. If this bit is unset, the content
+ * of the target bitmap **must be zeroed** !
+ *
+ **************************************************************************/
+ typedef enum {
+
+ ft_raster_flag_default = 0,
+ ft_raster_flag_aa = 1,
+ ft_raster_flag_direct = 2
+
+ } FT_Raster_Flag;
+
+ /**************************************************************************
+ *
+ * <Struct>
+ * FT_Raster_Params
+ *
+ * <Description>
+ * A structure used to hold the arguments used by a raster's render
+ * function.
+ *
+ * <Fields>
+ * target :: the target bitmap
+ * source :: pointer to the source glyph image (e.g. a FT_Outline)
+ * flags :: rendering flags
+ * gray_spans :: gray span drawing callback
+ * black_spans :: black span drawing callback
+ * bit_test :: bit test callback
+ * bit_set :: bit set callback
+ * user :: user-supplied data that is passed to each drawing
+ * callback..
+ *
+ * <Note>
+ * An anti-aliased glyph bitmap is drawn if the ft_raster_flag_aa bit
+ * flag is set in the "flags" field, otherwise a monochrome bitmap will
+ * be generated.
+ *
+ * When the ft_raster_flag_direct bit flag is set in "flags", the raster
+ * will call the "gray_spans" callback to drawn gray pixel spans, in the
+ * case of an aa glyph bitmap, or "black_spans", "bit_test" and "bit_set"
+ * in the case of a monochrome bitmap.
+ *
+ * This allows direct composition over a pre-existing bitmap through
+ * user-provided callbacks to perform the span drawing/composition.
+ *
+ * Note that the "bit_test" and "bit_set" callbacks are required when
+ * rendering a monochrome bitmap, as they are crucial to implement correct
+ * drop-out control per-se the TrueType specification..
+ *
+ **************************************************************************/
+
+ typedef struct FT_Raster_Params_
+ {
+ FT_Bitmap* target;
+ void* source;
+ int flags;
+ FT_Raster_Span_Func gray_spans;
+ FT_Raster_Span_Func black_spans;
+ FT_Raster_BitTest_Func bit_test;
+ FT_Raster_BitSet_Func bit_set;
+ void* user;
+
+ } FT_Raster_Params;
+
+
+
+ /**************************************************************************
+ * <FuncType>
+ * FT_Raster_New_Func
+ *
+ * <Description>
+ * A function used to create a new raster object.
+ *
+ * <Input>
+ * memory :: handle to memory allocator.
+ *
+ * <Output>
+ * raster :: handle to new raster object
+ *
+ * <Return>
+ * Error code. 0 means success
+ *
+ * <Note>
+ * the "memory" parameter is a typeless pointer in order to avoid
+ * un-wanted dependencies on the rest of the FreeType code.
+ *
+ * in practice, it is a FT_Memory, i.e. a handle to the standard
+ * FreeType memory allocator. However, this field can be completely
+ * ignored by a given raster implementation..
+ *
+ **************************************************************************/
+
+ typedef int (*FT_Raster_New_Func)( void* memory,
+ FT_Raster *raster );
+
+
+ /**************************************************************************
+ * <FuncType>
+ * FT_Raster_Done_Func
+ *
+ * <Description>
+ * A function used to destroy a given raster object.
+ *
+ * <Input>
+ * raster :: handle to new raster object
+ *
+ **************************************************************************/
+
+ typedef void (*FT_Raster_Done_Func)( FT_Raster raster );
+
+
+
+ /**************************************************************************
+ *
+ * <FuncType>
+ * FT_Raster_Reset_Func
+ *
+ * <Description>
+ * FreeType provides an area of memory called the "render pool",
+ * available to all registered rasters. This pool can be freely
+ * used during a given scan-conversion but is shared by all rasters.
+ * Its content is thus transient.
+ *
+ * This function is called each time the render pool changes, or
+ * just after a new raster object is created.
+ *
+ * <Input>
+ * raster :: handle to new raster object
+ * pool_base :: address in memory of render pool
+ * pool_size :: size in bytes of render pool
+ *
+ * <Note>
+ * Rasters can ignore the render pool and rely on dynamic memory
+ * allocation if they want to (a handle to the memory allocator is
+ * passed to the raster constructor). However, this is not recommended
+ * for efficiency purposes..
+ *
+ **************************************************************************/
+
+ typedef void (*FT_Raster_Reset_Func)( FT_Raster raster,
+ const char* pool_base,
+ long pool_size );
+
+
+ /**************************************************************************
+ *
+ * <FuncType>
+ * FT_Raster_Set_Mode_Func
+ *
+ * <Description>
+ * This function is a generic facility to change modes or attributes
+ * in a given raster. This can be used for debugging purposes, or
+ * simply to allow implementation-specific "features" in a given
+ * raster module.
+ *
+ * <Input>
+ * raster :: handle to new raster object
+ * mode :: a 4-byte tag used to name the mode or property
+ * args :: a pointer to the new mode/property to use
+ *
+ **************************************************************************/
+
+ typedef int (*FT_Raster_Set_Mode_Func)( FT_Raster raster,
+ unsigned long mode,
+ void* args );
+
+ /**************************************************************************
+ *
+ * <FuncType>
+ * FT_Raster_Render_Func
+ *
+ * <Description>
+ * Invokes a given raster to scan-convert a given glyph image into
+ * a target bitmap.
+ *
+ * <Input>
+ * raster :: handle to raster object
+ * params :: pointer to a FT_Raster_Params structure used to store
+ * the rendering parameters.
+ *
+ * <Return>
+ * Error code. 0 means success
+ *
+ * <Note>
+ * The exact format of the source image depends on the raster's
+ * glyph format defined in its FT_Raster_Funcs structure. It can be
+ * an FT_Outline or anything else in order to support a large array
+ * of glyph formats.
+ *
+ * Note also that the render function can fail and return a
+ * FT_Err_Unimplemented_Feature error code when the raster used does
+ * not support direct composition.
+ *
+ * XXX: For now, the standard raster doesn't support direct composition
+ * but this should change for the final release (see the files
+ * demos/src/ftgrays.c and demos/src/ftgrays2.c for examples of
+ * distinct implementations which support direct composition).
+ *
+ **************************************************************************/
+
+ typedef int (*FT_Raster_Render_Func)( FT_Raster raster,
+ FT_Raster_Params* params );
+
+
+ /**************************************************************************
+ *
+ * <Struct>
+ * FT_Raster_Funcs
+ *
+ * <Description>
+ * A structure used to describe a given raster class to the library.
+ *
+ * <Fields>
+ * glyph_format :: the supported glyph format for this raster
+ * raster_new :: the raster constructor
+ * raster_reset :: used to reset the render pool within the raster
+ * raster_render :: renders a glyph into a given bitmap
+ * raster_done :: the raster destructor
+ *
+ **************************************************************************/
+
+
+ typedef struct FT_Raster_Funcs_
+ {
+ FT_Glyph_Format glyph_format;
+ FT_Raster_New_Func raster_new;
+ FT_Raster_Reset_Func raster_reset;
+ FT_Raster_Set_Mode_Func raster_set_mode;
+ FT_Raster_Render_Func raster_render;
+ FT_Raster_Done_Func raster_done;
+
+ } FT_Raster_Funcs;
+
+#endif /* FTIMAGE_H */
+
+
--- /dev/null
+++ b/include/freetype/ftraster.h
@@ -1,0 +1,50 @@
+/***************************************************************************/
+/* */
+/* ftraster.h */
+/* */
+/* The FreeType glyph rasterizer (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 FTRASTER_H
+#define FTRASTER_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* Uncomment the following line if you are using ftraster.c as a */
+ /* standalone module, fully independent of FreeType. */
+ /* */
+/* #define _STANDALONE_ */
+
+#include <freetype/freetype.h>
+
+#ifndef EXPORT_DEF
+#define EXPORT_DEF /* nothing */
+#endif
+
+ EXPORT_DEF
+ FT_Raster_Funcs ft_raster_funcs;
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* FTRASTER_H */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftsystem.h
@@ -1,0 +1,95 @@
+/**************************************************************************
+ *
+ * ftsystem.h 1.0
+ *
+ * FreeType low-level system interface definition
+ *
+ * This file contains the definitions of the stream and memory interfaces
+ * used by FreeType.
+ *
+ *
+ * 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.
+ *
+ **************************************************************************/
+
+#ifndef FTSYSTEM_H
+#define FTSYSTEM_H
+
+/*************************************************************************
+ *
+ * M E M O R Y M A N A G E M E N T
+ *
+ *************************************************************************/
+
+ typedef struct FT_MemoryRec_* FT_Memory;
+
+ typedef void* (*FT_Alloc_Func)( FT_Memory memory,
+ long size );
+
+ typedef void (*FT_Free_Func)( FT_Memory memory,
+ void* block );
+
+ typedef void* (*FT_Realloc_Func)( FT_Memory memory,
+ long cur_size,
+ long new_size,
+ void* block );
+
+ struct FT_MemoryRec_
+ {
+ void* user;
+ FT_Alloc_Func alloc;
+ FT_Free_Func free;
+ FT_Realloc_Func realloc;
+ };
+
+
+
+/*************************************************************************
+ *
+ * I / O M A N A G E M E N T
+ *
+ *************************************************************************/
+
+ typedef union FT_StreamDesc_
+ {
+ long value;
+ void* pointer;
+
+ } FT_StreamDesc;
+
+
+ typedef struct FT_StreamRec_* FT_Stream;
+
+ typedef unsigned long (*FT_Stream_IO)( FT_Stream stream,
+ unsigned long offset,
+ char* buffer,
+ unsigned long count );
+
+ typedef void (*FT_Stream_Close)( FT_Stream stream );
+
+ struct FT_StreamRec_
+ {
+ char* base;
+ unsigned long size;
+ unsigned long pos;
+
+ FT_StreamDesc descriptor;
+ FT_StreamDesc pathname; /* ignored by FreeType - useful for debugging */
+
+ FT_Stream_IO read;
+ FT_Stream_Close close;
+
+ FT_Memory memory;
+ char* cursor;
+ char* limit;
+ };
+
+
+#endif /* FTSYSTEM_H */
--- /dev/null
+++ b/include/freetype/internal/autohint.h
@@ -1,0 +1,200 @@
+/***************************************************************************/
+/* */
+/* 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/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 */
+
--- /dev/null
+++ b/include/freetype/internal/ftcalc.h
@@ -1,0 +1,114 @@
+/***************************************************************************/
+/* */
+/* ftcalc.h */
+/* */
+/* Arithmetic computations (specification). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef FTCALC_H
+#define FTCALC_H
+
+#include <freetype/freetype.h>
+#include <freetype/config/ftconfig.h> /* for LONG64 */
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+#ifdef LONG64
+
+
+ typedef INT64 FT_Int64;
+
+#define ADD_64( x, y, z ) z = (x) + (y)
+#define MUL_64( x, y, z ) z = (FT_Int64)(x) * (y)
+
+#define DIV_64( x, y ) ( (x) / (y) )
+
+#ifdef FT_CONFIG_OPTION_OLD_CALCS
+
+#define SQRT_64( z ) FT_Sqrt64( z )
+
+ 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 */
--- /dev/null
+++ b/include/freetype/internal/ftdebug.h
@@ -1,0 +1,205 @@
+/***************************************************************************/
+/* */
+/* 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 <freetype/config/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 */
--- /dev/null
+++ b/include/freetype/internal/ftdriver.h
@@ -1,0 +1,588 @@
+/***************************************************************************/
+/* */
+/* 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/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 */
--- /dev/null
+++ b/include/freetype/internal/ftextend.h
@@ -1,0 +1,167 @@
+/***************************************************************************/
+/* */
+/* ftextend.h */
+/* */
+/* FreeType extensions implementation (specification). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef FTEXTEND_H
+#define FTEXTEND_H
+
+#include <freetype/internal/ftobjs.h>
+
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+ /*************************************************************************/
+ /* */
+ /* The extensions don't need to be integrated at compile time into the */
+ /* engine, only at link time. */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Extension_Initializer */
+ /* */
+ /* <Description> */
+ /* Each new face object can have several extensions associated with */
+ /* it at creation time. This function is used to initialize given */
+ /* extension data for a given face. */
+ /* */
+ /* <InOut> */
+ /* ext :: A typeless pointer to the extension data. */
+ /* face :: A handle to the source face object the extension is */
+ /* associated with. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* In case of error, the initializer should not destroy the extension */
+ /* data, as the finalizer will get called later by the function's */
+ /* caller. */
+ /* */
+ typedef FT_Error (*FT_Extension_Initializer)( void* ext,
+ FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Extension_Finalizer */
+ /* */
+ /* <Description> */
+ /* Each new face object can have several extensions associated with */
+ /* it at creation time. This function is used to finalize given */
+ /* extension data for a given face; it occurs before the face object */
+ /* itself is finalized. */
+ /* */
+ /* <InOut> */
+ /* ext :: A typeless pointer to the extension data. */
+ /* face :: A handle to the source face object the extension is */
+ /* associated with. */
+ /* */
+ typedef void (*FT_Extension_Finalizer)( void* ext,
+ FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Extension_Class */
+ /* */
+ /* <Description> */
+ /* A simple structure used to describe a given extension to the */
+ /* FreeType base layer. An FT_Extension_Class is used as a parameter */
+ /* for FT_Register_Extension(). */
+ /* */
+ /* <Fields> */
+ /* id :: The extension's ID. This is a normal C string that */
+ /* is used to uniquely reference the extension's */
+ /* interface. */
+ /* size :: The size in bytes of the extension data that must be */
+ /* associated with each face object. */
+ /* init :: A pointer to the extension data's initializer. */
+ /* finalize :: A pointer to the extension data's finalizer. */
+ /* interface :: This pointer can be anything, but should usually */
+ /* point to a table of function pointers which implement */
+ /* the extension's interface. */
+ /* */
+ /* offset :: This field is set and used within the base layer and */
+ /* should be set to 0 when registering an extension */
+ /* through FT_Register_Extension(). It contains an */
+ /* offset within the face's extension block for the */
+ /* current extension's data. */
+ /* */
+ typedef struct FT_Extension_Class_
+ {
+ const char* id;
+ FT_ULong size;
+ FT_Extension_Initializer init;
+ FT_Extension_Finalizer finalize;
+ void* interface;
+
+ FT_ULong offset;
+
+ } FT_Extension_Class;
+
+
+ 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 */
--- /dev/null
+++ b/include/freetype/internal/ftlist.h
@@ -1,0 +1,116 @@
+/***************************************************************************/
+/* */
+/* ftlist.c */
+/* */
+/* Generic list support for FreeType (specification). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* This file implements functions relative to list processing. Its */
+ /* data structures are defined in `freetype.h'. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef FTLIST_H
+#define FTLIST_H
+
+#include <freetype/freetype.h>
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+ 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 */
--- /dev/null
+++ b/include/freetype/internal/ftobjs.h
@@ -1,0 +1,454 @@
+/***************************************************************************/
+/* */
+/* 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 <freetype/config/ftconfig.h>
+#include <freetype/ftsystem.h>
+#include <freetype/internal/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_) )
+
+ /* various useful types and definitions */
+
+ extern void FP_Panic( const char* message );
+
+ extern FT_Memory FP_New_Memory( void );
+
+
+
+
+
+ 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 */
--- /dev/null
+++ b/include/freetype/internal/ftoutln.h
@@ -1,0 +1,6 @@
+#ifndef FTOUTLN_H
+#define FTOUTLN_H
+
+#include <freetype/internal/ftobjs.h>
+
+#endif /* FTOUTLN_H */
--- /dev/null
+++ b/include/freetype/internal/ftstream.h
@@ -1,0 +1,285 @@
+#ifndef FTSTREAM_H
+#define FTSTREAM_H
+
+#include <freetype/internal/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 */
--- /dev/null
+++ b/include/freetype/internal/psnames.h
@@ -1,0 +1,214 @@
+/***************************************************************************/
+/* */
+/* psnames.h */
+/* */
+/* High-level interface for the "psnames" module (in charge of */
+/* various functions related to Postscript glyph names conversion) */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef PSNAMES_H
+#define PSNAMES_H
+
+#include <freetype/freetype.h>
+
+ /**************************************************************************
+ *
+ * <FuncType>
+ * PS_Unicode_Value_Func
+ *
+ * <Description>
+ * A function used to return the Unicode index corresponding to a
+ * given glyph name.
+ *
+ * <Input>
+ * glyph_name :: the glyph name
+ *
+ * <Return>
+ * The Unicode character index. 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 */
--- /dev/null
+++ b/include/freetype/internal/sfnt.h
@@ -1,0 +1,380 @@
+/***************************************************************************/
+/* */
+/* sfnt.h */
+/* */
+/* High-level `sfnt' driver interface (specification). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef SFNT_H
+#define SFNT_H
+
+#include <freetype/freetype.h>
+#include <freetype/internal/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 */
--- /dev/null
+++ b/include/freetype/internal/t1types.h
@@ -1,0 +1,398 @@
+/*******************************************************************
+ *
+ * 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 <freetype/t1tables.h>
+#include <freetype/internal/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 */
--- /dev/null
+++ b/include/freetype/internal/tterrors.h
@@ -1,0 +1,126 @@
+/***************************************************************************/
+/* */
+/* 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 */
--- /dev/null
+++ b/include/freetype/internal/tttypes.h
@@ -1,0 +1,2073 @@
+/***************************************************************************/
+/* */
+/* 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 <freetype/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 */
--- /dev/null
+++ b/include/freetype/t1tables.h
@@ -1,0 +1,218 @@
+/***************************************************************************/
+/* */
+/* t1tables.h */
+/* */
+/* Basic Type 1/Type 2 tables definitions and interface */
+/* */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef T1TABLES_H
+#define T1TABLES_H
+
+#include <freetype/freetype.h>
+
+ /* Note that we separate font data in T1_FontInfo and T1_Private structures */
+ /* in order to later support multiple master fonts.. */
+
+ /*************************************************************************
+ *
+ * <Struct>
+ * T1_FontInfo
+ *
+ * <Description>
+ * A structure used to model a Type1/Type2 FontInfo dictionary
+ * Note that for multiple-master fonts, each instance has its own
+ * FontInfo.
+ *
+ */
+
+ typedef struct T1_FontInfo
+ {
+ FT_String* version;
+ FT_String* notice;
+ FT_String* full_name;
+ FT_String* family_name;
+ FT_String* weight;
+ FT_Long italic_angle;
+ FT_Bool is_fixed_pitch;
+ FT_Short underline_position;
+ FT_UShort underline_thickness;
+
+ } T1_FontInfo;
+
+
+ /*************************************************************************
+ *
+ * <Struct>
+ * T1_Private
+ *
+ * <Description>
+ * A structure used to model a Type1/Type2 FontInfo dictionary
+ * Note that for multiple-master fonts, each instance has its own
+ * Private dict.
+ *
+ */
+
+ typedef struct T1_Private
+ {
+
+ FT_Int unique_id;
+ FT_Int lenIV;
+
+ FT_Byte num_blues;
+ FT_Byte num_other_blues;
+ FT_Byte num_family_blues;
+ FT_Byte num_family_other_blues;
+
+ FT_Short blue_values[14];
+ FT_Short other_blues[10];
+
+ FT_Short family_blues [14];
+ FT_Short family_other_blues[10];
+
+ FT_Fixed blue_scale;
+ FT_Int blue_shift;
+ FT_Int blue_fuzz;
+
+ FT_UShort standard_width;
+ FT_UShort standard_height;
+
+ FT_Byte num_snap_widths;
+ FT_Byte num_snap_heights;
+ FT_Bool force_bold;
+ FT_Bool round_stem_up;
+
+ FT_Short stem_snap_widths [13]; /* reserve one place for the std */
+ FT_Short stem_snap_heights[13]; /* reserve one place for the std */
+
+ FT_Long language_group;
+ FT_Long password;
+
+ FT_Short min_feature[2];
+
+ } T1_Private;
+
+
+ /*************************************************************************
+ *
+ * <Enum>
+ * T1_Blend_Flags
+ *
+ * <Description>
+ * A set of flags used to indicate which fields are present in a
+ * given blen dictionary (font info or private). Used to support
+ * multiple masters..
+ *
+ */
+ typedef enum
+ {
+ t1_blend_none = 0,
+
+ /* required fields in a FontInfo blend dictionary */
+ t1_blend_underline_position,
+ t1_blend_underline_thickness,
+ t1_blend_italic_angle,
+
+ /* required fields in a Private blend dictionary */
+ t1_blend_blue_values,
+ t1_blend_other_blues,
+ t1_blend_standard_width,
+ t1_blend_standard_height,
+ t1_blend_stem_snap_widths,
+ t1_blend_stem_snap_heights,
+ t1_blend_blue_scale,
+ t1_blend_blue_shift,
+ t1_blend_family_blues,
+ t1_blend_family_other_blues,
+ t1_blend_force_bold,
+
+ /* never remove */
+ t1_blend_max
+
+ } T1_Flags;
+
+
+ typedef struct T1_Blend_Pos
+ {
+ FT_Fixed min;
+ FT_Fixed max;
+
+ } T1_Blend_Pos;
+
+ /*************************************************************************
+ *
+ * <Struct>
+ * T1_Blend
+ *
+ * <Description>
+ * A structure used to describe the multiple-master fonts information
+ * of a given Type 1 font.
+ *
+ */
+ typedef struct T1_Blend_
+ {
+ FT_Int num_axis;
+ FT_String* axis_types[4];
+
+ /* XXXX : add /BlendDesignMap entries */
+
+ FT_Int num_blends;
+ T1_Flags* flags [17];
+ T1_Private* privates [17];
+ T1_FontInfo* fontinfos[17];
+
+ } T1_Blend;
+
+
+
+ typedef struct CID_FontDict_
+ {
+ T1_FontInfo font_info;
+ T1_Private private;
+
+ FT_UInt num_subrs;
+ FT_ULong subrmap_offset;
+ FT_Int sd_bytes;
+
+ } CID_FontDict;
+
+
+ typedef struct CID_Info_
+ {
+ FT_String* cid_font_name;
+ FT_Fixed cid_version;
+ FT_Int cid_font_type;
+
+ FT_String* registry;
+ FT_String* ordering;
+ FT_Int supplement;
+
+ FT_ULong uid_base;
+
+ FT_Int num_xuid;
+ FT_ULong xuid[16];
+
+
+ FT_ULong cidmap_offset;
+ FT_Int fd_bytes;
+ FT_Int gd_bytes;
+ FT_ULong cid_count;
+
+ FT_Int num_font_dicts;
+ CID_FontDict* font_dicts;
+
+ } CID_Info;
+
+
+
+#endif /* T1TABLES_H */
--- /dev/null
+++ b/include/freetype/ttnameid.h
@@ -1,0 +1,670 @@
+/*******************************************************************
+ *
+ * ttnameid.h
+ *
+ * TrueType Name ID definitions
+ *
+ * Copyright 1996-2000 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used
+ * modified and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ ******************************************************************/
+
+#ifndef TTNAMEID_H
+#define TTNAMEID_H
+
+/*
+ * possible values for the 'Platform' identifier code in the name
+ * records of the TTF "name" table
+ */
+
+#define TT_PLATFORM_APPLE_UNICODE 0
+#define TT_PLATFORM_MACINTOSH 1
+#define TT_PLATFORM_ISO 2 /* deprecated */
+#define TT_PLATFORM_MICROSOFT 3
+
+
+/*
+ * possible values of the platform specific encoding identifier field in
+ * the name records of the TTF "name" table when the 'Platform' identifier
+ * code is TT_PLATFORM_APPLE_UNICODE
+ */
+
+#define TT_APPLE_ID_DEFAULT 0
+#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
+#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
+#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
+
+
+/*
+ * possible values of the platform specific encoding identifier field in
+ * the name records of the TTF "name" table when the 'Platform' identifier
+ * code is TT_PLATFORM_MACINTOSH
+ */
+
+#define TT_MAC_ID_ROMAN 0
+#define TT_MAC_ID_JAPANESE 1
+#define TT_MAC_ID_TRADITIONAL_CHINESE 2
+#define TT_MAC_ID_KOREAN 3
+#define TT_MAC_ID_ARABIC 4
+#define TT_MAC_ID_HEBREW 5
+#define TT_MAC_ID_GREEK 6
+#define TT_MAC_ID_RUSSIAN 7
+#define TT_MAC_ID_RSYMBOL 8
+#define TT_MAC_ID_DEVANAGARI 9
+#define TT_MAC_ID_GURMUKHI 10
+#define TT_MAC_ID_GUJARATI 11
+#define TT_MAC_ID_ORIYA 12
+#define TT_MAC_ID_BENGALI 13
+#define TT_MAC_ID_TAMIL 14
+#define TT_MAC_ID_TELUGU 15
+#define TT_MAC_ID_KANNADA 16
+#define TT_MAC_ID_MALAYALAM 17
+#define TT_MAC_ID_SINHALESE 18
+#define TT_MAC_ID_BURMESE 19
+#define TT_MAC_ID_KHMER 20
+#define TT_MAC_ID_THAI 21
+#define TT_MAC_ID_LAOTIAN 22
+#define TT_MAC_ID_GEORGIAN 23
+#define TT_MAC_ID_ARMENIAN 24
+#define TT_MAC_ID_MALDIVIAN 25
+#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
+#define TT_MAC_ID_TIBETAN 26
+#define TT_MAC_ID_MONGOLIAN 27
+#define TT_MAC_ID_GEEZ 28
+#define TT_MAC_ID_SLAVIC 29
+#define TT_MAC_ID_VIETNAMESE 30
+#define TT_MAC_ID_SINDHI 31
+#define TT_MAC_ID_UNINTERP 32
+
+
+/*
+ * possible values of the platform specific encoding identifier field in
+ * the name records of the TTF "name" table when the 'Platform' identifier
+ * code is TT_PLATFORM_ISO
+ *
+ * This use is now deprecated
+ */
+
+#define TT_ISO_ID_7BIT_ASCII 0
+#define TT_ISO_ID_10646 1
+#define TT_ISO_ID_8859_1 2
+
+
+/*
+ * possible values of the platform specific encoding identifier field in
+ * the name records of the TTF "name" table when the 'Platform' identifier
+ * code is TT_PLATFORM_MICROSOFT
+ */
+
+#define TT_MS_ID_SYMBOL_CS 0
+#define TT_MS_ID_UNICODE_CS 1
+#define TT_MS_ID_SJIS 2
+#define TT_MS_ID_GB2312 3
+#define TT_MS_ID_BIG_5 4
+#define TT_MS_ID_WANSUNG 5
+#define TT_MS_ID_JOHAB 6
+
+
+
+/*
+ * possible values of the language identifier field in the name records of
+ * the TTF "name" table when the 'Platform' identifier code is
+ * TT_PLATFORM_MACINTOSH
+ *
+ * the canonical source for the Apple assigned Language ID's is at
+ * http://fonts.apple.com/TTRefMan/RM06/Chap6name.html
+ */
+
+#define TT_MAC_LANGID_ENGLISH 0
+#define TT_MAC_LANGID_FRENCH 1
+#define TT_MAC_LANGID_GERMAN 2
+#define TT_MAC_LANGID_ITALIAN 3
+#define TT_MAC_LANGID_DUTCH 4
+#define TT_MAC_LANGID_SWEDISH 5
+#define TT_MAC_LANGID_SPANISH 6
+#define TT_MAC_LANGID_DANISH 7
+#define TT_MAC_LANGID_PORTUGUESE 8
+#define TT_MAC_LANGID_NORWEGIAN 9
+#define TT_MAC_LANGID_HEBREW 10
+#define TT_MAC_LANGID_JAPANESE 11
+#define TT_MAC_LANGID_ARABIC 12
+#define TT_MAC_LANGID_FINNISH 13
+#define TT_MAC_LANGID_GREEK 14
+#define TT_MAC_LANGID_ICELANDIC 15
+#define TT_MAC_LANGID_MALTESE 16
+#define TT_MAC_LANGID_TURKISH 17
+#define TT_MAC_LANGID_CROATIAN 18
+#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19
+#define TT_MAC_LANGID_URDU 20
+#define TT_MAC_LANGID_HINDI 21
+#define TT_MAC_LANGID_THAI 22
+#define TT_MAC_LANGID_KOREAN 23
+#define TT_MAC_LANGID_LITHUANIAN 24
+#define TT_MAC_LANGID_POLISH 25
+#define TT_MAC_LANGID_HUNGARIAN 26
+#define TT_MAC_LANGID_ESTONIAN 27
+#define TT_MAC_LANGID_LETTISH 28
+#define TT_MAC_LANGID_SAAMISK 29
+#define TT_MAC_LANGID_FAEROESE 30
+#define TT_MAC_LANGID_FARSI 31
+#define TT_MAC_LANGID_RUSSIAN 32
+#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33
+#define TT_MAC_LANGID_FLEMISH 34
+#define TT_MAC_LANGID_IRISH 35
+#define TT_MAC_LANGID_ALBANIAN 36
+#define TT_MAC_LANGID_ROMANIAN 37
+#define TT_MAC_LANGID_CZECH 38
+#define TT_MAC_LANGID_SLOVAK 39
+#define TT_MAC_LANGID_SLOVENIAN 40
+#define TT_MAC_LANGID_YIDDISH 41
+#define TT_MAC_LANGID_SERBIAN 42
+#define TT_MAC_LANGID_MACEDONIAN 43
+#define TT_MAC_LANGID_BULGARIAN 44
+#define TT_MAC_LANGID_UKRAINIAN 45
+#define TT_MAC_LANGID_BYELORUSSIAN 46
+#define TT_MAC_LANGID_UZBEK 47
+#define TT_MAC_LANGID_KAZAKH 48
+#define TT_MAC_LANGID_AZERBAIJANI 49
+#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49
+#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50
+#define TT_MAC_LANGID_ARMENIAN 51
+#define TT_MAC_LANGID_GEORGIAN 52
+#define TT_MAC_LANGID_MOLDAVIAN 53
+#define TT_MAC_LANGID_KIRGHIZ 54
+#define TT_MAC_LANGID_TAJIKI 55
+#define TT_MAC_LANGID_TURKMEN 56
+#define TT_MAC_LANGID_MONGOLIAN 57
+#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57
+#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58
+#define TT_MAC_LANGID_PASHTO 59
+#define TT_MAC_LANGID_KURDISH 60
+#define TT_MAC_LANGID_KASHMIRI 61
+#define TT_MAC_LANGID_SINDHI 62
+#define TT_MAC_LANGID_TIBETAN 63
+#define TT_MAC_LANGID_NEPALI 64
+#define TT_MAC_LANGID_SANSKRIT 65
+#define TT_MAC_LANGID_MARATHI 66
+#define TT_MAC_LANGID_BENGALI 67
+#define TT_MAC_LANGID_ASSAMESE 68
+#define TT_MAC_LANGID_GUJARATI 69
+#define TT_MAC_LANGID_PUNJABI 70
+#define TT_MAC_LANGID_ORIYA 71
+#define TT_MAC_LANGID_MALAYALAM 72
+#define TT_MAC_LANGID_KANNADA 73
+#define TT_MAC_LANGID_TAMIL 74
+#define TT_MAC_LANGID_TELUGU 75
+#define TT_MAC_LANGID_SINHALESE 76
+#define TT_MAC_LANGID_BURMESE 77
+#define TT_MAC_LANGID_KHMER 78
+#define TT_MAC_LANGID_LAO 79
+#define TT_MAC_LANGID_VIETNAMESE 80
+#define TT_MAC_LANGID_INDONESIAN 81
+#define TT_MAC_LANGID_TAGALOG 82
+#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83
+#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84
+#define TT_MAC_LANGID_AMHARIC 85
+#define TT_MAC_LANGID_TIGRINYA 86
+#define TT_MAC_LANGID_GALLA 87
+#define TT_MAC_LANGID_SOMALI 88
+#define TT_MAC_LANGID_SWAHILI 89
+#define TT_MAC_LANGID_RUANDA 90
+#define TT_MAC_LANGID_RUNDI 91
+#define TT_MAC_LANGID_CHEWA 92
+#define TT_MAC_LANGID_MALAGASY 93
+#define TT_MAC_LANGID_ESPERANTO 94
+#define TT_MAC_LANGID_WELSH 128
+#define TT_MAC_LANGID_BASQUE 129
+#define TT_MAC_LANGID_CATALAN 130
+#define TT_MAC_LANGID_LATIN 131
+#define TT_MAC_LANGID_QUECHUA 132
+#define TT_MAC_LANGID_GUARANI 133
+#define TT_MAC_LANGID_AYMARA 134
+#define TT_MAC_LANGID_TATAR 135
+#define TT_MAC_LANGID_UIGHUR 136
+#define TT_MAC_LANGID_DZONGKHA 137
+#define TT_MAC_LANGID_JAVANESE 138
+#define TT_MAC_LANGID_SUNDANESE 139
+
+#if 0 /* these seem to be errors that have been dropped */
+#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
+#define TT_MAC_LANGID_IRISH_GAELIC 141
+#endif
+
+/* The following codes are new as of 2000-03-10 */
+#define TT_MAC_LANGID_GALICIAN 140
+#define TT_MAC_LANGID_AFRIKAANS 141
+#define TT_MAC_LANGID_BRETON 142
+#define TT_MAC_LANGID_INUKTITUT 143
+#define TT_MAC_LANGID_SCOTTISH_GAELIC 144
+#define TT_MAC_LANGID_MANX_GAELIC 145
+#define TT_MAC_LANGID_IRISH_GAELIC 146
+#define TT_MAC_LANGID_TONGAN 147
+#define TT_MAC_LANGID_GREEK_POLYTONIC 148
+#define TT_MAC_LANGID_GREELANDIC 149
+#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
+
+
+/*
+ * possible values of the language identifier field in the name records of
+ * the TTF "name" table when the 'Platform' identifier code is
+ * TT_PLATFORM_MICROSOFT
+ *
+ * the canonical source for the MS assigned LCID's is at
+ * http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt
+ */
+
+#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
+#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
+#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01
+#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
+#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
+#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
+#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01
+#define TT_MS_LANGID_ARABIC_OMAN 0x2001
+#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
+#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
+#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01
+#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
+#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
+#define TT_MS_LANGID_ARABIC_UAE 0x3801
+#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01
+#define TT_MS_LANGID_ARABIC_QATAR 0x4001
+#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
+#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
+#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
+#define TT_MS_LANGID_CHINESE_PRC 0x0804
+#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04
+#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
+#define TT_MS_LANGID_CHINESE_MACAU 0x1404
+#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
+#define TT_MS_LANGID_DANISH_DENMARK 0x0406
+#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
+#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
+#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07
+#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
+#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
+#define TT_MS_LANGID_GREEK_GREECE 0x0408
+#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
+#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
+#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09
+#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
+#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
+#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
+#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09
+#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
+#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
+#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
+#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09
+#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
+#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
+#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a
+#define TT_MS_LANGID_SPANISH_MEXICO 0x080a
+#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a
+#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a
+#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a
+#define TT_MS_LANGID_SPANISH_PANAMA 0x180a
+#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a
+#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a
+#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a
+#define TT_MS_LANGID_SPANISH_PERU 0x280a
+#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a
+#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a
+#define TT_MS_LANGID_SPANISH_CHILE 0x340a
+#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a
+#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a
+#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a
+#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a
+#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a
+#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a
+#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a
+#define TT_MS_LANGID_FINNISH_FINLAND 0x040b
+#define TT_MS_LANGID_FRENCH_FRANCE 0x040c
+#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c
+#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c
+#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c
+#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c
+#define TT_MS_LANGID_FRENCH_MONACO 0x180c
+#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
+#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
+#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f
+#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
+#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
+#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
+#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
+#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
+#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
+#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
+#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
+#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814
+#define TT_MS_LANGID_POLISH_POLAND 0x0415
+#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
+#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
+#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
+#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
+#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
+#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
+#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
+#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a
+#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a
+#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a
+#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b
+#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c
+#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d
+#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d
+#define TT_MS_LANGID_THAI_THAILAND 0x041e
+#define TT_MS_LANGID_TURKISH_TURKEY 0x041f
+#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
+#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
+#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
+#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
+#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
+#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
+#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
+#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
+#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
+#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0428
+#define TT_MS_LANGID_FARSI_IRAN 0x0429
+#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a
+#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b
+#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c
+#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c
+#define TT_MS_LANGID_BASQUE_SPAIN 0x042d
+#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e
+#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f
+#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
+#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
+#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
+#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
+#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
+#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
+#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
+#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
+#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
+#define TT_MS_LANGID_HINDI_INDIA 0x0439
+#define TT_MS_LANGID_MALTESE_MALTA 0x043a
+#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b
+#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
+#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
+#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e
+#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
+#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
+#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
+#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
+#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
+#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
+#define TT_MS_LANGID_BENGALI_INDIA 0x0445
+#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
+#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
+#define TT_MS_LANGID_ORIYA_INDIA 0x0448
+#define TT_MS_LANGID_TAMIL_INDIA 0x0449
+#define TT_MS_LANGID_TELUGU_INDIA 0x044a
+#define TT_MS_LANGID_KANNADA_INDIA 0x044b
+#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c
+#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d
+#define TT_MS_LANGID_MARATHI_INDIA 0x044e
+#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f
+#define TT_MS_LANGID_KONKANI_INDIA 0x0457
+
+
+/*
+ * possible values of the 'Name' identifier field in the name records of
+ * the TTF "name" table. These values are platform independent.
+ */
+
+#define TT_NAME_ID_COPYRIGHT 0
+#define TT_NAME_ID_FONT_FAMILY 1
+#define TT_NAME_ID_FONT_SUBFAMILY 2
+#define TT_NAME_ID_UNIQUE_ID 3
+#define TT_NAME_ID_FULL_NAME 4
+#define TT_NAME_ID_VERSION_STRING 5
+#define TT_NAME_ID_PS_NAME 6
+#define TT_NAME_ID_TRADEMARK 7
+/* the following values are from the OpenType spec */
+#define TT_NAME_ID_MANUFACTURER 8
+#define TT_NAME_ID_DESIGNER 9
+#define TT_NAME_ID_DESCRIPTION 10
+#define TT_NAME_ID_VENDOR_URL 11
+#define TT_NAME_ID_DESIGNER_URL 12
+#define TT_NAME_ID_LICENSE 13
+#define TT_NAME_ID_LICENSE_URL 14
+/* number 15 is reserved */
+#define TT_NAME_ID_PREFERRED_FAMILY 16
+#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
+#define TT_NAME_ID_MAC_FULL_NAME 18
+/* The following code is new as of 2000-01-21 */
+#define TT_NAME_ID_SAMPLE_TEXT 19
+
+
+/*
+ * Bit Mask values for the Unicode Ranges from the TTF "OS2 " table.
+ */
+
+/* General Scripts Area */
+
+/* Bit 0 C0 Controls and Basic Latin */
+#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0000-U+007F */
+/* Bit 1 C1 Controls and Latin-1 Supplement */
+#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
+/* Bit 2 Latin Extended-A */
+#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
+/* Bit 3 Latin Extended-B */
+#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
+/* Bit 4 IPA Extensions */
+#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
+/* Bit 5 Spacing Modifier Letters */
+#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
+/* Bit 6 Combining Diacritical Marks */
+#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
+/* Bit 7 Greek */
+#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
+/* Bit 8 is reserved (was: Greek Symbols and Coptic) */
+/* Bit 9 Cyrillic */
+#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
+/* Bit 10 Armenian */
+#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
+/* Bit 11 Hebrew */
+#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
+/* Bit 12 is reserved (was: Hebrew Extended) */
+/* Bit 13 Arabic */
+#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
+/* Bit 14 is reserved (was: Arabic Extended) */
+/* Bit 15 Devanagari */
+#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
+/* Bit 16 Bengali */
+#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
+/* Bit 17 Gurmukhi */
+#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
+/* Bit 18 Gujarati */
+#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
+/* Bit 19 Oriya */
+#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
+/* Bit 20 Tamil */
+#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
+/* Bit 21 Telugu */
+#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
+/* Bit 22 Kannada */
+#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
+/* Bit 23 Malayalam */
+#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
+/* Bit 24 Thai */
+#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
+/* Bit 25 Lao */
+#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
+/* Bit 26 Georgian */
+#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
+/* Bit 27 is reserved (was Georgian Extended) */
+/* Bit 28 Hangul Jamo */
+#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
+/* Bit 29 Latin Extended Additional */
+#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
+/* Bit 30 Greek Extended */
+#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
+
+/* Symbols Area */
+
+/* Bit 31 General Punctuation */
+#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
+/* Bit 32 Superscripts And Subscripts */
+#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
+/* Bit 33 Currency Symbols */
+#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
+/* Bit 34 Combining Diacritical Marks For Symbols */
+#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
+/* Bit 35 Letterlike Symbols */
+#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
+/* Bit 36 Number Forms */
+#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
+/* Bit 37 Arrows */
+#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
+/* Bit 38 Mathematical Operators */
+#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
+/* Bit 39 Miscellaneous Technical */
+#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
+/* Bit 40 Control Pictures */
+#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
+/* Bit 41 Optical Character Recognition */
+#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
+/* Bit 42 Enclosed Alphanumerics */
+#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
+/* Bit 43 Box Drawing */
+#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
+/* Bit 44 Block Elements */
+#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
+/* Bit 45 Geometric Shapes */
+#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
+/* Bit 46 Miscellaneous Symbols */
+#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
+/* Bit 47 Dingbats */
+#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
+
+/* CJK Phonetics and Symbols Area */
+
+/* Bit 48 CJK Symbols And Punctuation */
+#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
+/* Bit 49 Hiragana */
+#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
+/* Bit 50 Katakana */
+#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
+/* Bit 51 Bopomofo */
+#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
+/* Bit 52 Hangul Compatibility Jamo */
+#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
+/* Bit 53 CJK Miscellaneous */
+#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */
+/* Bit 54 Enclosed CJK Letters And Months */
+#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
+/* Bit 55 CJK Compatibility */
+#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
+
+/* Hangul Syllables Area */
+
+/* Bit 56 Hangul */
+#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
+
+/* Surrogates Area */
+
+/* Bit 57 Surrogates */
+#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DFFF */
+/* Bit 58 is reserved for Unicode SubRanges */
+
+/* CJK Ideographs Area */
+
+/* Bit 59 CJK Unified Ideographs */
+#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
+
+/* Private Use Area */
+
+/* Bit 60 Private Use */
+#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
+
+/* Compatibility Area and Specials */
+
+/* Bit 61 CJK Compatibility Ideographs */
+#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */
+/* Bit 62 Alphabetic Presentation Forms */
+#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
+/* Bit 63 Arabic Presentation Forms-A */
+#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FSFF */
+/* Bit 64 Combining Half Marks */
+#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
+/* Bit 65 CJK Compatibility Forms */
+#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */
+/* Bit 66 Small Form Variants */
+#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
+/* Bit 67 Arabic Presentation Forms-B */
+#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFF */
+/* Bit 68 Halfwidth And Fullwidth Forms */
+#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
+/* Bit 69 Specials */
+#define TT_UCR_SPECIALS (1L << 5) /* U+FEFF,
+ U+FFF0-U+FFFF */
+/* Bit 70 Tibetan */
+#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FBF */
+/* Bit 71 Syriac */
+#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
+/* Bit 72 Thaana */
+#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
+/* Bit 73 Sinhala */
+#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
+/* Bit 74 Myanmar */
+#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
+/* Bit 75 Ethiopic */
+#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+12BF */
+/* Bit 76 Cherokee */
+#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
+/* Bit 77 Canadian Aboriginal Syllabics */
+#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+14DF */
+/* Bit 78 Ogham */
+#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
+/* Bit 79 Runic */
+#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
+/* Bit 80 Khmer */
+#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
+/* Bit 81 Mongolian */
+#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
+/* Bit 82 Braille */
+#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
+/* Bit 83 Yi */
+#define TT_UCR_YI (1L << 19) /* U+A000-U+A4CF */
+
+
+/* Some compilers have a very limited length of identifiers. */
+#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
+#define HAVE_LIMIT_ON_IDENTS
+#endif
+
+#ifndef HAVE_LIMIT_ON_IDENTS
+
+/*
+ * Here some alias #defines in order to be clearer.
+ *
+ * These are not always #defined to stay within the 31 character limit
+ * which some compilers have.
+ *
+ * Credits go to Dave Hoo <[email protected]> for pointing out that modern
+ * Borland compilers (read: from BC++ 3.1 on) can increase this limit.
+ * If you get a warning with such a compiler, use the -i40 switch.
+ */
+
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
+ TT_UCR_ARABIC_PRESENTATIONS_A
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
+ TT_UCR_ARABIC_PRESENTATIONS_B
+
+#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
+ TT_UCR_COMBINING_DIACRITICS
+#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
+ TT_UCR_COMBINING_DIACRITICS_SYMB
+
+#endif /* ndef HAVE_LIMIT_ON_IDENTS */
+
+#endif /* TTNAMEID_H */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/tttables.h
@@ -1,0 +1,534 @@
+/***************************************************************************/
+/* */
+/* tttables.h */
+/* */
+/* Basic SFNT/TrueType tables definitions and interface */
+/* */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+#ifndef TTTABLES_H
+#define TTTABLES_H
+
+#include <freetype/freetype.h>
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_Header */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType font header table. All */
+ /* fields follow the TrueType specification. */
+ /* */
+ typedef struct TT_Header_
+ {
+ FT_Fixed Table_Version;
+ FT_Fixed Font_Revision;
+
+ FT_Long CheckSum_Adjust;
+ FT_Long Magic_Number;
+
+ FT_UShort Flags;
+ FT_UShort Units_Per_EM;
+
+ FT_Long Created [2];
+ FT_Long Modified[2];
+
+ FT_Short xMin;
+ FT_Short yMin;
+ FT_Short xMax;
+ FT_Short yMax;
+
+ FT_UShort Mac_Style;
+ FT_UShort Lowest_Rec_PPEM;
+
+ FT_Short Font_Direction;
+ FT_Short Index_To_Loc_Format;
+ FT_Short Glyph_Data_Format;
+
+ } TT_Header;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_HoriHeader */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType horizontal header, the `hhea' */
+ /* table, as well as the corresponding horizontal metrics table, */
+ /* i.e., the `hmtx' table. */
+ /* */
+ /* <Fields> */
+ /* Version :: The table version. */
+ /* */
+ /* Ascender :: The font's ascender, i.e., the distance */
+ /* from the baseline to the top-most of all */
+ /* glyph points found in the font. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of the */
+ /* glyphs found in the font (maybe ASCII). */
+ /* */
+ /* You should use the `sTypoAscender' field */
+ /* of the OS/2 table instead if you want */
+ /* the correct one. */
+ /* */
+ /* Descender :: The font's descender, i.e., the distance */
+ /* from the baseline to the bottom-most of */
+ /* all glyph points found in the font. It */
+ /* is negative. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of the */
+ /* glyphs found in the font (maybe ASCII). */
+ /* */
+ /* You should use the `sTypoDescender' */
+ /* field of the OS/2 table instead if you */
+ /* want the correct one. */
+ /* */
+ /* Line_Gap :: The font's line gap, i.e., the distance */
+ /* to add to the ascender and descender to */
+ /* get the BTB, i.e., the */
+ /* baseline-to-baseline distance for the */
+ /* font. */
+ /* */
+ /* advance_Width_Max :: This field is the maximum of all advance */
+ /* widths found in the font. It can be */
+ /* used to compute the maximum width of an */
+ /* arbitrary string of text. */
+ /* */
+ /* min_Left_Side_Bearing :: The minimum left side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* min_Right_Side_Bearing :: The minimum right side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* xMax_Extent :: The maximum horizontal extent (i.e., the */
+ /* `width' of a glyph's bounding box) for */
+ /* all glyphs in the font. */
+ /* */
+ /* caret_Slope_Rise :: The rise coefficient of the cursor's */
+ /* slope of the cursor (slope=rise/run). */
+ /* */
+ /* caret_Slope_Run :: The run coefficient of the cursor's */
+ /* slope. */
+ /* */
+ /* Reserved :: 10 reserved bytes. */
+ /* */
+ /* metric_Data_Format :: Always 0. */
+ /* */
+ /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
+ /* table -- this value can be smaller than */
+ /* the total number of glyphs in the font. */
+ /* */
+ /* long_metrics :: A pointer into the `hmtx' table. */
+ /* */
+ /* short_metrics :: A pointer into the `hmtx' table. */
+ /* */
+ /* <Note> */
+ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+ /* be identical except for the names of their fields which */
+ /* are different. */
+ /* */
+ /* This ensures that a single function in the `ttload' */
+ /* module is able to read both the horizontal and vertical */
+ /* headers. */
+ /* */
+ typedef struct TT_HoriHeader_
+ {
+ FT_Fixed Version;
+ FT_Short Ascender;
+ FT_Short Descender;
+ FT_Short Line_Gap;
+
+ FT_UShort advance_Width_Max; /* advance width maximum */
+
+ FT_Short min_Left_Side_Bearing; /* minimum left-sb */
+ FT_Short min_Right_Side_Bearing; /* minimum right-sb */
+ FT_Short xMax_Extent; /* xmax extents */
+ FT_Short caret_Slope_Rise;
+ FT_Short caret_Slope_Run;
+ FT_Short caret_Offset;
+
+ FT_Short Reserved[4];
+
+ FT_Short metric_Data_Format;
+ FT_UShort number_Of_HMetrics;
+
+ /* The following fields are not defined by the TrueType specification */
+ /* but they're used to connect the metrics header to the relevant */
+ /* `HMTX' table. */
+
+ void* long_metrics;
+ void* short_metrics;
+
+ } TT_HoriHeader;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_VertHeader */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType vertical header, the `vhea' */
+ /* table, as well as the corresponding vertical metrics table, i.e., */
+ /* the `vmtx' table. */
+ /* */
+ /* <Fields> */
+ /* Version :: The table version. */
+ /* */
+ /* Ascender :: The font's ascender, i.e., the distance */
+ /* from the baseline to the top-most of */
+ /* all glyph points found in the font. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of */
+ /* the glyphs found in the font (maybe */
+ /* ASCII). */
+ /* */
+ /* You should use the `sTypoAscender' */
+ /* field of the OS/2 table instead if you */
+ /* want the correct one. */
+ /* */
+ /* Descender :: The font's descender, i.e., the */
+ /* distance from the baseline to the */
+ /* bottom-most of all glyph points found */
+ /* in the font. It is negative. */
+ /* */
+ /* This value is invalid in many fonts, as */
+ /* it is usually set by the font designer, */
+ /* and often reflects only a portion of */
+ /* the glyphs found in the font (maybe */
+ /* ASCII). */
+ /* */
+ /* You should use the `sTypoDescender' */
+ /* field of the OS/2 table instead if you */
+ /* want the correct one. */
+ /* */
+ /* Line_Gap :: The font's line gap, i.e., the distance */
+ /* to add to the ascender and descender to */
+ /* get the BTB, i.e., the */
+ /* baseline-to-baseline distance for the */
+ /* font. */
+ /* */
+ /* advance_Height_Max :: This field is the maximum of all */
+ /* advance heights found in the font. It */
+ /* can be used to compute the maximum */
+ /* height of an arbitrary string of text. */
+ /* */
+ /* min_Top_Side_Bearing :: The minimum top side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
+ /* glyphs within the font. */
+ /* */
+ /* yMax_Extent :: The maximum vertical extent (i.e., the */
+ /* `height' of a glyph's bounding box) for */
+ /* all glyphs in the font. */
+ /* */
+ /* caret_Slope_Rise :: The rise coefficient of the cursor's */
+ /* slope of the cursor (slope=rise/run). */
+ /* */
+ /* caret_Slope_Run :: The run coefficient of the cursor's */
+ /* slope. */
+ /* */
+ /* Reserved :: 10 reserved bytes. */
+ /* */
+ /* metric_Data_Format :: Always 0. */
+ /* */
+ /* number_Of_HMetrics :: Number of VMetrics entries in the */
+ /* `vmtx' table -- this value can be */
+ /* smaller than the total number of glyphs */
+ /* in the font. */
+ /* */
+ /* long_metrics :: A pointer into the `vmtx' table. */
+ /* */
+ /* short_metrics :: A pointer into the `vmtx' table. */
+ /* */
+ /* <Note> */
+ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
+ /* be identical except for the names of their fields which */
+ /* are different. */
+ /* */
+ /* This ensures that a single function in the `ttload' */
+ /* module is able to read both the horizontal and vertical */
+ /* headers. */
+ /* */
+ typedef struct TT_VertHeader_
+ {
+ FT_Fixed Version;
+ FT_Short Ascender;
+ FT_Short Descender;
+ FT_Short Line_Gap;
+
+ FT_UShort advance_Height_Max; /* advance height maximum */
+
+ FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
+ FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
+ FT_Short yMax_Extent; /* xmax or ymax extents */
+ FT_Short caret_Slope_Rise;
+ FT_Short caret_Slope_Run;
+ FT_Short caret_Offset;
+
+ FT_Short Reserved[4];
+
+ FT_Short metric_Data_Format;
+ FT_UShort number_Of_VMetrics;
+
+ /* The following fields are not defined by the TrueType specification */
+ /* but they're used to connect the metrics header to the relevant */
+ /* `HMTX' or `VMTX' table. */
+
+ void* long_metrics;
+ void* short_metrics;
+
+ } TT_VertHeader;
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_OS2 */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType OS/2 table. This is the long */
+ /* table version. All fields comply to the TrueType specification. */
+ /* */
+ /* Note that we now support old Mac fonts which do not include an */
+ /* OS/2 table. In this case, the `version' field is always set to */
+ /* 0xFFFF. */
+ /* */
+ typedef struct TT_OS2_
+ {
+ FT_UShort version; /* 0x0001 - more or 0xFFFF */
+ FT_Short xAvgCharWidth;
+ FT_UShort usWeightClass;
+ FT_UShort usWidthClass;
+ FT_Short fsType;
+ FT_Short ySubscriptXSize;
+ FT_Short ySubscriptYSize;
+ FT_Short ySubscriptXOffset;
+ FT_Short ySubscriptYOffset;
+ FT_Short ySuperscriptXSize;
+ FT_Short ySuperscriptYSize;
+ FT_Short ySuperscriptXOffset;
+ FT_Short ySuperscriptYOffset;
+ FT_Short yStrikeoutSize;
+ FT_Short yStrikeoutPosition;
+ FT_Short sFamilyClass;
+
+ FT_Byte panose[10];
+
+ FT_ULong ulUnicodeRange1; /* Bits 0-31 */
+ FT_ULong ulUnicodeRange2; /* Bits 32-63 */
+ FT_ULong ulUnicodeRange3; /* Bits 64-95 */
+ FT_ULong ulUnicodeRange4; /* Bits 96-127 */
+
+ FT_Char achVendID[4];
+
+ FT_UShort fsSelection;
+ FT_UShort usFirstCharIndex;
+ FT_UShort usLastCharIndex;
+ FT_Short sTypoAscender;
+ FT_Short sTypoDescender;
+ FT_Short sTypoLineGap;
+ FT_UShort usWinAscent;
+ FT_UShort usWinDescent;
+
+ /* only version 1 tables: */
+
+ FT_ULong ulCodePageRange1; /* Bits 0-31 */
+ FT_ULong ulCodePageRange2; /* Bits 32-63 */
+
+ /* only version 2 tables */
+ FT_Short sxHeight;
+ FT_Short sCapHeight;
+ FT_UShort usDefaultChar;
+ FT_UShort usBreakChar;
+ FT_UShort usMaxContext;
+
+ } TT_OS2;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_Postscript */
+ /* */
+ /* <Description> */
+ /* A structure used to model a TrueType Postscript table. All fields */
+ /* comply to the TrueType table. This structure does not reference */
+ /* the Postscript glyph names, which can be nevertheless accessed */
+ /* with the `ttpost' module. */
+ /* */
+ typedef struct TT_Postscript_
+ {
+ FT_Fixed FormatType;
+ FT_Fixed italicAngle;
+ FT_Short underlinePosition;
+ FT_Short underlineThickness;
+ FT_ULong isFixedPitch;
+ FT_ULong minMemType42;
+ FT_ULong maxMemType42;
+ FT_ULong minMemType1;
+ FT_ULong maxMemType1;
+
+ /* Glyph names follow in the file, but we don't */
+ /* load them by default. See the ttpost.c file. */
+
+ } TT_Postscript;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* TT_MaxProfile */
+ /* */
+ /* <Description> */
+ /* The maximum profile is a table containing many max values which */
+ /* can be used to pre-allocate arrays. This ensures that no memory */
+ /* allocation occurs during a glyph load. */
+ /* */
+ /* <Fields> */
+ /* version :: The version number. */
+ /* */
+ /* numGlyphs :: The number of glyphs in this TrueType */
+ /* font. */
+ /* */
+ /* maxPoints :: The maximum number of points in a */
+ /* non-composite TrueType glyph. See also */
+ /* the structure element */
+ /* `maxCompositePoints'. */
+ /* */
+ /* maxContours :: The maximum number of contours in a */
+ /* non-composite TrueType glyph. See also */
+ /* the structure element */
+ /* `maxCompositeContours'. */
+ /* */
+ /* maxCompositePoints :: The maximum number of points in a */
+ /* composite TrueType glyph. See also the */
+ /* structure element `maxPoints'. */
+ /* */
+ /* maxCompositeContours :: The maximum number of contours in a */
+ /* composite TrueType glyph. See also the */
+ /* structure element `maxContours'. */
+ /* */
+ /* maxZones :: The maximum number of zones used for */
+ /* glyph hinting. */
+ /* */
+ /* maxTwilightPoints :: The maximum number of points in the */
+ /* twilight zone used for glyph hinting. */
+ /* */
+ /* maxStorage :: The maximum number of elements in the */
+ /* storage area used for glyph hinting. */
+ /* */
+ /* maxFunctionDefs :: The maximum number of function */
+ /* definitions in the TrueType bytecode for */
+ /* this font. */
+ /* */
+ /* maxInstructionDefs :: The maximum number of instruction */
+ /* definitions in the TrueType bytecode for */
+ /* this font. */
+ /* */
+ /* maxStackElements :: The maximum number of stack elements used */
+ /* during bytecode interpretation. */
+ /* */
+ /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
+ /* used for glyph hinting. */
+ /* */
+ /* maxComponentElements :: An obscure value related to composite */
+ /* glyphs definitions. */
+ /* */
+ /* maxComponentDepth :: An obscure value related to composite */
+ /* glyphs definitions. Probably the maximum */
+ /* number of simple glyphs in a composite. */
+ /* */
+ /* <Note> */
+ /* This structure is only used during font loading. */
+ /* */
+ typedef struct TT_MaxProfile_
+ {
+ FT_Fixed version;
+ FT_UShort numGlyphs;
+ FT_UShort maxPoints;
+ FT_UShort maxContours;
+ FT_UShort maxCompositePoints;
+ FT_UShort maxCompositeContours;
+ FT_UShort maxZones;
+ FT_UShort maxTwilightPoints;
+ FT_UShort maxStorage;
+ FT_UShort maxFunctionDefs;
+ FT_UShort maxInstructionDefs;
+ FT_UShort maxStackElements;
+ FT_UShort maxSizeOfInstructions;
+ FT_UShort maxComponentElements;
+ FT_UShort maxComponentDepth;
+
+ } TT_MaxProfile;
+
+
+
+
+ typedef enum
+ {
+ ft_sfnt_head = 0,
+ ft_sfnt_maxp = 1,
+ ft_sfnt_os2 = 2,
+ ft_sfnt_hhea = 3,
+ ft_sfnt_vhea = 4,
+ ft_sfnt_post = 5,
+
+ sfnt_max /* don't remove */
+
+ } FT_Sfnt_Tag;
+
+ /* internal use only */
+ typedef void* (*FT_Get_Sfnt_Table_Func)( FT_Face face, FT_Sfnt_Tag tag );
+
+ /***************************************************************************
+ *
+ * <Function>
+ * FT_Get_Sfnt_Table
+ *
+ * <Description>
+ * Returns a pointer to a given SFNT table within a face.
+ *
+ * <Input>
+ * face :: handle to source
+ * tag :: index if SFNT table
+ *
+ * <Return>
+ * type-less pointer to the table. This will be 0 in case of error, or
+ * when the corresponding table was not found *OR* loaded from the file.
+ *
+ * <Note>
+ * The table is owned by the face object, and disappears with it.
+ *
+ * This function is only useful to access Sfnt tables that are loaded
+ * by the sfnt/truetype/opentype drivers. See FT_Sfnt_tag for a list.
+ *
+ * You can load any table with a different function.. XXX
+ *
+ ***************************************************************************/
+
+ EXPORT_DEF
+ void* FT_Get_Sfnt_Table( FT_Face face,
+ FT_Sfnt_Tag tag );
+
+
+#endif /* TTTABLES_H */
+
--- /dev/null
+++ b/include/freetype/tttags.h
@@ -1,0 +1,60 @@
+/***************************************************************************/
+/* */
+/* tttags.h */
+/* */
+/* Tags for TrueType tables (specification only). */
+/* */
+/* Copyright 1996-2000 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef TTAGS_H
+#define TTAGS_H
+
+
+#include <freetype/freetype.h> /* for MAKE_TT_TAG() */
+
+
+#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
+#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
+#define TTAG_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 */
--- a/include/ftbbox.h
+++ /dev/null
@@ -1,73 +1,0 @@
-/***************************************************************************/
-/* */
-/* ftbbox.h */
-/* */
-/* FreeType bbox computation (specification). */
-/* */
-/* Copyright 1996-2000 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used */
-/* modified and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* This component has a _single_ role: to compute exact outline bounding */
- /* boxes. */
- /* */
- /* It is separated from the rest of the engine for various technical */
- /* reasons. It may well be integrated in `ftoutln' later. */
- /* */
- /*************************************************************************/
-
-
-#ifndef FTBBOX_H
-#define FTBBOX_H
-
-#include <freetype.h>
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Raster_GetBBox */
- /* */
- /* <Description> */
- /* Computes the exact bounding box of an outline. This is slower */
- /* than computing the control box. However, it uses an advanced */
- /* algorithm which returns _very_ quickly when the two boxes */
- /* coincide. Otherwise, the outline Bezier arcs are walked over to */
- /* extract their extrema. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline. */
- /* */
- /* <Output> */
- /* bbox :: The outline's exact bounding box. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- EXPORT_DEF
- FT_Error FT_Raster_GetBBox( FT_Outline* outline,
- FT_BBox* abbox );
-
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* FTBBOX_H */
-
-
-/* END */
--- a/include/fterrors.h
+++ /dev/null
@@ -1,82 +1,0 @@
-/***************************************************************************/
-/* */
-/* fterrors.h */
-/* */
-/* FreeType error codes (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. */
-/* */
-/***************************************************************************/
-
-
-#define FT_Err_Ok 0x000
-
-#define FT_Err_Cannot_Open_Resource 0x001
-#define FT_Err_Unknown_File_Format 0x002
-#define FT_Err_Invalid_File_Format 0x002
-
-#define FT_Err_Invalid_Argument 0x003
-#define FT_Err_Invalid_Handle 0x004
-#define FT_Err_Invalid_Glyph_Index 0x00A
-#define FT_Err_Invalid_Character_Code 0x00B
-
-#define FT_Err_Unimplemented_Feature 0x010
-#define FT_Err_Invalid_Glyph_Format 0x00D
-
-#define FT_Err_Invalid_Library_Handle 0x004
-#define FT_Err_Invalid_Driver_Handle 0x005
-#define FT_Err_Invalid_Face_Handle 0x006
-#define FT_Err_Invalid_Size_Handle 0x007
-#define FT_Err_Invalid_Slot_Handle 0x008
-#define FT_Err_Invalid_CharMap_Handle 0x009
-#define FT_Err_Invalid_Outline 0x00B
-#define FT_Err_Invalid_Dimensions 0x00C
-
-#define FT_Err_Unavailable_Outline 0x011
-#define FT_Err_Unavailable_Bitmap 0x012
-#define FT_Err_Unavailable_Pixmap 0x013
-#define FT_Err_File_Is_Not_Collection 0x014
-#define FT_Err_Too_Many_Drivers 0x015
-#define FT_Err_Too_Many_Glyph_Formats 0x016
-#define FT_Err_Too_Many_Extensions 0x017
-
-#define FT_Err_Out_Of_Memory 0x100
-#define FT_Err_Unlisted_Object 0x101
-
-#define FT_Err_Invalid_Resource_Handle 0x200
-#define FT_Err_Invalid_Stream_Handle 0x201
-#define FT_Err_Cannot_Open_Stream 0x202
-#define FT_Err_Invalid_Stream_Seek 0x203
-#define FT_Err_Invalid_Stream_Skip 0x204
-#define FT_Err_Invalid_Stream_Read 0x205
-#define FT_Err_Invalid_Stream_Operation 0x206
-#define FT_Err_Invalid_Frame_Operation 0x207
-#define FT_Err_Nested_Frame_Access 0x208
-#define FT_Err_Invalid_Frame_Read 0x209
-
-#define FT_Err_Too_Many_Points 0x300
-#define FT_Err_Too_Many_Contours 0x301
-#define FT_Err_Invalid_Composite 0x302
-#define FT_Err_Too_Many_Hints 0x303
-#define FT_Err_Too_Many_Edges 0x304
-#define FT_Err_Too_Many_Strokes 0x305
-
-/* range 0x400 - 0x4FF is reserved for TrueType specific stuff */
-
-/* range 0x500 - 0x5FF is reserved for TrueDoc specific stuff */
-
-/* range 0x600 - 0x6FF is reserved for Type1 specific stuff */
-
-#define FT_Err_Raster_Uninitialized 0xF00
-#define FT_Err_Raster_Corrupted 0xF01
-#define FT_Err_Raster_Overflow 0xF02
-
-
-/* END */
--- a/include/ftglyph.h
+++ /dev/null
@@ -1,320 +1,0 @@
-/***************************************************************************/
-/* */
-/* ftglyph.h */
-/* */
-/* FreeType convenience functions to handle glyphs.. */
-/* */
-/* 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 several convenience functions */
-/* that can be used by client applications to easily retrieve glyph */
-/* bitmaps and outlines from a given face. */
-/* */
-/* These functions should be optional if you're writing a font server */
-/* or text layout engine on top of FreeType. However, they are pretty */
-/* handy for many other simple uses of the library.. */
-/* */
-/***************************************************************************/
-
-#ifndef FTGLYPH_H
-#define FTGLYPH_H
-
-#include <freetype.h>
-
- typedef enum {
-
- ft_glyph_type_none = 0,
- ft_glyph_type_bitmap = 1,
- ft_glyph_type_outline = 2
-
- } FT_GlyphType;
-
- /***********************************************************************
- *
- * <Struct>
- * FT_GlyphRec
- *
- * <Description>
- * The root glyph structure contains a given glyph image's metrics.
- * Note that the FT_Glyph type is a pointer to FT_GlyphRec
- *
- * <Field>
- * memory :: a handle to the memory allocator that is used to
- * create/clone/destroy this glyph..
- *
- * glyph_type :: the glyph type..
- *
- * height :: height of glyph image
- * width :: width of glyph image
- *
- * bearingX :: horizontal bearing, this is the distance from the
- * the current pen position to the left of the glyph
- *
- * bearingY :: vertical bearing, this is the distance from the
- * current pen position to the top of the glyph
- *
- * advance :: this is the horizontal or vertical advance for the
- * glyph
- *
- * <Note>
- * the distances expressed in the metrics are expressed in 26.6 fixed
- * float sub-pixels (i.e. 1/64th of pixels).
- *
- * the vertical bearing has a positive value when the glyph top is
- * above the baseline, and negative when it is under..
- *
- ***********************************************************************/
-
- typedef struct FT_GlyphRec_
- {
- FT_Memory memory;
- FT_GlyphType glyph_type;
- FT_Int height;
- FT_Int width;
- FT_Int bearingX;
- FT_Int bearingY;
- FT_Int advance;
-
- } FT_GlyphRec, *FT_Glyph;
-
-
- /***********************************************************************
- *
- * <Struct>
- * FT_BitmapGlyphRec
- *
- * <Description>
- * A structure used to describe a bitmap glyph image..
- * Note that the FT_BitmapGlyph type is a pointer to FT_BitmapGlyphRec
- *
- * <Field>
- * metrics :: the corresponding glyph metrics
- * bitmap :: a descriptor for the bitmap.
- *
- * <Note>
- * the "width" and "height" fields of the metrics are expressed in
- * 26.6 sub-pixels. However, the width and height in pixels can be
- * read directly from "bitmap.width" and "bitmap.height"
- *
- * this structure is used for both monochrome and anti-aliased
- * bitmaps (the bitmap descriptor contains field describing the
- * format of the pixel buffer)
- *
- * the corresponding pixel buffer is always owned by the BitmapGlyph
- * and is thus creatde and destroyed with it..
- *
- ***********************************************************************/
-
- typedef struct FT_BitmapGlyphRec_
- {
- FT_GlyphRec metrics;
- FT_Int left;
- FT_Int top;
- FT_Bitmap bitmap;
-
- } FT_BitmapGlyphRec_, *FT_BitmapGlyph;
-
-
- /***********************************************************************
- *
- * <Struct>
- * FT_OutlineGlyphRec
- *
- * <Description>
- * A structure used to describe a vectorial outline glyph image..
- * Note that the FT_OutlineGlyph type is a pointer to FT_OutlineGlyphRec
- *
- * <Field>
- * metrics :: the corresponding glyph metrics
- * outline :: a descriptor for the outline
- *
- * <Note>
- * the "width" and "height" fields of the metrics are expressed in
- * 26.6 sub-pixels. However, the width and height in pixels can be
- * read directly from "bitmap.width" and "bitmap.rows"
- *
- * the corresponding outline points tables is always owned by the
- * object and are destroyed with it..
- *
- * an OutlineGlyph can be used to generate a BitmapGlyph with the
- * function FT_OutlineGlyph_Render()
- *
- ***********************************************************************/
-
- typedef struct FT_OutlineGlyphRec_
- {
- FT_GlyphRec metrics;
- FT_Outline outline;
-
- } FT_OutlineGlyphRec_, *FT_OutlineGlyph;
-
-
- /***********************************************************************
- *
- * <Function>
- * FT_Get_Glyph_Bitmap
- *
- * <Description>
- * A function used to directly return a monochrome bitmap glyph image
- * from a face.
- *
- * <Input>
- * face :: handle to source face object
- * glyph_index :: glyph index in face
- * load_flags :: load flags, see FT_LOAD_FLAG_XXXX constants..
- * grays :: number of gray levels for anti-aliased bitmaps,
- * set to 0 if you want to render a monochrome bitmap
- * origin :: a pointer to the origin's position. Set to 0
- * if the current transform is the identity..
- *
- * <Output>
- * bitglyph :: pointer to the new bitmap glyph
- *
- * <Return>
- * Error code. 0 means success.
- *
- * <Note>
- * If the font contains glyph outlines, these will be automatically
- * converted to a bitmap according to the value of "grays"
- *
- * If "grays" is set to 0, the result is a 1-bit monochrome bitmap
- * otherwise, it is an 8-bit gray-level bitmap
- *
- * The number of gray levels in the result anti-aliased bitmap might
- * not be "grays", depending on the current scan-converter implementation
- *
- * Note that it is not possible to generate 8-bit monochrome bitmaps
- * with this function. Rather, use FT_Get_Glyph_Outline, then
- * FT_Glyph_Render_Outline and provide your own span callbacks..
- *
- * When the face doesn't contain scalable outlines, this function will
- * fail if the current transform is not the identity, or if the glyph
- * origin's phase to the pixel grid is not 0 in both directions !!
- *
- ***********************************************************************/
-
- EXPORT_DEF
- FT_Error FT_Get_Glyph_Bitmap( FT_Face face,
- FT_UInt glyph_index,
- FT_UInt load_flags,
- FT_Int grays,
- FT_Vector* origin,
- FT_BitmapGlyph *abitglyph );
-
-
- /***********************************************************************
- *
- * <Function>
- * FT_Get_Glyph_Outline
- *
- * <Description>
- * A function used to directly return a bitmap glyph image from a
- * face. This is faster than calling FT_Load_Glyph+FT_Get_Outline_Bitmap..
- *
- * <Input>
- * face :: handle to source face object
- * glyph_index :: glyph index in face
- * load_flags :: load flags, see FT_LOAD_FLAG_XXXX constants..
- *
- * <Output>
- * vecglyph :: pointer to the new outline glyph
- *
- * <Return>
- * Error code. 0 means success.
- *
- * <Note>
- * If the glyph is not an outline in the face, this function will
- * fail..
- *
- * This function will fail if the load flags FT_LOAD_NO_OUTLINE and
- * FT_LOAD_NO_RECURSE are set..
- *
- ***********************************************************************/
-
- EXPORT_DEF
- FT_Error FT_Get_Glyph_Outline( FT_Face face,
- FT_UInt glyph_index,
- FT_UInt load_flags,
- FT_OutlineGlyph *vecglyph );
-
-
- /***********************************************************************
- *
- * <Function>
- * FT_Set_Transform
- *
- * <Description>
- * A function used to set the transform that is applied to glyph images
- * just after they're loaded in the face's glyph slot, and before they're
- * returned by either FT_Get_Glyph_Bitmap or FT_Get_Glyph_Outline
- *
- * <Input>
- * face :: handle to source face object
- * matrix :: pointer to the transform's 2x2 matrix. 0 for identity
- * delta :: pointer to the transform's translation. 0 for null vector
- *
- * <Note>
- * The transform is only applied to glyph outlines when they are found
- * in a font face. It is unable to transform embedded glyph bitmaps
- *
- ***********************************************************************/
-
- EXPORT_DEF
- void FT_Set_Transform( FT_Face face,
- FT_Matrix* matrix,
- FT_Vector* delta );
-
-
- /***********************************************************************
- *
- * <Function>
- * FT_Done_Glyph
- *
- * <Description>
- * Destroys a given glyph..
- *
- * <Input>
- * glyph :: handle to target glyph object
- *
- ***********************************************************************/
-
- EXPORT_DEF
- void FT_Done_Glyph( FT_Glyph glyph );
-
-
- /***********************************************************************
- *
- * <Function>
- * FT_Glyph_Get_Box
- *
- * <Description>
- * Returns the glyph image's bounding box in pixels.
- *
- * <Input>
- * glyph :: handle to target glyph object
- *
- * <Output>
- * box :: the glyph bounding box. Coordinates are expressed in
- * _integer_ pixels, with exclusive max bounds
- *
- * <Note>
- * Coordinates are relative to the glyph origin, using the Y-upwards
- * convention..
- *
- * The width of the box in pixels is box.xMax-box.xMin
- * The height is box.yMax - box.yMin
- *
- ***********************************************************************/
-
- EXPORT_DEF
- void FT_Glyph_Get_Box( FT_Glyph glyph,
- FT_BBox *box );
-
-#endif /* FTGLYPH_H */
--- a/include/ftgrays.h
+++ /dev/null
@@ -1,20 +1,0 @@
-#ifndef FTGRAYS_H
-#define FTGRAYS_H
-
-#include <ftimage.h>
-
- /*************************************************************************/
- /* */
- /* To make ftgrays.h independent from configuration files we check */
- /* whether EXPORT_DEF has been defined already. */
- /* */
- /* On some systems and compilers (Win32 mostly), an extra keyword is */
- /* necessary to compile the library as a DLL. */
- /* */
-#ifndef EXPORT_DEF
-#define EXPORT_DEF extern
-#endif
-
- EXPORT_DEF FT_Raster_Funcs ft_grays_raster;
-
-#endif
--- a/include/ftimage.h
+++ /dev/null
@@ -1,938 +1,0 @@
-/***************************************************************************/
-/* */
-/* ftimage.h */
-/* */
-/* This file defines the glyph image formats recognized by FreeType, as */
-/* well as the default raster interface. */
-/* */
-/* 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. */
-/* */
-/***************************************************************************/
-
-#ifndef FTIMAGE_H
-#define FTIMAGE_H
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_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. */
- /* */
- typedef signed long FT_Pos;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Vector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2d vector; coordinates are of */
- /* the FT_Pos type. */
- /* */
- /* <Fields> */
- /* x :: The horizontal coordinate. */
- /* y :: The vertical coordinate. */
- /* */
- typedef struct FT_Vector_
- {
- FT_Pos x;
- FT_Pos y;
-
- } FT_Vector;
-
-
- /*************************************************************************
- *
- * <Enum>
- * FT_Pixel_Mode
- *
- * <Description>
- * An enumeration type used to describe the format of pixels
- * in a given bitmap. Note that additional formats may be added
- * in the future.
- *
- * <Fields>
- * ft_pixel_mode_mono :: a monochrome bitmap (1 bit/pixel)
- *
- * ft_pixel_mode_grays :: an 8-bit gray-levels bitmap. Note that
- * the total number of gray levels is given
- * in the `num_grays' field of the FT_Bitmap
- * structure.
- *
- * ft_pixel_mode_pal2 :: a 2-bit paletted bitmap.
- * currently unused by FreeType.
- *
- * ft_pixel_mode_pal4 :: a 4-bit paletted bitmap.
- * currently unused by FreeType.
- *
- * ft_pixel_mode_pal8 :: an 8-bit paletted bitmap.
- * currently unused by FreeType.
- *
- * ft_pixel_mode_rgb15 :: a 15-bit RGB bitmap. Uses 5:5:5 encoding
- * currently unused by FreeType.
- *
- * ft_pixel_mode_rgb16 :: a 16-bit RGB bitmap. Uses 5:6:5 encoding
- * currently unused by FreeType.
- *
- * ft_pixel_mode_rgb24 :: a 24-bit RGB bitmap.
- * currently unused by FreeType.
- *
- * ft_pixel_mode_rgb32 :: a 32-bit RGB bitmap.
- * currently unused by FreeType.
- *
- * <Note>
- * Some anti-aliased bitmaps might be embedded in TrueType fonts
- * using formats pal2 or pal4, though no fonts presenting those
- * have been found to date..
- *
- *************************************************************************/
-
- typedef enum FT_Pixel_Mode_
- {
- ft_pixel_mode_none = 0,
- ft_pixel_mode_mono,
- ft_pixel_mode_grays,
- ft_pixel_mode_pal2,
- ft_pixel_mode_pal4,
- ft_pixel_mode_pal8,
- ft_pixel_mode_rgb15,
- ft_pixel_mode_rgb16,
- ft_pixel_mode_rgb24,
- ft_pixel_mode_rgb32,
-
- ft_pixel_mode_max /* do not remove */
-
- } FT_Pixel_Mode;
-
-
-
- /*************************************************************************
- *
- * <Enum>
- * FT_Palette_Mode
- *
- * <Description>
- * An enumeration type used to describe the format of a bitmap
- * palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8
- *
- * <Fields>
- * ft_palette_mode_rgb :: the palette is an array of 3-bytes RGB records
- *
- * ft_palette_mode_rgba :: the palette is an array of 4-bytes RGBA records
- *
- * <Note>
- * As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by
- * FreeType, these types are not handled by the library itself.
- *
- *************************************************************************/
-
- typedef enum FT_Palette_Mode_
- {
- ft_palette_mode_rgb = 0,
- ft_palette_mode_rgba,
-
- ft_palettte_mode_max /* do not remove */
-
- } FT_Palette_Mode;
-
-
- /*************************************************************************
- *
- * <Struct>
- * FT_Bitmap
- *
- * <Description>
- * A structure used to describe a bitmap or pixmap to the raster.
- * Note that we now manage pixmaps of various depths through the
- * `pixel_mode' field.
- *
- * <Fields>
- * rows :: The number of bitmap rows.
- *
- * width :: The number of pixels in bitmap row.
- *
- * pitch :: The pitch's absolute value is the number of bytes
- * taken by one bitmap row, including padding. However,
- * the pitch is positive when the bitmap has a `down'
- * flow, and negative when it has an `up' flow. In all
- * cases, the pitch is an offset to add to a bitmap
- * pointer in order to go down one row.
- *
- * buffer :: A typeless pointer to the bitmap buffer. This value
- * should be aligned on 32-bit boundaries in most cases.
- *
- * num_grays :: this field is only used with ft_pixel_mode_grays,
- * it gives the number of gray levels used in the
- * bitmap.
- *
- * pixel_mode :: the pixel_mode, i.e. how pixel bits are stored
- *
- * palette_mode :: this field is only used with paletted pixel modes,
- * it indicates how the palette is stored
- *
- * palette :: a typeless pointer to the bitmap palette. only used
- * for paletted pixel modes.
- *
- * <Note>
- * When using pixel modes pal2, pal4 and pal8 with a void `palette'
- * field, a gray pixmap with respectively 4, 16 and 256 levels of gray
- * is assumed. This, in order to be compatible with some embedded bitmap
- * formats defined in the TrueType spec.
- *
- * Note that no font was found presenting such embedded bitmaps, so this
- * is currently completely unhandled by the library.
- *
- *
- *************************************************************************/
-
- typedef struct FT_Bitmap_
- {
- int rows;
- int width;
- int pitch;
- void* buffer;
- short num_grays;
- char pixel_mode;
- char palette_mode;
- void* palette;
-
- } FT_Bitmap;
-
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Outline */
- /* */
- /* <Description> */
- /* This structure is used to describe an outline to the scan-line */
- /* converter. It's a copy of the TT_Outline type that was defined */
- /* in FreeType 1.x. */
- /* */
- /* <Fields> */
- /* n_contours :: The number of contours in the outline. */
- /* */
- /* n_points :: The number of points in the outline. */
- /* */
- /* points :: A pointer to an array of `n_points' FT_Vector */
- /* elements, giving the outline's point */
- /* coordinates. */
- /* */
- /* tags :: A pointer to an array of `n_points' chars, */
- /* giving each outline point's type. If bit 0 is */
- /* unset, the point is 'off' the curve, i.e. a */
- /* Bezier control point, while it is `on' when */
- /* unset. */
- /* */
- /* Bit 1 is meaningful for `off' points only. If */
- /* set, it indicates a third-order Bezier arc */
- /* control point; and a second-order control point */
- /* if unset. */
- /* */
- /* contours :: An array of `n_contours' shorts, giving the end */
- /* point of each contour within the outline. For */
- /* example, the first contour is defined by the */
- /* points `0' to `contours[0]', the second one is */
- /* defined by the points `contours[0]+1' to */
- /* `contours[1]', etc. */
- /* */
- /* flags :: a set of bit flags used to characterize the */
- /* outline and give hints to the scan-converter */
- /* and hinter on how to convert/grid-fit it.. */
- /* see FT_Outline_Flags.. */
- /* */
- typedef struct FT_Outline_
- {
- short n_contours; /* number of contours in glyph */
- short n_points; /* number of points in the glyph */
-
- FT_Vector* points; /* the outline's points */
- char* tags; /* the points flags */
- short* contours; /* the contour end points */
-
- int flags; /* outline masks */
-
- } FT_Outline;
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Outline_Flags */
- /* */
- /* <Description> */
- /* A simple type used to enumerates the flags in an outline's */
- /* "outline_flags" field. */
- /* */
- /* <Fields> */
- /* ft_outline_owner :: */
- /* when set, this flag indicates that the outline's field arrays */
- /* (i.e. "points", "flags" & "contours") are "owned" by the */
- /* outline object, and should thus be freed when it is destroyed. */
- /* */
- /* ft_outline_even_odd_fill :: */
- /* by default, outlines are filled using the non-zero winding */
- /* rule. When set to 1, the outline will be filled using the */
- /* even-odd fill rule.. (XXX: unimplemented) */
- /* */
- /* ft_outline_reverse_fill :: */
- /* By default, outside contours of an outline are oriented in */
- /* clock-wise direction, as defined in the TrueType specification. */
- /* This flag is set when the outline uses the opposite direction, */
- /* (typically for Type 1 fonts). This flag is ignored by the */
- /* scan-converter. However, it is very important for the */
- /* auto-hinter.. */
- /* */
- /* ft_outline_ignore_dropouts :: */
- /* By default, the scan converter will try to detect drop-outs */
- /* in an outline and correct the glyph bitmap to ensure consistent */
- /* shape continuity. When set, this flag hints the scan-line */
- /* converter to ignore such cases. */
- /* */
- /* ft_outline_high_precision :: */
- /* this flag indicates that the scan-line converter should try */
- /* to convert this outline to bitmaps with the highest possible */
- /* quality. It is typically set for small character sizes. Note */
- /* that this is only a hint, that might be completely ignored */
- /* by a given scan-converter. */
- /* */
- /* ft_outline_single_pass :: */
- /* this flag is set to force a given scan-converter to only */
- /* use a single pass over the outline to render a bitmap glyph */
- /* image. Normally, it is set for very large character sizes. */
- /* It is only a hint, that might be completely ignored by a */
- /* given scan-converter. */
- /* */
- typedef enum FT_Outline_Flags_
- {
- ft_outline_none = 0,
- ft_outline_owner = 1,
- ft_outline_even_odd_fill = 2,
- ft_outline_reverse_fill = 4,
- ft_outline_ignore_dropouts = 8,
- ft_outline_high_precision = 256,
- ft_outline_single_pass = 512
-
- } FT_Outline_Flags;
-
-
-
-#define FT_CURVE_TAG( flag ) (flag & 3)
-
-#define FT_Curve_Tag_On 1
-#define FT_Curve_Tag_Conic 0
-#define FT_Curve_Tag_Cubic 2
-
-#define FT_Curve_Tag_Touch_X 8 /* reserved for the TrueType hinter */
-#define FT_Curve_Tag_Touch_Y 16 /* reserved for the TrueType hinter */
-
-#define FT_Curve_Tag_Touch_Both ( FT_Curve_Tag_Touch_X | \
- FT_Curve_Tag_Touch_Y)
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_MoveTo_Func */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `move */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `move to' is emitted to start a new contour in an outline. */
- /* */
- /* <Input> */
- /* to :: A pointer to the target point of the `move to'. */
- /* user :: A typeless pointer which is passed from the caller of the */
- /* decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- typedef int (*FT_Outline_MoveTo_Func)( FT_Vector* to,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_LineTo_Func */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `line */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `line to' is emitted to indicate a segment in the outline. */
- /* */
- /* <Input> */
- /* to :: A pointer to the target point of the `line to'. */
- /* user :: A typeless pointer which is passed from the caller of the */
- /* decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- typedef int (*FT_Outline_LineTo_Func)( FT_Vector* to,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_ConicTo_Func */
- /* */
- /* <Description> */
- /* A function pointer type use to describe the signature of a `conic */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `conic to' is emitted to indicate a second-order Bezier arc in */
- /* the outline. */
- /* */
- /* <Input> */
- /* control :: An intermediate control point between the last position */
- /* and the new target in `to'. */
- /* */
- /* to :: A pointer to the target end point of the conic arc. */
- /* */
- /* user :: A typeless pointer which is passed from the caller of */
- /* the decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- typedef int (*FT_Outline_ConicTo_Func)( FT_Vector* control,
- FT_Vector* to,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Outline_CubicTo_Func */
- /* */
- /* <Description> */
- /* A function pointer type used to describe the signature of a `cubic */
- /* to' function during outline walking/decomposition. */
- /* */
- /* A `cubic to' is emitted to indicate a third-order Bezier arc. */
- /* */
- /* <Input> */
- /* control1 :: A pointer to the first Bezier control point. */
- /* control2 :: A pointer to the second Bezier control point. */
- /* to :: A pointer to the target end point. */
- /* user :: A typeless pointer which is passed from the caller of */
- /* the decomposition function. */
- /* */
- /* <Return> */
- /* Error code. 0 means success. */
- /* */
- typedef int (*FT_Outline_CubicTo_Func)( FT_Vector* control1,
- FT_Vector* control2,
- FT_Vector* to,
- void* user );
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Outline_Funcs */
- /* */
- /* <Description> */
- /* A structure to hold various function pointers used during outline */
- /* decomposition in order to emit segments, conic, and cubic Beziers, */
- /* as well as `move to' and `close to' operations. */
- /* */
- /* <Fields> */
- /* move_to :: The `move to' emitter. */
- /* line_to :: The segment emitter. */
- /* conic_to :: The second-order Bezier arc emitter. */
- /* cubic_to :: The third-order Bezier arc emitter. */
- /* */
- typedef struct FT_Outline_Funcs_
- {
- FT_Outline_MoveTo_Func move_to;
- FT_Outline_LineTo_Func line_to;
- FT_Outline_ConicTo_Func conic_to;
- FT_Outline_CubicTo_Func cubic_to;
-
- int shift;
- FT_Pos delta;
-
- } FT_Outline_Funcs;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_IMAGE_TAG */
- /* */
- /* <Description> */
- /* This macro converts four letter tags which are used to label */
- /* TrueType tables into an unsigned long to be used within FreeType. */
- /* */
-#define FT_IMAGE_TAG( _x1, _x2, _x3, _x4 ) \
- (((unsigned long)_x1 << 24) | \
- ((unsigned long)_x2 << 16) | \
- ((unsigned long)_x3 << 8) | \
- (unsigned long)_x4)
-
-
- /***********************************************************************
- *
- * <Enum>
- * FT_Glyph_Format
- *
- * <Description>
- * An enumeration type used to describethe format of a given glyph
- * image. Note that this version of FreeType only supports two image
- * formats, even though future font drivers will be able to register
- * their own format.
- *
- * <Fields>
- * ft_glyph_format_composite :: the glyph image is a composite of several
- * other images. This glyph format is _only_
- * used with the FT_LOAD_FLAG_NO_RECURSE flag
- * (XXX: Which is currently iunimplemented)
- *
- * ft_glyph_format_bitmap :: the glyph image is a bitmap, and can
- * be described as a FT_Bitmap
- *
- * ft_glyph_format_outline :: the glyph image is a vectorial image
- * made of bezier control points, and can
- * be described as a FT_Outline
- *
- * ft_glyph_format_plotter :: the glyph image is a vectorial image
- * made of plotter lines (some T1 fonts like
- * Hershey contain glyph in this format).
- *
- ***********************************************************************/
-
- typedef enum FT_Glyph_Format_
- {
- ft_glyph_format_none = 0,
- ft_glyph_format_composite = FT_IMAGE_TAG('c','o','m','p'),
- ft_glyph_format_bitmap = FT_IMAGE_TAG('b','i','t','s'),
- ft_glyph_format_outline = FT_IMAGE_TAG('o','u','t','l'),
- ft_glyph_format_plotter = FT_IMAGE_TAG('p','l','o','t')
-
- } FT_Glyph_Format;
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** R A S T E R D E F I N I T I O N S *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /**************************************************************************
- *
- *
- *
- *
- *
- *
- *
- *
- **************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Raster */
- /* */
- /* <Description> */
- /* A handle (pointer) to a raster object. Each object can be used */
- /* independently to convert an outline into a bitmap or pixmap. */
- /* */
- typedef struct FT_RasterRec_* FT_Raster;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Span */
- /* */
- /* <Description> */
- /* A structure used to model a single span of gray (or black) pixels */
- /* when rendering a monocrhome or anti-aliased bitmap. */
- /* */
- /* <Fields> */
- /* x :: the span's horizontal start position */
- /* len :: the span's length in pixels */
- /* coverage :: the span color/coverage, ranging from 0 (background) */
- /* to 255 (foreground). Only used for anti-aliased */
- /* rendering.. */
- /* */
- /* <Note> */
- /* This structure is used by the span drawing callback type */
- /* named FT_Raster_Span_Func, which takes the y coordinate of the */
- /* span as a paremeter.. */
- /* */
- /* The coverage value is always between 0 and 255, even if the */
- /* number of gray levels have been set through FT_Set_Gray_Levels() */
- /* */
- typedef struct FT_Span_
- {
- short x;
- unsigned short len;
- unsigned char coverage;
-
- } FT_Span;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_Span_Func */
- /* */
- /* <Description> */
- /* A function used as a call-back by the anti-aliased renderer in */
- /* order to let client applications draw themselves the gray pixel */
- /* spans on each scan line. */
- /* */
- /* <Input> */
- /* y :: the scanline's y coordinate */
- /* count :: the number of spans to draw on this scanline */
- /* spans :: a table of 'count' spans to draw on the scanline */
- /* user :: user-supplied data that is passed to the callback */
- /* */
- /* <Note> */
- /* This callback allows client applications to directly render the */
- /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
- /* */
- /* This can be used to write anti-aliased outlines directly to a */
- /* given background bitmap, and even perform translucency.. */
- /* */
- /* Note that the "count" field cannot be greater than a fixed value */
- /* defined by the FT_MAX_GRAY_SPANS configuration macro in ftoption.h */
- /* */
- /* By default, this value is set to 32, which means that if there are */
- /* more than 32 spans on a given scanline, the callback will be called */
- /* several times with the same "y" parameter in order to draw all */
- /* callbacks.. */
- /* */
- /* Otherwise, the callback is only called once per scan-line, and */
- /* only for those scanlines that do have "gray" pixels on them.. */
- /* */
- typedef void (*FT_Raster_Span_Func)( int y,
- int count,
- FT_Span* spans,
- void* user );
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_BitTest_Func */
- /* */
- /* <Description> */
- /* A function used as a call-back by the monochrome scan-converter */
- /* to test wether a given target pixel is already set to the drawing */
- /* "color". These tests are crucial to implement drop-out control */
- /* per-se the TrueType spec.. */
- /* */
- /* <Input> */
- /* y :: the pixel's y coordinate */
- /* x :: the pixel's x coordinate */
- /* user :: user-supplied data that is passed to the callback */
- /* */
- /* <Return> */
- /* 1 if the pixel is "set", 0 otherwise */
- /* */
- typedef int (*FT_Raster_BitTest_Func)( int y,
- int x,
- void* user );
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Raster_BitSet_Func */
- /* */
- /* <Description> */
- /* A function used as a call-back by the monochrome scan-converter */
- /* used to set an individual target pixel. This is crucial to */
- /* implement drop-out control per-se the TrueType spec.. */
- /* */
- /* <Input> */
- /* y :: the pixel's y coordinate */
- /* x :: the pixel's x coordinate */
- /* user :: user-supplied data that is passed to the callback */
- /* */
- /* <Return> */
- /* 1 if the pixel is "set", 0 otherwise */
- /* */
- typedef void (*FT_Raster_BitSet_Func)( int y,
- int x,
- void* user );
-
-
- /**************************************************************************
- *
- * <Enum>
- * FT_Raster_Flag
- *
- * <Description>
- * An enumeration used to list the bit flags used in the "flags"
- * field of a FT_Raster_Params function.
- *
- * <Fields>
- * ft_raster_flag_default :: this value is 0
- *
- * ft_raster_flag_aa :: resquests the rendering of an anti-aliased
- * glyph bitmap. If unset, a monchrome bitmap
- * will be rendered.
- *
- * ft_raster_flag_direct :: requests direct rendering over the target
- * bitmap. Direct rendering uses user-provided
- * callbacks in order to perform direct
- * drawing or composition over an existing
- * bitmap. If this bit is unset, the content
- * of the target bitmap **must be zeroed** !
- *
- **************************************************************************/
- typedef enum {
-
- ft_raster_flag_default = 0,
- ft_raster_flag_aa = 1,
- ft_raster_flag_direct = 2
-
- } FT_Raster_Flag;
-
- /**************************************************************************
- *
- * <Struct>
- * FT_Raster_Params
- *
- * <Description>
- * A structure used to hold the arguments used by a raster's render
- * function.
- *
- * <Fields>
- * target :: the target bitmap
- * source :: pointer to the source glyph image (e.g. a FT_Outline)
- * flags :: rendering flags
- * gray_spans :: gray span drawing callback
- * black_spans :: black span drawing callback
- * bit_test :: bit test callback
- * bit_set :: bit set callback
- * user :: user-supplied data that is passed to each drawing
- * callback..
- *
- * <Note>
- * An anti-aliased glyph bitmap is drawn if the ft_raster_flag_aa bit
- * flag is set in the "flags" field, otherwise a monochrome bitmap will
- * be generated.
- *
- * When the ft_raster_flag_direct bit flag is set in "flags", the raster
- * will call the "gray_spans" callback to drawn gray pixel spans, in the
- * case of an aa glyph bitmap, or "black_spans", "bit_test" and "bit_set"
- * in the case of a monochrome bitmap.
- *
- * This allows direct composition over a pre-existing bitmap through
- * user-provided callbacks to perform the span drawing/composition.
- *
- * Note that the "bit_test" and "bit_set" callbacks are required when
- * rendering a monochrome bitmap, as they are crucial to implement correct
- * drop-out control per-se the TrueType specification..
- *
- **************************************************************************/
-
- typedef struct FT_Raster_Params_
- {
- FT_Bitmap* target;
- void* source;
- int flags;
- FT_Raster_Span_Func gray_spans;
- FT_Raster_Span_Func black_spans;
- FT_Raster_BitTest_Func bit_test;
- FT_Raster_BitSet_Func bit_set;
- void* user;
-
- } FT_Raster_Params;
-
-
-
- /**************************************************************************
- * <FuncType>
- * FT_Raster_New_Func
- *
- * <Description>
- * A function used to create a new raster object.
- *
- * <Input>
- * memory :: handle to memory allocator.
- *
- * <Output>
- * raster :: handle to new raster object
- *
- * <Return>
- * Error code. 0 means success
- *
- * <Note>
- * the "memory" parameter is a typeless pointer in order to avoid
- * un-wanted dependencies on the rest of the FreeType code.
- *
- * in practice, it is a FT_Memory, i.e. a handle to the standard
- * FreeType memory allocator. However, this field can be completely
- * ignored by a given raster implementation..
- *
- **************************************************************************/
-
- typedef int (*FT_Raster_New_Func)( void* memory,
- FT_Raster *raster );
-
-
- /**************************************************************************
- * <FuncType>
- * FT_Raster_Done_Func
- *
- * <Description>
- * A function used to destroy a given raster object.
- *
- * <Input>
- * raster :: handle to new raster object
- *
- **************************************************************************/
-
- typedef void (*FT_Raster_Done_Func)( FT_Raster raster );
-
-
-
- /**************************************************************************
- *
- * <FuncType>
- * FT_Raster_Reset_Func
- *
- * <Description>
- * FreeType provides an area of memory called the "render pool",
- * available to all registered rasters. This pool can be freely
- * used during a given scan-conversion but is shared by all rasters.
- * Its content is thus transient.
- *
- * This function is called each time the render pool changes, or
- * just after a new raster object is created.
- *
- * <Input>
- * raster :: handle to new raster object
- * pool_base :: address in memory of render pool
- * pool_size :: size in bytes of render pool
- *
- * <Note>
- * Rasters can ignore the render pool and rely on dynamic memory
- * allocation if they want to (a handle to the memory allocator is
- * passed to the raster constructor). However, this is not recommended
- * for efficiency purposes..
- *
- **************************************************************************/
-
- typedef void (*FT_Raster_Reset_Func)( FT_Raster raster,
- const char* pool_base,
- long pool_size );
-
-
- /**************************************************************************
- *
- * <FuncType>
- * FT_Raster_Set_Mode_Func
- *
- * <Description>
- * This function is a generic facility to change modes or attributes
- * in a given raster. This can be used for debugging purposes, or
- * simply to allow implementation-specific "features" in a given
- * raster module.
- *
- * <Input>
- * raster :: handle to new raster object
- * mode :: a 4-byte tag used to name the mode or property
- * args :: a pointer to the new mode/property to use
- *
- **************************************************************************/
-
- typedef int (*FT_Raster_Set_Mode_Func)( FT_Raster raster,
- unsigned long mode,
- void* args );
-
- /**************************************************************************
- *
- * <FuncType>
- * FT_Raster_Render_Func
- *
- * <Description>
- * Invokes a given raster to scan-convert a given glyph image into
- * a target bitmap.
- *
- * <Input>
- * raster :: handle to raster object
- * params :: pointer to a FT_Raster_Params structure used to store
- * the rendering parameters.
- *
- * <Return>
- * Error code. 0 means success
- *
- * <Note>
- * The exact format of the source image depends on the raster's
- * glyph format defined in its FT_Raster_Funcs structure. It can be
- * an FT_Outline or anything else in order to support a large array
- * of glyph formats.
- *
- * Note also that the render function can fail and return a
- * FT_Err_Unimplemented_Feature error code when the raster used does
- * not support direct composition.
- *
- * XXX: For now, the standard raster doesn't support direct composition
- * but this should change for the final release (see the files
- * demos/src/ftgrays.c and demos/src/ftgrays2.c for examples of
- * distinct implementations which support direct composition).
- *
- **************************************************************************/
-
- typedef int (*FT_Raster_Render_Func)( FT_Raster raster,
- FT_Raster_Params* params );
-
-
- /**************************************************************************
- *
- * <Struct>
- * FT_Raster_Funcs
- *
- * <Description>
- * A structure used to describe a given raster class to the library.
- *
- * <Fields>
- * glyph_format :: the supported glyph format for this raster
- * raster_new :: the raster constructor
- * raster_reset :: used to reset the render pool within the raster
- * raster_render :: renders a glyph into a given bitmap
- * raster_done :: the raster destructor
- *
- **************************************************************************/
-
-
- typedef struct FT_Raster_Funcs_
- {
- FT_Glyph_Format glyph_format;
- FT_Raster_New_Func raster_new;
- FT_Raster_Reset_Func raster_reset;
- FT_Raster_Set_Mode_Func raster_set_mode;
- FT_Raster_Render_Func raster_render;
- FT_Raster_Done_Func raster_done;
-
- } FT_Raster_Funcs;
-
-#endif /* FTIMAGE_H */
-
-
--- a/include/ftraster.h
+++ /dev/null
@@ -1,50 +1,0 @@
-/***************************************************************************/
-/* */
-/* ftraster.h */
-/* */
-/* The FreeType glyph rasterizer (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 FTRASTER_H
-#define FTRASTER_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-
- /*************************************************************************/
- /* */
- /* Uncomment the following line if you are using ftraster.c as a */
- /* standalone module, fully independent of FreeType. */
- /* */
-/* #define _STANDALONE_ */
-
-#include <ftimage.h>
-
-#ifndef EXPORT_DEF
-#define EXPORT_DEF /* nothing */
-#endif
-
- EXPORT_DEF
- FT_Raster_Funcs ft_raster_funcs;
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* FTRASTER_H */
-
-
-/* END */
--- a/include/ftsystem.h
+++ /dev/null
@@ -1,95 +1,0 @@
-/**************************************************************************
- *
- * ftsystem.h 1.0
- *
- * FreeType low-level system interface definition
- *
- * This file contains the definitions of the stream and memory interfaces
- * used by FreeType.
- *
- *
- * 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.
- *
- **************************************************************************/
-
-#ifndef FTSYSTEM_H
-#define FTSYSTEM_H
-
-/*************************************************************************
- *
- * M E M O R Y M A N A G E M E N T
- *
- *************************************************************************/
-
- typedef struct FT_MemoryRec_* FT_Memory;
-
- typedef void* (*FT_Alloc_Func)( FT_Memory memory,
- long size );
-
- typedef void (*FT_Free_Func)( FT_Memory memory,
- void* block );
-
- typedef void* (*FT_Realloc_Func)( FT_Memory memory,
- long cur_size,
- long new_size,
- void* block );
-
- struct FT_MemoryRec_
- {
- void* user;
- FT_Alloc_Func alloc;
- FT_Free_Func free;
- FT_Realloc_Func realloc;
- };
-
-
-
-/*************************************************************************
- *
- * I / O M A N A G E M E N T
- *
- *************************************************************************/
-
- typedef union FT_StreamDesc_
- {
- long value;
- void* pointer;
-
- } FT_StreamDesc;
-
-
- typedef struct FT_StreamRec_* FT_Stream;
-
- typedef unsigned long (*FT_Stream_IO)( FT_Stream stream,
- unsigned long offset,
- char* buffer,
- unsigned long count );
-
- typedef void (*FT_Stream_Close)( FT_Stream stream );
-
- struct FT_StreamRec_
- {
- char* base;
- unsigned long size;
- unsigned long pos;
-
- FT_StreamDesc descriptor;
- FT_StreamDesc pathname; /* ignored by FreeType - useful for debugging */
-
- FT_Stream_IO read;
- FT_Stream_Close close;
-
- FT_Memory memory;
- char* cursor;
- char* limit;
- };
-
-
-#endif /* FTSYSTEM_H */
--- a/include/t1tables.h
+++ /dev/null
@@ -1,145 +1,0 @@
-/***************************************************************************/
-/* */
-/* t1tables.h */
-/* */
-/* Basic Type 1/Type 2 tables definitions and interface */
-/* */
-/* */
-/* Copyright 1996-2000 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used */
-/* modified and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-#ifndef T1TABLES_H
-#define T1TABLES_H
-
-#include <freetype.h>
-
- /* Note that we separate font data in T1_FontInfo and T1_Private structures */
- /* in order to later support multiple master fonts.. */
-
- /*************************************************************************
- *
- * <Struct>
- * T1_FontInfo
- *
- * <Description>
- * A structure used to model a Type1/Type2 FontInfo dictionary
- * Note that for multiple-master fonts, each instance has its own
- * FontInfo.
- *
- */
-
- typedef struct T1_FontInfo
- {
- FT_String* version;
- FT_String* notice;
- FT_String* full_name;
- FT_String* family_name;
- FT_String* weight;
- FT_Long italic_angle;
- FT_Bool is_fixed_pitch;
- FT_Short underline_position;
- FT_UShort underline_thickness;
-
- } T1_FontInfo;
-
-
- /*************************************************************************
- *
- * <Struct>
- * T1_Private
- *
- * <Description>
- * A structure used to model a Type1/Type2 FontInfo dictionary
- * Note that for multiple-master fonts, each instance has its own
- * Private dict.
- *
- */
-
- typedef struct T1_Private
- {
-
- FT_Int unique_id;
- FT_Int lenIV;
-
- FT_Byte num_blues;
- FT_Byte num_other_blues;
- FT_Byte num_family_blues;
- FT_Byte num_family_other_blues;
-
- FT_Short blue_values[14];
- FT_Short other_blues[10];
-
- FT_Short family_blues [14];
- FT_Short family_other_blues[10];
-
- FT_Fixed blue_scale;
- FT_Int blue_shift;
- FT_Int blue_fuzz;
-
- FT_UShort standard_width;
- FT_UShort standard_height;
-
- FT_Byte num_snap_widths;
- FT_Byte num_snap_heights;
- FT_Bool force_bold;
- FT_Bool round_stem_up;
-
- FT_Short stem_snap_widths [13]; /* reserve one place for the std */
- FT_Short stem_snap_heights[13]; /* reserve one place for the std */
-
- FT_Long language_group;
- FT_Long password;
-
- FT_Short min_feature[2];
-
- } T1_Private;
-
-
- typedef struct CID_FontDict_
- {
- T1_FontInfo font_info;
- T1_Private private;
-
- FT_UInt num_subrs;
- FT_ULong subrmap_offset;
- FT_Int sd_bytes;
-
- } CID_FontDict;
-
-
- typedef struct CID_Info_
- {
- FT_String* cid_font_name;
- FT_Fixed cid_version;
- FT_Int cid_font_type;
-
- FT_String* registry;
- FT_String* ordering;
- FT_Int supplement;
-
- FT_ULong uid_base;
-
- FT_Int num_xuid;
- FT_ULong xuid[16];
-
-
- FT_ULong cidmap_offset;
- FT_Int fd_bytes;
- FT_Int gd_bytes;
- FT_ULong cid_count;
-
- FT_Int num_font_dicts;
- CID_FontDict* font_dicts;
-
- } CID_Info;
-
-
-#endif /* T1TABLES_H */
--- a/include/ttnameid.h
+++ /dev/null
@@ -1,670 +1,0 @@
-/*******************************************************************
- *
- * ttnameid.h
- *
- * TrueType Name ID definitions
- *
- * Copyright 1996-2000 by
- * David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- * This file is part of the FreeType project, and may only be used
- * modified and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- ******************************************************************/
-
-#ifndef TTNAMEID_H
-#define TTNAMEID_H
-
-/*
- * possible values for the 'Platform' identifier code in the name
- * records of the TTF "name" table
- */
-
-#define TT_PLATFORM_APPLE_UNICODE 0
-#define TT_PLATFORM_MACINTOSH 1
-#define TT_PLATFORM_ISO 2 /* deprecated */
-#define TT_PLATFORM_MICROSOFT 3
-
-
-/*
- * possible values of the platform specific encoding identifier field in
- * the name records of the TTF "name" table when the 'Platform' identifier
- * code is TT_PLATFORM_APPLE_UNICODE
- */
-
-#define TT_APPLE_ID_DEFAULT 0
-#define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */
-#define TT_APPLE_ID_ISO_10646 2 /* deprecated */
-#define TT_APPLE_ID_UNICODE_2_0 3 /* or later */
-
-
-/*
- * possible values of the platform specific encoding identifier field in
- * the name records of the TTF "name" table when the 'Platform' identifier
- * code is TT_PLATFORM_MACINTOSH
- */
-
-#define TT_MAC_ID_ROMAN 0
-#define TT_MAC_ID_JAPANESE 1
-#define TT_MAC_ID_TRADITIONAL_CHINESE 2
-#define TT_MAC_ID_KOREAN 3
-#define TT_MAC_ID_ARABIC 4
-#define TT_MAC_ID_HEBREW 5
-#define TT_MAC_ID_GREEK 6
-#define TT_MAC_ID_RUSSIAN 7
-#define TT_MAC_ID_RSYMBOL 8
-#define TT_MAC_ID_DEVANAGARI 9
-#define TT_MAC_ID_GURMUKHI 10
-#define TT_MAC_ID_GUJARATI 11
-#define TT_MAC_ID_ORIYA 12
-#define TT_MAC_ID_BENGALI 13
-#define TT_MAC_ID_TAMIL 14
-#define TT_MAC_ID_TELUGU 15
-#define TT_MAC_ID_KANNADA 16
-#define TT_MAC_ID_MALAYALAM 17
-#define TT_MAC_ID_SINHALESE 18
-#define TT_MAC_ID_BURMESE 19
-#define TT_MAC_ID_KHMER 20
-#define TT_MAC_ID_THAI 21
-#define TT_MAC_ID_LAOTIAN 22
-#define TT_MAC_ID_GEORGIAN 23
-#define TT_MAC_ID_ARMENIAN 24
-#define TT_MAC_ID_MALDIVIAN 25
-#define TT_MAC_ID_SIMPLIFIED_CHINESE 25
-#define TT_MAC_ID_TIBETAN 26
-#define TT_MAC_ID_MONGOLIAN 27
-#define TT_MAC_ID_GEEZ 28
-#define TT_MAC_ID_SLAVIC 29
-#define TT_MAC_ID_VIETNAMESE 30
-#define TT_MAC_ID_SINDHI 31
-#define TT_MAC_ID_UNINTERP 32
-
-
-/*
- * possible values of the platform specific encoding identifier field in
- * the name records of the TTF "name" table when the 'Platform' identifier
- * code is TT_PLATFORM_ISO
- *
- * This use is now deprecated
- */
-
-#define TT_ISO_ID_7BIT_ASCII 0
-#define TT_ISO_ID_10646 1
-#define TT_ISO_ID_8859_1 2
-
-
-/*
- * possible values of the platform specific encoding identifier field in
- * the name records of the TTF "name" table when the 'Platform' identifier
- * code is TT_PLATFORM_MICROSOFT
- */
-
-#define TT_MS_ID_SYMBOL_CS 0
-#define TT_MS_ID_UNICODE_CS 1
-#define TT_MS_ID_SJIS 2
-#define TT_MS_ID_GB2312 3
-#define TT_MS_ID_BIG_5 4
-#define TT_MS_ID_WANSUNG 5
-#define TT_MS_ID_JOHAB 6
-
-
-
-/*
- * possible values of the language identifier field in the name records of
- * the TTF "name" table when the 'Platform' identifier code is
- * TT_PLATFORM_MACINTOSH
- *
- * the canonical source for the Apple assigned Language ID's is at
- * http://fonts.apple.com/TTRefMan/RM06/Chap6name.html
- */
-
-#define TT_MAC_LANGID_ENGLISH 0
-#define TT_MAC_LANGID_FRENCH 1
-#define TT_MAC_LANGID_GERMAN 2
-#define TT_MAC_LANGID_ITALIAN 3
-#define TT_MAC_LANGID_DUTCH 4
-#define TT_MAC_LANGID_SWEDISH 5
-#define TT_MAC_LANGID_SPANISH 6
-#define TT_MAC_LANGID_DANISH 7
-#define TT_MAC_LANGID_PORTUGUESE 8
-#define TT_MAC_LANGID_NORWEGIAN 9
-#define TT_MAC_LANGID_HEBREW 10
-#define TT_MAC_LANGID_JAPANESE 11
-#define TT_MAC_LANGID_ARABIC 12
-#define TT_MAC_LANGID_FINNISH 13
-#define TT_MAC_LANGID_GREEK 14
-#define TT_MAC_LANGID_ICELANDIC 15
-#define TT_MAC_LANGID_MALTESE 16
-#define TT_MAC_LANGID_TURKISH 17
-#define TT_MAC_LANGID_CROATIAN 18
-#define TT_MAC_LANGID_CHINESE_TRADITIONAL 19
-#define TT_MAC_LANGID_URDU 20
-#define TT_MAC_LANGID_HINDI 21
-#define TT_MAC_LANGID_THAI 22
-#define TT_MAC_LANGID_KOREAN 23
-#define TT_MAC_LANGID_LITHUANIAN 24
-#define TT_MAC_LANGID_POLISH 25
-#define TT_MAC_LANGID_HUNGARIAN 26
-#define TT_MAC_LANGID_ESTONIAN 27
-#define TT_MAC_LANGID_LETTISH 28
-#define TT_MAC_LANGID_SAAMISK 29
-#define TT_MAC_LANGID_FAEROESE 30
-#define TT_MAC_LANGID_FARSI 31
-#define TT_MAC_LANGID_RUSSIAN 32
-#define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33
-#define TT_MAC_LANGID_FLEMISH 34
-#define TT_MAC_LANGID_IRISH 35
-#define TT_MAC_LANGID_ALBANIAN 36
-#define TT_MAC_LANGID_ROMANIAN 37
-#define TT_MAC_LANGID_CZECH 38
-#define TT_MAC_LANGID_SLOVAK 39
-#define TT_MAC_LANGID_SLOVENIAN 40
-#define TT_MAC_LANGID_YIDDISH 41
-#define TT_MAC_LANGID_SERBIAN 42
-#define TT_MAC_LANGID_MACEDONIAN 43
-#define TT_MAC_LANGID_BULGARIAN 44
-#define TT_MAC_LANGID_UKRAINIAN 45
-#define TT_MAC_LANGID_BYELORUSSIAN 46
-#define TT_MAC_LANGID_UZBEK 47
-#define TT_MAC_LANGID_KAZAKH 48
-#define TT_MAC_LANGID_AZERBAIJANI 49
-#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49
-#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50
-#define TT_MAC_LANGID_ARMENIAN 51
-#define TT_MAC_LANGID_GEORGIAN 52
-#define TT_MAC_LANGID_MOLDAVIAN 53
-#define TT_MAC_LANGID_KIRGHIZ 54
-#define TT_MAC_LANGID_TAJIKI 55
-#define TT_MAC_LANGID_TURKMEN 56
-#define TT_MAC_LANGID_MONGOLIAN 57
-#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57
-#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58
-#define TT_MAC_LANGID_PASHTO 59
-#define TT_MAC_LANGID_KURDISH 60
-#define TT_MAC_LANGID_KASHMIRI 61
-#define TT_MAC_LANGID_SINDHI 62
-#define TT_MAC_LANGID_TIBETAN 63
-#define TT_MAC_LANGID_NEPALI 64
-#define TT_MAC_LANGID_SANSKRIT 65
-#define TT_MAC_LANGID_MARATHI 66
-#define TT_MAC_LANGID_BENGALI 67
-#define TT_MAC_LANGID_ASSAMESE 68
-#define TT_MAC_LANGID_GUJARATI 69
-#define TT_MAC_LANGID_PUNJABI 70
-#define TT_MAC_LANGID_ORIYA 71
-#define TT_MAC_LANGID_MALAYALAM 72
-#define TT_MAC_LANGID_KANNADA 73
-#define TT_MAC_LANGID_TAMIL 74
-#define TT_MAC_LANGID_TELUGU 75
-#define TT_MAC_LANGID_SINHALESE 76
-#define TT_MAC_LANGID_BURMESE 77
-#define TT_MAC_LANGID_KHMER 78
-#define TT_MAC_LANGID_LAO 79
-#define TT_MAC_LANGID_VIETNAMESE 80
-#define TT_MAC_LANGID_INDONESIAN 81
-#define TT_MAC_LANGID_TAGALOG 82
-#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83
-#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84
-#define TT_MAC_LANGID_AMHARIC 85
-#define TT_MAC_LANGID_TIGRINYA 86
-#define TT_MAC_LANGID_GALLA 87
-#define TT_MAC_LANGID_SOMALI 88
-#define TT_MAC_LANGID_SWAHILI 89
-#define TT_MAC_LANGID_RUANDA 90
-#define TT_MAC_LANGID_RUNDI 91
-#define TT_MAC_LANGID_CHEWA 92
-#define TT_MAC_LANGID_MALAGASY 93
-#define TT_MAC_LANGID_ESPERANTO 94
-#define TT_MAC_LANGID_WELSH 128
-#define TT_MAC_LANGID_BASQUE 129
-#define TT_MAC_LANGID_CATALAN 130
-#define TT_MAC_LANGID_LATIN 131
-#define TT_MAC_LANGID_QUECHUA 132
-#define TT_MAC_LANGID_GUARANI 133
-#define TT_MAC_LANGID_AYMARA 134
-#define TT_MAC_LANGID_TATAR 135
-#define TT_MAC_LANGID_UIGHUR 136
-#define TT_MAC_LANGID_DZONGKHA 137
-#define TT_MAC_LANGID_JAVANESE 138
-#define TT_MAC_LANGID_SUNDANESE 139
-
-#if 0 /* these seem to be errors that have been dropped */
-#define TT_MAC_LANGID_SCOTTISH_GAELIC 140
-#define TT_MAC_LANGID_IRISH_GAELIC 141
-#endif
-
-/* The following codes are new as of 2000-03-10 */
-#define TT_MAC_LANGID_GALICIAN 140
-#define TT_MAC_LANGID_AFRIKAANS 141
-#define TT_MAC_LANGID_BRETON 142
-#define TT_MAC_LANGID_INUKTITUT 143
-#define TT_MAC_LANGID_SCOTTISH_GAELIC 144
-#define TT_MAC_LANGID_MANX_GAELIC 145
-#define TT_MAC_LANGID_IRISH_GAELIC 146
-#define TT_MAC_LANGID_TONGAN 147
-#define TT_MAC_LANGID_GREEK_POLYTONIC 148
-#define TT_MAC_LANGID_GREELANDIC 149
-#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150
-
-
-/*
- * possible values of the language identifier field in the name records of
- * the TTF "name" table when the 'Platform' identifier code is
- * TT_PLATFORM_MICROSOFT
- *
- * the canonical source for the MS assigned LCID's is at
- * http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt
- */
-
-#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401
-#define TT_MS_LANGID_ARABIC_IRAQ 0x0801
-#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01
-#define TT_MS_LANGID_ARABIC_LIBYA 0x1001
-#define TT_MS_LANGID_ARABIC_ALGERIA 0x1401
-#define TT_MS_LANGID_ARABIC_MOROCCO 0x1801
-#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01
-#define TT_MS_LANGID_ARABIC_OMAN 0x2001
-#define TT_MS_LANGID_ARABIC_YEMEN 0x2401
-#define TT_MS_LANGID_ARABIC_SYRIA 0x2801
-#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01
-#define TT_MS_LANGID_ARABIC_LEBANON 0x3001
-#define TT_MS_LANGID_ARABIC_KUWAIT 0x3401
-#define TT_MS_LANGID_ARABIC_UAE 0x3801
-#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01
-#define TT_MS_LANGID_ARABIC_QATAR 0x4001
-#define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402
-#define TT_MS_LANGID_CATALAN_SPAIN 0x0403
-#define TT_MS_LANGID_CHINESE_TAIWAN 0x0404
-#define TT_MS_LANGID_CHINESE_PRC 0x0804
-#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04
-#define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004
-#define TT_MS_LANGID_CHINESE_MACAU 0x1404
-#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405
-#define TT_MS_LANGID_DANISH_DENMARK 0x0406
-#define TT_MS_LANGID_GERMAN_GERMANY 0x0407
-#define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807
-#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07
-#define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007
-#define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407
-#define TT_MS_LANGID_GREEK_GREECE 0x0408
-#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
-#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809
-#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09
-#define TT_MS_LANGID_ENGLISH_CANADA 0x1009
-#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409
-#define TT_MS_LANGID_ENGLISH_IRELAND 0x1809
-#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09
-#define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009
-#define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409
-#define TT_MS_LANGID_ENGLISH_BELIZE 0x2809
-#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09
-#define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009
-#define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409
-#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a
-#define TT_MS_LANGID_SPANISH_MEXICO 0x080a
-#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a
-#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a
-#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a
-#define TT_MS_LANGID_SPANISH_PANAMA 0x180a
-#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a
-#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a
-#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a
-#define TT_MS_LANGID_SPANISH_PERU 0x280a
-#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a
-#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a
-#define TT_MS_LANGID_SPANISH_CHILE 0x340a
-#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a
-#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a
-#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a
-#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a
-#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a
-#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a
-#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a
-#define TT_MS_LANGID_FINNISH_FINLAND 0x040b
-#define TT_MS_LANGID_FRENCH_FRANCE 0x040c
-#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c
-#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c
-#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c
-#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c
-#define TT_MS_LANGID_FRENCH_MONACO 0x180c
-#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d
-#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e
-#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f
-#define TT_MS_LANGID_ITALIAN_ITALY 0x0410
-#define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810
-#define TT_MS_LANGID_JAPANESE_JAPAN 0x0411
-#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA 0x0412
-#define TT_MS_LANGID_KOREAN_JOHAB_KOREA 0x0812
-#define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413
-#define TT_MS_LANGID_DUTCH_BELGIUM 0x0813
-#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414
-#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814
-#define TT_MS_LANGID_POLISH_POLAND 0x0415
-#define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416
-#define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816
-#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND 0x0417
-#define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418
-#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818
-#define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419
-#define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819
-#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a
-#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a
-#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a
-#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b
-#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c
-#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d
-#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d
-#define TT_MS_LANGID_THAI_THAILAND 0x041e
-#define TT_MS_LANGID_TURKISH_TURKEY 0x041f
-#define TT_MS_LANGID_URDU_PAKISTAN 0x0420
-#define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421
-#define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422
-#define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423
-#define TT_MS_LANGID_SLOVENE_SLOVENIA 0x0424
-#define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425
-#define TT_MS_LANGID_LATVIAN_LATVIA 0x0426
-#define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427
-#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827
-#define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0428
-#define TT_MS_LANGID_FARSI_IRAN 0x0429
-#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a
-#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b
-#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c
-#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c
-#define TT_MS_LANGID_BASQUE_SPAIN 0x042d
-#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e
-#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f
-#define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430
-#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431
-#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432
-#define TT_MS_LANGID_VENDA_SOUTH_AFRICA 0x0433
-#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA 0x0434
-#define TT_MS_LANGID_ZULU_SOUTH_AFRICA 0x0435
-#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436
-#define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437
-#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438
-#define TT_MS_LANGID_HINDI_INDIA 0x0439
-#define TT_MS_LANGID_MALTESE_MALTA 0x043a
-#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b
-#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c
-#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c
-#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e
-#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e
-#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f
-#define TT_MS_LANGID_SWAHILI_KENYA 0x0441
-#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
-#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843
-#define TT_MS_LANGID_TATAR_TATARSTAN 0x0444
-#define TT_MS_LANGID_BENGALI_INDIA 0x0445
-#define TT_MS_LANGID_PUNJABI_INDIA 0x0446
-#define TT_MS_LANGID_GUJARATI_INDIA 0x0447
-#define TT_MS_LANGID_ORIYA_INDIA 0x0448
-#define TT_MS_LANGID_TAMIL_INDIA 0x0449
-#define TT_MS_LANGID_TELUGU_INDIA 0x044a
-#define TT_MS_LANGID_KANNADA_INDIA 0x044b
-#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c
-#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d
-#define TT_MS_LANGID_MARATHI_INDIA 0x044e
-#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f
-#define TT_MS_LANGID_KONKANI_INDIA 0x0457
-
-
-/*
- * possible values of the 'Name' identifier field in the name records of
- * the TTF "name" table. These values are platform independent.
- */
-
-#define TT_NAME_ID_COPYRIGHT 0
-#define TT_NAME_ID_FONT_FAMILY 1
-#define TT_NAME_ID_FONT_SUBFAMILY 2
-#define TT_NAME_ID_UNIQUE_ID 3
-#define TT_NAME_ID_FULL_NAME 4
-#define TT_NAME_ID_VERSION_STRING 5
-#define TT_NAME_ID_PS_NAME 6
-#define TT_NAME_ID_TRADEMARK 7
-/* the following values are from the OpenType spec */
-#define TT_NAME_ID_MANUFACTURER 8
-#define TT_NAME_ID_DESIGNER 9
-#define TT_NAME_ID_DESCRIPTION 10
-#define TT_NAME_ID_VENDOR_URL 11
-#define TT_NAME_ID_DESIGNER_URL 12
-#define TT_NAME_ID_LICENSE 13
-#define TT_NAME_ID_LICENSE_URL 14
-/* number 15 is reserved */
-#define TT_NAME_ID_PREFERRED_FAMILY 16
-#define TT_NAME_ID_PREFERRED_SUBFAMILY 17
-#define TT_NAME_ID_MAC_FULL_NAME 18
-/* The following code is new as of 2000-01-21 */
-#define TT_NAME_ID_SAMPLE_TEXT 19
-
-
-/*
- * Bit Mask values for the Unicode Ranges from the TTF "OS2 " table.
- */
-
-/* General Scripts Area */
-
-/* Bit 0 C0 Controls and Basic Latin */
-#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0000-U+007F */
-/* Bit 1 C1 Controls and Latin-1 Supplement */
-#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
-/* Bit 2 Latin Extended-A */
-#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
-/* Bit 3 Latin Extended-B */
-#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
-/* Bit 4 IPA Extensions */
-#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
-/* Bit 5 Spacing Modifier Letters */
-#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
-/* Bit 6 Combining Diacritical Marks */
-#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
-/* Bit 7 Greek */
-#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
-/* Bit 8 is reserved (was: Greek Symbols and Coptic) */
-/* Bit 9 Cyrillic */
-#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
-/* Bit 10 Armenian */
-#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
-/* Bit 11 Hebrew */
-#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
-/* Bit 12 is reserved (was: Hebrew Extended) */
-/* Bit 13 Arabic */
-#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
-/* Bit 14 is reserved (was: Arabic Extended) */
-/* Bit 15 Devanagari */
-#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
-/* Bit 16 Bengali */
-#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
-/* Bit 17 Gurmukhi */
-#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
-/* Bit 18 Gujarati */
-#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
-/* Bit 19 Oriya */
-#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
-/* Bit 20 Tamil */
-#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
-/* Bit 21 Telugu */
-#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
-/* Bit 22 Kannada */
-#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
-/* Bit 23 Malayalam */
-#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
-/* Bit 24 Thai */
-#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
-/* Bit 25 Lao */
-#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
-/* Bit 26 Georgian */
-#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
-/* Bit 27 is reserved (was Georgian Extended) */
-/* Bit 28 Hangul Jamo */
-#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
-/* Bit 29 Latin Extended Additional */
-#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
-/* Bit 30 Greek Extended */
-#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
-
-/* Symbols Area */
-
-/* Bit 31 General Punctuation */
-#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
-/* Bit 32 Superscripts And Subscripts */
-#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
-/* Bit 33 Currency Symbols */
-#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
-/* Bit 34 Combining Diacritical Marks For Symbols */
-#define TT_UCR_COMBINING_DIACRITICS_SYMB (1L << 2) /* U+20D0-U+20FF */
-/* Bit 35 Letterlike Symbols */
-#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
-/* Bit 36 Number Forms */
-#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
-/* Bit 37 Arrows */
-#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
-/* Bit 38 Mathematical Operators */
-#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
-/* Bit 39 Miscellaneous Technical */
-#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
-/* Bit 40 Control Pictures */
-#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
-/* Bit 41 Optical Character Recognition */
-#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
-/* Bit 42 Enclosed Alphanumerics */
-#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
-/* Bit 43 Box Drawing */
-#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
-/* Bit 44 Block Elements */
-#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
-/* Bit 45 Geometric Shapes */
-#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
-/* Bit 46 Miscellaneous Symbols */
-#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
-/* Bit 47 Dingbats */
-#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
-
-/* CJK Phonetics and Symbols Area */
-
-/* Bit 48 CJK Symbols And Punctuation */
-#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
-/* Bit 49 Hiragana */
-#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
-/* Bit 50 Katakana */
-#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
-/* Bit 51 Bopomofo */
-#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
-/* Bit 52 Hangul Compatibility Jamo */
-#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
-/* Bit 53 CJK Miscellaneous */
-#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */
-/* Bit 54 Enclosed CJK Letters And Months */
-#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
-/* Bit 55 CJK Compatibility */
-#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
-
-/* Hangul Syllables Area */
-
-/* Bit 56 Hangul */
-#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
-
-/* Surrogates Area */
-
-/* Bit 57 Surrogates */
-#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DFFF */
-/* Bit 58 is reserved for Unicode SubRanges */
-
-/* CJK Ideographs Area */
-
-/* Bit 59 CJK Unified Ideographs */
-#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
-
-/* Private Use Area */
-
-/* Bit 60 Private Use */
-#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
-
-/* Compatibility Area and Specials */
-
-/* Bit 61 CJK Compatibility Ideographs */
-#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */
-/* Bit 62 Alphabetic Presentation Forms */
-#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
-/* Bit 63 Arabic Presentation Forms-A */
-#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FSFF */
-/* Bit 64 Combining Half Marks */
-#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
-/* Bit 65 CJK Compatibility Forms */
-#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */
-/* Bit 66 Small Form Variants */
-#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
-/* Bit 67 Arabic Presentation Forms-B */
-#define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFF */
-/* Bit 68 Halfwidth And Fullwidth Forms */
-#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
-/* Bit 69 Specials */
-#define TT_UCR_SPECIALS (1L << 5) /* U+FEFF,
- U+FFF0-U+FFFF */
-/* Bit 70 Tibetan */
-#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FBF */
-/* Bit 71 Syriac */
-#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
-/* Bit 72 Thaana */
-#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
-/* Bit 73 Sinhala */
-#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
-/* Bit 74 Myanmar */
-#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
-/* Bit 75 Ethiopic */
-#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+12BF */
-/* Bit 76 Cherokee */
-#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
-/* Bit 77 Canadian Aboriginal Syllabics */
-#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+14DF */
-/* Bit 78 Ogham */
-#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
-/* Bit 79 Runic */
-#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
-/* Bit 80 Khmer */
-#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
-/* Bit 81 Mongolian */
-#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
-/* Bit 82 Braille */
-#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
-/* Bit 83 Yi */
-#define TT_UCR_YI (1L << 19) /* U+A000-U+A4CF */
-
-
-/* Some compilers have a very limited length of identifiers. */
-#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )
-#define HAVE_LIMIT_ON_IDENTS
-#endif
-
-#ifndef HAVE_LIMIT_ON_IDENTS
-
-/*
- * Here some alias #defines in order to be clearer.
- *
- * These are not always #defined to stay within the 31 character limit
- * which some compilers have.
- *
- * Credits go to Dave Hoo <[email protected]> for pointing out that modern
- * Borland compilers (read: from BC++ 3.1 on) can increase this limit.
- * If you get a warning with such a compiler, use the -i40 switch.
- */
-
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_A \
- TT_UCR_ARABIC_PRESENTATIONS_A
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_B \
- TT_UCR_ARABIC_PRESENTATIONS_B
-
-#define TT_UCR_COMBINING_DIACRITICAL_MARKS \
- TT_UCR_COMBINING_DIACRITICS
-#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
- TT_UCR_COMBINING_DIACRITICS_SYMB
-
-#endif /* ndef HAVE_LIMIT_ON_IDENTS */
-
-#endif /* TTNAMEID_H */
-
-
-/* END */
--- a/include/tttables.h
+++ /dev/null
@@ -1,534 +1,0 @@
-/***************************************************************************/
-/* */
-/* tttables.h */
-/* */
-/* Basic SFNT/TrueType tables definitions and interface */
-/* */
-/* */
-/* Copyright 1996-2000 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used */
-/* modified and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-#ifndef TTTABLES_H
-#define TTTABLES_H
-
-#include <freetype.h>
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Header */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType font header table. All */
- /* fields follow the TrueType specification. */
- /* */
- typedef struct TT_Header_
- {
- FT_Fixed Table_Version;
- FT_Fixed Font_Revision;
-
- FT_Long CheckSum_Adjust;
- FT_Long Magic_Number;
-
- FT_UShort Flags;
- FT_UShort Units_Per_EM;
-
- FT_Long Created [2];
- FT_Long Modified[2];
-
- FT_Short xMin;
- FT_Short yMin;
- FT_Short xMax;
- FT_Short yMax;
-
- FT_UShort Mac_Style;
- FT_UShort Lowest_Rec_PPEM;
-
- FT_Short Font_Direction;
- FT_Short Index_To_Loc_Format;
- FT_Short Glyph_Data_Format;
-
- } TT_Header;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_HoriHeader */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType horizontal header, the `hhea' */
- /* table, as well as the corresponding horizontal metrics table, */
- /* i.e., the `hmtx' table. */
- /* */
- /* <Fields> */
- /* Version :: The table version. */
- /* */
- /* Ascender :: The font's ascender, i.e., the distance */
- /* from the baseline to the top-most of all */
- /* glyph points found in the font. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of the */
- /* glyphs found in the font (maybe ASCII). */
- /* */
- /* You should use the `sTypoAscender' field */
- /* of the OS/2 table instead if you want */
- /* the correct one. */
- /* */
- /* Descender :: The font's descender, i.e., the distance */
- /* from the baseline to the bottom-most of */
- /* all glyph points found in the font. It */
- /* is negative. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of the */
- /* glyphs found in the font (maybe ASCII). */
- /* */
- /* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Line_Gap :: The font's line gap, i.e., the distance */
- /* to add to the ascender and descender to */
- /* get the BTB, i.e., the */
- /* baseline-to-baseline distance for the */
- /* font. */
- /* */
- /* advance_Width_Max :: This field is the maximum of all advance */
- /* widths found in the font. It can be */
- /* used to compute the maximum width of an */
- /* arbitrary string of text. */
- /* */
- /* min_Left_Side_Bearing :: The minimum left side bearing of all */
- /* glyphs within the font. */
- /* */
- /* min_Right_Side_Bearing :: The minimum right side bearing of all */
- /* glyphs within the font. */
- /* */
- /* xMax_Extent :: The maximum horizontal extent (i.e., the */
- /* `width' of a glyph's bounding box) for */
- /* all glyphs in the font. */
- /* */
- /* caret_Slope_Rise :: The rise coefficient of the cursor's */
- /* slope of the cursor (slope=rise/run). */
- /* */
- /* caret_Slope_Run :: The run coefficient of the cursor's */
- /* slope. */
- /* */
- /* Reserved :: 10 reserved bytes. */
- /* */
- /* metric_Data_Format :: Always 0. */
- /* */
- /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
- /* table -- this value can be smaller than */
- /* the total number of glyphs in the font. */
- /* */
- /* long_metrics :: A pointer into the `hmtx' table. */
- /* */
- /* short_metrics :: A pointer into the `hmtx' table. */
- /* */
- /* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields which */
- /* are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
- /* */
- typedef struct TT_HoriHeader_
- {
- FT_Fixed Version;
- FT_Short Ascender;
- FT_Short Descender;
- FT_Short Line_Gap;
-
- FT_UShort advance_Width_Max; /* advance width maximum */
-
- FT_Short min_Left_Side_Bearing; /* minimum left-sb */
- FT_Short min_Right_Side_Bearing; /* minimum right-sb */
- FT_Short xMax_Extent; /* xmax extents */
- FT_Short caret_Slope_Rise;
- FT_Short caret_Slope_Run;
- FT_Short caret_Offset;
-
- FT_Short Reserved[4];
-
- FT_Short metric_Data_Format;
- FT_UShort number_Of_HMetrics;
-
- /* The following fields are not defined by the TrueType specification */
- /* but they're used to connect the metrics header to the relevant */
- /* `HMTX' table. */
-
- void* long_metrics;
- void* short_metrics;
-
- } TT_HoriHeader;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_VertHeader */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType vertical header, the `vhea' */
- /* table, as well as the corresponding vertical metrics table, i.e., */
- /* the `vmtx' table. */
- /* */
- /* <Fields> */
- /* Version :: The table version. */
- /* */
- /* Ascender :: The font's ascender, i.e., the distance */
- /* from the baseline to the top-most of */
- /* all glyph points found in the font. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of */
- /* the glyphs found in the font (maybe */
- /* ASCII). */
- /* */
- /* You should use the `sTypoAscender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Descender :: The font's descender, i.e., the */
- /* distance from the baseline to the */
- /* bottom-most of all glyph points found */
- /* in the font. It is negative. */
- /* */
- /* This value is invalid in many fonts, as */
- /* it is usually set by the font designer, */
- /* and often reflects only a portion of */
- /* the glyphs found in the font (maybe */
- /* ASCII). */
- /* */
- /* You should use the `sTypoDescender' */
- /* field of the OS/2 table instead if you */
- /* want the correct one. */
- /* */
- /* Line_Gap :: The font's line gap, i.e., the distance */
- /* to add to the ascender and descender to */
- /* get the BTB, i.e., the */
- /* baseline-to-baseline distance for the */
- /* font. */
- /* */
- /* advance_Height_Max :: This field is the maximum of all */
- /* advance heights found in the font. It */
- /* can be used to compute the maximum */
- /* height of an arbitrary string of text. */
- /* */
- /* min_Top_Side_Bearing :: The minimum top side bearing of all */
- /* glyphs within the font. */
- /* */
- /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
- /* glyphs within the font. */
- /* */
- /* yMax_Extent :: The maximum vertical extent (i.e., the */
- /* `height' of a glyph's bounding box) for */
- /* all glyphs in the font. */
- /* */
- /* caret_Slope_Rise :: The rise coefficient of the cursor's */
- /* slope of the cursor (slope=rise/run). */
- /* */
- /* caret_Slope_Run :: The run coefficient of the cursor's */
- /* slope. */
- /* */
- /* Reserved :: 10 reserved bytes. */
- /* */
- /* metric_Data_Format :: Always 0. */
- /* */
- /* number_Of_HMetrics :: Number of VMetrics entries in the */
- /* `vmtx' table -- this value can be */
- /* smaller than the total number of glyphs */
- /* in the font. */
- /* */
- /* long_metrics :: A pointer into the `vmtx' table. */
- /* */
- /* short_metrics :: A pointer into the `vmtx' table. */
- /* */
- /* <Note> */
- /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
- /* be identical except for the names of their fields which */
- /* are different. */
- /* */
- /* This ensures that a single function in the `ttload' */
- /* module is able to read both the horizontal and vertical */
- /* headers. */
- /* */
- typedef struct TT_VertHeader_
- {
- FT_Fixed Version;
- FT_Short Ascender;
- FT_Short Descender;
- FT_Short Line_Gap;
-
- FT_UShort advance_Height_Max; /* advance height maximum */
-
- FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
- FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
- FT_Short yMax_Extent; /* xmax or ymax extents */
- FT_Short caret_Slope_Rise;
- FT_Short caret_Slope_Run;
- FT_Short caret_Offset;
-
- FT_Short Reserved[4];
-
- FT_Short metric_Data_Format;
- FT_UShort number_Of_VMetrics;
-
- /* The following fields are not defined by the TrueType specification */
- /* but they're used to connect the metrics header to the relevant */
- /* `HMTX' or `VMTX' table. */
-
- void* long_metrics;
- void* short_metrics;
-
- } TT_VertHeader;
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_OS2 */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType OS/2 table. This is the long */
- /* table version. All fields comply to the TrueType specification. */
- /* */
- /* Note that we now support old Mac fonts which do not include an */
- /* OS/2 table. In this case, the `version' field is always set to */
- /* 0xFFFF. */
- /* */
- typedef struct TT_OS2_
- {
- FT_UShort version; /* 0x0001 - more or 0xFFFF */
- FT_Short xAvgCharWidth;
- FT_UShort usWeightClass;
- FT_UShort usWidthClass;
- FT_Short fsType;
- FT_Short ySubscriptXSize;
- FT_Short ySubscriptYSize;
- FT_Short ySubscriptXOffset;
- FT_Short ySubscriptYOffset;
- FT_Short ySuperscriptXSize;
- FT_Short ySuperscriptYSize;
- FT_Short ySuperscriptXOffset;
- FT_Short ySuperscriptYOffset;
- FT_Short yStrikeoutSize;
- FT_Short yStrikeoutPosition;
- FT_Short sFamilyClass;
-
- FT_Byte panose[10];
-
- FT_ULong ulUnicodeRange1; /* Bits 0-31 */
- FT_ULong ulUnicodeRange2; /* Bits 32-63 */
- FT_ULong ulUnicodeRange3; /* Bits 64-95 */
- FT_ULong ulUnicodeRange4; /* Bits 96-127 */
-
- FT_Char achVendID[4];
-
- FT_UShort fsSelection;
- FT_UShort usFirstCharIndex;
- FT_UShort usLastCharIndex;
- FT_Short sTypoAscender;
- FT_Short sTypoDescender;
- FT_Short sTypoLineGap;
- FT_UShort usWinAscent;
- FT_UShort usWinDescent;
-
- /* only version 1 tables: */
-
- FT_ULong ulCodePageRange1; /* Bits 0-31 */
- FT_ULong ulCodePageRange2; /* Bits 32-63 */
-
- /* only version 2 tables */
- FT_Short sxHeight;
- FT_Short sCapHeight;
- FT_UShort usDefaultChar;
- FT_UShort usBreakChar;
- FT_UShort usMaxContext;
-
- } TT_OS2;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Postscript */
- /* */
- /* <Description> */
- /* A structure used to model a TrueType Postscript table. All fields */
- /* comply to the TrueType table. This structure does not reference */
- /* the Postscript glyph names, which can be nevertheless accessed */
- /* with the `ttpost' module. */
- /* */
- typedef struct TT_Postscript_
- {
- FT_Fixed FormatType;
- FT_Fixed italicAngle;
- FT_Short underlinePosition;
- FT_Short underlineThickness;
- FT_ULong isFixedPitch;
- FT_ULong minMemType42;
- FT_ULong maxMemType42;
- FT_ULong minMemType1;
- FT_ULong maxMemType1;
-
- /* Glyph names follow in the file, but we don't */
- /* load them by default. See the ttpost.c file. */
-
- } TT_Postscript;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_MaxProfile */
- /* */
- /* <Description> */
- /* The maximum profile is a table containing many max values which */
- /* can be used to pre-allocate arrays. This ensures that no memory */
- /* allocation occurs during a glyph load. */
- /* */
- /* <Fields> */
- /* version :: The version number. */
- /* */
- /* numGlyphs :: The number of glyphs in this TrueType */
- /* font. */
- /* */
- /* maxPoints :: The maximum number of points in a */
- /* non-composite TrueType glyph. See also */
- /* the structure element */
- /* `maxCompositePoints'. */
- /* */
- /* maxContours :: The maximum number of contours in a */
- /* non-composite TrueType glyph. See also */
- /* the structure element */
- /* `maxCompositeContours'. */
- /* */
- /* maxCompositePoints :: The maximum number of points in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxPoints'. */
- /* */
- /* maxCompositeContours :: The maximum number of contours in a */
- /* composite TrueType glyph. See also the */
- /* structure element `maxContours'. */
- /* */
- /* maxZones :: The maximum number of zones used for */
- /* glyph hinting. */
- /* */
- /* maxTwilightPoints :: The maximum number of points in the */
- /* twilight zone used for glyph hinting. */
- /* */
- /* maxStorage :: The maximum number of elements in the */
- /* storage area used for glyph hinting. */
- /* */
- /* maxFunctionDefs :: The maximum number of function */
- /* definitions in the TrueType bytecode for */
- /* this font. */
- /* */
- /* maxInstructionDefs :: The maximum number of instruction */
- /* definitions in the TrueType bytecode for */
- /* this font. */
- /* */
- /* maxStackElements :: The maximum number of stack elements used */
- /* during bytecode interpretation. */
- /* */
- /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
- /* used for glyph hinting. */
- /* */
- /* maxComponentElements :: An obscure value related to composite */
- /* glyphs definitions. */
- /* */
- /* maxComponentDepth :: An obscure value related to composite */
- /* glyphs definitions. Probably the maximum */
- /* number of simple glyphs in a composite. */
- /* */
- /* <Note> */
- /* This structure is only used during font loading. */
- /* */
- typedef struct TT_MaxProfile_
- {
- FT_Fixed version;
- FT_UShort numGlyphs;
- FT_UShort maxPoints;
- FT_UShort maxContours;
- FT_UShort maxCompositePoints;
- FT_UShort maxCompositeContours;
- FT_UShort maxZones;
- FT_UShort maxTwilightPoints;
- FT_UShort maxStorage;
- FT_UShort maxFunctionDefs;
- FT_UShort maxInstructionDefs;
- FT_UShort maxStackElements;
- FT_UShort maxSizeOfInstructions;
- FT_UShort maxComponentElements;
- FT_UShort maxComponentDepth;
-
- } TT_MaxProfile;
-
-
-
-
- typedef enum
- {
- ft_sfnt_head = 0,
- ft_sfnt_maxp = 1,
- ft_sfnt_os2 = 2,
- ft_sfnt_hhea = 3,
- ft_sfnt_vhea = 4,
- ft_sfnt_post = 5,
-
- sfnt_max /* don't remove */
-
- } FT_Sfnt_Tag;
-
- /* internal use only */
- typedef void* (*FT_Get_Sfnt_Table_Func)( FT_Face face, FT_Sfnt_Tag tag );
-
- /***************************************************************************
- *
- * <Function>
- * FT_Get_Sfnt_Table
- *
- * <Description>
- * Returns a pointer to a given SFNT table within a face.
- *
- * <Input>
- * face :: handle to source
- * tag :: index if SFNT table
- *
- * <Return>
- * type-less pointer to the table. This will be 0 in case of error, or
- * when the corresponding table was not found *OR* loaded from the file.
- *
- * <Note>
- * The table is owned by the face object, and disappears with it.
- *
- * This function is only useful to access Sfnt tables that are loaded
- * by the sfnt/truetype/opentype drivers. See FT_Sfnt_tag for a list.
- *
- * You can load any table with a different function.. XXX
- *
- ***************************************************************************/
-
- EXPORT_DEF
- void* FT_Get_Sfnt_Table( FT_Face face,
- FT_Sfnt_Tag tag );
-
-
-#endif /* TTTABLES_H */
-
--- 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
--- a/src/base/ftcalc.h
+++ /dev/null
@@ -1,114 +1,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 */
--- 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];
--- a/src/base/ftdebug.h
+++ /dev/null
@@ -1,205 +1,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 */
--- a/src/base/ftdriver.h
+++ /dev/null
@@ -1,588 +1,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 */
--- 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
--- a/src/base/ftextend.h
+++ /dev/null
@@ -1,167 +1,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 */
--- 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,
--- 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 @@
#else
-#include "ftobjs.h"
+#include <freetype/internal/ftobjs.h>
static
int grays_raster_new( FT_Memory memory, FT_Raster* araster )
--- 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
};
--- 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>
/*************************************************************************/
--- a/src/base/ftlist.h
+++ /dev/null
@@ -1,116 +1,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 */
--- 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>
/*************************************************************************/
/*************************************************************************/
--- a/src/base/ftobjs.h
+++ /dev/null
@@ -1,447 +1,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 */
--- 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 };
--- a/src/base/ftoutln.h
+++ /dev/null
@@ -1,6 +1,0 @@
-#ifndef FTOUTLN_H
-#define FTOUTLN_H
-
-#include <ftobjs.h>
-
-#endif /* FTOUTLN_H */
--- 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 @@
#else
-#include "ftobjs.h"
+#include <freetype/internal/ftobjs.h>
static
int ft_raster_new( FT_Memory memory, FT_Raster* araster )
--- 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
--- a/src/base/ftstream.h
+++ /dev/null
@@ -1,285 +1,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 */
--- 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>
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -39,13 +39,13 @@
# 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
--- 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>
--- 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 */
--- 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
--- 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;
--- 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 =
{
--- 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;
--- 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
--- 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" {
--- 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
--- 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>
*/
--- 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
--- 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" {
--- 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>
/*************************************************************************/
--- a/src/shared/autohint.h
+++ /dev/null
@@ -1,200 +1,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 */
-
--- a/src/shared/psnames.h
+++ /dev/null
@@ -1,214 +1,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 */
--- a/src/shared/readme.txt
+++ /dev/null
@@ -1,6 +1,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.
--- a/src/shared/rules.mk
+++ /dev/null
@@ -1,27 +1,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
--- a/src/shared/sfnt.h
+++ /dev/null
@@ -1,380 +1,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 */
--- a/src/shared/t1types.h
+++ /dev/null
@@ -1,398 +1,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 */
--- a/src/shared/tterrors.h
+++ /dev/null
@@ -1,126 +1,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 */
--- a/src/shared/tttags.h
+++ /dev/null
@@ -1,60 +1,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 */
--- a/src/shared/tttypes.h
+++ /dev/null
@@ -1,2073 +1,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 */
--- 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>
--- 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
--- a/src/truetype/tterrors.h
+++ b/src/truetype/tterrors.h
@@ -19,7 +19,6 @@
#ifndef TTERRORS_H
#define TTERRORS_H
-
/*************************************************************************/
/* */
/* Error codes declaration */
@@ -91,6 +90,9 @@
#define TT_Err_Invalid_CodeRange 0x40F
#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. */
--- 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>
--- 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
--- 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 <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftcalc.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/ttnameid.h>
+#include <freetype/tttags.h>
-#include <sfnt.h>
-#include <psnames.h>
+#include <freetype/internal/sfnt.h>
+#include <freetype/internal/psnames.h>
#include <ttobjs.h>
#include <ttpload.h>
--- 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>
--- 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
--- 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
--- 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 )
--- 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.. */
--- 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
--- 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>
--- 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>
--- 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>
--- 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
--- 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
--- 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" {
--- 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 */
--- 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
--- 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>
--- 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
--- 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.. */
--- 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
--- 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 **************/
--- 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
--- 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>
--- 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
--- 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 */
--- 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" {
--- 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>
--- 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" {