aboutsummaryrefslogtreecommitdiff
path: root/freetype/include
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-21 11:18:17 +0200
committermarha <marha@users.sourceforge.net>2013-06-21 11:18:17 +0200
commit039fb6c83783fff3b92f1e7934ce4702cedb1722 (patch)
treebb971ed2e247f7d311b696e62c7ed4d66b199b6d /freetype/include
parent84f6a75a56f4749f91a51a161c1989cbc8807b80 (diff)
parentfa791414601df61d20d860299dba80fdb62565df (diff)
downloadvcxsrv-039fb6c83783fff3b92f1e7934ce4702cedb1722.tar.gz
vcxsrv-039fb6c83783fff3b92f1e7934ce4702cedb1722.tar.bz2
vcxsrv-039fb6c83783fff3b92f1e7934ce4702cedb1722.zip
Merge remote-tracking branch 'origin/released'
* origin/released: Upgraded freetype to 2.5.0.1 Conflicts: freetype/src/base/ftcalc.c freetype/src/base/ftgloadr.c freetype/src/base/ftgxval.c freetype/src/base/ftotval.c freetype/src/base/ftoutln.c freetype/src/base/ftpfr.c freetype/src/base/fttrigon.c freetype/src/cff/cffobjs.c freetype/src/psaux/afmparse.c freetype/src/psnames/psmodule.c freetype/src/raster/ftraster.c freetype/src/raster/ftrend1.c freetype/src/sfnt/ttsbit.c freetype/src/sfnt/ttsbit0.c freetype/src/truetype/ttobjs.c freetype/src/truetype/ttsubpix.c freetype/src/type1/t1afm.c
Diffstat (limited to 'freetype/include')
-rw-r--r--freetype/include/freetype/config/ftconfig.h46
-rw-r--r--freetype/include/freetype/config/ftheader.h28
-rw-r--r--freetype/include/freetype/config/ftoption.h68
-rw-r--r--freetype/include/freetype/freetype.h44
-rw-r--r--freetype/include/freetype/ftadvanc.h21
-rw-r--r--freetype/include/freetype/ftautoh.h12
-rw-r--r--freetype/include/freetype/ftbitmap.h8
-rw-r--r--freetype/include/freetype/ftcache.h89
-rw-r--r--freetype/include/freetype/ftcffdrv.h151
-rw-r--r--freetype/include/freetype/ftchapters.h6
-rw-r--r--freetype/include/freetype/fterrdef.h4
-rw-r--r--freetype/include/freetype/fterrors.h23
-rw-r--r--freetype/include/freetype/ftglyph.h2
-rw-r--r--freetype/include/freetype/ftimage.h15
-rw-r--r--freetype/include/freetype/ftlcdfil.h38
-rw-r--r--freetype/include/freetype/ftmodapi.h15
-rw-r--r--freetype/include/freetype/ftmoderr.h64
-rw-r--r--freetype/include/freetype/ftoutln.h2
-rw-r--r--freetype/include/freetype/ftstroke.h2
-rw-r--r--freetype/include/freetype/fttrigon.h10
-rw-r--r--freetype/include/freetype/ftttdrv.h150
-rw-r--r--freetype/include/freetype/fttypes.h28
-rw-r--r--freetype/include/freetype/internal/ftcalc.h44
-rw-r--r--freetype/include/freetype/internal/ftdebug.h29
-rw-r--r--freetype/include/freetype/internal/ftdriver.h196
-rw-r--r--freetype/include/freetype/internal/ftmemory.h176
-rw-r--r--freetype/include/freetype/internal/ftobjs.h10
-rw-r--r--freetype/include/freetype/internal/ftserv.h88
-rw-r--r--freetype/include/freetype/internal/ftstream.h87
-rw-r--r--freetype/include/freetype/internal/fttrace.h7
-rw-r--r--freetype/include/freetype/internal/ftvalid.h15
-rw-r--r--freetype/include/freetype/internal/internal.h14
-rw-r--r--freetype/include/freetype/internal/psaux.h4
-rw-r--r--freetype/include/freetype/internal/sfnt.h525
-rw-r--r--freetype/include/freetype/internal/t1types.h6
-rw-r--r--freetype/include/freetype/internal/tttypes.h119
-rw-r--r--freetype/include/freetype/tttags.h4
37 files changed, 1105 insertions, 1045 deletions
diff --git a/freetype/include/freetype/config/ftconfig.h b/freetype/include/freetype/config/ftconfig.h
index 4502fd83d..5dce30ef3 100644
--- a/freetype/include/freetype/config/ftconfig.h
+++ b/freetype/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
-/* Copyright 1996-2004, 2006-2008, 2010-2011 by */
+/* Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -200,6 +200,30 @@ FT_BEGIN_HEADER
/* */
typedef unsigned XXX FT_UInt32;
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int64 */
+ /* */
+ /* A typedef for a 64bit signed integer type. The size depends on */
+ /* the configuration. Only defined if there is real 64bit support; */
+ /* otherwise, it gets emulated with a structure (if necessary). */
+ /* */
+ typedef signed XXX FT_Int64;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UInt64 */
+ /* */
+ /* A typedef for a 64bit unsigned integer type. The size depends on */
+ /* the configuration. Only defined if there is real 64bit support; */
+ /* otherwise, it gets emulated with a structure (if necessary). */
+ /* */
+ typedef unsigned XXX FT_UInt64;
+
/* */
#endif
@@ -239,13 +263,15 @@ FT_BEGIN_HEADER
/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64
-#define FT_INT64 long
+#define FT_INT64 long
+#define FT_UINT64 unsigned long
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the __int64 type */
#define FT_LONG64
-#define FT_INT64 __int64
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */
@@ -254,7 +280,8 @@ FT_BEGIN_HEADER
/* this compiler provides the __int64 type */
#define FT_LONG64
-#define FT_INT64 __int64
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
#elif defined( __WATCOMC__ ) /* Watcom C++ */
@@ -263,13 +290,15 @@ FT_BEGIN_HEADER
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
#define FT_LONG64
-#define FT_INT64 long long int
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
#elif defined( __GNUC__ )
/* GCC provides the `long long' type */
#define FT_LONG64
-#define FT_INT64 long long int
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
@@ -293,6 +322,11 @@ FT_BEGIN_HEADER
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
+#ifdef FT_LONG64
+ typedef FT_INT64 FT_Int64;
+ typedef FT_UINT64 FT_UInt64;
+#endif
+
#define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
diff --git a/freetype/include/freetype/config/ftheader.h b/freetype/include/freetype/config/ftheader.h
index 33d6b4054..8371a3161 100644
--- a/freetype/include/freetype/config/ftheader.h
+++ b/freetype/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
-/* Copyright 1996-2008, 2010, 2012 by */
+/* Copyright 1996-2008, 2010, 2012, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -331,6 +331,32 @@
/*************************************************************************
*
* @macro:
+ * FT_CFF_DRIVER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the CFF driver module.
+ *
+ */
+#define FT_CFF_DRIVER_H <freetype/ftcffdrv.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_TRUETYPE_DRIVER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the TrueType driver module.
+ *
+ */
+#define FT_TRUETYPE_DRIVER_H <freetype/ftttdrv.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
* FT_TYPE1_TABLES_H
*
* @description:
diff --git a/freetype/include/freetype/config/ftoption.h b/freetype/include/freetype/config/ftoption.h
index a73fff455..0883c69e4 100644
--- a/freetype/include/freetype/config/ftoption.h
+++ b/freetype/include/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
-/* Copyright 1996-2012 by */
+/* Copyright 1996-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -216,6 +216,20 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
+ /* PNG bitmap support. */
+ /* */
+ /* FreeType now handles loading color bitmap glyphs in the PNG format. */
+ /* This requires help from the external libpng library. Uncompressed */
+ /* color bitmaps do not need any external libraries and will be */
+ /* supported regardless of this configuration. */
+ /* */
+ /* Define this macro if you want to enable this `feature'. */
+ /* */
+/* #define FT_CONFIG_OPTION_USE_PNG */
+
+
+ /*************************************************************************/
+ /* */
/* DLL export compilation */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
@@ -738,6 +752,25 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/**** ****/
+ /**** C F F D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
+ /* engine gets compiled into FreeType. If defined, it is possible to */
+ /* switch between the two engines using the `hinting-engine' property of */
+ /* the cff driver module. */
+ /* */
+/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
@@ -774,37 +807,10 @@ FT_BEGIN_HEADER
/*
- * Define this variable if you want to keep the layout of internal
- * structures that was used prior to FreeType 2.2. This also compiles in
- * a few obsolete functions to avoid linking problems on typical Unix
- * distributions.
- *
- * For embedded systems or building a new distribution from scratch, it
- * is recommended to disable the macro since it reduces the library's code
- * size and activates a few memory-saving optimizations as well.
+ * This macro is obsolete. Support has been removed in FreeType
+ * version 2.5.
*/
-#define FT_CONFIG_OPTION_OLD_INTERNALS
-
-
- /*
- * To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
- * we restrict the number of charmaps in a font. The current API of
- * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
- * takes charcode only. To determine the passed value is for cmap_index
- * or charcode, the possible cmap_index is restricted not to exceed
- * the minimum possible charcode by a rogue client. It is also very
- * unlikely that a rogue client is interested in Unicode values 0 to 15.
- *
- * NOTE: The original threshold was 4 deduced from popular number of
- * cmap subtables in UCS-4 TrueType fonts, but now it is not
- * irregular for OpenType fonts to have more than 4 subtables,
- * because variation selector subtables are available for Apple
- * and Microsoft platforms.
- */
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_MAX_CHARMAP_CACHEABLE 15
-#endif
+/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
/*
diff --git a/freetype/include/freetype/freetype.h b/freetype/include/freetype/freetype.h
index 8df4828f6..fe46d2297 100644
--- a/freetype/include/freetype/freetype.h
+++ b/freetype/include/freetype/freetype.h
@@ -4,7 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
-/* Copyright 1996-2012 by */
+/* Copyright 1996-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,8 +31,8 @@
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
-#include FT_ERRORS_H
#include FT_TYPES_H
+#include FT_ERRORS_H
FT_BEGIN_HEADER
@@ -329,12 +329,14 @@ FT_BEGIN_HEADER
/* It also embeds a memory manager (see @FT_Memory), as well as a */
/* scan-line converter object (see @FT_Raster). */
/* */
- /* For multi-threading applications each thread should have its own */
- /* FT_Library object. */
+ /* In multi-threaded applications, make sure that the same FT_Library */
+ /* object or any of its children doesn't get accessed in parallel. */
/* */
/* <Note> */
/* Library objects are normally created by @FT_Init_FreeType, and */
- /* destroyed with @FT_Done_FreeType. */
+ /* destroyed with @FT_Done_FreeType. If you need reference-counting */
+ /* (cf. @FT_Reference_Library), use @FT_New_Library and */
+ /* @FT_Done_Library. */
/* */
typedef struct FT_LibraryRec_ *FT_Library;
@@ -875,12 +877,15 @@ FT_BEGIN_HEADER
/* usually negative. Only relevant for */
/* scalable formats. */
/* */
- /* height :: The height is the vertical distance */
+ /* height :: This value is the vertical distance */
/* between two consecutive baselines, */
/* expressed in font units. It is always */
/* positive. Only relevant for scalable */
/* formats. */
/* */
+ /* If you want the global glyph height, use */
+ /* `ascender - descender'. */
+ /* */
/* 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 */
@@ -1675,6 +1680,9 @@ FT_BEGIN_HEADER
/* For multi-threading applications each thread should have its own */
/* FT_Library object. */
/* */
+ /* If you need reference-counting (cf. @FT_Reference_Library), use */
+ /* @FT_New_Library and @FT_Done_Library. */
+ /* */
FT_EXPORT( FT_Error )
FT_Init_FreeType( FT_Library *alibrary );
@@ -1869,6 +1877,10 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Note> */
+ /* Use @FT_Done_Face to destroy the created @FT_Face object (along */
+ /* with its slot and sizes). */
+ /* */
FT_EXPORT( FT_Error )
FT_New_Face( FT_Library library,
const char* filepathname,
@@ -2431,7 +2443,7 @@ FT_BEGIN_HEADER
*
* If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
* FT_LOAD_NO_SCALE usually yields meaningless outlines because the
- * subglyphs must be scaled and positioned with hinting instructions.
+ * subglyphs must be scaled and positioned with hinting instructions.
* This can be solved by loading the font without FT_LOAD_NO_SCALE and
* setting the character size to `font->units_per_EM'.
*
@@ -2520,6 +2532,14 @@ FT_BEGIN_HEADER
* FT_LOAD_NO_AUTOHINT ::
* Disable auto-hinter. See also the note below.
*
+ * FT_LOAD_COLOR ::
+ * This flag is used to request loading of color embedded-bitmap
+ * images. The resulting color bitmaps, if available, will have the
+ * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color
+ * bitmaps are found, they will be converted to 256-level gray
+ * bitmaps transparently. Those bitmaps will be in the
+ * @FT_PIXEL_MODE_GRAY format.
+ *
* @note:
* By default, hinting is enabled and the font's native hinter (see
* @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
@@ -2557,6 +2577,8 @@ FT_BEGIN_HEADER
#define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
+ /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
+#define FT_LOAD_COLOR ( 1L << 20 )
/* */
@@ -3695,7 +3717,7 @@ FT_BEGIN_HEADER
/* <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. */
+ /* used to multiply a given value by a 16.16 fixed-point factor. */
/* */
/* <Input> */
/* a :: The first multiplier. */
@@ -3740,7 +3762,7 @@ FT_BEGIN_HEADER
/* <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. */
+ /* used to divide a given value by a 16.16 fixed-point factor. */
/* */
/* <Input> */
/* a :: The first multiplier. */
@@ -3878,8 +3900,8 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 4
-#define FREETYPE_PATCH 11
+#define FREETYPE_MINOR 5
+#define FREETYPE_PATCH 0
/*************************************************************************/
diff --git a/freetype/include/freetype/ftadvanc.h b/freetype/include/freetype/ftadvanc.h
index 8c10b77cb..31203459b 100644
--- a/freetype/include/freetype/ftadvanc.h
+++ b/freetype/include/freetype/ftadvanc.h
@@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (specification only). */
/* */
-/* Copyright 2008 by */
+/* Copyright 2008, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -82,8 +82,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Retrieve the advance value of a given glyph outline in an */
- /* @FT_Face. By default, the unhinted advance is returned in font */
- /* units. */
+ /* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
@@ -94,8 +93,9 @@ FT_BEGIN_HEADER
/* calling @FT_Load_Glyph, used to determine what kind */
/* of advances you need. */
/* <Output> */
- /* padvance :: The advance value, in either font units or 16.16 */
- /* format. */
+ /* padvance :: The advance value. If scaling is performed (based on */
+ /* the value of `load_flags'), the advance value is in */
+ /* 16.16 format. Otherwise, it is in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
/* vertical advance corresponding to a vertical layout. */
@@ -127,8 +127,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Retrieve the advance values of several glyph outlines in an */
- /* @FT_Face. By default, the unhinted advances are returned in font */
- /* units. */
+ /* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
@@ -141,8 +140,12 @@ FT_BEGIN_HEADER
/* calling @FT_Load_Glyph. */
/* */
/* <Output> */
- /* padvance :: The advances, in either font units or 16.16 format. */
- /* This array must contain at least `count' elements. */
+ /* padvance :: The advance values. This array, to be provided by the */
+ /* caller, must contain at least `count' elements. */
+ /* */
+ /* If scaling is performed (based on the value of */
+ /* `load_flags'), the advance values are in 16.16 format. */
+ /* Otherwise, they are in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
/* vertical advances corresponding to a vertical layout. */
diff --git a/freetype/include/freetype/ftautoh.h b/freetype/include/freetype/ftautoh.h
index b427c4dd0..5e1153a1c 100644
--- a/freetype/include/freetype/ftautoh.h
+++ b/freetype/include/freetype/ftautoh.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for controlling the auto-hinter (specification only). */
/* */
-/* Copyright 2012 by */
+/* Copyright 2012, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -61,6 +61,8 @@ FT_BEGIN_HEADER
* glyph-to-script-map
*
* @description:
+ * *Experimental* *only*
+ *
* The auto-hinter provides various script modules to hint glyphs.
* Examples of supported scripts are Latin or CJK. Before a glyph is
* auto-hinted, the Unicode character map of the font gets examined, and
@@ -113,6 +115,8 @@ FT_BEGIN_HEADER
* FT_AUTOHINTER_SCRIPT_XXX
*
* @description:
+ * *Experimental* *only*
+ *
* A list of constants used for the @glyph-to-script-map property to
* specify the script submodule the auto-hinter should use for hinting a
* particular glyph.
@@ -216,7 +220,7 @@ FT_BEGIN_HEADER
* U+1900 - U+194F // Limbu
* U+1B80 - U+1BBF // Sundanese
* U+1C80 - U+1CDF // Meetei Mayak
- * U+A800 - U+A82F // Syloti Nagri
+ * U+A800 - U+A82F // Syloti Nagri
* U+11800 - U+118DF // Sharada
* }
*
@@ -236,6 +240,8 @@ FT_BEGIN_HEADER
* FT_Prop_GlyphToScriptMap
*
* @description:
+ * *Experimental* *only*
+ *
* The data exchange structure for the @glyph-to-script-map property.
*
*/
@@ -253,6 +259,8 @@ FT_BEGIN_HEADER
* fallback-script
*
* @description:
+ * *Experimental* *only*
+ *
* If no auto-hinter script module can be assigned to a glyph, a
* fallback script gets assigned to it (see also the
* @glyph-to-script-map property). By default, this is
diff --git a/freetype/include/freetype/ftbitmap.h b/freetype/include/freetype/ftbitmap.h
index b314273d8..c57f42bcc 100644
--- a/freetype/include/freetype/ftbitmap.h
+++ b/freetype/include/freetype/ftbitmap.h
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
-/* Copyright 2004, 2005, 2006, 2008 by */
+/* Copyright 2004-2006, 2008, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -135,9 +135,9 @@ FT_BEGIN_HEADER
/* FT_Bitmap_Convert */
/* */
/* <Description> */
- /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
- /* bitmap object with depth 8bpp, making the number of used bytes per */
- /* line (a.k.a. the `pitch') a multiple of `alignment'. */
+ /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
+ /* to a bitmap object with depth 8bpp, making the number of used */
+ /* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
diff --git a/freetype/include/freetype/ftcache.h b/freetype/include/freetype/ftcache.h
index 6af530622..4ec9587cf 100644
--- a/freetype/include/freetype/ftcache.h
+++ b/freetype/include/freetype/ftcache.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache subsystem (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
+/* Copyright 1996-2008, 2010, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -214,17 +214,6 @@ FT_BEGIN_HEADER
/* */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /* these macros are incompatible with LLP64, should not be used */
-
-#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
-
-#define FTC_FACE_ID_HASH( i ) \
- ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
- ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/
/*************************************************************************/
@@ -381,7 +370,7 @@ FT_BEGIN_HEADER
/* should never try to discard it yourself. */
/* */
/* The @FT_Face object doesn't necessarily have a current size object */
- /* (i.e., face->size can be 0). If you need a specific `font size', */
+ /* (i.e., face->size can be~0). If you need a specific `font size', */
/* use @FTC_Manager_LookupSize instead. */
/* */
/* Never change the face's transformation matrix (i.e., never call */
@@ -705,17 +694,6 @@ FT_BEGIN_HEADER
(d1)->width == (d2)->width && \
(d1)->flags == (d2)->flags )
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /* this macro is incompatible with LLP64, should not be used */
-
-#define FTC_IMAGE_TYPE_HASH( d ) \
- (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
- ( (d)->width << 8 ) ^ (d)->height ^ \
- ( (d)->flags << 4 ) )
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
/*************************************************************************/
/* */
@@ -723,7 +701,7 @@ FT_BEGIN_HEADER
/* FTC_ImageCache */
/* */
/* <Description> */
- /* A handle to an glyph image cache object. They are designed to */
+ /* A handle to a glyph image cache object. They are designed to */
/* hold many distinct glyph images while not exceeding a certain */
/* memory threshold. */
/* */
@@ -1071,67 +1049,6 @@ FT_BEGIN_HEADER
/* */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /*@***********************************************************************/
- /* */
- /* <Struct> */
- /* FTC_FontRec */
- /* */
- /* <Description> */
- /* A simple structure used to describe a given `font' to the cache */
- /* manager. Note that a `font' is the combination of a given face */
- /* with a given character size. */
- /* */
- /* <Fields> */
- /* face_id :: The ID of the face to use. */
- /* */
- /* pix_width :: The character width in integer pixels. */
- /* */
- /* pix_height :: The character height in integer pixels. */
- /* */
- typedef struct FTC_FontRec_
- {
- FTC_FaceID face_id;
- FT_UShort pix_width;
- FT_UShort pix_height;
-
- } FTC_FontRec;
-
-
- /* */
-
-
-#define FTC_FONT_COMPARE( f1, f2 ) \
- ( (f1)->face_id == (f2)->face_id && \
- (f1)->pix_width == (f2)->pix_width && \
- (f1)->pix_height == (f2)->pix_height )
-
- /* this macro is incompatible with LLP64, should not be used */
-#define FTC_FONT_HASH( f ) \
- (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
- ((f)->pix_width << 8) ^ \
- ((f)->pix_height) )
-
- typedef FTC_FontRec* FTC_Font;
-
-
- FT_EXPORT( FT_Error )
- FTC_Manager_Lookup_Face( FTC_Manager manager,
- FTC_FaceID face_id,
- FT_Face *aface );
-
- FT_EXPORT( FT_Error )
- FTC_Manager_Lookup_Size( FTC_Manager manager,
- FTC_Font font,
- FT_Face *aface,
- FT_Size *asize );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
- /* */
-
FT_END_HEADER
#endif /* __FTCACHE_H__ */
diff --git a/freetype/include/freetype/ftcffdrv.h b/freetype/include/freetype/ftcffdrv.h
new file mode 100644
index 000000000..ccbcbccaa
--- /dev/null
+++ b/freetype/include/freetype/ftcffdrv.h
@@ -0,0 +1,151 @@
+/***************************************************************************/
+/* */
+/* ftcffdrv.h */
+/* */
+/* FreeType API for controlling the CFF driver (specification only). */
+/* */
+/* Copyright 2013 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 __FTCFFDRV_H__
+#define __FTCFFDRV_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * cff_driver
+ *
+ * @title:
+ * The CFF driver
+ *
+ * @abstract:
+ * Controlling the CFF driver module.
+ *
+ * @description:
+ * While FreeType's CFF driver doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * The CFF driver's module name is `cff'.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * hinting-engine
+ *
+ * @description:
+ * Thanks to Adobe, which contributed a new hinting (and parsing)
+ * engine, an application can select between `freetype' and `adobe' if
+ * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
+ * macro isn't defined, `hinting-engine' does nothing.
+ *
+ * The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
+ * defined, and `adobe' otherwise.
+ *
+ * The following example code demonstrates how to select Adobe's hinting
+ * engine (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "hinting-engine", &hinting_engine );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_CFF_HINTING_XXX
+ *
+ * @description:
+ * A list of constants used for the @hinting-engine property to select
+ * the hinting engine for CFF fonts.
+ *
+ * @values:
+ * FT_CFF_HINTING_FREETYPE ::
+ * Use the old FreeType hinting engine.
+ *
+ * FT_CFF_HINTING_ADOBE ::
+ * Use the hinting engine contributed by Adobe.
+ *
+ */
+#define FT_CFF_HINTING_FREETYPE 0
+#define FT_CFF_HINTING_ADOBE 1
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * no-stem-darkening
+ *
+ * @description:
+ * By default, the Adobe CFF engine darkens stems at smaller sizes,
+ * regardless of hinting, to enhance contrast. Setting this property,
+ * stem darkening gets switched off.
+ *
+ * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Bool no_stem_darkening = TRUE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "no-stem-darkening", &no_stem_darkening );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTCFFDRV_H__ */
+
+
+/* END */
diff --git a/freetype/include/freetype/ftchapters.h b/freetype/include/freetype/ftchapters.h
index 984eef372..c55670d1d 100644
--- a/freetype/include/freetype/ftchapters.h
+++ b/freetype/include/freetype/ftchapters.h
@@ -67,13 +67,15 @@
/***************************************************************************/
/* */
/* <Chapter> */
-/* auto_hinter */
+/* module_specific */
/* */
/* <Title> */
-/* The Auto-Hinter */
+/* Controlling FreeType Modules */
/* */
/* <Sections> */
/* auto_hinter */
+/* cff_driver */
+/* tt_driver */
/* */
/***************************************************************************/
diff --git a/freetype/include/freetype/fterrdef.h b/freetype/include/freetype/fterrdef.h
index bb06d79e9..76c7b9e36 100644
--- a/freetype/include/freetype/fterrdef.h
+++ b/freetype/include/freetype/fterrdef.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error codes (specification). */
/* */
-/* Copyright 2002, 2004, 2006, 2007, 2010-2012 by */
+/* Copyright 2002, 2004, 2006, 2007, 2010-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -217,6 +217,8 @@
"ignore" )
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
"no Unicode glyph name found" )
+ FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \
+ "glyph to big for hinting" )
/* BDF errors */
diff --git a/freetype/include/freetype/fterrors.h b/freetype/include/freetype/fterrors.h
index a54699f87..0fa3e4dce 100644
--- a/freetype/include/freetype/fterrors.h
+++ b/freetype/include/freetype/fterrors.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error code handling (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2007 by */
+/* Copyright 1996-2002, 2004, 2007, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -28,9 +28,8 @@
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* defined in ftoption.h in order to make the higher byte indicate */
/* the module where the error has happened (this is not compatible */
- /* with standard builds of FreeType 2). You can then use the macro */
- /* FT_ERROR_BASE macro to extract the generic error code from an */
- /* FT_Error value. */
+ /* with standard builds of FreeType 2). See the file `ftmoderr.h' for */
+ /* more details. */
/* */
/* */
/* II - Error Message strings */
@@ -101,12 +100,6 @@
#undef FT_NEED_EXTERN_C
-#undef FT_ERR_XCAT
-#undef FT_ERR_CAT
-
-#define FT_ERR_XCAT( x, y ) x ## y
-#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
-
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
/* By default, we use `FT_Err_'. */
@@ -150,11 +143,11 @@
/* this macro is used to define an error */
-#define FT_ERRORDEF_( e, v, s ) \
+#define FT_ERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
/* this is only used for <module>_Err_Ok, which must be 0! */
-#define FT_NOERRORDEF_( e, v, s ) \
+#define FT_NOERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
@@ -194,11 +187,9 @@
#undef FT_NEED_EXTERN_C
#undef FT_ERR_BASE
- /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */
-#ifndef FT_KEEP_ERR_PREFIX
+ /* FT_ERR_PREFIX is needed internally */
+#ifndef FT2_BUILD_LIBRARY
#undef FT_ERR_PREFIX
-#else
-#undef FT_KEEP_ERR_PREFIX
#endif
#endif /* __FTERRORS_H__ */
diff --git a/freetype/include/freetype/ftglyph.h b/freetype/include/freetype/ftglyph.h
index f5fb7dcd4..ff5ad6380 100644
--- a/freetype/include/freetype/ftglyph.h
+++ b/freetype/include/freetype/ftglyph.h
@@ -94,7 +94,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* The root glyph structure contains a given glyph image plus its */
- /* advance width in 16.16 fixed float format. */
+ /* advance width in 16.16 fixed-point format. */
/* */
/* <Fields> */
/* library :: A handle to the FreeType library object. */
diff --git a/freetype/include/freetype/ftimage.h b/freetype/include/freetype/ftimage.h
index 04b5e04f7..3b826b1d3 100644
--- a/freetype/include/freetype/ftimage.h
+++ b/freetype/include/freetype/ftimage.h
@@ -5,8 +5,7 @@
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
-/* 2010 by */
+/* Copyright 1996-2010, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -54,7 +53,7 @@ FT_BEGIN_HEADER
/* <Description> */
/* The type FT_Pos is used to store vectorial coordinates. Depending */
/* on the context, these can represent distances in integer font */
- /* units, or 16.16, or 26.6 fixed float pixel coordinates. */
+ /* units, or 16.16, or 26.6 fixed-point pixel coordinates. */
/* */
typedef signed long FT_Pos;
@@ -169,6 +168,15 @@ FT_BEGIN_HEADER
/* times taller than the original glyph image. See also */
/* @FT_RENDER_MODE_LCD_V. */
/* */
+ /* FT_PIXEL_MODE_BGRA :: */
+ /* An image with four 8-bit channels per pixel, representing a */
+ /* color image (such as emoticons) with alpha channel. For each */
+ /* pixel, the format is BGRA, which means, the blue channel comes */
+ /* first in memory. The color channels are pre-multiplied and in */
+ /* the sRGB colorspace. For example, full red at half-translucent */
+ /* opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */
+ /* See also @FT_LOAD_COLOR. */
+ /* */
typedef enum FT_Pixel_Mode_
{
FT_PIXEL_MODE_NONE = 0,
@@ -178,6 +186,7 @@ FT_BEGIN_HEADER
FT_PIXEL_MODE_GRAY4,
FT_PIXEL_MODE_LCD,
FT_PIXEL_MODE_LCD_V,
+ FT_PIXEL_MODE_BGRA,
FT_PIXEL_MODE_MAX /* do not remove */
diff --git a/freetype/include/freetype/ftlcdfil.h b/freetype/include/freetype/ftlcdfil.h
index 45add8675..9d8a26555 100644
--- a/freetype/include/freetype/ftlcdfil.h
+++ b/freetype/include/freetype/ftlcdfil.h
@@ -53,6 +53,44 @@ FT_BEGIN_HEADER
* *not* implemented in default builds of the library. You need to
* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
* in order to activate it.
+ *
+ * FreeType generates alpha coverage maps, which are linear by nature.
+ * For instance, the value 0x80 in bitmap representation means that
+ * (within numerical precision) 0x80/0xff fraction of that pixel is
+ * covered by the glyph's outline. The blending function for placing
+ * text over a background is
+ *
+ * {
+ * dst = alpha * src + (1 - alpha) * dst ,
+ * }
+ *
+ * which is known as OVER. However, when calculating the output of the
+ * OVER operator, the source colors should first be transformed to a
+ * linear color space, then alpha blended in that space, and transformed
+ * back to the output color space.
+ *
+ * When linear light blending is used, the default FIR5 filtering
+ * weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
+ * they have been designed for black on white rendering while lacking
+ * gamma correction. To preserve color neutrality, weights for a FIR5
+ * filter should be chosen according to two free parameters `a' and `c',
+ * and the FIR weights should be
+ *
+ * {
+ * [a - c, a + c, 2 * a, a + c, a - c] .
+ * }
+ *
+ * This formula generates equal weights for all the color primaries
+ * across the filter kernel, which makes it colorless. One suggested
+ * set of weights is
+ *
+ * {
+ * [0x10, 0x50, 0x60, 0x50, 0x10] ,
+ * }
+ *
+ * where `a' has value 0x30 and `b' value 0x20. The weights in filter
+ * may have a sum larger than 0x100, which increases coloration slightly
+ * but also improves contrast.
*/
diff --git a/freetype/include/freetype/ftmodapi.h b/freetype/include/freetype/ftmodapi.h
index 5e5242cf9..12cc7c4ad 100644
--- a/freetype/include/freetype/ftmodapi.h
+++ b/freetype/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
/* */
/* FreeType modules public interface (specification). */
/* */
-/* Copyright 1996-2003, 2006, 2008-2010, 2012 by */
+/* Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -322,14 +322,21 @@ FT_BEGIN_HEADER
* FT_Property_Set( library, "foo", "bar", &bar );
* }
*
+ * Note that the FreeType Cache sub-system doesn't recognize module
+ * property changes. To avoid glyph lookup confusion within the cache
+ * you should call @FTC_Manager_Reset to completely flush the cache if
+ * a module property gets changed after @FTC_Manager_New has been
+ * called.
+ *
* It is not possible to set properties of the FreeType Cache
- * sub-system with FT_Property_Set; use @FTC_Property_Set instead.
+ * sub-system itself with FT_Property_Set; use @FTC_Property_Set
+ * instead.
*
* @since:
* 2.4.11
*
*/
- FT_Error
+ FT_EXPORT( FT_Error )
FT_Property_Set( FT_Library library,
const FT_String* module_name,
const FT_String* property_name,
@@ -393,7 +400,7 @@ FT_BEGIN_HEADER
* 2.4.11
*
*/
- FT_Error
+ FT_EXPORT( FT_Error )
FT_Property_Get( FT_Library library,
const FT_String* module_name,
const FT_String* property_name,
diff --git a/freetype/include/freetype/ftmoderr.h b/freetype/include/freetype/ftmoderr.h
index 1bf3b384a..5a27db151 100644
--- a/freetype/include/freetype/ftmoderr.h
+++ b/freetype/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
/* */
/* FreeType module error offsets (specification). */
/* */
-/* Copyright 2001, 2002, 2003, 2004, 2005, 2010 by */
+/* Copyright 2001-2005, 2010, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,17 +18,57 @@
/*************************************************************************/
/* */
- /* This file is used to define the FreeType module error offsets. */
+ /* This file is used to define the FreeType module error codes. */
/* */
- /* The lower byte gives the error code, the higher byte gives the */
- /* module. The base module has error offset 0. For example, the error */
- /* `FT_Err_Invalid_File_Format' has value 0x003, the error */
- /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */
- /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */
+ /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is */
+ /* set, the lower byte of an error value identifies the error code as */
+ /* usual. In addition, the higher byte identifies the module. For */
+ /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
+ /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error */
+ /* `T1_Err_Invalid_File_Format' has value 0x1403, etc. */
+ /* */
+ /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero, */
+ /* including the high byte. */
+ /* */
+ /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of */
+ /* an error value is set to zero. */
+ /* */
+ /* To hide the various `XXX_Err_' prefixes in the source code, FreeType */
+ /* provides some macros in `fttypes.h'. */
+ /* */
+ /* FT_ERR( err ) */
+ /* Add current error module prefix (as defined with the */
+ /* `FT_ERR_PREFIX' macro) to `err'. For example, in the BDF module */
+ /* the line */
+ /* */
+ /* error = FT_ERR( Invalid_Outline ); */
+ /* */
+ /* expands to */
+ /* */
+ /* error = BDF_Err_Invalid_Outline; */
+ /* */
+ /* For simplicity, you can always use `FT_Err_Ok' directly instead */
+ /* of `FT_ERR( Ok )'. */
+ /* */
+ /* FT_ERR_EQ( errcode, err ) */
+ /* FT_ERR_NEQ( errcode, err ) */
+ /* Compare error code `errcode' with the error `err' for equality */
+ /* and inequality, respectively. Example: */
+ /* */
+ /* if ( FT_ERR_EQ( error, Invalid_Outline ) ) */
+ /* ... */
+ /* */
+ /* Using this macro you don't have to think about error prefixes. */
+ /* Of course, if module errors are not active, the above example is */
+ /* the same as */
+ /* */
+ /* if ( error == FT_Err_Invalid_Outline ) */
+ /* ... */
+ /* */
+ /* FT_ERROR_BASE( errcode ) */
+ /* FT_ERROR_MODULE( errcode ) */
+ /* Get base error and module error code, respectively. */
/* */
- /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
- /* to make the higher byte always zero (disabling the module error */
- /* mechanism). */
/* */
/* It can also be used to create a module error message table easily */
/* with something like */
@@ -48,9 +88,6 @@
/* #include FT_MODULE_ERRORS_H */
/* } */
/* */
- /* To use such a table, all errors must be ANDed with 0xFF00 to remove */
- /* the error code. */
- /* */
/*************************************************************************/
@@ -124,6 +161,7 @@
FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
+ FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
#ifdef FT_MODERR_END_LIST
diff --git a/freetype/include/freetype/ftoutln.h b/freetype/include/freetype/ftoutln.h
index bdeaf3277..baff88920 100644
--- a/freetype/include/freetype/ftoutln.h
+++ b/freetype/include/freetype/ftoutln.h
@@ -126,8 +126,10 @@ FT_BEGIN_HEADER
/* destroying the library, by @FT_Done_FreeType. */
/* */
/* numPoints :: The maximum number of points within the outline. */
+ /* Must be smaller than or equal to 0xFFFF (65535). */
/* */
/* numContours :: The maximum number of contours within the outline. */
+ /* This value must be in the range 0 to `numPoints'. */
/* */
/* <Output> */
/* anoutline :: A handle to the new outline. */
diff --git a/freetype/include/freetype/ftstroke.h b/freetype/include/freetype/ftstroke.h
index c3eb85a67..a498e4a88 100644
--- a/freetype/include/freetype/ftstroke.h
+++ b/freetype/include/freetype/ftstroke.h
@@ -271,7 +271,7 @@ FT_BEGIN_HEADER
* miter_limit ::
* The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
* FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
- * expressed as 16.16 fixed point value.
+ * expressed as 16.16 fixed-point value.
*
* @note:
* The radius is expressed in the same units as the outline
diff --git a/freetype/include/freetype/fttrigon.h b/freetype/include/freetype/fttrigon.h
index f5f94e502..3dc77cbe6 100644
--- a/freetype/include/freetype/fttrigon.h
+++ b/freetype/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (specification). */
/* */
-/* Copyright 2001, 2003, 2005, 2007 by */
+/* Copyright 2001, 2003, 2005, 2007, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -46,7 +46,7 @@ FT_BEGIN_HEADER
*
* @description:
* This type is used to model angle values in FreeType. Note that the
- * angle is a 16.16 fixed float value expressed in degrees.
+ * angle is a 16.16 fixed-point value expressed in degrees.
*
*/
typedef FT_Fixed FT_Angle;
@@ -106,7 +106,7 @@ FT_BEGIN_HEADER
* FT_Sin
*
* @description:
- * Return the sinus of a given angle in fixed point format.
+ * Return the sinus of a given angle in fixed-point format.
*
* @input:
* angle ::
@@ -130,7 +130,7 @@ FT_BEGIN_HEADER
* FT_Cos
*
* @description:
- * Return the cosinus of a given angle in fixed point format.
+ * Return the cosinus of a given angle in fixed-point format.
*
* @input:
* angle ::
@@ -154,7 +154,7 @@ FT_BEGIN_HEADER
* FT_Tan
*
* @description:
- * Return the tangent of a given angle in fixed point format.
+ * Return the tangent of a given angle in fixed-point format.
*
* @input:
* angle ::
diff --git a/freetype/include/freetype/ftttdrv.h b/freetype/include/freetype/ftttdrv.h
new file mode 100644
index 000000000..d5d3f1ccc
--- /dev/null
+++ b/freetype/include/freetype/ftttdrv.h
@@ -0,0 +1,150 @@
+/***************************************************************************/
+/* */
+/* ftttdrv.h */
+/* */
+/* FreeType API for controlling the TrueType driver */
+/* (specification only). */
+/* */
+/* Copyright 2013 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 __FTTTDRV_H__
+#define __FTTTDRV_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * tt_driver
+ *
+ * @title:
+ * The TrueType driver
+ *
+ * @abstract:
+ * Controlling the TrueType driver module.
+ *
+ * @description:
+ * While FreeType's TrueType driver doesn't expose API functions by
+ * itself, it is possible to control its behaviour with @FT_Property_Set
+ * and @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * The TrueType driver's module name is `truetype'.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * interpreter-version
+ *
+ * @description:
+ * Currently, two versions are available which represent the bytecode
+ * interpreter with and without subpixel hinting support,
+ * respectively. The default is subpixel support if
+ * TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel
+ * support otherwise (since it isn't available then).
+ *
+ * If subpixel hinting is on, many TrueType bytecode instructions
+ * behave differently compared to B/W or grayscale rendering. The
+ * main idea is to render at a much increased horizontal resolution,
+ * then sampling down the created output to subpixel precision.
+ * However, many older fonts are not suited to this and must be
+ * specially taken care of by applying (hardcoded) font-specific
+ * tweaks.
+ *
+ * Details on subpixel hinting and some of the necessary tweaks can be
+ * found in Greg Hitchcock's whitepaper at
+ * `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
+ *
+ * The following example code demonstrates how to activate subpixel
+ * hinting (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_38;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "truetype",
+ * "interpreter-version",
+ * &interpreter_version );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * TT_INTERPRETER_VERSION_XXX
+ *
+ * @description:
+ * A list of constants used for the @interpreter-version property to
+ * select the hinting engine for Truetype fonts.
+ *
+ * The numeric value in the constant names represents the version
+ * number as returned by the `GETINFO' bytecode instruction.
+ *
+ * @values:
+ * TT_INTERPRETER_VERSION_35 ::
+ * Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
+ * Windows~98; only grayscale and B/W rasterizing is supported.
+ *
+ * TT_INTERPRETER_VERSION_38 ::
+ * Version~38 corresponds to MS rasterizer v.1.9; it is roughly
+ * equivalent to the hinting provided by DirectWrite ClearType (as
+ * can be found, for example, in the Internet Explorer~9 running on
+ * Windows~7).
+ *
+ * @note:
+ * This property controls the behaviour of the bytecode interpreter
+ * and thus how outlines get hinted. It does *not* control how glyph
+ * get rasterized! In particular, it does not control subpixel color
+ * filtering.
+ *
+ * If FreeType has not been compiled with configuration option
+ * FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an
+ * `FT_Err_Unimplemented_Feature' error.
+ *
+ */
+#define TT_INTERPRETER_VERSION_35 35
+#define TT_INTERPRETER_VERSION_38 38
+
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTTTDRV_H__ */
+
+
+/* END */
diff --git a/freetype/include/freetype/fttypes.h b/freetype/include/freetype/fttypes.h
index 325552744..027e59ce1 100644
--- a/freetype/include/freetype/fttypes.h
+++ b/freetype/include/freetype/fttypes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType simple types definitions (specification only). */
/* */
-/* Copyright 1996-2002, 2004, 2006-2009, 2012 by */
+/* Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -255,7 +255,7 @@ FT_BEGIN_HEADER
/* FT_F2Dot14 */
/* */
/* <Description> */
- /* A signed 2.14 fixed float type used for unit vectors. */
+ /* A signed 2.14 fixed-point type used for unit vectors. */
/* */
typedef signed short FT_F2Dot14;
@@ -266,7 +266,7 @@ FT_BEGIN_HEADER
/* FT_F26Dot6 */
/* */
/* <Description> */
- /* A signed 26.6 fixed float type used for vectorial pixel */
+ /* A signed 26.6 fixed-point type used for vectorial pixel */
/* coordinates. */
/* */
typedef signed long FT_F26Dot6;
@@ -278,7 +278,7 @@ FT_BEGIN_HEADER
/* FT_Fixed */
/* */
/* <Description> */
- /* This type is used to store 16.16 fixed float values, like scaling */
+ /* This type is used to store 16.16 fixed-point values, like scaling */
/* values or matrix coefficients. */
/* */
typedef signed long FT_Fixed;
@@ -362,7 +362,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* A simple structure used to store a 2x2 matrix. Coefficients are */
- /* in 16.16 fixed float format. The computation performed is: */
+ /* in 16.16 fixed-point format. The computation performed is: */
/* */
/* { */
/* x' = x*xx + y*xy */
@@ -571,14 +571,24 @@ FT_BEGIN_HEADER
/* */
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
+#define FT_BOOL( x ) ( (FT_Bool)( x ) )
- /* return base error code (without module-specific prefix) */
-#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
+ /* concatenate C tokens */
+#define FT_ERR_XCAT( x, y ) x ## y
+#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
+
+ /* see `ftmoderr.h' for descriptions of the following macros */
+
+#define FT_ERR( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
- /* return module error code */
+#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
-#define FT_BOOL( x ) ( (FT_Bool)( x ) )
+#define FT_ERR_EQ( x, e ) \
+ ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )
+#define FT_ERR_NEQ( x, e ) \
+ ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )
+
FT_END_HEADER
diff --git a/freetype/include/freetype/internal/ftcalc.h b/freetype/include/freetype/internal/ftcalc.h
index 125cda1a3..75652a10d 100644
--- a/freetype/include/freetype/internal/ftcalc.h
+++ b/freetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (specification). */
/* */
-/* Copyright 1996-2006, 2008, 2009, 2012 by */
+/* Copyright 1996-2006, 2008, 2009, 2012-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -33,7 +33,7 @@ FT_BEGIN_HEADER
/* FT_FixedSqrt */
/* */
/* <Description> */
- /* Computes the square root of a 16.16 fixed point value. */
+ /* Computes the square root of a 16.16 fixed-point value. */
/* */
/* <Input> */
/* x :: The value to compute the root for. */
@@ -48,29 +48,6 @@ FT_BEGIN_HEADER
FT_SqrtFixed( FT_Int32 x );
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Sqrt32 */
- /* */
- /* <Description> */
- /* Computes the square root of an Int32 integer (which will be */
- /* handled as an unsigned long value). */
- /* */
- /* <Input> */
- /* x :: The value to compute the root for. */
- /* */
- /* <Return> */
- /* The result of `sqrt(x)'. */
- /* */
- FT_EXPORT( FT_Int32 )
- FT_Sqrt32( FT_Int32 x );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
/*************************************************************************/
/* */
/* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
@@ -125,7 +102,6 @@ FT_BEGIN_HEADER
* A variant of FT_Vector_Transform. See comments for
* FT_Matrix_Multiply_Scaled.
*/
-
FT_BASE( void )
FT_Vector_Transform_Scaled( FT_Vector* vector,
const FT_Matrix* matrix,
@@ -156,6 +132,22 @@ FT_BEGIN_HEADER
FT_Pos out_y );
+ /*
+ * Return the most significant bit index.
+ */
+ FT_BASE( FT_Int )
+ FT_MSB( FT_UInt32 z );
+
+
+ /*
+ * Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
+ * two fixed-point arguments instead.
+ */
+ FT_BASE( FT_Fixed )
+ FT_Hypot( FT_Fixed x,
+ FT_Fixed y );
+
+
#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 )
diff --git a/freetype/include/freetype/internal/ftdebug.h b/freetype/include/freetype/internal/ftdebug.h
index f8e19e965..7d72f9301 100644
--- a/freetype/include/freetype/internal/ftdebug.h
+++ b/freetype/include/freetype/internal/ftdebug.h
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by */
+/* Copyright 1996-2002, 2004, 2006-2009, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -185,7 +185,8 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
- /* Define the FT_ASSERT macro. */
+ /* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw' */
+ /* makes it possible to easily set a breakpoint at this function. */
/* */
/*************************************************************************/
@@ -199,10 +200,18 @@ FT_BEGIN_HEADER
__LINE__, __FILE__ ); \
} while ( 0 )
+#define FT_THROW( e ) \
+ ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ), \
+ __LINE__, \
+ __FILE__ ) | \
+ FT_ERR_CAT( FT_ERR_PREFIX, e ) )
+
#else /* !FT_DEBUG_LEVEL_ERROR */
#define FT_ASSERT( condition ) do { } while ( 0 )
+#define FT_THROW( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
+
#endif /* !FT_DEBUG_LEVEL_ERROR */
@@ -226,22 +235,18 @@ FT_BEGIN_HEADER
FT_Panic( const char* fmt,
... );
+ /* report file name and line number of an error */
+ FT_BASE( int )
+ FT_Throw( FT_Error error,
+ int line,
+ const char* file );
+
#endif /* FT_DEBUG_LEVEL_ERROR */
FT_BASE( void )
ft_debug_init( void );
-
-#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
-
- /* We disable the warning `conditional expression is constant' here */
- /* in order to compile cleanly with the maximum level of warnings. */
-#pragma warning( disable : 4127 )
-
-#endif /* _MSC_VER */
-
-
FT_END_HEADER
#endif /* __FTDEBUG_H__ */
diff --git a/freetype/include/freetype/internal/ftdriver.h b/freetype/include/freetype/internal/ftdriver.h
index 093b14b4f..940218e62 100644
--- a/freetype/include/freetype/internal/ftdriver.h
+++ b/freetype/include/freetype/internal/ftdriver.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver interface (specification). */
/* */
-/* Copyright 1996-2003, 2006, 2008, 2011-2012 by */
+/* Copyright 1996-2003, 2006, 2008, 2011-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -60,22 +60,6 @@ FT_BEGIN_HEADER
(*FT_Size_SelectFunc)( FT_Size size,
FT_ULong size_index );
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- typedef FT_Error
- (*FT_Size_ResetPointsFunc)( FT_Size size,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
-
- typedef FT_Error
- (*FT_Size_ResetPixelsFunc)( FT_Size size,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
typedef FT_Error
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
FT_Size size,
@@ -196,13 +180,6 @@ FT_BEGIN_HEADER
FT_Slot_InitFunc init_slot;
FT_Slot_DoneFunc done_slot;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- FT_Size_ResetPointsFunc set_char_sizes;
- FT_Size_ResetPixelsFunc set_pixel_sizes;
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
FT_Slot_LoadFunc load_glyph;
FT_Face_GetKerningFunc get_kerning;
@@ -216,30 +193,6 @@ FT_BEGIN_HEADER
} FT_Driver_ClassRec, *FT_Driver_Class;
- /*
- * The following functions are used as stubs for `set_char_sizes' and
- * `set_pixel_sizes'; the code uses `request_size' and `select_size'
- * functions instead.
- *
- * Implementation is in `src/base/ftobjs.c'.
- */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- FT_BASE( FT_Error )
- ft_stub_set_char_sizes( FT_Size size,
- FT_F26Dot6 width,
- FT_F26Dot6 height,
- FT_UInt horz_res,
- FT_UInt vert_res );
-
- FT_BASE( FT_Error )
- ft_stub_set_pixel_sizes( FT_Size size,
- FT_UInt width,
- FT_UInt height );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
/*************************************************************************/
/* */
/* <Macro> */
@@ -279,94 +232,74 @@ FT_BEGIN_HEADER
/* */
#ifndef FT_CONFIG_OPTION_PIC
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) \
- a_, b_,
-#else
-#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) /* empty */
-#endif
-
#define FT_DECLARE_DRIVER( class_ ) \
- FT_CALLBACK_TABLE \
+ FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_;
-#define FT_DEFINE_DRIVER( \
- class_, \
- flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_, \
- face_object_size_, \
- size_object_size_, \
- slot_object_size_, \
- init_face_, \
- done_face_, \
- init_size_, \
- done_size_, \
- init_slot_, \
- done_slot_, \
- old_set_char_sizes_, \
- old_set_pixel_sizes_, \
- load_glyph_, \
- get_kerning_, \
- attach_file_, \
- get_advances_, \
- request_size_, \
- select_size_ ) \
- FT_CALLBACK_TABLE_DEF \
- const FT_Driver_ClassRec class_ = \
- { \
- FT_DEFINE_ROOT_MODULE( flags_, \
- size_, \
- name_, \
- version_, \
- requires_, \
- interface_, \
- init_, \
- done_, \
- get_interface_ ) \
- \
- face_object_size_, \
- size_object_size_, \
- slot_object_size_, \
- \
- init_face_, \
- done_face_, \
- \
- init_size_, \
- done_size_, \
- \
- init_slot_, \
- done_slot_, \
- \
- FT_DEFINE_DRIVERS_OLD_INTERNALS( old_set_char_sizes_, \
- old_set_pixel_sizes_ ) \
- \
- load_glyph_, \
- \
- get_kerning_, \
- attach_file_, \
- get_advances_, \
- \
- request_size_, \
- select_size_ \
+#define FT_DEFINE_DRIVER( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_, \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ init_face_, \
+ done_face_, \
+ init_size_, \
+ done_size_, \
+ init_slot_, \
+ done_slot_, \
+ load_glyph_, \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ request_size_, \
+ select_size_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_Driver_ClassRec class_ = \
+ { \
+ FT_DEFINE_ROOT_MODULE( flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ \
+ init_face_, \
+ done_face_, \
+ \
+ init_size_, \
+ done_size_, \
+ \
+ init_slot_, \
+ done_slot_, \
+ \
+ load_glyph_, \
+ \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ \
+ request_size_, \
+ select_size_ \
};
#else /* FT_CONFIG_OPTION_PIC */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) \
- clazz->set_char_sizes = a_; \
- clazz->set_pixel_sizes = b_;
-#else
-#define FT_DEFINE_DRIVERS_OLD_INTERNALS( a_, b_ ) /* empty */
-#endif
-
#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_DRIVER( \
@@ -389,8 +322,6 @@ FT_BEGIN_HEADER
done_size_, \
init_slot_, \
done_slot_, \
- old_set_char_sizes_, \
- old_set_pixel_sizes_, \
load_glyph_, \
get_kerning_, \
attach_file_, \
@@ -453,9 +384,6 @@ FT_BEGIN_HEADER
clazz->init_slot = init_slot_; \
clazz->done_slot = done_slot_; \
\
- FT_DEFINE_DRIVERS_OLD_INTERNALS( old_set_char_sizes_, \
- old_set_pixel_sizes_ ) \
- \
clazz->load_glyph = load_glyph_; \
\
clazz->get_kerning = get_kerning_; \
diff --git a/freetype/include/freetype/internal/ftmemory.h b/freetype/include/freetype/internal/ftmemory.h
index 026aa63ea..3d51aeec6 100644
--- a/freetype/include/freetype/internal/ftmemory.h
+++ b/freetype/include/freetype/internal/ftmemory.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType memory management macros (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */
+/* Copyright 1996-2002, 2004-2007, 2010, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -141,8 +141,10 @@ FT_BEGIN_HEADER
const void* P );
-#define FT_MEM_ALLOC( ptr, size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )
+#define FT_MEM_ALLOC( ptr, size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
+ (FT_Long)(size), \
+ &error ) )
#define FT_MEM_FREE( ptr ) \
FT_BEGIN_STMNT \
@@ -154,45 +156,60 @@ FT_BEGIN_HEADER
FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1, \
- (cursz), (newsz), \
- (ptr), &error ) )
-
-#define FT_MEM_QALLOC( ptr, size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ 1, \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_QALLOC( ptr, size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, \
+ (FT_Long)(size), \
+ &error ) )
#define FT_MEM_QNEW( ptr ) \
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
-#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1, \
- (cursz), (newsz), \
- (ptr), &error ) )
-
-#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
- (cursz), (newsz), \
- (ptr), &error ) )
-
-#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \
- 0, (count), \
- NULL, &error ) )
-
-#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz), \
- (oldcnt), (newcnt), \
- (ptr), &error ) )
-
-#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \
- 0, (count), \
- NULL, &error ) )
-
-#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz), \
- (oldcnt), (newcnt), \
- (ptr), &error ) )
+#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ 1, \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ (FT_Long)(item_size), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ (FT_Long)(itmsz), \
+ (FT_Long)(oldcnt), \
+ (FT_Long)(newcnt), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ (FT_Long)(item_size), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ (FT_Long)(itmsz), \
+ (FT_Long)(oldcnt), \
+ (FT_Long)(newcnt), \
+ (ptr), \
+ &error ) )
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
@@ -236,26 +253,37 @@ FT_BEGIN_HEADER
/* _typed_ in order to automatically compute array element sizes. */
/* */
-#define FT_MEM_NEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
- 0, (count), \
- NULL, &error ) )
-
-#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
- (cursz), (newsz), \
- (ptr), &error ) )
-
-#define FT_MEM_QNEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
- 0, (count), \
- NULL, &error ) )
-
-#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
- (cursz), (newsz), \
- (ptr), &error ) )
-
+#define FT_MEM_NEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ sizeof ( *(ptr) ), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
+ sizeof ( *(ptr) ), \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
+
+#define FT_MEM_QNEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ sizeof ( *(ptr) ), \
+ 0, \
+ (FT_Long)(count), \
+ NULL, \
+ &error ) )
+
+#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
+ sizeof ( *(ptr) ), \
+ (FT_Long)(cursz), \
+ (FT_Long)(newsz), \
+ (ptr), \
+ &error ) )
#define FT_ALLOC( ptr, size ) \
FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
@@ -303,37 +331,6 @@ FT_BEGIN_HEADER
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- FT_BASE( FT_Error )
- FT_Alloc( FT_Memory memory,
- FT_Long size,
- void* *P );
-
- FT_BASE( FT_Error )
- FT_QAlloc( FT_Memory memory,
- FT_Long size,
- void* *p );
-
- FT_BASE( FT_Error )
- FT_Realloc( FT_Memory memory,
- FT_Long current,
- FT_Long size,
- void* *P );
-
- FT_BASE( FT_Error )
- FT_QRealloc( FT_Memory memory,
- FT_Long current,
- FT_Long size,
- void* *p );
-
- FT_BASE( void )
- FT_Free( FT_Memory memory,
- void* *P );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
FT_BASE( FT_Pointer )
ft_mem_strdup( FT_Memory memory,
const char* str,
@@ -345,6 +342,7 @@ FT_BEGIN_HEADER
FT_ULong size,
FT_Error *p_error );
+
#define FT_MEM_STRDUP( dst, str ) \
(dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
diff --git a/freetype/include/freetype/internal/ftobjs.h b/freetype/include/freetype/internal/ftobjs.h
index c97b25b27..444e5d15c 100644
--- a/freetype/include/freetype/internal/ftobjs.h
+++ b/freetype/include/freetype/internal/ftobjs.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (specification). */
/* */
-/* Copyright 1996-2006, 2008, 2010, 2012 by */
+/* Copyright 1996-2006, 2008, 2010, 2012-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -352,10 +352,6 @@ FT_BEGIN_HEADER
/* */
typedef struct FT_Face_InternalRec_
{
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- FT_UShort reserved1;
- FT_Short reserved2;
-#endif
FT_Matrix transform_matrix;
FT_Vector transform_delta;
FT_Int transform_flags;
@@ -367,7 +363,7 @@ FT_BEGIN_HEADER
#endif
FT_Bool ignore_unpatented_hinter;
- FT_UInt refcount;
+ FT_Int refcount;
} FT_Face_InternalRec;
@@ -887,7 +883,7 @@ FT_BEGIN_HEADER
FT_PIC_Container pic_container;
#endif
- FT_UInt refcount;
+ FT_Int refcount;
} FT_LibraryRec;
diff --git a/freetype/include/freetype/internal/ftserv.h b/freetype/include/freetype/internal/ftserv.h
index 1d4ded54f..cd5fbd0fa 100644
--- a/freetype/include/freetype/internal/ftserv.h
+++ b/freetype/include/freetype/internal/ftserv.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType services (specification only). */
/* */
-/* Copyright 2003-2007, 2009, 2012 by */
+/* Copyright 2003-2007, 2009, 2012, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -34,14 +34,6 @@
FT_BEGIN_HEADER
-#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
-
- /* we disable the warning `conditional expression is constant' here */
- /* in order to compile cleanly with the maximum level of warnings */
-#pragma warning( disable : 4127 )
-
-#endif /* _MSC_VER */
-
/*
* @macro:
* FT_FACE_FIND_SERVICE
@@ -174,6 +166,7 @@ FT_BEGIN_HEADER
/* FT_DEFINE_SERVICEDESCREC4 */
/* FT_DEFINE_SERVICEDESCREC5 */
/* FT_DEFINE_SERVICEDESCREC6 */
+ /* FT_DEFINE_SERVICEDESCREC7 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */
@@ -270,6 +263,26 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
};
+#define FT_DEFINE_SERVICEDESCREC7( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { serv_id_6, serv_data_6 }, \
+ { serv_id_7, serv_data_7 }, \
+ { NULL, NULL } \
+ };
+
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
@@ -527,6 +540,59 @@ FT_BEGIN_HEADER
return FT_Err_Ok; \
}
+#define FT_DEFINE_SERVICEDESCREC7( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
+ return error; \
+ \
+ clazz[0].serv_id = serv_id_1; \
+ clazz[0].serv_data = serv_data_1; \
+ clazz[1].serv_id = serv_id_2; \
+ clazz[1].serv_data = serv_data_2; \
+ clazz[2].serv_id = serv_id_3; \
+ clazz[2].serv_data = serv_data_3; \
+ clazz[3].serv_id = serv_id_4; \
+ clazz[3].serv_data = serv_data_4; \
+ clazz[4].serv_id = serv_id_5; \
+ clazz[4].serv_data = serv_data_5; \
+ clazz[5].serv_id = serv_id_6; \
+ clazz[5].serv_data = serv_data_6; \
+ clazz[6].serv_id = serv_id_7; \
+ clazz[6].serv_data = serv_data_7; \
+ clazz[7].serv_id = NULL; \
+ clazz[7].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
#endif /* FT_CONFIG_OPTION_PIC */
@@ -579,7 +645,9 @@ FT_BEGIN_HEADER
/*
* A magic number used within the services cache.
*/
-#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~1) /* magic number */
+
+ /* ensure that value `1' has the same width as a pointer */
+#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
/*
diff --git a/freetype/include/freetype/internal/ftstream.h b/freetype/include/freetype/internal/ftstream.h
index 7211ba66e..4d3e88105 100644
--- a/freetype/include/freetype/internal/ftstream.h
+++ b/freetype/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
/* */
/* Stream handling (specification). */
/* */
-/* Copyright 1996-2002, 2004-2006, 2011 by */
+/* Copyright 1996-2002, 2004-2006, 2011, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -154,67 +154,60 @@ FT_BEGIN_HEADER
/* */
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
-#define FT_INT8_( p, i ) ( ((const FT_Char*)(p))[(i)] )
#define FT_INT16( x ) ( (FT_Int16)(x) )
#define FT_UINT16( x ) ( (FT_UInt16)(x) )
#define FT_INT32( x ) ( (FT_Int32)(x) )
#define FT_UINT32( x ) ( (FT_UInt32)(x) )
-#define FT_BYTE_I16( p, i, s ) ( FT_INT16( FT_BYTE_( p, i ) ) << (s) )
+
#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
-#define FT_BYTE_I32( p, i, s ) ( FT_INT32( FT_BYTE_( p, i ) ) << (s) )
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
-#define FT_INT8_I16( p, i, s ) ( FT_INT16( FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_U16( p, i, s ) ( FT_UINT16( FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_I32( p, i, s ) ( FT_INT32( FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_U32( p, i, s ) ( FT_UINT32( FT_INT8_( p, i ) ) << (s) )
-
-#define FT_PEEK_SHORT( p ) FT_INT16( FT_INT8_I16( p, 0, 8) | \
- FT_BYTE_I16( p, 1, 0) )
+#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
+ FT_BYTE_U16( p, 1, 0) )
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
-#define FT_PEEK_LONG( p ) FT_INT32( FT_INT8_I32( p, 0, 24 ) | \
- FT_BYTE_I32( p, 1, 16 ) | \
- FT_BYTE_I32( p, 2, 8 ) | \
- FT_BYTE_I32( p, 3, 0 ) )
+#define FT_PEEK_LONG( p ) FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
+ FT_BYTE_U32( p, 1, 16 ) | \
+ FT_BYTE_U32( p, 2, 8 ) | \
+ FT_BYTE_U32( p, 3, 0 ) )
#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
FT_BYTE_U32( p, 1, 16 ) | \
FT_BYTE_U32( p, 2, 8 ) | \
FT_BYTE_U32( p, 3, 0 ) )
-#define FT_PEEK_OFF3( p ) FT_INT32( FT_INT8_I32( p, 0, 16 ) | \
- FT_BYTE_I32( p, 1, 8 ) | \
- FT_BYTE_I32( p, 2, 0 ) )
+#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 2, 0 ) )
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 2, 0 ) )
-#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_INT8_I16( p, 1, 8 ) | \
- FT_BYTE_I16( p, 0, 0 ) )
+#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
+ FT_BYTE_U16( p, 0, 0 ) )
#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
FT_BYTE_U16( p, 0, 0 ) )
-#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_INT8_I32( p, 3, 24 ) | \
- FT_BYTE_I32( p, 2, 16 ) | \
- FT_BYTE_I32( p, 1, 8 ) | \
- FT_BYTE_I32( p, 0, 0 ) )
+#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
+ FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
-#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_INT8_I32( p, 2, 16 ) | \
- FT_BYTE_I32( p, 1, 8 ) | \
- FT_BYTE_I32( p, 0, 0 ) )
+#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
@@ -493,37 +486,41 @@ FT_BEGIN_HEADER
#define FT_STREAM_POS() \
FT_Stream_Pos( stream )
-#define FT_STREAM_SEEK( position ) \
- FT_SET_ERROR( FT_Stream_Seek( stream, position ) )
+#define FT_STREAM_SEEK( position ) \
+ FT_SET_ERROR( FT_Stream_Seek( stream, \
+ (FT_ULong)(position) ) )
-#define FT_STREAM_SKIP( distance ) \
- FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )
+#define FT_STREAM_SKIP( distance ) \
+ FT_SET_ERROR( FT_Stream_Skip( stream, \
+ (FT_Long)(distance) ) )
-#define FT_STREAM_READ( buffer, count ) \
- FT_SET_ERROR( FT_Stream_Read( stream, \
- (FT_Byte*)buffer, \
- count ) )
+#define FT_STREAM_READ( buffer, count ) \
+ FT_SET_ERROR( FT_Stream_Read( stream, \
+ (FT_Byte*)(buffer), \
+ (FT_ULong)(count) ) )
-#define FT_STREAM_READ_AT( position, buffer, count ) \
- FT_SET_ERROR( FT_Stream_ReadAt( stream, \
- position, \
- (FT_Byte*)buffer, \
- count ) )
+#define FT_STREAM_READ_AT( position, buffer, count ) \
+ FT_SET_ERROR( FT_Stream_ReadAt( stream, \
+ (FT_ULong)(position), \
+ (FT_Byte*)buffer, \
+ (FT_ULong)(count) ) )
#define FT_STREAM_READ_FIELDS( fields, object ) \
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
-#define FT_FRAME_ENTER( size ) \
- FT_SET_ERROR( \
- FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )
+#define FT_FRAME_ENTER( size ) \
+ FT_SET_ERROR( \
+ FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, \
+ (FT_ULong)(size) ) ) )
-#define FT_FRAME_EXIT() \
+#define FT_FRAME_EXIT() \
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
#define FT_FRAME_EXTRACT( size, bytes ) \
FT_SET_ERROR( \
- FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size, \
+ FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, \
+ (FT_ULong)(size), \
(FT_Byte**)&(bytes) ) ) )
#define FT_FRAME_RELEASE( bytes ) \
diff --git a/freetype/include/freetype/internal/fttrace.h b/freetype/include/freetype/internal/fttrace.h
index 6e6cb49fa..a9d98b60a 100644
--- a/freetype/include/freetype/internal/fttrace.h
+++ b/freetype/include/freetype/internal/fttrace.h
@@ -4,7 +4,7 @@
/* */
/* Tracing handling (specification only). */
/* */
-/* Copyright 2002, 2004-2007, 2009, 2011-2012 by */
+/* Copyright 2002, 2004-2007, 2009, 2011-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -38,6 +38,7 @@ FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
+FT_TRACE_DEF( bitmap ) /* bitmap checksum (ftobjs.c) */
/* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
@@ -87,6 +88,10 @@ FT_TRACE_DEF( cffload )
FT_TRACE_DEF( cffobjs )
FT_TRACE_DEF( cffparse )
+FT_TRACE_DEF( cf2blues )
+FT_TRACE_DEF( cf2hints )
+FT_TRACE_DEF( cf2interp )
+
/* Type 42 driver component */
FT_TRACE_DEF( t42 )
diff --git a/freetype/include/freetype/internal/ftvalid.h b/freetype/include/freetype/internal/ftvalid.h
index 00cd85e7b..12ad03685 100644
--- a/freetype/include/freetype/internal/ftvalid.h
+++ b/freetype/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -76,6 +76,14 @@ FT_BEGIN_HEADER
} FT_ValidationLevel;
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+ /* We disable the warning `structure was padded due to */
+ /* __declspec(align())' in order to compile cleanly with */
+ /* the maximum level of warnings. */
+#pragma warning( push )
+#pragma warning( disable : 4324 )
+#endif /* _MSC_VER */
+
/* validator structure */
typedef struct FT_ValidatorRec_
{
@@ -88,8 +96,11 @@ FT_BEGIN_HEADER
} FT_ValidatorRec;
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
-#define FT_VALIDATOR( x ) ((FT_Validator)( x ))
+#define FT_VALIDATOR( x ) ( (FT_Validator)( x ) )
FT_BASE( void )
diff --git a/freetype/include/freetype/internal/internal.h b/freetype/include/freetype/internal/internal.h
index f500a651c..262afcfa8 100644
--- a/freetype/include/freetype/internal/internal.h
+++ b/freetype/include/freetype/internal/internal.h
@@ -4,7 +4,7 @@
/* */
/* Internal header files (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004 by */
+/* Copyright 1996-2004, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -48,4 +48,16 @@
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
+#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
+
+ /* We disable the warning `conditional expression is constant' here */
+ /* in order to compile cleanly with the maximum level of warnings. */
+ /* In particular, the warning complains about stuff like `while(0)' */
+ /* which is very useful in macro definitions. There is no benefit */
+ /* in having it enabled. */
+#pragma warning( disable : 4127 )
+
+#endif /* _MSC_VER */
+
+
/* END */
diff --git a/freetype/include/freetype/internal/psaux.h b/freetype/include/freetype/internal/psaux.h
index ce3556ef1..ac7edacc2 100644
--- a/freetype/include/freetype/internal/psaux.h
+++ b/freetype/include/freetype/internal/psaux.h
@@ -101,6 +101,9 @@ FT_BEGIN_HEADER
/* capacity :: The current size of the heap block. Increments by */
/* 1kByte chunks. */
/* */
+ /* init :: Set to 0xDEADBEEF if `elements' and `lengths' have */
+ /* been allocated. */
+ /* */
/* max_elems :: The maximum number of elements in table. */
/* */
/* num_elems :: The current number of elements in table. */
@@ -183,6 +186,7 @@ FT_BEGIN_HEADER
T1_FIELD_TYPE_STRING,
T1_FIELD_TYPE_KEY,
T1_FIELD_TYPE_BBOX,
+ T1_FIELD_TYPE_MM_BBOX,
T1_FIELD_TYPE_INTEGER_ARRAY,
T1_FIELD_TYPE_FIXED_ARRAY,
T1_FIELD_TYPE_CALLBACK,
diff --git a/freetype/include/freetype/internal/sfnt.h b/freetype/include/freetype/internal/sfnt.h
index c593ed73c..b94b4dd3e 100644
--- a/freetype/include/freetype/internal/sfnt.h
+++ b/freetype/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
/* */
/* High-level `sfnt' driver interface (specification). */
/* */
-/* Copyright 1996-2006, 2009, 2012 by */
+/* Copyright 1996-2006, 2009, 2012-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -125,77 +125,6 @@ FT_BEGIN_HEADER
(*TT_Done_Face_Func)( TT_Face face );
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_SFNT_HeaderRec_Func */
- /* */
- /* <Description> */
- /* Loads the header of a SFNT font file. Supports collections. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* face_index :: The index of the TrueType font, if we are opening a */
- /* collection. */
- /* */
- /* <Output> */
- /* sfnt :: The SFNT header. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The stream cursor must be at the font file's origin. */
- /* */
- /* This function recognizes fonts embedded in a `TrueType */
- /* collection'. */
- /* */
- /* This function checks that the header is valid by looking at the */
- /* values of `search_range', `entry_selector', and `range_shift'. */
- /* */
- typedef FT_Error
- (*TT_Load_SFNT_HeaderRec_Func)( TT_Face face,
- FT_Stream stream,
- FT_Long face_index,
- SFNT_Header sfnt );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Load_Directory_Func */
- /* */
- /* <Description> */
- /* Loads the table directory into a face object. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object. */
- /* */
- /* stream :: The input stream. */
- /* */
- /* sfnt :: The SFNT header. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The stream cursor must be on the first byte after the 4-byte font */
- /* format tag. This is the case just after a call to */
- /* TT_Load_Format_Tag(). */
- /* */
- typedef FT_Error
- (*TT_Load_Directory_Func)( TT_Face face,
- FT_Stream stream,
- SFNT_Header sfnt );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
/*************************************************************************/
/* */
/* <FuncType> */
@@ -363,88 +292,6 @@ FT_BEGIN_HEADER
TT_SBit_MetricsRec *ametrics );
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_Set_SBit_Strike_OldFunc */
- /* */
- /* <Description> */
- /* Select an sbit strike for a given size request. */
- /* */
- /* <Input> */
- /* face :: The target face object. */
- /* */
- /* req :: The size request. */
- /* */
- /* <Output> */
- /* astrike_index :: The index of the sbit strike. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. Returns an error if no */
- /* sbit strike exists for the selected ppem values. */
- /* */
- typedef FT_Error
- (*TT_Set_SBit_Strike_OldFunc)( TT_Face face,
- FT_UInt x_ppem,
- FT_UInt y_ppem,
- FT_ULong* astrike_index );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_CharMap_Load_Func */
- /* */
- /* <Description> */
- /* Loads a given TrueType character map into memory. */
- /* */
- /* <Input> */
- /* face :: A handle to the parent face object. */
- /* */
- /* stream :: A handle to the current stream object. */
- /* */
- /* <InOut> */
- /* cmap :: A pointer to a cmap object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The function assumes that the stream is already in use (i.e., */
- /* opened). In case of error, all partially allocated tables are */
- /* released. */
- /* */
- typedef FT_Error
- (*TT_CharMap_Load_Func)( TT_Face face,
- void* cmap,
- FT_Stream input );
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* TT_CharMap_Free_Func */
- /* */
- /* <Description> */
- /* Destroys a character mapping table. */
- /* */
- /* <Input> */
- /* face :: A handle to the parent face object. */
- /* */
- /* cmap :: A handle to a cmap object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- typedef FT_Error
- (*TT_CharMap_Free_Func)( TT_Face face,
- void* cmap );
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
/*************************************************************************/
/* */
/* <FuncType> */
@@ -657,11 +504,6 @@ FT_BEGIN_HEADER
TT_Load_Any_Func load_any;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- TT_Load_SFNT_HeaderRec_Func load_sfnt_header;
- TT_Load_Directory_Func load_directory;
-#endif
-
/* these functions are called by `load_face' but they can also */
/* be called from external modules, if there is a need to do so */
TT_Load_Table_Func load_head;
@@ -674,12 +516,6 @@ FT_BEGIN_HEADER
TT_Load_Table_Func load_name;
TT_Free_Table_Func free_name;
- /* optional tables */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- TT_Load_Table_Func load_hdmx_stub;
- TT_Free_Table_Func free_hdmx_stub;
-#endif
-
/* this field was called `load_kerning' up to version 2.1.10 */
TT_Load_Table_Func load_kern;
@@ -690,43 +526,12 @@ FT_BEGIN_HEADER
/* version 2.1.10 */
TT_Load_Table_Func load_bhed;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /* see `ttsbit.h' */
- TT_Set_SBit_Strike_OldFunc set_sbit_strike_stub;
- TT_Load_Table_Func load_sbits_stub;
-
- /*
- * The following two fields appeared in version 2.1.8, and were placed
- * between `load_sbits' and `load_sbit_image'. We support them as a
- * special exception since they are used by Xfont library within the
- * X.Org xserver, and because the probability that other rogue clients
- * use the other version 2.1.7 fields below is _extremely_ low.
- *
- * Note that this forces us to disable an interesting memory-saving
- * optimization though...
- */
-
- TT_Find_SBit_Image_Func find_sbit_image;
- TT_Load_SBit_Metrics_Func load_sbit_metrics;
-
-#endif
-
TT_Load_SBit_Image_Func load_sbit_image;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- TT_Free_Table_Func free_sbits_stub;
-#endif
-
/* see `ttpost.h' */
TT_Get_PS_Name_Func get_psname;
TT_Free_Table_Func free_psnames;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- TT_CharMap_Load_Func load_charmap_stub;
- TT_CharMap_Free_Func free_charmap_stub;
-#endif
-
/* starting here, the structure differs from version 2.1.7 */
/* this field was introduced in version 2.1.8, named `get_psname' */
@@ -755,213 +560,141 @@ FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_PIC
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) \
- a,
-#else
-#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a ) /* empty */
-#endif
-
-#define FT_INTERNAL( a ) \
- a,
-
-#define FT_DEFINE_SFNT_INTERFACE( \
- class_, \
- goto_table_, \
- init_face_, \
- load_face_, \
- done_face_, \
- get_interface_, \
- load_any_, \
- load_sfnt_header_, \
- load_directory_, \
- load_head_, \
- load_hhea_, \
- load_cmap_, \
- load_maxp_, \
- load_os2_, \
- load_post_, \
- load_name_, \
- free_name_, \
- load_hdmx_stub_, \
- free_hdmx_stub_, \
- load_kern_, \
- load_gasp_, \
- load_pclt_, \
- load_bhed_, \
- set_sbit_strike_stub_, \
- load_sbits_stub_, \
- find_sbit_image_, \
- load_sbit_metrics_, \
- load_sbit_image_, \
- free_sbits_stub_, \
- get_psname_, \
- free_psnames_, \
- load_charmap_stub_, \
- free_charmap_stub_, \
- get_kerning_, \
- load_font_dir_, \
- load_hmtx_, \
- load_eblc_, \
- free_eblc_, \
- set_sbit_strike_, \
- load_strike_metrics_, \
- get_metrics_ ) \
- static const SFNT_Interface class_ = \
- { \
- FT_INTERNAL( goto_table_ ) \
- FT_INTERNAL( init_face_ ) \
- FT_INTERNAL( load_face_ ) \
- FT_INTERNAL( done_face_ ) \
- FT_INTERNAL( get_interface_ ) \
- FT_INTERNAL( load_any_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory_ ) \
- FT_INTERNAL( load_head_ ) \
- FT_INTERNAL( load_hhea_ ) \
- FT_INTERNAL( load_cmap_ ) \
- FT_INTERNAL( load_maxp_ ) \
- FT_INTERNAL( load_os2_ ) \
- FT_INTERNAL( load_post_ ) \
- FT_INTERNAL( load_name_ ) \
- FT_INTERNAL( free_name_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub_ ) \
- FT_INTERNAL( load_kern_ ) \
- FT_INTERNAL( load_gasp_ ) \
- FT_INTERNAL( load_pclt_ ) \
- FT_INTERNAL( load_bhed_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics_ ) \
- FT_INTERNAL( load_sbit_image_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub_ ) \
- FT_INTERNAL( get_psname_ ) \
- FT_INTERNAL( free_psnames_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub_ ) \
- FT_INTERNAL( get_kerning_ ) \
- FT_INTERNAL( load_font_dir_ ) \
- FT_INTERNAL( load_hmtx_ ) \
- FT_INTERNAL( load_eblc_ ) \
- FT_INTERNAL( free_eblc_ ) \
- FT_INTERNAL( set_sbit_strike_ ) \
- FT_INTERNAL( load_strike_metrics_ ) \
- FT_INTERNAL( get_metrics_ ) \
+#define FT_DEFINE_SFNT_INTERFACE( \
+ class_, \
+ goto_table_, \
+ init_face_, \
+ load_face_, \
+ done_face_, \
+ get_interface_, \
+ load_any_, \
+ load_head_, \
+ load_hhea_, \
+ load_cmap_, \
+ load_maxp_, \
+ load_os2_, \
+ load_post_, \
+ load_name_, \
+ free_name_, \
+ load_kern_, \
+ load_gasp_, \
+ load_pclt_, \
+ load_bhed_, \
+ load_sbit_image_, \
+ get_psname_, \
+ free_psnames_, \
+ get_kerning_, \
+ load_font_dir_, \
+ load_hmtx_, \
+ load_eblc_, \
+ free_eblc_, \
+ set_sbit_strike_, \
+ load_strike_metrics_, \
+ get_metrics_ ) \
+ static const SFNT_Interface class_ = \
+ { \
+ goto_table_, \
+ init_face_, \
+ load_face_, \
+ done_face_, \
+ get_interface_, \
+ load_any_, \
+ load_head_, \
+ load_hhea_, \
+ load_cmap_, \
+ load_maxp_, \
+ load_os2_, \
+ load_post_, \
+ load_name_, \
+ free_name_, \
+ load_kern_, \
+ load_gasp_, \
+ load_pclt_, \
+ load_bhed_, \
+ load_sbit_image_, \
+ get_psname_, \
+ free_psnames_, \
+ get_kerning_, \
+ load_font_dir_, \
+ load_hmtx_, \
+ load_eblc_, \
+ free_eblc_, \
+ set_sbit_strike_, \
+ load_strike_metrics_, \
+ get_metrics_, \
};
#else /* FT_CONFIG_OPTION_PIC */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) \
- clazz->a = a_;
-#else
-#define FT_DEFINE_DRIVERS_OLD_INTERNAL( a, a_ ) /* empty */
-#endif
-
#define FT_INTERNAL( a, a_ ) \
clazz->a = a_;
-#define FT_DEFINE_SFNT_INTERFACE( \
- class_, \
- goto_table_, \
- init_face_, \
- load_face_, \
- done_face_, \
- get_interface_, \
- load_any_, \
- load_sfnt_header_, \
- load_directory_, \
- load_head_, \
- load_hhea_, \
- load_cmap_, \
- load_maxp_, \
- load_os2_, \
- load_post_, \
- load_name_, \
- free_name_, \
- load_hdmx_stub_, \
- free_hdmx_stub_, \
- load_kern_, \
- load_gasp_, \
- load_pclt_, \
- load_bhed_, \
- set_sbit_strike_stub_, \
- load_sbits_stub_, \
- find_sbit_image_, \
- load_sbit_metrics_, \
- load_sbit_image_, \
- free_sbits_stub_, \
- get_psname_, \
- free_psnames_, \
- load_charmap_stub_, \
- free_charmap_stub_, \
- get_kerning_, \
- load_font_dir_, \
- load_hmtx_, \
- load_eblc_, \
- free_eblc_, \
- set_sbit_strike_, \
- load_strike_metrics_, \
- get_metrics_ ) \
- void \
- FT_Init_Class_ ## class_( FT_Library library, \
- SFNT_Interface* clazz ) \
- { \
- FT_UNUSED( library ); \
- \
- FT_INTERNAL( goto_table, goto_table_ ) \
- FT_INTERNAL( init_face, init_face_ ) \
- FT_INTERNAL( load_face, load_face_ ) \
- FT_INTERNAL( done_face, done_face_ ) \
- FT_INTERNAL( get_interface, get_interface_ ) \
- FT_INTERNAL( load_any, load_any_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sfnt_header, \
- load_sfnt_header_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_directory, \
- load_directory_ ) \
- FT_INTERNAL( load_head, load_head_ ) \
- FT_INTERNAL( load_hhea, load_hhea_ ) \
- FT_INTERNAL( load_cmap, load_cmap_ ) \
- FT_INTERNAL( load_maxp, load_maxp_ ) \
- FT_INTERNAL( load_os2, load_os2_ ) \
- FT_INTERNAL( load_post, load_post_ ) \
- FT_INTERNAL( load_name, load_name_ ) \
- FT_INTERNAL( free_name, free_name_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_hdmx_stub, \
- load_hdmx_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( free_hdmx_stub, \
- free_hdmx_stub_ ) \
- FT_INTERNAL( load_kern, load_kern_ ) \
- FT_INTERNAL( load_gasp, load_gasp_ ) \
- FT_INTERNAL( load_pclt, load_pclt_ ) \
- FT_INTERNAL( load_bhed, load_bhed_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( set_sbit_strike_stub, \
- set_sbit_strike_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbits_stub, \
- load_sbits_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( find_sbit_image, \
- find_sbit_image_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_sbit_metrics, \
- load_sbit_metrics_ ) \
- FT_INTERNAL( load_sbit_image, load_sbit_image_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( free_sbits_stub, \
- free_sbits_stub_ ) \
- FT_INTERNAL( get_psname, get_psname_ ) \
- FT_INTERNAL( free_psnames, free_psnames_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( load_charmap_stub, \
- load_charmap_stub_ ) \
- FT_DEFINE_DRIVERS_OLD_INTERNAL( free_charmap_stub, \
- free_charmap_stub_ ) \
- FT_INTERNAL( get_kerning, get_kerning_ ) \
- FT_INTERNAL( load_font_dir, load_font_dir_ ) \
- FT_INTERNAL( load_hmtx, load_hmtx_ ) \
- FT_INTERNAL( load_eblc, load_eblc_ ) \
- FT_INTERNAL( free_eblc, free_eblc_ ) \
- FT_INTERNAL( set_sbit_strike, set_sbit_strike_ ) \
- FT_INTERNAL( load_strike_metrics, load_strike_metrics_ ) \
- FT_INTERNAL( get_metrics, get_metrics_ ) \
+#define FT_DEFINE_SFNT_INTERFACE( \
+ class_, \
+ goto_table_, \
+ init_face_, \
+ load_face_, \
+ done_face_, \
+ get_interface_, \
+ load_any_, \
+ load_head_, \
+ load_hhea_, \
+ load_cmap_, \
+ load_maxp_, \
+ load_os2_, \
+ load_post_, \
+ load_name_, \
+ free_name_, \
+ load_kern_, \
+ load_gasp_, \
+ load_pclt_, \
+ load_bhed_, \
+ load_sbit_image_, \
+ get_psname_, \
+ free_psnames_, \
+ get_kerning_, \
+ load_font_dir_, \
+ load_hmtx_, \
+ load_eblc_, \
+ free_eblc_, \
+ set_sbit_strike_, \
+ load_strike_metrics_, \
+ get_metrics_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Library library, \
+ SFNT_Interface* clazz ) \
+ { \
+ FT_UNUSED( library ); \
+ \
+ clazz->goto_table = goto_table_; \
+ clazz->init_face = init_face_; \
+ clazz->load_face = load_face_; \
+ clazz->done_face = done_face_; \
+ clazz->get_interface = get_interface_; \
+ clazz->load_any = load_any_; \
+ clazz->load_head = load_head_; \
+ clazz->load_hhea = load_hhea_; \
+ clazz->load_cmap = load_cmap_; \
+ clazz->load_maxp = load_maxp_; \
+ clazz->load_os2 = load_os2_; \
+ clazz->load_post = load_post_; \
+ clazz->load_name = load_name_; \
+ clazz->free_name = free_name_; \
+ clazz->load_kern = load_kern_; \
+ clazz->load_gasp = load_gasp_; \
+ clazz->load_pclt = load_pclt_; \
+ clazz->load_bhed = load_bhed_; \
+ clazz->load_sbit_image = load_sbit_image_; \
+ clazz->get_psname = get_psname_; \
+ clazz->free_psnames = free_psnames_; \
+ clazz->get_kerning = get_kerning_; \
+ clazz->load_font_dir = load_font_dir_; \
+ clazz->load_hmtx = load_hmtx_; \
+ clazz->load_eblc = load_eblc_; \
+ clazz->free_eblc = free_eblc_; \
+ clazz->set_sbit_strike = set_sbit_strike_; \
+ clazz->load_strike_metrics = load_strike_metrics_; \
+ clazz->get_metrics = get_metrics_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
diff --git a/freetype/include/freetype/internal/t1types.h b/freetype/include/freetype/internal/t1types.h
index c8f0621d1..ad8d27f8c 100644
--- a/freetype/include/freetype/internal/t1types.h
+++ b/freetype/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
/* Basic Type1/Type2 type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */
+/* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -205,10 +205,6 @@ FT_BEGIN_HEADER
FT_CharMapRec charmaprecs[2];
FT_CharMap charmaps[2];
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- PS_Unicodes unicode_map;
-#endif
-
/* support for Multiple Masters fonts */
PS_Blend blend;
diff --git a/freetype/include/freetype/internal/tttypes.h b/freetype/include/freetype/internal/tttypes.h
index 84a3415c7..b7baf2040 100644
--- a/freetype/include/freetype/internal/tttypes.h
+++ b/freetype/include/freetype/internal/tttypes.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2002, 2004-2008, 2012 by */
+/* Copyright 1996-2002, 2004-2008, 2012-2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -311,87 +311,6 @@ FT_BEGIN_HEADER
} TT_GaspRec;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_HdmxEntryRec */
- /* */
- /* <Description> */
- /* A small structure used to model the pre-computed widths of a given */
- /* size. They are 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_HdmxEntryRec_
- {
- FT_Byte ppem;
- FT_Byte max_width;
- FT_Byte* widths;
-
- } TT_HdmxEntryRec, *TT_HdmxEntry;
-
-
- /*************************************************************************/
- /* */
- /* <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_HdmxRec_
- {
- FT_UShort version;
- FT_Short num_records;
- TT_HdmxEntry records;
-
- } TT_HdmxRec, *TT_Hdmx;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* TT_Kern0_PairRec */
- /* */
- /* <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_Kern0_PairRec_
- {
- FT_UShort left; /* index of left glyph in pair */
- FT_UShort right; /* index of right glyph in pair */
- FT_FWord value; /* kerning value */
-
- } TT_Kern0_PairRec, *TT_Kern0_Pair;
-
-#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
-
-
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -1269,9 +1188,6 @@ FT_BEGIN_HEADER
TT_HoriHeader horizontal; /* TrueType horizontal header */
TT_MaxProfile max_profile;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- FT_ULong max_components; /* stubbed to 0 */
-#endif
FT_Bool vertical_info;
TT_VertHeader vertical; /* TT Vertical header, if present */
@@ -1308,11 +1224,6 @@ FT_BEGIN_HEADER
/* */
/***********************************************************************/
- /* horizontal device metrics */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- TT_HdmxRec hdmx;
-#endif
-
/* grid-fitting and scaling table */
TT_GaspRec gasp; /* the `gasp' table */
@@ -1320,11 +1231,6 @@ FT_BEGIN_HEADER
TT_PCLT pclt;
/* embedded bitmaps support */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- FT_ULong num_sbit_strikes;
- TT_SBit_Strike sbit_strikes;
-#endif
-
FT_ULong num_sbit_scales;
TT_SBit_Scale sbit_scales;
@@ -1338,12 +1244,6 @@ FT_BEGIN_HEADER
/* */
/***********************************************************************/
- /* the glyph locations */
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- FT_UShort num_locations_stub;
- FT_Long* glyph_locations_stub;
-#endif
-
/* the font program, if any */
FT_ULong font_program_size;
FT_Byte* font_program;
@@ -1356,13 +1256,6 @@ FT_BEGIN_HEADER
FT_ULong cvt_size;
FT_Short* cvt;
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /* the format 0 kerning table, if any */
- FT_Int num_kern_pairs;
- FT_Int kern_table_index;
- TT_Kern0_Pair kern_pairs;
-#endif
-
/* A pointer to the bytecode interpreter to use. This is also */
/* used to hook the debugger for the `ttdebug' utility. */
TT_Interpreter interpreter;
@@ -1383,11 +1276,8 @@ FT_BEGIN_HEADER
const char* postscript_name;
- /* since version 2.1.8, but was originally placed after */
- /* `glyph_locations_stub' */
FT_ULong glyf_len;
- /* since version 2.1.8, but was originally placed before `extra' */
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Bool doblend;
GX_Blend blend;
@@ -1428,6 +1318,13 @@ FT_BEGIN_HEADER
FT_ULong horz_metrics_offset;
FT_ULong vert_metrics_offset;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+ /* since 2.4.12 */
+ FT_ULong sph_found_func_flags; /* special functions found */
+ /* for this face */
+ FT_Bool sph_compatibility_mode;
+#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
+
} TT_FaceRec;
diff --git a/freetype/include/freetype/tttags.h b/freetype/include/freetype/tttags.h
index 5d86e93fb..c4dee4666 100644
--- a/freetype/include/freetype/tttags.h
+++ b/freetype/include/freetype/tttags.h
@@ -4,7 +4,7 @@
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
-/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */
+/* Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -40,6 +40,8 @@ FT_BEGIN_HEADER
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
+#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
+#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )