summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-08-17 18:21:28 +0200
committerDavid 'Digit' Turner <digit@google.com>2011-08-17 18:25:40 +0200
commitaeb407daf3711a10a27f3bc2223c5eb05158076e (patch)
tree570010914e8c91992ea388f2319611655c7d4b0c /include
parent3053d1b9db55099918843889e4809ce97483ca9f (diff)
downloadandroid_external_freetype-aeb407daf3711a10a27f3bc2223c5eb05158076e.tar.gz
android_external_freetype-aeb407daf3711a10a27f3bc2223c5eb05158076e.tar.bz2
android_external_freetype-aeb407daf3711a10a27f3bc2223c5eb05158076e.zip
Update to FreeType 2.4.6+
This patch updates our copy of the FreeType sources to 2.4.6+. More precisely, it contains source code corresponding to the state of the upstream repository at the following hash submitted on August 16 2001: c3fb981e2ac79acad09d5673352646696472f55e This corresponds to 2.4.6 with 7 more patches applied on top of it to fix bugs in the TrueType interpreter and the CFF parser. Change-Id: I9f3ac736d616020c8d10fd1d4e4be466f35fb6e7
Diffstat (limited to 'include')
-rw-r--r--include/freetype/config/ftconfig.h48
-rw-r--r--include/freetype/config/ftheader.h15
-rw-r--r--include/freetype/config/ftoption.h89
-rw-r--r--include/freetype/freetype.h36
-rw-r--r--include/freetype/ftbbox.h10
-rw-r--r--include/freetype/ftcache.h19
-rw-r--r--include/freetype/ftchapters.h1
-rw-r--r--include/freetype/fterrdef.h1
-rw-r--r--include/freetype/ftgasp.h18
-rw-r--r--include/freetype/ftglyph.h9
-rw-r--r--include/freetype/ftimage.h12
-rw-r--r--include/freetype/ftmoderr.h39
-rw-r--r--include/freetype/ftoutln.h7
-rw-r--r--include/freetype/ftrender.h8
-rw-r--r--include/freetype/ftstroke.h49
-rw-r--r--include/freetype/internal/ftstream.h104
-rw-r--r--include/freetype/internal/fttrace.h7
-rw-r--r--include/freetype/tttables.h12
18 files changed, 356 insertions, 128 deletions
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index cbe30f2..7af737f 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010 by */
+/* Copyright 1996-2004, 2006-2008, 2010-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -127,7 +127,12 @@ FT_BEGIN_HEADER
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
+ /* AvailabilityMacros.h is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
+#endif
#if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1
@@ -348,14 +353,14 @@ FT_BEGIN_HEADER
register FT_Int32 t, t2;
- asm __volatile__ (
+ __asm__ __volatile__ (
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
"adds %1, %1, %0\n\t" /* %1 += %0 */
"adc %2, %2, #0\n\t" /* %2 += carry */
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
- "orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
+ "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b) );
return a;
@@ -395,6 +400,43 @@ FT_BEGIN_HEADER
#endif /* __GNUC__ */
+
+#ifdef _MSC_VER /* Visual C++ */
+
+#ifdef _M_IX86
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
+
+ /* documentation is in freetype.h */
+
+ static __inline FT_Int32
+ FT_MulFix_i386( FT_Int32 a,
+ FT_Int32 b )
+ {
+ register FT_Int32 result;
+
+ __asm
+ {
+ mov eax, a
+ mov edx, b
+ imul edx
+ mov ecx, edx
+ sar ecx, 31
+ add ecx, 8000h
+ add eax, ecx
+ adc edx, 0
+ shr eax, 16
+ shl edx, 16
+ add eax, edx
+ mov result, eax
+ }
+ return result;
+ }
+
+#endif /* _M_IX86 */
+
+#endif /* _MSC_VER */
+
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index b63945d..2a7b8c4 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -427,6 +427,19 @@
/*************************************************************************
*
* @macro:
+ * FT_BZIP2_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which supports bzip2-compressed files.
+ *
+ */
+#define FT_BZIP2_H <freetype/ftbzip2.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
* FT_WINFONTS_H
*
* @description:
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index c6d1974..c41f089 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -4,8 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
-/* 2010 by */
+/* Copyright 1996-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -190,6 +189,33 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
+ /* Bzip2-compressed file support. */
+ /* */
+ /* FreeType now handles font files that have been compressed with the */
+ /* `bzip2' program. This is mostly used to parse many of the PCF */
+ /* files that come with XFree86. The implementation uses `libbz2' to */
+ /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
+ /* Contrary to gzip, bzip2 currently is not included and need to use */
+ /* the system available bzip2 implementation. */
+ /* */
+ /* Define this macro if you want to enable this `feature'. */
+ /* */
+/* #define FT_CONFIG_OPTION_USE_BZIP2 */
+
+
+ /*************************************************************************/
+ /* */
+ /* Define to disable the use of file stream functions and types, FILE, */
+ /* fopen() etc. Enables the use of smaller system libraries on embedded */
+ /* systems that have multiple system libraries, some with or without */
+ /* file stream support, in the cases where file stream support is not */
+ /* necessary such as memory loading of font files. */
+ /* */
+/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
+
+
+ /*************************************************************************/
+ /* */
/* DLL export compilation */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
@@ -365,6 +391,39 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
+ /* Autofitter debugging */
+ /* */
+ /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
+ /* control the autofitter behaviour for debugging purposes with global */
+ /* boolean variables (consequently, you should *never* enable this */
+ /* while compiling in `release' mode): */
+ /* */
+ /* _af_debug_disable_horz_hints */
+ /* _af_debug_disable_vert_hints */
+ /* _af_debug_disable_blue_hints */
+ /* */
+ /* Additionally, the following functions provide dumps of various */
+ /* internal autofit structures to stdout (using `printf'): */
+ /* */
+ /* af_glyph_hints_dump_points */
+ /* af_glyph_hints_dump_segments */
+ /* af_glyph_hints_dump_edges */
+ /* */
+ /* As an argument, they use another global variable: */
+ /* */
+ /* _af_debug_hints */
+ /* */
+ /* Please have a look at the `ftgrid' demo program to see how those */
+ /* variables and macros should be used. */
+ /* */
+ /* Do not #undef these macros here since the build system might define */
+ /* them for certain configurations only. */
+ /* */
+/* #define FT_DEBUG_AUTOFIT */
+
+
+ /*************************************************************************/
+ /* */
/* Memory Debugging */
/* */
/* FreeType now comes with an integrated memory debugger that is */
@@ -503,10 +562,13 @@ FT_BEGIN_HEADER
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
- /* any of the patented opcodes and algorithms. Note that the */
- /* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */
- /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */
- /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
+ /* any of the patented opcodes and algorithms. The patents related to */
+ /* TrueType hinting have expired worldwide since May 2010; this option */
+ /* is now deprecated. */
+ /* */
+ /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
+ /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
+ /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* */
/* This macro is only useful for a small number of font files (mostly */
@@ -572,7 +634,7 @@ FT_BEGIN_HEADER
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
- /* http://partners.adobe.com/asn/developer/opentype/glyf.html */
+ /* http://www.microsoft.com/typography/otspec/glyf.htm */
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@@ -673,6 +735,19 @@ FT_BEGIN_HEADER
/* */
#define AF_CONFIG_OPTION_INDIC
+ /*************************************************************************/
+ /* */
+ /* Compile autofit module with warp hinting. The idea of the warping */
+ /* code is to slightly scale and shift a glyph within a single dimension */
+ /* so that as much of its segments are aligned (more or less) on the */
+ /* grid. To find out the optimal scaling and shifting value, various */
+ /* parameter combinations are tried and scored. */
+ /* */
+ /* This experimental option is only active if the render mode is */
+ /* FT_RENDER_MODE_LIGHT. */
+ /* */
+/* #define AF_CONFIG_OPTION_USE_WARPER */
+
/* */
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 7799b70..660b303 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -4,8 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
-/* 2010 by */
+/* Copyright 1996-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -227,10 +226,12 @@ FT_BEGIN_HEADER
/* Left side bearing for vertical layout. */
/* */
/* vertBearingY :: */
- /* Top side bearing for vertical layout. */
+ /* Top side bearing for vertical layout. Larger positive values */
+ /* mean further below the vertical glyph origin. */
/* */
/* vertAdvance :: */
- /* Advance height for vertical layout. */
+ /* Advance height for vertical layout. Positive values mean the */
+ /* glyph has a positive advance downward. */
/* */
/* <Note> */
/* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
@@ -1058,12 +1059,12 @@ FT_BEGIN_HEADER
/* */
/* It is not possible to autohint such fonts using */
/* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
- /* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */
+ /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
/* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
/* probably never want this except for demonstration purposes. */
/* */
- /* Currently, there are six TrueType fonts in the list of tricky */
- /* fonts; they are hard-coded in file `ttobjs.c'. */
+ /* Currently, there are about a dozen TrueType fonts in the list of */
+ /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@@ -2106,8 +2107,8 @@ FT_BEGIN_HEADER
/* used to determine both scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
- /* The real dimension. The sum of the the `Ascender' and (minus */
- /* of) the `Descender' fields of @FT_FaceRec are used to determine */
+ /* The real dimension. The sum of the the `ascender' and (minus */
+ /* of) the `descender' fields of @FT_FaceRec are used to determine */
/* both scaling values. */
/* */
/* FT_SIZE_REQUEST_TYPE_BBOX :: */
@@ -2445,13 +2446,7 @@ FT_BEGIN_HEADER
* in fonts. By default, FreeType tries to handle broken fonts also.
*
* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
- * Indicates that the font driver should ignore the global advance
- * width defined in the font. By default, that value is used as the
- * advance width for all glyphs when the face has
- * @FT_FACE_FLAG_FIXED_WIDTH set.
- *
- * This flag exists for historical reasons (to support buggy CJK
- * fonts).
+ * Ignored. Deprecated.
*
* FT_LOAD_NO_RECURSE ::
* This flag is only used internally. It merely indicates that the
@@ -2921,6 +2916,10 @@ FT_BEGIN_HEADER
/* The glyph name is truncated to fit within the buffer if it is too */
/* long. The returned string is always zero-terminated. */
/* */
+ /* Be aware that FreeType reorders glyph indices internally so that */
+ /* glyph index~0 always corresponds to the `missing glyph' (called */
+ /* `.notdef'). */
+ /* */
/* This function is not compiled within the library if the config */
/* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
/* `include/freetype/config/ftoptions.h'. */
@@ -3331,6 +3330,9 @@ FT_BEGIN_HEADER
/* in the @PS_FontInfoRec structure which is only guaranteed to */
/* return the correct results for Type~1 fonts. */
/* */
+ /* <Since> */
+ /* 2.3.8 */
+ /* */
FT_EXPORT( FT_UShort )
FT_Get_FSType_Flags( FT_Face face );
@@ -3808,7 +3810,7 @@ FT_BEGIN_HEADER
*/
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 4
-#define FREETYPE_PATCH 2
+#define FREETYPE_PATCH 6
/*************************************************************************/
diff --git a/include/freetype/ftbbox.h b/include/freetype/ftbbox.h
index 01fe3fb..9766919 100644
--- a/include/freetype/ftbbox.h
+++ b/include/freetype/ftbbox.h
@@ -4,7 +4,7 @@
/* */
/* FreeType exact bbox computation (specification). */
/* */
-/* Copyright 1996-2001, 2003, 2007 by */
+/* Copyright 1996-2001, 2003, 2007, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -73,6 +73,14 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Note> */
+ /* If the font is tricky and the glyph has been loaded with */
+ /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
+ /* reasonable values for the BBox it is necessary to load the glyph */
+ /* at a large ppem value (so that the hinting instructions can */
+ /* properly shift and scale the subglyphs), then extracting the BBox */
+ /* which can be eventually converted back to font units. */
+ /* */
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
diff --git a/include/freetype/ftcache.h b/include/freetype/ftcache.h
index a9e1237..6af5306 100644
--- a/include/freetype/ftcache.h
+++ b/include/freetype/ftcache.h
@@ -56,9 +56,12 @@ FT_BEGIN_HEADER
* interpret them in any way.
*
* Second, the cache calls, only when needed, a client-provided function
- * to convert a @FTC_FaceID into a new @FT_Face object. The latter is
+ * to convert an @FTC_FaceID into a new @FT_Face object. The latter is
* then completely managed by the cache, including its termination
- * through @FT_Done_Face.
+ * through @FT_Done_Face. To monitor termination of face objects, the
+ * finalizer callback in the `generic' field of the @FT_Face object can
+ * be used, which might also be used to store the @FTC_FaceID of the
+ * face.
*
* Clients are free to map face IDs to anything else. The most simple
* usage is to associate them to a (pathname,face_index) pair that is
@@ -211,12 +214,17 @@ 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 */
/*************************************************************************/
/*************************************************************************/
@@ -697,11 +705,17 @@ 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 */
+
/*************************************************************************/
/* */
@@ -1093,6 +1107,7 @@ FT_BEGIN_HEADER
(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) ^ \
diff --git a/include/freetype/ftchapters.h b/include/freetype/ftchapters.h
index 7775a6b..6cdf54e 100644
--- a/include/freetype/ftchapters.h
+++ b/include/freetype/ftchapters.h
@@ -98,6 +98,7 @@
/* module_management */
/* gzip */
/* lzw */
+/* bzip2 */
/* lcd_filtering */
/* */
/***************************************************************************/
diff --git a/include/freetype/fterrdef.h b/include/freetype/fterrdef.h
index bf52220..d4e7287 100644
--- a/include/freetype/fterrdef.h
+++ b/include/freetype/fterrdef.h
@@ -214,7 +214,6 @@
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
"no Unicode glyph name found" )
-
/* BDF errors */
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
diff --git a/include/freetype/ftgasp.h b/include/freetype/ftgasp.h
index 91a769e..5e978e5 100644
--- a/include/freetype/ftgasp.h
+++ b/include/freetype/ftgasp.h
@@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
-/* Copyright 2007, 2008 by */
+/* Copyright 2007, 2008, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -62,19 +62,27 @@
* It is up to the client to decide what to do.
*
* FT_GASP_DO_GRIDFIT ::
- * Grid-fitting and hinting should be performed at the specified ppem.
- * This *really* means TrueType bytecode interpretation.
+ * Grid-fitting and hinting should be performed at the specified ppem.
+ * This *really* means TrueType bytecode interpretation. If this bit
+ * is not set, no hinting gets applied.
*
* FT_GASP_DO_GRAY ::
- * Anti-aliased rendering should be performed at the specified ppem.
+ * Anti-aliased rendering should be performed at the specified ppem.
+ * If not set, do monochrome rendering.
*
* FT_GASP_SYMMETRIC_SMOOTHING ::
- * Smoothing along multiple axes must be used with ClearType.
+ * If set, smoothing along multiple axes must be used with ClearType.
*
* FT_GASP_SYMMETRIC_GRIDFIT ::
* Grid-fitting must be used with ClearType's symmetric smoothing.
*
* @note:
+ * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
+ * used for standard font rasterization only. Independently of that,
+ * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
+ * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
+ * `FT_GASP_DO_GRAY' are consequently ignored).
+ *
* `ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents.
*
diff --git a/include/freetype/ftglyph.h b/include/freetype/ftglyph.h
index 0b8f0c0..3de69f7 100644
--- a/include/freetype/ftglyph.h
+++ b/include/freetype/ftglyph.h
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */
+/* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -384,6 +384,13 @@ FT_BEGIN_HEADER
/* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
/* is another name for this constant. */
/* */
+ /* If the font is tricky and the glyph has been loaded with */
+ /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */
+ /* reasonable values for the CBox it is necessary to load the glyph */
+ /* at a large ppem value (so that the hinting instructions can */
+ /* properly shift and scale the subglyphs), then extracting the CBox */
+ /* which can be eventually converted back to font units. */
+ /* */
/* Note that the maximum coordinates are exclusive, which means that */
/* one can compute the width and height of the glyph image (be it in */
/* integer or 26.6 pixels) as: */
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index 0272e92..04b5e04 100644
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -268,9 +268,21 @@ FT_BEGIN_HEADER
/* flow. In all cases, the pitch is an offset to add */
/* to a bitmap pointer in order to go down one row. */
/* */
+ /* Note that `padding' means the alignment of a */
+ /* bitmap to a byte border, and FreeType functions */
+ /* normally align to the smallest possible integer */
+ /* value. */
+ /* */
/* For the B/W rasterizer, `pitch' is always an even */
/* number. */
/* */
+ /* To change the pitch of a bitmap (say, to make it a */
+ /* multiple of 4), use @FT_Bitmap_Convert. */
+ /* Alternatively, you might use callback functions to */
+ /* directly render to the application's surface; see */
+ /* the file `example2.cpp' in the tutorial for a */
+ /* demonstration. */
+ /* */
/* buffer :: A typeless pointer to the bitmap buffer. This */
/* value should be aligned on 32-bit boundaries in */
/* most cases. */
diff --git a/include/freetype/ftmoderr.h b/include/freetype/ftmoderr.h
index b0115dd..1bf3b38 100644
--- a/include/freetype/ftmoderr.h
+++ b/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
/* */
/* FreeType module error offsets (specification). */
/* */
-/* Copyright 2001, 2002, 2003, 2004, 2005 by */
+/* Copyright 2001, 2002, 2003, 2004, 2005, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -105,24 +105,25 @@
FT_MODERRDEF( Base, 0x000, "base module" )
FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
FT_MODERRDEF( BDF, 0x200, "BDF module" )
- FT_MODERRDEF( Cache, 0x300, "cache module" )
- FT_MODERRDEF( CFF, 0x400, "CFF module" )
- FT_MODERRDEF( CID, 0x500, "CID module" )
- FT_MODERRDEF( Gzip, 0x600, "Gzip module" )
- FT_MODERRDEF( LZW, 0x700, "LZW module" )
- FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" )
- FT_MODERRDEF( PCF, 0x900, "PCF module" )
- FT_MODERRDEF( PFR, 0xA00, "PFR module" )
- FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" )
- FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" )
- FT_MODERRDEF( PSnames, 0xD00, "PS names module" )
- FT_MODERRDEF( Raster, 0xE00, "raster module" )
- FT_MODERRDEF( SFNT, 0xF00, "SFNT module" )
- FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" )
- FT_MODERRDEF( TrueType, 0x1100, "TrueType module" )
- FT_MODERRDEF( Type1, 0x1200, "Type 1 module" )
- FT_MODERRDEF( Type42, 0x1300, "Type 42 module" )
- FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" )
+ FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
+ FT_MODERRDEF( Cache, 0x400, "cache module" )
+ FT_MODERRDEF( CFF, 0x500, "CFF module" )
+ FT_MODERRDEF( CID, 0x600, "CID module" )
+ FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
+ FT_MODERRDEF( LZW, 0x800, "LZW module" )
+ FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
+ FT_MODERRDEF( PCF, 0xA00, "PCF module" )
+ FT_MODERRDEF( PFR, 0xB00, "PFR module" )
+ FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
+ FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
+ FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
+ FT_MODERRDEF( Raster, 0xF00, "raster module" )
+ FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
+ FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
+ FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
+ FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
+ FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
+ FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
#ifdef FT_MODERR_END_LIST
diff --git a/include/freetype/ftoutln.h b/include/freetype/ftoutln.h
index 2829a05..1cf3c3f 100644
--- a/include/freetype/ftoutln.h
+++ b/include/freetype/ftoutln.h
@@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 by */
+/* Copyright 1996-2003, 2005-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -227,6 +227,9 @@ FT_BEGIN_HEADER
/* <Output> */
/* acbox :: The outline's control box. */
/* */
+ /* <Note> */
+ /* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
+ /* */
FT_EXPORT( void )
FT_Outline_Get_CBox( const FT_Outline* outline,
FT_BBox *acbox );
@@ -332,7 +335,7 @@ FT_BEGIN_HEADER
/* handled incorrectly. */
/* */
/* If you need `better' metrics values you should call */
- /* @FT_Outline_Get_CBox ot @FT_Outline_Get_BBox. */
+ /* @FT_Outline_Get_CBox or @FT_Outline_Get_BBox. */
/* */
/* Example call: */
/* */
diff --git a/include/freetype/ftrender.h b/include/freetype/ftrender.h
index e06a814..dd0229b 100644
--- a/include/freetype/ftrender.h
+++ b/include/freetype/ftrender.h
@@ -212,6 +212,14 @@ FT_BEGIN_HEADER
/* */
/* This doesn't change the current renderer for other formats. */
/* */
+ /* Currently, only the B/W renderer, if compiled with */
+ /* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */
+ /* anti-aliasing mode; this option must be set directly in */
+ /* `ftraster.c' and is undefined by default) accepts a single tag */
+ /* `pal5' to set its gray palette as a character string with */
+ /* 5~elements. Consequently, the third and fourth argument are zero */
+ /* normally. */
+ /* */
FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library,
FT_Renderer renderer,
diff --git a/include/freetype/ftstroke.h b/include/freetype/ftstroke.h
index 3afb87d..dbda6d2 100644
--- a/include/freetype/ftstroke.h
+++ b/include/freetype/ftstroke.h
@@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (specification). */
/* */
-/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
+/* Copyright 2002-2006, 2008, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -75,20 +75,44 @@ FT_BEGIN_HEADER
* to join two lines smoothly.
*
* FT_STROKER_LINEJOIN_BEVEL ::
- * Used to render beveled line joins; i.e., the two joining lines
- * are extended until they intersect.
- *
+ * Used to render beveled line joins. The outer corner of
+ * the joined lines is filled by enclosing the triangular
+ * region of the corner with a straight line between the
+ * outer corners of each stroke.
+ *
+ * FT_STROKER_LINEJOIN_MITER_FIXED ::
+ * Used to render mitered line joins, with fixed bevels if the
+ * miter limit is exceeded. The outer edges of the strokes
+ * for the two segments are extended until they meet at an
+ * angle. If the segments meet at too sharp an angle (such
+ * that the miter would extend from the intersection of the
+ * segments a distance greater than the product of the miter
+ * limit value and the border radius), then a bevel join (see
+ * above) is used instead. This prevents long spikes being
+ * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
+ * line join as used in PostScript and PDF.
+ *
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE ::
* FT_STROKER_LINEJOIN_MITER ::
- * Same as beveled rendering, except that an additional line
- * break is added if the angle between the two joining lines
- * is too closed (this is useful to avoid unpleasant spikes
- * in beveled rendering).
+ * Used to render mitered line joins, with variable bevels if
+ * the miter limit is exceeded. The intersection of the
+ * strokes is clipped at a line perpendicular to the bisector
+ * of the angle between the strokes, at the distance from the
+ * intersection of the segments equal to the product of the
+ * miter limit value and the border radius. This prevents
+ * long spikes being created.
+ * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
+ * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias
+ * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
+ * backwards compatibility.
*/
typedef enum FT_Stroker_LineJoin_
{
- FT_STROKER_LINEJOIN_ROUND = 0,
- FT_STROKER_LINEJOIN_BEVEL,
- FT_STROKER_LINEJOIN_MITER
+ FT_STROKER_LINEJOIN_ROUND = 0,
+ FT_STROKER_LINEJOIN_BEVEL = 1,
+ FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
+ FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE,
+ FT_STROKER_LINEJOIN_MITER_FIXED = 3
} FT_Stroker_LineJoin;
@@ -245,7 +269,8 @@ FT_BEGIN_HEADER
* The line join style.
*
* miter_limit ::
- * The miter limit for the FT_STROKER_LINEJOIN_MITER style,
+ * 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.
*
* @note:
diff --git a/include/freetype/internal/ftstream.h b/include/freetype/internal/ftstream.h
index a91eb72..9c12186 100644
--- a/include/freetype/internal/ftstream.h
+++ b/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
/* */
/* Stream handling (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2004, 2005, 2006 by */
+/* Copyright 1996-2002, 2004-2006, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -292,18 +292,18 @@ FT_BEGIN_HEADER
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
-#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetShort, FT_Short )
-#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetShort, FT_UShort )
-#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetOffset, FT_Long )
-#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetOffset, FT_ULong )
-#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetLong, FT_Long )
-#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
-#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
-
-#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetShortLE, FT_Short )
-#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetShortLE, FT_UShort )
-#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetLongLE, FT_Long )
-#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetLongLE, FT_ULong )
+#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
+#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
+#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
+#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
+#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
+#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
+#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
+
+#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
+#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
+#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
+#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
#endif
#define FT_READ_MACRO( func, type, var ) \
@@ -312,17 +312,17 @@ FT_BEGIN_HEADER
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
-#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadShort, FT_Short, var )
-#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadShort, FT_UShort, var )
-#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadOffset, FT_Long, var )
-#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadOffset, FT_ULong, var )
-#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadLong, FT_Long, var )
-#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadLong, FT_ULong, var )
+#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
+#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
+#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
+#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
+#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
+#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
-#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadShortLE, FT_Short, var )
-#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadShortLE, FT_UShort, var )
-#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadLongLE, FT_Long, var )
-#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadLongLE, FT_ULong, var )
+#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
+#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
+#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
+#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
@@ -431,25 +431,25 @@ FT_BEGIN_HEADER
FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream );
- /* read a 16-bit big-endian integer from an entered frame */
- FT_BASE( FT_Short )
- FT_Stream_GetShort( FT_Stream stream );
+ /* read a 16-bit big-endian unsigned integer from an entered frame */
+ FT_BASE( FT_UShort )
+ FT_Stream_GetUShort( FT_Stream stream );
- /* read a 24-bit big-endian integer from an entered frame */
- FT_BASE( FT_Long )
- FT_Stream_GetOffset( FT_Stream stream );
+ /* read a 24-bit big-endian unsigned integer from an entered frame */
+ FT_BASE( FT_ULong )
+ FT_Stream_GetUOffset( FT_Stream stream );
- /* read a 32-bit big-endian integer from an entered frame */
- FT_BASE( FT_Long )
- FT_Stream_GetLong( FT_Stream stream );
+ /* read a 32-bit big-endian unsigned integer from an entered frame */
+ FT_BASE( FT_ULong )
+ FT_Stream_GetULong( FT_Stream stream );
- /* read a 16-bit little-endian integer from an entered frame */
- FT_BASE( FT_Short )
- FT_Stream_GetShortLE( FT_Stream stream );
+ /* read a 16-bit little-endian unsigned integer from an entered frame */
+ FT_BASE( FT_UShort )
+ FT_Stream_GetUShortLE( FT_Stream stream );
- /* read a 32-bit little-endian integer from an entered frame */
- FT_BASE( FT_Long )
- FT_Stream_GetLongLE( FT_Stream stream );
+ /* read a 32-bit little-endian unsigned integer from an entered frame */
+ FT_BASE( FT_ULong )
+ FT_Stream_GetULongLE( FT_Stream stream );
/* read a byte from a stream */
@@ -457,29 +457,29 @@ FT_BEGIN_HEADER
FT_Stream_ReadChar( FT_Stream stream,
FT_Error* error );
- /* read a 16-bit big-endian integer from a stream */
- FT_BASE( FT_Short )
- FT_Stream_ReadShort( FT_Stream stream,
+ /* read a 16-bit big-endian unsigned integer from a stream */
+ FT_BASE( FT_UShort )
+ FT_Stream_ReadUShort( FT_Stream stream,
FT_Error* error );
- /* read a 24-bit big-endian integer from a stream */
- FT_BASE( FT_Long )
- FT_Stream_ReadOffset( FT_Stream stream,
+ /* read a 24-bit big-endian unsigned integer from a stream */
+ FT_BASE( FT_ULong )
+ FT_Stream_ReadUOffset( FT_Stream stream,
FT_Error* error );
/* read a 32-bit big-endian integer from a stream */
- FT_BASE( FT_Long )
- FT_Stream_ReadLong( FT_Stream stream,
+ FT_BASE( FT_ULong )
+ FT_Stream_ReadULong( FT_Stream stream,
FT_Error* error );
- /* read a 16-bit little-endian integer from a stream */
- FT_BASE( FT_Short )
- FT_Stream_ReadShortLE( FT_Stream stream,
+ /* read a 16-bit little-endian unsigned integer from a stream */
+ FT_BASE( FT_UShort )
+ FT_Stream_ReadUShortLE( FT_Stream stream,
FT_Error* error );
- /* read a 32-bit little-endian integer from a stream */
- FT_BASE( FT_Long )
- FT_Stream_ReadLongLE( FT_Stream stream,
+ /* read a 32-bit little-endian unsigned integer from a stream */
+ FT_BASE( FT_ULong )
+ FT_Stream_ReadULongLE( FT_Stream stream,
FT_Error* error );
/* Read a structure from a stream. The structure must be described */
diff --git a/include/freetype/internal/fttrace.h b/include/freetype/internal/fttrace.h
index e9b383a..fbefdbd 100644
--- a/include/freetype/internal/fttrace.h
+++ b/include/freetype/internal/fttrace.h
@@ -4,7 +4,7 @@
/* */
/* Tracing handling (specification only). */
/* */
-/* Copyright 2002, 2004, 2005, 2006, 2007 by */
+/* Copyright 2002, 2004-2007, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -135,5 +135,10 @@ FT_TRACE_DEF( gxvtrak )
FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvlcar )
+ /* autofit components */
+FT_TRACE_DEF( afcjk )
+FT_TRACE_DEF( aflatin )
+FT_TRACE_DEF( aflatin2 )
+FT_TRACE_DEF( afwarp )
/* END */
diff --git a/include/freetype/tttables.h b/include/freetype/tttables.h
index 4610e50..02236c2 100644
--- a/include/freetype/tttables.h
+++ b/include/freetype/tttables.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 by */
+/* Copyright 1996-2005, 2008-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -687,12 +687,16 @@ FT_BEGIN_HEADER
* The index of an SFNT table. The function returns
* FT_Err_Table_Missing for an invalid value.
*
- * @output:
+ * @inout:
* tag ::
- * The name tag of the SFNT table.
+ * The name tag of the SFNT table. If the value is NULL, `table_index'
+ * is ignored, and `length' returns the number of SFNT tables in the
+ * font.
*
+ * @output:
* length ::
- * The length of the SFNT table.
+ * The length of the SFNT table (or the number of SFNT tables, depending
+ * on `tag').
*
* @return:
* FreeType error code. 0~means success.