-updated freetype from 2.3.7 to 2.4.10

-updated zlib from 1.2.5 to 1.2.7
-updated jpeglib from 8b to 8d
-fixed possible wiiflow exit bug
This commit is contained in:
fix94.1 2012-07-11 14:59:09 +00:00
parent ee49554a49
commit 09b5210138
48 changed files with 3610 additions and 2487 deletions

View File

@ -1,11 +1,10 @@
/* ftconfig.h. Generated from ftconfig.in by configure. */
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftconfig.in */ /* ftconfig.h */
/* */ /* */
/* UNIX-specific configuration file (specification only). */ /* ANSI-specific configuration file (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */ /* Copyright 1996-2004, 2006-2008, 2010-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -32,9 +31,10 @@
/* contains system-specific files that are always included first when */ /* contains system-specific files that are always included first when */
/* building the library. */ /* building the library. */
/* */ /* */
/* This ANSI version should stay in `include/freetype/config'. */
/* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTCONFIG_H__ #ifndef __FTCONFIG_H__
#define __FTCONFIG_H__ #define __FTCONFIG_H__
@ -58,11 +58,6 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
#define HAVE_UNISTD_H 1
#define HAVE_FCNTL_H 1
#define HAVE_STDINT_H 1
/* There are systems (like the Texas Instruments 'C54x) where a `char' */ /* There are systems (like the Texas Instruments 'C54x) where a `char' */
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */ /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */ /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
@ -76,22 +71,6 @@ FT_BEGIN_HEADER
#endif #endif
/* #undef FT_USE_AUTOCONF_SIZEOF_TYPES */
#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define FT_SIZEOF_INT SIZEOF_INT
#define FT_SIZEOF_LONG SIZEOF_LONG
#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
/* Following cpp computation of the bit length of int and long */
/* is copied from default include/freetype/config/ftconfig.h. */
/* If any improvement is required for this file, it should be */
/* applied to the original header file for the builders that */
/* does not use configure script. */
/* The size of an `int' type. */ /* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFUL #if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT) #define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
@ -115,12 +94,6 @@ FT_BEGIN_HEADER
#error "Unsupported size of `long' type!" #error "Unsupported size of `long' type!"
#endif #endif
#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
/* Preferred alignment of data */
#define FT_ALIGNMENT 8
/* FT_UNUSED is a macro used to indicate that a given parameter is not */ /* FT_UNUSED is a macro used to indicate that a given parameter is not */
/* used -- this is only used to get rid of unpleasant compiler warnings */ /* used -- this is only used to get rid of unpleasant compiler warnings */
@ -147,15 +120,17 @@ FT_BEGIN_HEADER
/* This is the only necessary change, so it is defined here instead */ /* This is the only necessary change, so it is defined here instead */
/* providing a new configuration file. */ /* providing a new configuration file. */
/* */ /* */
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */ /* 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" #include "AvailabilityMacros.h"
#endif
#if defined( __LP64__ ) && \ #if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1 #undef FT_MACINTOSH
#else
#define FT_MACINTOSH 1
#endif #endif
#elif defined( __SC__ ) || defined( __MRC__ ) #elif defined( __SC__ ) || defined( __MRC__ )
@ -168,29 +143,73 @@ FT_BEGIN_HEADER
#endif #endif
/* Fix compiler warning with sgi compiler */ /*************************************************************************/
#if defined( __sgi ) && !defined( __GNUC__ ) /* */
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) /* <Section> */
#pragma set woff 3505 /* basic_types */
#endif /* */
#endif /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* IntN types */ /* <Type> */
/* FT_Int16 */
/* */ /* */
/* Used to guarantee the size of some specific integers. */ /* <Description> */
/* A typedef for a 16bit signed integer type. */
/* */
typedef signed short FT_Int16;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt16 */
/* */
/* <Description> */
/* A typedef for a 16bit unsigned integer type. */
/* */ /* */
typedef signed short FT_Int16;
typedef unsigned short FT_UInt16; typedef unsigned short FT_UInt16;
#if FT_SIZEOF_INT == 4 /* */
/* this #if 0 ... #endif clause is for documentation purposes */
#if 0
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int32 */
/* */
/* <Description> */
/* A typedef for a 32bit signed integer type. The size depends on */
/* the configuration. */
/* */
typedef signed XXX FT_Int32;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt32 */
/* */
/* A typedef for a 32bit unsigned integer type. The size depends on */
/* the configuration. */
/* */
typedef unsigned XXX FT_UInt32;
/* */
#endif
#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
typedef signed int FT_Int32; typedef signed int FT_Int32;
typedef unsigned int FT_UInt32; typedef unsigned int FT_UInt32;
#elif FT_SIZEOF_LONG == 4 #elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
typedef signed long FT_Int32; typedef signed long FT_Int32;
typedef unsigned long FT_UInt32; typedef unsigned long FT_UInt32;
@ -201,12 +220,12 @@ FT_BEGIN_HEADER
/* look up an integer type that is at least 32 bits */ /* look up an integer type that is at least 32 bits */
#if FT_SIZEOF_INT >= 4 #if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
typedef int FT_Fast; typedef int FT_Fast;
typedef unsigned int FT_UFast; typedef unsigned int FT_UFast;
#elif FT_SIZEOF_LONG >= 4 #elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
typedef long FT_Fast; typedef long FT_Fast;
typedef unsigned long FT_UFast; typedef unsigned long FT_UFast;
@ -216,7 +235,7 @@ FT_BEGIN_HEADER
/* determine whether we have a 64-bit int type for platforms without */ /* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */ /* Autoconf */
#if FT_SIZEOF_LONG == 8 #if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
/* FT_LONG64 must be defined if a 64-bit type is available */ /* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64 #define FT_LONG64
@ -252,7 +271,7 @@ FT_BEGIN_HEADER
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 long long int #define FT_INT64 long long int
#endif /* FT_SIZEOF_LONG == 8 */ #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
/*************************************************************************/ /*************************************************************************/
@ -266,10 +285,7 @@ FT_BEGIN_HEADER
#ifdef __STDC__ #ifdef __STDC__
/* Undefine the 64-bit macros in strict ANSI compilation mode. */ /* undefine the 64-bit macros in strict ANSI compilation mode */
/* Since `#undef' doesn't survive in configuration header files */
/* we use the postprocessing facility of AC_CONFIG_HEADERS to */
/* replace the leading `/' with `#'. */
#undef FT_LONG64 #undef FT_LONG64
#undef FT_INT64 #undef FT_INT64
@ -287,11 +303,42 @@ FT_BEGIN_HEADER
/* Provide assembler fragments for performance-critical functions. */ /* Provide assembler fragments for performance-critical functions. */
/* These must be defined `static __inline__' with GCC. */ /* These must be defined `static __inline__' with GCC. */
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
/* documentation is in freetype.h */
static __inline FT_Int32
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 t, t2;
__asm
{
smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
mov a, t, asr #31 /* a = (hi >> 31) */
add a, a, #0x8000 /* a += 0x8000 */
adds t2, t2, a /* t2 += a */
adc t, t, #0 /* t += carry */
mov a, t2, lsr #16 /* a = t2 >> 16 */
orr a, a, t, lsl #16 /* a |= t << 16 */
}
return a;
}
#endif /* __CC_ARM || __ARMCC__ */
#ifdef __GNUC__ #ifdef __GNUC__
#if defined( __arm__ ) && !defined( __thumb__ ) #if defined( __arm__ ) && !defined( __thumb__ ) && \
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
/* documentation is in freetype.h */
static __inline__ FT_Int32 static __inline__ FT_Int32
FT_MulFix_arm( FT_Int32 a, FT_MulFix_arm( FT_Int32 a,
FT_Int32 b ) FT_Int32 b )
@ -299,24 +346,26 @@ FT_BEGIN_HEADER
register FT_Int32 t, t2; register FT_Int32 t, t2;
asm __volatile__ ( __asm__ __volatile__ (
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
"adds %1, %1, %0\n\t" /* %1 += %0 */ "adds %1, %1, %0\n\t" /* %1 += %0 */
"adc %2, %2, #0\n\t" /* %2 += carry */ "adc %2, %2, #0\n\t" /* %2 += carry */
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ "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"(t2), "=&r"(t)
: "r"(a), "r"(b) ); : "r"(a), "r"(b) );
return a; return a;
} }
#endif /* __arm__ && !__thumb__ */ #endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
#if defined( i386 ) #if defined( __i386__ )
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386
/* documentation is in freetype.h */
static __inline__ FT_Int32 static __inline__ FT_Int32
FT_MulFix_i386( FT_Int32 a, FT_MulFix_i386( FT_Int32 a,
FT_Int32 b ) FT_Int32 b )
@ -334,9 +383,9 @@ FT_BEGIN_HEADER
"shrl $16, %%eax\n" "shrl $16, %%eax\n"
"shll $16, %%edx\n" "shll $16, %%edx\n"
"addl %%edx, %%eax\n" "addl %%edx, %%eax\n"
: "=a"(result), "+d"(b) : "=a"(result), "=d"(b)
: "a"(a) : "a"(a), "d"(b)
: "%ecx" ); : "%ecx", "cc" );
return result; return result;
} }
@ -344,6 +393,43 @@ FT_BEGIN_HEADER
#endif /* __GNUC__ */ #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 */ #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Build macros of the FreeType 2 library. */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -424,6 +424,19 @@
#define FT_LZW_H <freetype/ftlzw.h> #define FT_LZW_H <freetype/ftlzw.h>
/*************************************************************************
*
* @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: * @macro:

View File

@ -1,13 +1,32 @@
/* This is a generated file. */ /*
* This file registers the FreeType modules compiled into the library.
*
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/') based on information
* from `<topdir>/modules.cfg'.
*
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
* FreeType without GNU make.
*
*/
FT_USE_MODULE( FT_Module_Class, autofit_module_class )
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
FT_USE_MODULE( FT_Module_Class, autofit_module_class ) FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class ) FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
/* EOF */ /* EOF */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* User-selectable configuration macros (specification only). */ /* User-selectable configuration macros (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -85,9 +85,9 @@ FT_BEGIN_HEADER
/* */ /* */
/* This macro has no impact on the FreeType API, only on its */ /* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times larger than */ /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
/* the original size; the difference will be that each triplet of */ /* the original size in case this macro isn't defined; however, each */
/* subpixels has R=G=B. */ /* triplet of subpixels has R=G=B. */
/* */ /* */
/* This is done to allow FreeType clients to run unmodified, forcing */ /* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */ /* them to display normal gray-level anti-aliased glyphs. */
@ -187,6 +187,33 @@ FT_BEGIN_HEADER
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
/*************************************************************************/
/* */
/* 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 */ /* DLL export compilation */
@ -312,10 +339,11 @@ FT_BEGIN_HEADER
/* */ /* */
/* Allow the use of FT_Incremental_Interface to load typefaces that */ /* Allow the use of FT_Incremental_Interface to load typefaces that */
/* contain no glyph data, but supply it via a callback function. */ /* contain no glyph data, but supply it via a callback function. */
/* This allows FreeType to be used with the PostScript language, using */ /* This is required by clients supporting document formats which */
/* the GhostScript interpreter. */ /* supply font data incrementally as the document is parsed, such */
/* as the Ghostscript interpreter for the PostScript language. */
/* */ /* */
/* #define FT_CONFIG_OPTION_INCREMENTAL */ #define FT_CONFIG_OPTION_INCREMENTAL
/*************************************************************************/ /*************************************************************************/
@ -361,6 +389,39 @@ FT_BEGIN_HEADER
/* #define FT_DEBUG_LEVEL_TRACE */ /* #define FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/
/* */
/* 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 */ /* Memory Debugging */
@ -396,6 +457,20 @@ FT_BEGIN_HEADER
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
/*************************************************************************/
/* */
/* Position Independent Code */
/* */
/* If this macro is set (which is _not_ the default), FreeType2 will */
/* avoid creating constants that require address fixups. Instead the */
/* constants will be moved into a struct and additional intialization */
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
/* fixups, such as BREW. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
@ -439,7 +514,7 @@ FT_BEGIN_HEADER
/* does not contain any glyph name though. */ /* does not contain any glyph name though. */
/* */ /* */
/* Accessing SFNT names is done through the functions declared in */ /* Accessing SFNT names is done through the functions declared in */
/* `freetype/ftnames.h'. */ /* `freetype/ftsnames.h'. */
/* */ /* */
#define TT_CONFIG_OPTION_SFNT_NAMES #define TT_CONFIG_OPTION_SFNT_NAMES
@ -457,6 +532,7 @@ FT_BEGIN_HEADER
#define TT_CONFIG_CMAP_FORMAT_8 #define TT_CONFIG_CMAP_FORMAT_8
#define TT_CONFIG_CMAP_FORMAT_10 #define TT_CONFIG_CMAP_FORMAT_10
#define TT_CONFIG_CMAP_FORMAT_12 #define TT_CONFIG_CMAP_FORMAT_12
#define TT_CONFIG_CMAP_FORMAT_13
#define TT_CONFIG_CMAP_FORMAT_14 #define TT_CONFIG_CMAP_FORMAT_14
@ -471,8 +547,7 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
/* a bytecode interpreter in the TrueType driver. Note that there are */ /* a bytecode interpreter in the TrueType driver. */
/* important patent issues related to the use of the interpreter. */
/* */ /* */
/* By undefining this, you will only compile the code necessary to load */ /* By undefining this, you will only compile the code necessary to load */
/* TrueType glyphs without hinting. */ /* TrueType glyphs without hinting. */
@ -480,17 +555,20 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here, since the build system might */ /* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */ /* define it for certain configurations only. */
/* */ /* */
/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */ /* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. Note that the */ /* any of the patented opcodes and algorithms. The patents related to */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */ /* TrueType hinting have expired worldwide since May 2010; this option */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */ /* is now deprecated. */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ /* */
/* 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. */ /* 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 */ /* This macro is only useful for a small number of font files (mostly */
@ -527,7 +605,7 @@ FT_BEGIN_HEADER
/* ... */ /* ... */
/* } */ /* } */
/* */ /* */
#define TT_CONFIG_OPTION_UNPATENTED_HINTING /* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
/*************************************************************************/ /*************************************************************************/
@ -556,7 +634,7 @@ FT_BEGIN_HEADER
/* composite flags array which can be used to disambiguate, but old */ /* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */ /* 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 */ /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
/* */ /* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@ -591,7 +669,7 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */ /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
/* required. */ /* required. */
/* */ /* */
@ -657,6 +735,19 @@ FT_BEGIN_HEADER
/* */ /* */
#define AF_CONFIG_OPTION_INDIC #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 */
/* */ /* */
@ -673,6 +764,27 @@ FT_BEGIN_HEADER
#define FT_CONFIG_OPTION_OLD_INTERNALS #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
/* /*
* This macro is defined if either unpatented or native TrueType * This macro is defined if either unpatented or native TrueType
* hinting is requested by the definitions above. * hinting is requested by the definitions above.

View File

@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */ /* ANSI-specific library and header configuration file (specification */
/* only). */ /* only). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ /* Copyright 2002-2007, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -59,10 +59,12 @@
#include <limits.h> #include <limits.h>
#define FT_CHAR_BIT CHAR_BIT #define FT_CHAR_BIT CHAR_BIT
#define FT_INT_MAX INT_MAX #define FT_USHORT_MAX USHRT_MAX
#define FT_UINT_MAX UINT_MAX #define FT_INT_MAX INT_MAX
#define FT_ULONG_MAX ULONG_MAX #define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/ /**********************************************************************/

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType high-level API and common types (specification only). */ /* FreeType high-level API and common types (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* Copyright 1996-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -16,6 +16,10 @@
/***************************************************************************/ /***************************************************************************/
#ifndef __FREETYPE_H__
#define __FREETYPE_H__
#ifndef FT_FREETYPE_H #ifndef FT_FREETYPE_H
#error "`ft2build.h' hasn't been included yet!" #error "`ft2build.h' hasn't been included yet!"
#error "Please always use macros to include FreeType header files." #error "Please always use macros to include FreeType header files."
@ -25,18 +29,6 @@
#endif #endif
/*************************************************************************/
/* */
/* The `raster' component duplicates some of the declarations in */
/* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */
/* */
/*************************************************************************/
#ifndef __FREETYPE_H__
#define __FREETYPE_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_CONFIG_CONFIG_H #include FT_CONFIG_CONFIG_H
#include FT_ERRORS_H #include FT_ERRORS_H
@ -234,10 +226,20 @@ FT_BEGIN_HEADER
/* Left side bearing for vertical layout. */ /* Left side bearing for vertical layout. */
/* */ /* */
/* vertBearingY :: */ /* vertBearingY :: */
/* Top side bearing for vertical layout. */ /* Top side bearing for vertical layout. Larger positive values */
/* mean further below the vertical glyph origin. */
/* */ /* */
/* vertAdvance :: */ /* 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 */
/* dimensions of the hinted glyph (in case hinting is applicable). */
/* */
/* Stroking a glyph with an outside border does not increase */
/* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
/* values to account for the added width and height. */
/* */ /* */
typedef struct FT_Glyph_Metrics_ typedef struct FT_Glyph_Metrics_
{ {
@ -395,8 +397,8 @@ FT_BEGIN_HEADER
/* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
/* */ /* */
/* <Also> */ /* <Also> */
/* The @FT_FaceRec details the publicly accessible fields of a given */ /* See @FT_FaceRec for the publicly accessible fields of a given face */
/* face object. */ /* object. */
/* */ /* */
typedef struct FT_FaceRec_* FT_Face; typedef struct FT_FaceRec_* FT_Face;
@ -425,8 +427,8 @@ FT_BEGIN_HEADER
/* activated at any given time per face. */ /* activated at any given time per face. */
/* */ /* */
/* <Also> */ /* <Also> */
/* The @FT_SizeRec structure details the publicly accessible fields */ /* See @FT_SizeRec for the publicly accessible fields of a given size */
/* of a given size object. */ /* object. */
/* */ /* */
typedef struct FT_SizeRec_* FT_Size; typedef struct FT_SizeRec_* FT_Size;
@ -438,7 +440,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A handle to a given `glyph slot'. A slot is a container where it */ /* A handle to a given `glyph slot'. A slot is a container where it */
/* is possible to load any one of the glyphs contained in its parent */ /* is possible to load any of the glyphs contained in its parent */
/* face. */ /* face. */
/* */ /* */
/* In other words, each time you call @FT_Load_Glyph or */ /* In other words, each time you call @FT_Load_Glyph or */
@ -447,7 +449,7 @@ FT_BEGIN_HEADER
/* other control information. */ /* other control information. */
/* */ /* */
/* <Also> */ /* <Also> */
/* @FT_GlyphSlotRec details the publicly accessible glyph fields. */ /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
/* */ /* */
typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
@ -478,8 +480,8 @@ FT_BEGIN_HEADER
/* the list and automatically activates it. */ /* the list and automatically activates it. */
/* */ /* */
/* <Also> */ /* <Also> */
/* The @FT_CharMapRec details the publicly accessible fields of a */ /* See @FT_CharMapRec for the publicly accessible fields of a given */
/* given character map. */ /* character map. */
/* */ /* */
typedef struct FT_CharMapRec_* FT_CharMap; typedef struct FT_CharMapRec_* FT_CharMap;
@ -527,131 +529,132 @@ FT_BEGIN_HEADER
/* <Note> */ /* <Note> */
/* Despite the name, this enumeration lists specific character */ /* Despite the name, this enumeration lists specific character */
/* repertories (i.e., charsets), and not text encoding methods (e.g., */ /* repertories (i.e., charsets), and not text encoding methods (e.g., */
/* UTF-8, UTF-16, GB2312_EUC, etc.). */ /* UTF-8, UTF-16, etc.). */
/* */
/* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
/* all character codes must be expressed as FT_Longs. */
/* */ /* */
/* Other encodings might be defined in the future. */ /* Other encodings might be defined in the future. */
/* */ /* */
/* <Values> */ /* <Values> */
/* FT_ENCODING_NONE :: */ /* FT_ENCODING_NONE :: */
/* The encoding value~0 is reserved. */ /* The encoding value~0 is reserved. */
/* */ /* */
/* FT_ENCODING_UNICODE :: */ /* FT_ENCODING_UNICODE :: */
/* Corresponds to the Unicode character set. This value covers */ /* Corresponds to the Unicode character set. This value covers */
/* all versions of the Unicode repertoire, including ASCII and */ /* all versions of the Unicode repertoire, including ASCII and */
/* Latin-1. Most fonts include a Unicode charmap, but not all */ /* Latin-1. Most fonts include a Unicode charmap, but not all */
/* of them. */ /* of them. */
/* */ /* */
/* FT_ENCODING_MS_SYMBOL :: */ /* For example, if you want to access Unicode value U+1F028 (and */
/* Corresponds to the Microsoft Symbol encoding, used to encode */ /* the font contains it), use value 0x1F028 as the input value for */
/* mathematical symbols in the 32..255 character code range. For */ /* @FT_Get_Char_Index. */
/* more information, see `http://www.ceviz.net/symbol.htm'. */
/* */ /* */
/* FT_ENCODING_SJIS :: */ /* FT_ENCODING_MS_SYMBOL :: */
/* Corresponds to Japanese SJIS encoding. More info at */ /* Corresponds to the Microsoft Symbol encoding, used to encode */
/* at `http://langsupport.japanreference.com/encoding.shtml'. */ /* mathematical symbols in the 32..255 character code range. For */
/* See note on multi-byte encodings below. */ /* more information, see `http://www.ceviz.net/symbol.htm'. */
/* */ /* */
/* FT_ENCODING_GB2312 :: */ /* FT_ENCODING_SJIS :: */
/* Corresponds to an encoding system for Simplified Chinese as used */ /* Corresponds to Japanese SJIS encoding. More info at */
/* used in mainland China. */ /* at `http://langsupport.japanreference.com/encoding.shtml'. */
/* See note on multi-byte encodings below. */
/* */ /* */
/* FT_ENCODING_BIG5 :: */ /* FT_ENCODING_GB2312 :: */
/* Corresponds to an encoding system for Traditional Chinese as used */ /* Corresponds to an encoding system for Simplified Chinese as used */
/* in Taiwan and Hong Kong. */ /* used in mainland China. */
/* */ /* */
/* FT_ENCODING_WANSUNG :: */ /* FT_ENCODING_BIG5 :: */
/* Corresponds to the Korean encoding system known as Wansung. */ /* Corresponds to an encoding system for Traditional Chinese as */
/* For more information see */ /* used in Taiwan and Hong Kong. */
/* `http://www.microsoft.com/typography/unicode/949.txt'. */
/* */ /* */
/* FT_ENCODING_JOHAB :: */ /* FT_ENCODING_WANSUNG :: */
/* The Korean standard character set (KS~C 5601-1992), which */ /* Corresponds to the Korean encoding system known as Wansung. */
/* corresponds to MS Windows code page 1361. This character set */ /* For more information see */
/* includes all possible Hangeul character combinations. */ /* `http://www.microsoft.com/typography/unicode/949.txt'. */
/* */ /* */
/* FT_ENCODING_ADOBE_LATIN_1 :: */ /* FT_ENCODING_JOHAB :: */
/* Corresponds to a Latin-1 encoding as defined in a Type~1 */ /* The Korean standard character set (KS~C 5601-1992), which */
/* PostScript font. It is limited to 256 character codes. */ /* corresponds to MS Windows code page 1361. This character set */
/* includes all possible Hangeul character combinations. */
/* */ /* */
/* FT_ENCODING_ADOBE_STANDARD :: */ /* FT_ENCODING_ADOBE_LATIN_1 :: */
/* Corresponds to the Adobe Standard encoding, as found in Type~1, */ /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
/* CFF, and OpenType/CFF fonts. It is limited to 256 character */ /* PostScript font. It is limited to 256 character codes. */
/* codes. */
/* */ /* */
/* FT_ENCODING_ADOBE_EXPERT :: */ /* FT_ENCODING_ADOBE_STANDARD :: */
/* Corresponds to the Adobe Expert encoding, as found in Type~1, */ /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
/* CFF, and OpenType/CFF fonts. It is limited to 256 character */ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
/* codes. */ /* codes. */
/* */ /* */
/* FT_ENCODING_ADOBE_CUSTOM :: */ /* FT_ENCODING_ADOBE_EXPERT :: */
/* Corresponds to a custom encoding, as found in Type~1, CFF, and */ /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
/* OpenType/CFF fonts. It is limited to 256 character codes. */ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
/* codes. */
/* */ /* */
/* FT_ENCODING_APPLE_ROMAN :: */ /* FT_ENCODING_ADOBE_CUSTOM :: */
/* Corresponds to the 8-bit Apple roman encoding. Many TrueType and */ /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
/* OpenType fonts contain a charmap for this encoding, since older */ /* OpenType/CFF fonts. It is limited to 256 character codes. */
/* versions of Mac OS are able to use it. */
/* */ /* */
/* FT_ENCODING_OLD_LATIN_2 :: */ /* FT_ENCODING_APPLE_ROMAN :: */
/* This value is deprecated and was never used nor reported by */ /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
/* FreeType. Don't use or test for it. */ /* and OpenType fonts contain a charmap for this encoding, since */
/* older versions of Mac OS are able to use it. */
/* */ /* */
/* FT_ENCODING_MS_SJIS :: */ /* FT_ENCODING_OLD_LATIN_2 :: */
/* Same as FT_ENCODING_SJIS. Deprecated. */ /* This value is deprecated and was never used nor reported by */
/* FreeType. Don't use or test for it. */
/* */ /* */
/* FT_ENCODING_MS_GB2312 :: */ /* FT_ENCODING_MS_SJIS :: */
/* Same as FT_ENCODING_GB2312. Deprecated. */ /* Same as FT_ENCODING_SJIS. Deprecated. */
/* */ /* */
/* FT_ENCODING_MS_BIG5 :: */ /* FT_ENCODING_MS_GB2312 :: */
/* Same as FT_ENCODING_BIG5. Deprecated. */ /* Same as FT_ENCODING_GB2312. Deprecated. */
/* */ /* */
/* FT_ENCODING_MS_WANSUNG :: */ /* FT_ENCODING_MS_BIG5 :: */
/* Same as FT_ENCODING_WANSUNG. Deprecated. */ /* Same as FT_ENCODING_BIG5. Deprecated. */
/* */ /* */
/* FT_ENCODING_MS_JOHAB :: */ /* FT_ENCODING_MS_WANSUNG :: */
/* Same as FT_ENCODING_JOHAB. Deprecated. */ /* Same as FT_ENCODING_WANSUNG. Deprecated. */
/* */
/* FT_ENCODING_MS_JOHAB :: */
/* Same as FT_ENCODING_JOHAB. Deprecated. */
/* */ /* */
/* <Note> */ /* <Note> */
/* By default, FreeType automatically synthesizes a Unicode charmap */ /* By default, FreeType automatically synthesizes a Unicode charmap */
/* for PostScript fonts, using their glyph names dictionaries. */ /* for PostScript fonts, using their glyph names dictionaries. */
/* However, it also reports the encodings defined explicitly in the */ /* However, it also reports the encodings defined explicitly in the */
/* font file, for the cases when they are needed, with the Adobe */ /* font file, for the cases when they are needed, with the Adobe */
/* values as well. */ /* values as well. */
/* */ /* */
/* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
/* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
/* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out which */ /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
/* encoding is really present. If, for example, the `cs_registry' */ /* which encoding is really present. If, for example, the */
/* field is `KOI8' and the `cs_encoding' field is `R', the font is */ /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
/* encoded in KOI8-R. */ /* the font is encoded in KOI8-R. */
/* */ /* */
/* FT_ENCODING_NONE is always set (with a single exception) by the */ /* FT_ENCODING_NONE is always set (with a single exception) by the */
/* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
/* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
/* which encoding is really present. For example, */ /* which encoding is really present. For example, */
/* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
/* Russian). */ /* Russian). */
/* */ /* */
/* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
/* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
/* FT_ENCODING_APPLE_ROMAN). */ /* FT_ENCODING_APPLE_ROMAN). */
/* */ /* */
/* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
/* @FT_Get_CMap_Language_ID to query the Mac language ID which may be */ /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
/* needed to be able to distinguish Apple encoding variants. See */ /* be needed to be able to distinguish Apple encoding variants. See */
/* */ /* */
/* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
/* */ /* */
/* to get an idea how to do that. Basically, if the language ID is~0, */ /* to get an idea how to do that. Basically, if the language ID */
/* don't use it, otherwise subtract 1 from the language ID. Then */ /* is~0, don't use it, otherwise subtract 1 from the language ID. */
/* examine `encoding_id'. If, for example, `encoding_id' is */ /* Then examine `encoding_id'. If, for example, `encoding_id' is */
/* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */ /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
/* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
/* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
/* variant the Arabic encoding. */ /* variant the Arabic encoding. */
/* */ /* */
typedef enum FT_Encoding_ typedef enum FT_Encoding_
{ {
@ -845,8 +848,8 @@ FT_BEGIN_HEADER
/* expressed in font units (see */ /* expressed in font units (see */
/* `units_per_EM'). The box is large enough */ /* `units_per_EM'). The box is large enough */
/* to contain any glyph from the font. Thus, */ /* to contain any glyph from the font. Thus, */
/* `bbox.yMax' can be seen as the `maximal */ /* `bbox.yMax' can be seen as the `maximum */
/* ascender', and `bbox.yMin' as the `minimal */ /* ascender', and `bbox.yMin' as the `minimum */
/* descender'. Only relevant for scalable */ /* descender'. Only relevant for scalable */
/* formats. */ /* formats. */
/* */ /* */
@ -878,13 +881,13 @@ FT_BEGIN_HEADER
/* positive. Only relevant for scalable */ /* positive. Only relevant for scalable */
/* formats. */ /* formats. */
/* */ /* */
/* max_advance_width :: The maximal advance width, in font units, */ /* max_advance_width :: The maximum advance width, in font units, */
/* for all glyphs in this face. This can be */ /* for all glyphs in this face. This can be */
/* used to make word wrapping computations */ /* used to make word wrapping computations */
/* faster. Only relevant for scalable */ /* faster. Only relevant for scalable */
/* formats. */ /* formats. */
/* */ /* */
/* max_advance_height :: The maximal advance height, in font units, */ /* max_advance_height :: The maximum advance height, in font units, */
/* for all glyphs in this face. This is only */ /* for all glyphs in this face. This is only */
/* relevant for vertical layouts, and is set */ /* relevant for vertical layouts, and is set */
/* to `height' for fonts that do not provide */ /* to `height' for fonts that do not provide */
@ -907,8 +910,8 @@ FT_BEGIN_HEADER
/* charmap :: The current active charmap for this face. */ /* charmap :: The current active charmap for this face. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Fields may be changed after a call to @FT_Attach_File or */ /* Fields may be changed after a call to @FT_Attach_File or */
/* @FT_Attach_Stream. */ /* @FT_Attach_Stream. */
/* */ /* */
typedef struct FT_FaceRec_ typedef struct FT_FaceRec_
{ {
@ -959,8 +962,8 @@ FT_BEGIN_HEADER
FT_ListRec sizes_list; FT_ListRec sizes_list;
FT_Generic autohint; FT_Generic autohint; /* face-specific auto-hinter data */
void* extensions; void* extensions; /* unused */
FT_Face_Internal internal; FT_Face_Internal internal;
@ -1060,12 +1063,12 @@ FT_BEGIN_HEADER
/* */ /* */
/* It is not possible to autohint such fonts using */ /* It is not possible to autohint such fonts using */
/* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */ /* @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 */ /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
/* probably never want this except for demonstration purposes. */ /* probably never want this except for demonstration purposes. */
/* */ /* */
/* Currently, there are six TrueType fonts in the list of tricky */ /* Currently, there are about a dozen TrueType fonts in the list of */
/* fonts; they are hard-coded in file `ttobjs.c'. */ /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
/* */ /* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) #define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@ -1339,7 +1342,7 @@ FT_BEGIN_HEADER
/* height :: The height in 26.6 fractional pixels. See */ /* height :: The height in 26.6 fractional pixels. See */
/* @FT_FaceRec for the details. */ /* @FT_FaceRec for the details. */
/* */ /* */
/* max_advance :: The maximal advance width in 26.6 fractional */ /* max_advance :: The maximum advance width in 26.6 fractional */
/* pixels. See @FT_FaceRec for the details. */ /* pixels. See @FT_FaceRec for the details. */
/* */ /* */
/* <Note> */ /* <Note> */
@ -1484,8 +1487,13 @@ FT_BEGIN_HEADER
/* important to perform correct WYSIWYG layout. */ /* important to perform correct WYSIWYG layout. */
/* Only relevant for outline glyphs. */ /* Only relevant for outline glyphs. */
/* */ /* */
/* advance :: This is the transformed advance width for the */ /* advance :: This shorthand is, depending on */
/* glyph. */ /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
/* advance width for the glyph (in 26.6 */
/* fractional pixel format). As specified with */
/* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
/* `horiAdvance' or the `vertAdvance' value of */
/* `metrics' field. */
/* */ /* */
/* format :: This field indicates the format of the image */ /* format :: This field indicates the format of the image */
/* contained in the glyph slot. Typically */ /* contained in the glyph slot. Typically */
@ -1659,6 +1667,14 @@ FT_BEGIN_HEADER
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */
/* In case you want to provide your own memory allocating routines, */
/* use @FT_New_Library instead, followed by a call to */
/* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
/* */
/* For multi-threading applications each thread should have its own */
/* FT_Library object. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Init_FreeType( FT_Library *alibrary ); FT_Init_FreeType( FT_Library *alibrary );
@ -1692,26 +1708,26 @@ FT_BEGIN_HEADER
/* @FT_Open_Args structure. */ /* @FT_Open_Args structure. */
/* */ /* */
/* <Values> */ /* <Values> */
/* FT_OPEN_MEMORY :: This is a memory-based stream. */ /* FT_OPEN_MEMORY :: This is a memory-based stream. */
/* */ /* */
/* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
/* */ /* */
/* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
/* name. */ /* name. */
/* */ /* */
/* FT_OPEN_DRIVER :: Use the `driver' field. */ /* FT_OPEN_DRIVER :: Use the `driver' field. */
/* */ /* */
/* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
/* */ /* */
/* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
/* */ /* */
/* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
/* */ /* */
/* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
/* */ /* */
/* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
/* */ /* */
/* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
@ -1736,8 +1752,8 @@ FT_BEGIN_HEADER
/* FT_Parameter */ /* FT_Parameter */
/* */ /* */
/* <Description> */ /* <Description> */
/* A simple structure used to pass more or less generic parameters */ /* A simple structure used to pass more or less generic parameters to */
/* to @FT_Open_Face. */ /* @FT_Open_Face. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* tag :: A four-byte identification tag. */ /* tag :: A four-byte identification tag. */
@ -1745,7 +1761,8 @@ FT_BEGIN_HEADER
/* data :: A pointer to the parameter data. */ /* data :: A pointer to the parameter data. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The ID and function of parameters are driver-specific. */ /* The ID and function of parameters are driver-specific. See the */
/* various FT_PARAM_TAG_XXX flags for more information. */
/* */ /* */
typedef struct FT_Parameter_ typedef struct FT_Parameter_
{ {
@ -1943,6 +1960,13 @@ FT_BEGIN_HEADER
/* Each new face object created with this function also owns a */ /* Each new face object created with this function also owns a */
/* default @FT_Size object, accessible as `face->size'. */ /* default @FT_Size object, accessible as `face->size'. */
/* */ /* */
/* One @FT_Library instance can have multiple face objects, this is, */
/* @FT_Open_Face and its siblings can be called multiple times using */
/* the same `library' argument. */
/* */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Face. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Open_Face( FT_Library library, FT_Open_Face( FT_Library library,
const FT_Open_Args* args, const FT_Open_Args* args,
@ -2007,6 +2031,33 @@ FT_BEGIN_HEADER
FT_Open_Args* parameters ); FT_Open_Args* parameters );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Reference_Face */
/* */
/* <Description> */
/* A counter gets initialized to~1 at the time an @FT_Face structure */
/* is created. This function increments the counter. @FT_Done_Face */
/* then only destroys a face if the counter is~1, otherwise it simply */
/* decrements the counter. */
/* */
/* This function helps in managing life-cycles of structures which */
/* reference @FT_Face objects. */
/* */
/* <Input> */
/* face :: A handle to a target face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.4.2 */
/* */
FT_EXPORT( FT_Error )
FT_Reference_Face( FT_Face face );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -2022,6 +2073,10 @@ FT_BEGIN_HEADER
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Face. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Done_Face( FT_Face face ); FT_Done_Face( FT_Face face );
@ -2063,8 +2118,8 @@ FT_BEGIN_HEADER
/* used to determine both scaling values. */ /* used to determine both scaling values. */
/* */ /* */
/* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */ /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
/* The real dimension. The sum of the the `Ascender' and (minus */ /* The real dimension. The sum of the the `ascender' and (minus */
/* of) the `Descender' fields of @FT_FaceRec are used to determine */ /* of) the `descender' fields of @FT_FaceRec are used to determine */
/* both scaling values. */ /* both scaling values. */
/* */ /* */
/* FT_SIZE_REQUEST_TYPE_BBOX :: */ /* FT_SIZE_REQUEST_TYPE_BBOX :: */
@ -2128,8 +2183,8 @@ FT_BEGIN_HEADER
/* value. */ /* value. */
/* */ /* */
/* <Note> */ /* <Note> */
/* If `width' is zero, then the horizontal scaling value is set */ /* If `width' is zero, then the horizontal scaling value is set equal */
/* equal to the vertical scaling value, and vice versa. */ /* to the vertical scaling value, and vice versa. */
/* */ /* */
typedef struct FT_Size_RequestRec_ typedef struct FT_Size_RequestRec_
{ {
@ -2401,14 +2456,13 @@ FT_BEGIN_HEADER
* during glyph loading. This is mostly used to detect broken glyphs * during glyph loading. This is mostly used to detect broken glyphs
* in fonts. By default, FreeType tries to handle broken fonts also. * in fonts. By default, FreeType tries to handle broken fonts also.
* *
* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: * In particular, errors from the TrueType bytecode engine are not
* Indicates that the font driver should ignore the global advance * passed to the application if this flag is not set; this might
* width defined in the font. By default, that value is used as the * result in partially hinted or distorted glyphs in case a glyph's
* advance width for all glyphs when the face has * bytecode is buggy.
* @FT_FACE_FLAG_FIXED_WIDTH set.
* *
* This flag exists for historical reasons (to support buggy CJK * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
* fonts). * Ignored. Deprecated.
* *
* FT_LOAD_NO_RECURSE :: * FT_LOAD_NO_RECURSE ::
* This flag is only used internally. It merely indicates that the * This flag is only used internally. It merely indicates that the
@ -2456,28 +2510,36 @@ FT_BEGIN_HEADER
* *
* Besides deciding which hinter to use, you can also decide which * Besides deciding which hinter to use, you can also decide which
* hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
*
* Note that the auto-hinter needs a valid Unicode cmap (either a native
* one or synthesized by FreeType) for producing correct results. If a
* font provides an incorrect mapping (for example, assigning the
* character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
* mathematical integral sign), the auto-hinter might produce useless
* results.
*
*/ */
#define FT_LOAD_DEFAULT 0x0 #define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE 0x1 #define FT_LOAD_NO_SCALE ( 1L << 0 )
#define FT_LOAD_NO_HINTING 0x2 #define FT_LOAD_NO_HINTING ( 1L << 1 )
#define FT_LOAD_RENDER 0x4 #define FT_LOAD_RENDER ( 1L << 2 )
#define FT_LOAD_NO_BITMAP 0x8 #define FT_LOAD_NO_BITMAP ( 1L << 3 )
#define FT_LOAD_VERTICAL_LAYOUT 0x10 #define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
#define FT_LOAD_FORCE_AUTOHINT 0x20 #define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
#define FT_LOAD_CROP_BITMAP 0x40 #define FT_LOAD_CROP_BITMAP ( 1L << 6 )
#define FT_LOAD_PEDANTIC 0x80 #define FT_LOAD_PEDANTIC ( 1L << 7 )
#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 0x200 #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
#define FT_LOAD_NO_RECURSE 0x400 #define FT_LOAD_NO_RECURSE ( 1L << 10 )
#define FT_LOAD_IGNORE_TRANSFORM 0x800 #define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
#define FT_LOAD_MONOCHROME 0x1000 #define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN 0x2000 #define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
#define FT_LOAD_NO_AUTOHINT 0x8000U #define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
/* */ /* */
/* used internally only by certain font drivers! */ /* used internally only by certain font drivers! */
#define FT_LOAD_ADVANCE_ONLY 0x100 #define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
#define FT_LOAD_SBITS_ONLY 0x4000 #define FT_LOAD_SBITS_ONLY ( 1L << 14 )
/************************************************************************** /**************************************************************************
@ -2529,7 +2591,8 @@ FT_BEGIN_HEADER
* *
* If @FT_LOAD_RENDER is also set, the glyph is rendered in the * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
* corresponding mode (i.e., the mode which matches the used algorithm * corresponding mode (i.e., the mode which matches the used algorithm
* best) unless @FT_LOAD_MONOCHROME is set. * best). An exeption is FT_LOAD_TARGET_MONO since it implies
* @FT_LOAD_MONOCHROME.
* *
* You can use a hinting algorithm that doesn't correspond to the same * You can use a hinting algorithm that doesn't correspond to the same
* rendering mode. As an example, it is possible to use the `light' * rendering mode. As an example, it is possible to use the `light'
@ -2542,15 +2605,15 @@ FT_BEGIN_HEADER
* *
* FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
* } * }
*
*/ */
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
/************************************************************************** /**************************************************************************
@ -2563,7 +2626,6 @@ FT_BEGIN_HEADER
* @FT_LOAD_TARGET_XXX value. * @FT_LOAD_TARGET_XXX value.
* *
*/ */
#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
@ -2611,9 +2673,9 @@ FT_BEGIN_HEADER
/* FreeType~2. Each mode corresponds to a specific type of scanline */ /* FreeType~2. Each mode corresponds to a specific type of scanline */
/* conversion performed on the outline. */ /* conversion performed on the outline. */
/* */ /* */
/* For bitmap fonts the `bitmap->pixel_mode' field in the */ /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
/* @FT_GlyphSlotRec structure gives the format of the returned */ /* field in the @FT_GlyphSlotRec structure gives the format of the */
/* bitmap. */ /* returned bitmap. */
/* */ /* */
/* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */ /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
/* */ /* */
@ -2634,7 +2696,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* FT_RENDER_MODE_LCD :: */ /* FT_RENDER_MODE_LCD :: */
/* This mode corresponds to horizontal RGB and BGR sub-pixel */ /* This mode corresponds to horizontal RGB and BGR sub-pixel */
/* displays, like LCD-screens. It produces 8-bit bitmaps that are */ /* displays like LCD screens. It produces 8-bit bitmaps that are */
/* 3~times the width of the original glyph outline in pixels, and */ /* 3~times the width of the original glyph outline in pixels, and */
/* which use the @FT_PIXEL_MODE_LCD mode. */ /* which use the @FT_PIXEL_MODE_LCD mode. */
/* */ /* */
@ -2645,11 +2707,16 @@ FT_BEGIN_HEADER
/* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */ /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
/* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */ /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
/* (not active in the default builds). It is up to the caller to */ /* (not active in the default builds). It is up to the caller to */
/* either call @FT_Library_SetLcdFilter (if available) or do the */ /* either call @FT_Library_SetLcdFilter (if available) or do the */
/* filtering itself. */ /* filtering itself. */
/* */
/* The selected render mode only affects vector glyphs of a font. */
/* Embedded bitmaps often have a different pixel mode like */
/* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
/* them into 8-bit pixmaps. */
/* */ /* */
typedef enum FT_Render_Mode_ typedef enum FT_Render_Mode_
{ {
@ -2674,8 +2741,8 @@ FT_BEGIN_HEADER
/* @FT_Render_Mode values instead. */ /* @FT_Render_Mode values instead. */
/* */ /* */
/* <Values> */ /* <Values> */
/* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
/* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
/* */ /* */
#define ft_render_mode_normal FT_RENDER_MODE_NORMAL #define ft_render_mode_normal FT_RENDER_MODE_NORMAL
#define ft_render_mode_mono FT_RENDER_MODE_MONO #define ft_render_mode_mono FT_RENDER_MODE_MONO
@ -2822,18 +2889,30 @@ FT_BEGIN_HEADER
/* Return the track kerning for a given face object at a given size. */ /* Return the track kerning for a given face object at a given size. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to a source face object. */ /* face :: A handle to a source face object. */
/* */ /* */
/* point_size :: The point size in 16.16 fractional points. */ /* point_size :: The point size in 16.16 fractional points. */
/* */ /* */
/* degree :: The degree of tightness. */ /* degree :: The degree of tightness. Increasingly negative */
/* values represent tighter track kerning, while */
/* increasingly positive values represent looser track */
/* kerning. Value zero means no track kerning. */
/* */ /* */
/* <Output> */ /* <Output> */
/* akerning :: The kerning in 16.16 fractional points. */ /* akerning :: The kerning in 16.16 fractional points, to be */
/* uniformly applied between all glyphs. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */
/* Currently, only the Type~1 font driver supports track kerning, */
/* using data from AFM files (if attached with @FT_Attach_File or */
/* @FT_Attach_Stream). */
/* */
/* Only very few AFM files come with track kerning data; please refer */
/* to the Adobe's AFM specification for more details. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Track_Kerning( FT_Face face, FT_Get_Track_Kerning( FT_Face face,
FT_Fixed point_size, FT_Fixed point_size,
@ -2855,7 +2934,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* glyph_index :: The glyph index. */ /* glyph_index :: The glyph index. */
/* */ /* */
/* buffer_max :: The maximal number of bytes available in the */ /* buffer_max :: The maximum number of bytes available in the */
/* buffer. */ /* buffer. */
/* */ /* */
/* <Output> */ /* <Output> */
@ -2873,6 +2952,10 @@ FT_BEGIN_HEADER
/* The glyph name is truncated to fit within the buffer if it is too */ /* The glyph name is truncated to fit within the buffer if it is too */
/* long. The returned string is always zero-terminated. */ /* 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 */ /* This function is not compiled within the library if the config */
/* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */ /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
/* `include/freetype/config/ftoptions.h'. */ /* `include/freetype/config/ftoptions.h'. */
@ -2983,7 +3066,7 @@ FT_BEGIN_HEADER
* *
* @return: * @return:
* The index into the array of character maps within the face to which * The index into the array of character maps within the face to which
* `charmap' belongs. * `charmap' belongs. If an error occurs, -1 is returned.
* *
*/ */
FT_EXPORT( FT_Int ) FT_EXPORT( FT_Int )
@ -3010,9 +3093,15 @@ FT_BEGIN_HEADER
/* <Note> */ /* <Note> */
/* If you use FreeType to manipulate the contents of font files */ /* If you use FreeType to manipulate the contents of font files */
/* directly, be aware that the glyph index returned by this function */ /* directly, be aware that the glyph index returned by this function */
/* doesn't always correspond to the internal indices used within */ /* doesn't always correspond to the internal indices used within the */
/* the file. This is done to ensure that value~0 always corresponds */ /* file. This is done to ensure that value~0 always corresponds to */
/* to the `missing glyph'. */ /* the `missing glyph'. If the first glyph is not named `.notdef', */
/* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
/* the glyph ID~0 position, and whatever was there will be moved to */
/* the position `.notdef' had. For Type~1 fonts, if there is no */
/* `.notdef' glyph at all, then one will be created at index~0 and */
/* whatever was there will be moved to the last index -- Type~42 */
/* fonts are considered invalid under this condition. */
/* */ /* */
FT_EXPORT( FT_UInt ) FT_EXPORT( FT_UInt )
FT_Get_Char_Index( FT_Face face, FT_Get_Char_Index( FT_Face face,
@ -3060,7 +3149,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* Note that `*agindex' is set to~0 if the charmap is empty. The */ /* Note that `*agindex' is set to~0 if the charmap is empty. The */
/* result itself can be~0 in two cases: if the charmap is empty or */ /* result itself can be~0 in two cases: if the charmap is empty or */
/* when the value~0 is the first valid character code. */ /* if the value~0 is the first valid character code. */
/* */ /* */
FT_EXPORT( FT_ULong ) FT_EXPORT( FT_ULong )
FT_Get_First_Char( FT_Face face, FT_Get_First_Char( FT_Face face,
@ -3082,7 +3171,7 @@ FT_BEGIN_HEADER
/* char_code :: The starting character code. */ /* char_code :: The starting character code. */
/* */ /* */
/* <Output> */ /* <Output> */
/* agindex :: Glyph index of first character code. 0~if charmap */ /* agindex :: Glyph index of next character code. 0~if charmap */
/* is empty. */ /* is empty. */
/* */ /* */
/* <Return> */ /* <Return> */
@ -3159,15 +3248,16 @@ FT_BEGIN_HEADER
* *
* @description: * @description:
* Retrieve a description of a given subglyph. Only use it if * Retrieve a description of a given subglyph. Only use it if
* `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE, or an error is * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
* returned. * returned otherwise.
* *
* @input: * @input:
* glyph :: * glyph ::
* The source glyph slot. * The source glyph slot.
* *
* sub_index :: * sub_index ::
* The index of subglyph. Must be less than `glyph->num_subglyphs'. * The index of the subglyph. Must be less than
* `glyph->num_subglyphs'.
* *
* @output: * @output:
* p_index :: * p_index ::
@ -3282,6 +3372,9 @@ FT_BEGIN_HEADER
/* in the @PS_FontInfoRec structure which is only guaranteed to */ /* in the @PS_FontInfoRec structure which is only guaranteed to */
/* return the correct results for Type~1 fonts. */ /* return the correct results for Type~1 fonts. */
/* */ /* */
/* <Since> */
/* 2.3.8 */
/* */
FT_EXPORT( FT_UShort ) FT_EXPORT( FT_UShort )
FT_Get_FSType_Flags( FT_Face face ); FT_Get_FSType_Flags( FT_Face face );
@ -3539,7 +3632,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A very simple function used to perform the computation `(a*b)/c' */ /* A very simple function used to perform the computation `(a*b)/c' */
/* with maximal accuracy (it uses a 64-bit intermediate integer */ /* with maximum accuracy (it uses a 64-bit intermediate integer */
/* whenever necessary). */ /* whenever necessary). */
/* */ /* */
/* This function isn't necessarily as fast as some processor specific */ /* This function isn't necessarily as fast as some processor specific */
@ -3574,7 +3667,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A very simple function used to perform the computation */ /* A very simple function used to perform the computation */
/* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */ /* `(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 float factor. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -3619,7 +3712,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A very simple function used to perform the computation */ /* A very simple function used to perform the computation */
/* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */ /* `(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 float factor. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -3739,26 +3832,27 @@ FT_BEGIN_HEADER
/************************************************************************* /*************************************************************************
* *
* @enum: * @enum:
* FREETYPE_XXX * FREETYPE_XXX
* *
* @description: * @description:
* These three macros identify the FreeType source code version. * These three macros identify the FreeType source code version.
* Use @FT_Library_Version to access them at runtime. * Use @FT_Library_Version to access them at runtime.
* *
* @values: * @values:
* FREETYPE_MAJOR :: The major version number. * FREETYPE_MAJOR :: The major version number.
* FREETYPE_MINOR :: The minor version number. * FREETYPE_MINOR :: The minor version number.
* FREETYPE_PATCH :: The patch level. * FREETYPE_PATCH :: The patch level.
*
* @note:
* The version number of FreeType if built as a dynamic link library
* with the `libtool' package is _not_ controlled by these three
* macros.
* *
* @note:
* The version number of FreeType if built as a dynamic link library
* with the `libtool' package is _not_ controlled by these three
* macros.
*/ */
#define FREETYPE_MAJOR 2 #define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 3 #define FREETYPE_MINOR 4
#define FREETYPE_PATCH 8 #define FREETYPE_PATCH 10
/*************************************************************************/ /*************************************************************************/
@ -3818,6 +3912,9 @@ FT_BEGIN_HEADER
/* 1~if this is a TrueType font that uses one of the patented */ /* 1~if this is a TrueType font that uses one of the patented */
/* opcodes, 0~otherwise. */ /* opcodes, 0~otherwise. */
/* */ /* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
/* */
/* <Since> */ /* <Since> */
/* 2.3.5 */ /* 2.3.5 */
/* */ /* */
@ -3845,6 +3942,9 @@ FT_BEGIN_HEADER
/* an SFNT font, or if the unpatented hinter is not compiled in this */ /* an SFNT font, or if the unpatented hinter is not compiled in this */
/* instance of the library. */ /* instance of the library. */
/* */ /* */
/* <Note> */
/* Since May 2010, TrueType hinting is no longer patented. */
/* */
/* <Since> */ /* <Since> */
/* 2.3.5 */ /* 2.3.5 */
/* */ /* */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType exact bbox computation (specification). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -73,6 +73,14 @@ FT_BEGIN_HEADER
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* 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_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline, FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox ); FT_BBox *abbox );

View File

@ -0,0 +1,102 @@
/***************************************************************************/
/* */
/* ftbzip2.h */
/* */
/* Bzip2-compressed stream support. */
/* */
/* Copyright 2010 by */
/* Joel Klinghed. */
/* */
/* 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 __FTBZIP2_H__
#define __FTBZIP2_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> */
/* bzip2 */
/* */
/* <Title> */
/* BZIP2 Streams */
/* */
/* <Abstract> */
/* Using bzip2-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of Bzip2-specific functions. */
/* */
/*************************************************************************/
/************************************************************************
*
* @function:
* FT_Stream_OpenBzip2
*
* @description:
* Open a new stream to parse bzip2-compressed font files. This is
* mainly used to support the compressed `*.pcf.bz2' fonts that come
* with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, bzip2 compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a bzip2 compressed stream
* from it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with bzip2 support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenBzip2( FT_Stream stream,
FT_Stream source );
/* */
FT_END_HEADER
#endif /* __FTBZIP2_H__ */
/* END */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType Cache subsystem (specification). */ /* FreeType Cache subsystem (specification). */
/* */ /* */
/* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -56,9 +56,12 @@ FT_BEGIN_HEADER
* interpret them in any way. * interpret them in any way.
* *
* Second, the cache calls, only when needed, a client-provided function * 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 * 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 * 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 * 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 FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
#define FTC_FACE_ID_HASH( i ) \ #define FTC_FACE_ID_HASH( i ) \
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \ ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
( FT_POINTER_TO_ULONG( i ) << 7 ) ) ) ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
@ -263,10 +271,10 @@ FT_BEGIN_HEADER
/* reference-counted. A node with a count of~0 might be flushed */ /* reference-counted. A node with a count of~0 might be flushed */
/* out of a full cache whenever a lookup request is performed. */ /* out of a full cache whenever a lookup request is performed. */
/* */ /* */
/* If you lookup nodes, you have the ability to `acquire' them, i.e., */ /* If you look up nodes, you have the ability to `acquire' them, */
/* to increment their reference count. This will prevent the node */ /* i.e., to increment their reference count. This will prevent the */
/* from being flushed out of the cache until you explicitly `release' */ /* node from being flushed out of the cache until you explicitly */
/* it (see @FTC_Node_Unref). */ /* `release' it (see @FTC_Node_Unref). */
/* */ /* */
/* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */
/* */ /* */
@ -697,11 +705,17 @@ FT_BEGIN_HEADER
(d1)->width == (d2)->width && \ (d1)->width == (d2)->width && \
(d1)->flags == (d2)->flags ) (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 ) \ #define FTC_IMAGE_TYPE_HASH( d ) \
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \ (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
( (d)->width << 8 ) ^ (d)->height ^ \ ( (d)->width << 8 ) ^ (d)->height ^ \
( (d)->flags << 4 ) ) ( (d)->flags << 4 ) )
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
@ -1093,6 +1107,7 @@ FT_BEGIN_HEADER
(f1)->pix_width == (f2)->pix_width && \ (f1)->pix_width == (f2)->pix_width && \
(f1)->pix_height == (f2)->pix_height ) (f1)->pix_height == (f2)->pix_height )
/* this macro is incompatible with LLP64, should not be used */
#define FTC_FONT_HASH( f ) \ #define FTC_FONT_HASH( f ) \
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \ (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
((f)->pix_width << 8) ^ \ ((f)->pix_width << 8) ^ \

View File

@ -98,6 +98,7 @@
/* module_management */ /* module_management */
/* gzip */ /* gzip */
/* lzw */ /* lzw */
/* bzip2 */
/* lcd_filtering */ /* lcd_filtering */
/* */ /* */
/***************************************************************************/ /***************************************************************************/

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType API for accessing CID font information (specification). */ /* FreeType API for accessing CID font information (specification). */
/* */ /* */
/* Copyright 2007 by Dereg Clegg. */ /* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
@ -88,6 +88,74 @@ FT_BEGIN_HEADER
const char* *ordering, const char* *ordering,
FT_Int *supplement); FT_Int *supplement);
/**********************************************************************
*
* @function:
* FT_Get_CID_Is_Internally_CID_Keyed
*
* @description:
* Retrieve the type of the input face, CID keyed or not. In
* constrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SNFT wrapper.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* is_cid ::
* The type of the face as an @FT_Bool.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
FT_Bool *is_cid );
/**********************************************************************
*
* @function:
* FT_Get_CID_From_Glyph_Index
*
* @description:
* Retrieve the CID of the input glyph index.
*
* @input:
* face ::
* A handle to the input face.
*
* glyph_index ::
* The input glyph index.
*
* @output:
* cid ::
* The CID as an @FT_UInt.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with CID faces and OpenType fonts,
* returning an error otherwise.
*
* @since:
* 2.3.9
*/
FT_EXPORT( FT_Error )
FT_Get_CID_From_Glyph_Index( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid );
/* */ /* */
FT_END_HEADER FT_END_HEADER

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType error codes (specification). */ /* FreeType error codes (specification). */
/* */ /* */
/* Copyright 2002, 2004, 2006, 2007 by */ /* Copyright 2002, 2004, 2006, 2007, 2010-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -54,6 +54,8 @@
"broken offset within table" ) "broken offset within table" )
FT_ERRORDEF_( Array_Too_Large, 0x0A, \ FT_ERRORDEF_( Array_Too_Large, 0x0A, \
"array allocation size too large" ) "array allocation size too large" )
FT_ERRORDEF_( Missing_Module, 0x0B, \
"missing module" )
/* glyph/character errors */ /* glyph/character errors */
@ -211,6 +213,8 @@
"argument stack underflow" ) "argument stack underflow" )
FT_ERRORDEF_( Ignore, 0xA2, \ FT_ERRORDEF_( Ignore, 0xA2, \
"ignore" ) "ignore" )
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
"no Unicode glyph name found" )
/* BDF errors */ /* BDF errors */
@ -220,19 +224,21 @@
"`FONT' field missing" ) "`FONT' field missing" )
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
"`SIZE' field missing" ) "`SIZE' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \ FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
"`FONTBOUNDINGBOX' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
"`CHARS' field missing" ) "`CHARS' field missing" )
FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \ FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
"`STARTCHAR' field missing" ) "`STARTCHAR' field missing" )
FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \ FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
"`ENCODING' field missing" ) "`ENCODING' field missing" )
FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \ FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
"`BBX' field missing" ) "`BBX' field missing" )
FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \ FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
"`BBX' too big" ) "`BBX' too big" )
FT_ERRORDEF_( Corrupted_Font_Header, 0xB8, \ FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
"Font header corrupted or missing fields" ) "Font header corrupted or missing fields" )
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xB9, \ FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
"Font glyphs corrupted or missing fields" ) "Font glyphs corrupted or missing fields" )

View File

@ -192,12 +192,13 @@
#undef FT_NOERRORDEF_ #undef FT_NOERRORDEF_
#undef FT_NEED_EXTERN_C #undef FT_NEED_EXTERN_C
#undef FT_ERR_CONCAT
#undef FT_ERR_BASE #undef FT_ERR_BASE
/* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */ /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */
#ifndef FT_KEEP_ERR_PREFIX #ifndef FT_KEEP_ERR_PREFIX
#undef FT_ERR_PREFIX #undef FT_ERR_PREFIX
#else
#undef FT_KEEP_ERR_PREFIX
#endif #endif
#endif /* __FTERRORS_H__ */ #endif /* __FTERRORS_H__ */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Access of TrueType's `gasp' table (specification). */ /* Access of TrueType's `gasp' table (specification). */
/* */ /* */
/* Copyright 2007, 2008 by */ /* Copyright 2007, 2008, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -63,18 +63,26 @@
* *
* FT_GASP_DO_GRIDFIT :: * FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem. * Grid-fitting and hinting should be performed at the specified ppem.
* This *really* means TrueType bytecode interpretation. * This *really* means TrueType bytecode interpretation. If this bit
* is not set, no hinting gets applied.
* *
* FT_GASP_DO_GRAY :: * 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 :: * 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 :: * FT_GASP_SYMMETRIC_GRIDFIT ::
* Grid-fitting must be used with ClearType's symmetric smoothing. * Grid-fitting must be used with ClearType's symmetric smoothing.
* *
* @note: * @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 * `ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents. * protected by patents.
* *

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType convenience functions to handle glyphs (specification). */ /* FreeType convenience functions to handle glyphs (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */ /* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -194,7 +194,7 @@ FT_BEGIN_HEADER
/* outline :: A descriptor for the outline. */ /* outline :: A descriptor for the outline. */
/* */ /* */
/* <Note> */ /* <Note> */
/* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */ /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */
/* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
/* the outline's content easily. */ /* the outline's content easily. */
/* */ /* */
@ -384,6 +384,13 @@ FT_BEGIN_HEADER
/* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
/* is another name for this constant. */ /* 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 */ /* Note that the maximum coordinates are exclusive, which means that */
/* one can compute the width and height of the glyph image (be it in */ /* one can compute the width and height of the glyph image (be it in */
/* integer or 26.6 pixels) as: */ /* integer or 26.6 pixels) as: */
@ -468,7 +475,7 @@ FT_BEGIN_HEADER
/* // convert to a bitmap (default render mode + destroying old) */ /* // convert to a bitmap (default render mode + destroying old) */
/* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
/* { */ /* { */
/* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */ /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */
/* 0, 1 ); */ /* 0, 1 ); */
/* if ( error ) // `glyph' unchanged */ /* if ( error ) // `glyph' unchanged */
/* ... */ /* ... */

View File

@ -5,7 +5,8 @@
/* FreeType glyph image formats and default raster interface */ /* FreeType glyph image formats and default raster interface */
/* (specification). */ /* (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -51,10 +52,9 @@ FT_BEGIN_HEADER
/* FT_Pos */ /* FT_Pos */
/* */ /* */
/* <Description> */ /* <Description> */
/* The type FT_Pos is a 32-bit integer used to store vectorial */ /* The type FT_Pos is used to store vectorial coordinates. Depending */
/* coordinates. Depending on the context, these can represent */ /* on the context, these can represent distances in integer font */
/* distances in integer font units, or 16.16, or 26.6 fixed float */ /* units, or 16.16, or 26.6 fixed float pixel coordinates. */
/* pixel coordinates. */
/* */ /* */
typedef signed long FT_Pos; typedef signed long FT_Pos;
@ -99,6 +99,20 @@ FT_BEGIN_HEADER
/* */ /* */
/* yMax :: The vertical maximum (top-most). */ /* yMax :: The vertical maximum (top-most). */
/* */ /* */
/* <Note> */
/* The bounding box is specified with the coordinates of the lower */
/* left and the upper right corner. In PostScript, those values are */
/* often called (llx,lly) and (urx,ury), respectively. */
/* */
/* If `yMin' is negative, this value gives the glyph's descender. */
/* Otherwise, the glyph doesn't descend below the baseline. */
/* Similarly, if `ymax' is positive, this value gives the glyph's */
/* ascender. */
/* */
/* `xMin' gives the horizontal distance from the glyph's origin to */
/* the left edge of the glyph's bounding box. If `xMin' is negative, */
/* the glyph extends to the left of the origin. */
/* */
typedef struct FT_BBox_ typedef struct FT_BBox_
{ {
FT_Pos xMin, yMin; FT_Pos xMin, yMin;
@ -254,6 +268,21 @@ FT_BEGIN_HEADER
/* flow. In all cases, the pitch is an offset to add */ /* flow. In all cases, the pitch is an offset to add */
/* to a bitmap pointer in order to go down one row. */ /* 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 */ /* buffer :: A typeless pointer to the bitmap buffer. This */
/* value should be aligned on 32-bit boundaries in */ /* value should be aligned on 32-bit boundaries in */
/* most cases. */ /* most cases. */
@ -318,14 +347,23 @@ FT_BEGIN_HEADER
/* elements, giving the outline's point coordinates. */ /* elements, giving the outline's point coordinates. */
/* */ /* */
/* tags :: A pointer to an array of `n_points' chars, giving */ /* tags :: A pointer to an array of `n_points' chars, giving */
/* each outline point's type. If bit~0 is unset, the */ /* each outline point's type. */
/* point is `off' the curve, i.e., a Bézier control */ /* */
/* point, while it is `on' when set. */ /* If bit~0 is unset, the point is `off' the curve, */
/* i.e., a Bézier control point, while it is `on' if */
/* set. */
/* */ /* */
/* Bit~1 is meaningful for `off' points only. If set, */ /* Bit~1 is meaningful for `off' points only. If set, */
/* it indicates a third-order Bézier arc control point; */ /* it indicates a third-order Bézier arc control point; */
/* and a second-order control point if unset. */ /* and a second-order control point if unset. */
/* */ /* */
/* If bit~2 is set, bits 5-7 contain the drop-out mode */
/* (as defined in the OpenType specification; the value */
/* is the same as the argument to the SCANMODE */
/* instruction). */
/* */
/* Bits 3 and~4 are reserved for internal purposes. */
/* */
/* contours :: An array of `n_contours' shorts, giving the end */ /* contours :: An array of `n_contours' shorts, giving the end */
/* point of each contour within the outline. For */ /* point of each contour within the outline. For */
/* example, the first contour is defined by the points */ /* example, the first contour is defined by the points */
@ -336,6 +374,12 @@ FT_BEGIN_HEADER
/* and give hints to the scan-converter and hinter on */ /* and give hints to the scan-converter and hinter on */
/* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */ /* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
/* */ /* */
/* <Note> */
/* The B/W rasterizer only checks bit~2 in the `tags' array for the */
/* first point of each contour. The drop-out mode as given with */
/* @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and */
/* @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden. */
/* */
typedef struct FT_Outline_ typedef struct FT_Outline_
{ {
short n_contours; /* number of contours in glyph */ short n_contours; /* number of contours in glyph */
@ -349,6 +393,11 @@ FT_BEGIN_HEADER
} FT_Outline; } FT_Outline;
/* Following limits must be consistent with */
/* FT_Outline.{n_contours,n_points} */
#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
#define FT_OUTLINE_POINTS_MAX SHRT_MAX
/*************************************************************************/ /*************************************************************************/
/* */ /* */
@ -371,7 +420,7 @@ FT_BEGIN_HEADER
/* FT_OUTLINE_EVEN_ODD_FILL :: */ /* FT_OUTLINE_EVEN_ODD_FILL :: */
/* By default, outlines are filled using the non-zero winding rule. */ /* By default, outlines are filled using the non-zero winding rule. */
/* If set to 1, the outline will be filled using the even-odd fill */ /* If set to 1, the outline will be filled using the even-odd fill */
/* rule (only works with the smooth raster). */ /* rule (only works with the smooth rasterizer). */
/* */ /* */
/* FT_OUTLINE_REVERSE_FILL :: */ /* FT_OUTLINE_REVERSE_FILL :: */
/* By default, outside contours of an outline are oriented in */ /* By default, outside contours of an outline are oriented in */
@ -384,15 +433,17 @@ FT_BEGIN_HEADER
/* By default, the scan converter will try to detect drop-outs in */ /* By default, the scan converter will try to detect drop-outs in */
/* an outline and correct the glyph bitmap to ensure consistent */ /* an outline and correct the glyph bitmap to ensure consistent */
/* shape continuity. If set, this flag hints the scan-line */ /* shape continuity. If set, this flag hints the scan-line */
/* converter to ignore such cases. */ /* converter to ignore such cases. See below for more information. */
/* */ /* */
/* FT_OUTLINE_SMART_DROPOUTS :: */ /* FT_OUTLINE_SMART_DROPOUTS :: */
/* Select smart dropout control. If unset, use simple dropout */ /* Select smart dropout control. If unset, use simple dropout */
/* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. */ /* control. Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See */
/* below for more information. */
/* */ /* */
/* FT_OUTLINE_INCLUDE_STUBS :: */ /* FT_OUTLINE_INCLUDE_STUBS :: */
/* If set, turn pixels on for `stubs', otherwise exclude them. */ /* If set, turn pixels on for `stubs', otherwise exclude them. */
/* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. */ /* Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for */
/* more information. */
/* */ /* */
/* FT_OUTLINE_HIGH_PRECISION :: */ /* FT_OUTLINE_HIGH_PRECISION :: */
/* This flag indicates that the scan-line converter should try to */ /* This flag indicates that the scan-line converter should try to */
@ -409,6 +460,13 @@ FT_BEGIN_HEADER
/* scan-converter. */ /* scan-converter. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */
/* and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth */
/* rasterizer. */
/* */
/* There exists a second mechanism to pass the drop-out mode to the */
/* B/W rasterizer; see the `tags' field in @FT_Outline. */
/* */
/* Please refer to the description of the `SCANTYPE' instruction in */ /* Please refer to the description of the `SCANTYPE' instruction in */
/* the OpenType specification (in file `ttinst1.doc') how simple */ /* the OpenType specification (in file `ttinst1.doc') how simple */
/* drop-outs, smart drop-outs, and stubs are defined. */ /* drop-outs, smart drop-outs, and stubs are defined. */
@ -455,15 +513,17 @@ FT_BEGIN_HEADER
#define FT_CURVE_TAG( flag ) ( flag & 3 ) #define FT_CURVE_TAG( flag ) ( flag & 3 )
#define FT_CURVE_TAG_ON 1 #define FT_CURVE_TAG_ON 1
#define FT_CURVE_TAG_CONIC 0 #define FT_CURVE_TAG_CONIC 0
#define FT_CURVE_TAG_CUBIC 2 #define FT_CURVE_TAG_CUBIC 2
#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */ #define FT_CURVE_TAG_HAS_SCANMODE 4
#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */
#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \ #define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */
FT_CURVE_TAG_TOUCH_Y ) #define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */
#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
FT_CURVE_TAG_TOUCH_Y )
#define FT_Curve_Tag_On FT_CURVE_TAG_ON #define FT_Curve_Tag_On FT_CURVE_TAG_ON
#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC #define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
@ -532,8 +592,8 @@ FT_BEGIN_HEADER
/* FT_Outline_ConicToFunc */ /* FT_Outline_ConicToFunc */
/* */ /* */
/* <Description> */ /* <Description> */
/* A function pointer type use to describe the signature of a `conic */ /* A function pointer type used to describe the signature of a `conic */
/* to' function during outline walking/decomposition. */ /* to' function during outline walking or decomposition. */
/* */ /* */
/* A `conic to' is emitted to indicate a second-order Bézier arc in */ /* A `conic to' is emitted to indicate a second-order Bézier arc in */
/* the outline. */ /* the outline. */
@ -565,7 +625,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A function pointer type used to describe the signature of a `cubic */ /* A function pointer type used to describe the signature of a `cubic */
/* to' function during outline walking/decomposition. */ /* to' function during outline walking or decomposition. */
/* */ /* */
/* A `cubic to' is emitted to indicate a third-order Bézier arc. */ /* A `cubic to' is emitted to indicate a third-order Bézier arc. */
/* */ /* */
@ -598,8 +658,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* A structure to hold various function pointers used during outline */ /* A structure to hold various function pointers used during outline */
/* decomposition in order to emit segments, conic, and cubic Béziers, */ /* decomposition in order to emit segments, conic, and cubic Béziers. */
/* as well as `move to' and `close to' operations. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* move_to :: The `move to' emitter. */ /* move_to :: The `move to' emitter. */
@ -626,7 +685,7 @@ FT_BEGIN_HEADER
/* y' = (x << shift) - delta */ /* y' = (x << shift) - delta */
/* } */ /* } */
/* */ /* */
/* Set the value of `shift' and `delta' to~0 to get the original */ /* Set the values of `shift' and `delta' to~0 to get the original */
/* point coordinates. */ /* point coordinates. */
/* */ /* */
typedef struct FT_Outline_Funcs_ typedef struct FT_Outline_Funcs_
@ -1011,7 +1070,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* gray_spans :: The gray span drawing callback. */ /* gray_spans :: The gray span drawing callback. */
/* */ /* */
/* black_spans :: The black span drawing callback. */ /* black_spans :: The black span drawing callback. UNIMPLEMENTED! */
/* */ /* */
/* bit_test :: The bit test callback. UNIMPLEMENTED! */ /* bit_test :: The bit test callback. UNIMPLEMENTED! */
/* */ /* */
@ -1048,7 +1107,7 @@ FT_BEGIN_HEADER
const void* source; const void* source;
int flags; int flags;
FT_SpanFunc gray_spans; FT_SpanFunc gray_spans;
FT_SpanFunc black_spans; FT_SpanFunc black_spans; /* doesn't work! */
FT_Raster_BitTest_Func bit_test; /* doesn't work! */ FT_Raster_BitTest_Func bit_test; /* doesn't work! */
FT_Raster_BitSet_Func bit_set; /* doesn't work! */ FT_Raster_BitSet_Func bit_set; /* doesn't work! */
void* user; void* user;

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType incremental loading (specification). */ /* FreeType incremental loading (specification). */
/* */ /* */
/* Copyright 2002, 2003, 2006, 2007, 2008 by */ /* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -101,7 +101,10 @@ FT_BEGIN_HEADER
* Top bearing, in font units. * Top bearing, in font units.
* *
* advance :: * advance ::
* Glyph advance, in font units. * Horizontal component of glyph advance, in font units.
*
* advance_v ::
* Vertical component of glyph advance, in font units.
* *
* @note: * @note:
* These correspond to horizontal or vertical metrics depending on the * These correspond to horizontal or vertical metrics depending on the
@ -114,6 +117,7 @@ FT_BEGIN_HEADER
FT_Long bearing_x; FT_Long bearing_x;
FT_Long bearing_y; FT_Long bearing_y;
FT_Long advance; FT_Long advance;
FT_Long advance_v; /* since 2.3.12 */
} FT_Incremental_MetricsRec; } FT_Incremental_MetricsRec;

View File

@ -5,7 +5,7 @@
/* FreeType API for color filtering of subpixel bitmap glyphs */ /* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */ /* (specification). */
/* */ /* */
/* Copyright 2006, 2007, 2008 by */ /* Copyright 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -58,7 +58,7 @@ FT_BEGIN_HEADER
/**************************************************************************** /****************************************************************************
* *
* @func: * @enum:
* FT_LcdFilter * FT_LcdFilter
* *
* @description: * @description:
@ -161,6 +161,47 @@ FT_BEGIN_HEADER
FT_Library_SetLcdFilter( FT_Library library, FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter ); FT_LcdFilter filter );
/**************************************************************************
*
* @func:
* FT_Library_SetLcdFilterWeights
*
* @description:
* Use this function to override the filter weights selected by
* @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
* (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
* 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
* FT_LCD_FILTER_LEGACY.
*
* @input:
* library ::
* A handle to the target library instance.
*
* weights ::
* A pointer to an array; the function copies the first five bytes and
* uses them to specify the filter weights.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* This function must be called after @FT_Library_SetLcdFilter to have
* any effect.
*
* @since:
* 2.4.0
*/
FT_EXPORT( FT_Error )
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights );
/* */ /* */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Generic list support for FreeType (specification). */ /* Generic list support for FreeType (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2007 by */ /* Copyright 1996-2001, 2003, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -255,6 +255,10 @@ FT_BEGIN_HEADER
/* user :: A user-supplied field which is passed as the last */ /* user :: A user-supplied field which is passed as the last */
/* argument to the destructor. */ /* argument to the destructor. */
/* */ /* */
/* <Note> */
/* This function expects that all nodes added by @FT_List_Add or */
/* @FT_List_Insert have been dynamically allocated. */
/* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Finalize( FT_List list, FT_List_Finalize( FT_List list,
FT_List_Destructor destroy, FT_List_Destructor destroy,

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType Multiple Master font interface (specification). */ /* FreeType Multiple Master font interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2004, 2006 by */ /* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -257,7 +257,7 @@ FT_BEGIN_HEADER
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Output> */ /* <Output> */
/* amaster :: The Multiple Masters descriptor. */ /* amaster :: The Multiple Masters/GX var descriptor. */
/* Allocates a data structure, which the user must free */ /* Allocates a data structure, which the user must free */
/* (a single call to FT_FREE will do it). */ /* (a single call to FT_FREE will do it). */
/* */ /* */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType modules public interface (specification). */ /* FreeType modules public interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -249,6 +249,33 @@ FT_BEGIN_HEADER
FT_Module module ); FT_Module module );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Reference_Library */
/* */
/* <Description> */
/* A counter gets initialized to~1 at the time an @FT_Library */
/* structure is created. This function increments the counter. */
/* @FT_Done_Library then only destroys a library if the counter is~1, */
/* otherwise it simply decrements the counter. */
/* */
/* This function helps in managing life-cycles of structures which */
/* reference @FT_Library objects. */
/* */
/* <Input> */
/* library :: A handle to a target library object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.4.2 */
/* */
FT_EXPORT( FT_Error )
FT_Reference_Library( FT_Library library );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -259,6 +286,13 @@ FT_BEGIN_HEADER
/* from a given memory object. It is thus possible to use libraries */ /* from a given memory object. It is thus possible to use libraries */
/* with distinct memory allocators within the same program. */ /* with distinct memory allocators within the same program. */
/* */ /* */
/* Normally, you would call this function (followed by a call to */
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
/* instead of @FT_Init_FreeType to initialize the FreeType library. */
/* */
/* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
/* library instance. */
/* */
/* <Input> */ /* <Input> */
/* memory :: A handle to the original memory object. */ /* memory :: A handle to the original memory object. */
/* */ /* */
@ -268,6 +302,10 @@ FT_BEGIN_HEADER
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Library. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Library( FT_Memory memory, FT_New_Library( FT_Memory memory,
FT_Library *alibrary ); FT_Library *alibrary );
@ -288,6 +326,10 @@ FT_BEGIN_HEADER
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */
/* See the discussion of reference counters in the description of */
/* @FT_Reference_Library. */
/* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Done_Library( FT_Library library ); FT_Done_Library( FT_Library library );
@ -390,8 +432,8 @@ FT_BEGIN_HEADER
* *
* FT_TRUETYPE_ENGINE_TYPE_PATENTED :: * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers * The library implements a bytecode interpreter that covers
* the full instruction set of the TrueType virtual machine. * the full instruction set of the TrueType virtual machine (this
* See the file `docs/PATENTS' for legal aspects. * was governed by patents until May 2010, hence the name).
* *
* @since: * @since:
* 2.2 * 2.2

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType module error offsets (specification). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* 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( Base, 0x000, "base module" )
FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
FT_MODERRDEF( BDF, 0x200, "BDF module" ) FT_MODERRDEF( BDF, 0x200, "BDF module" )
FT_MODERRDEF( Cache, 0x300, "cache module" ) FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
FT_MODERRDEF( CFF, 0x400, "CFF module" ) FT_MODERRDEF( Cache, 0x400, "cache module" )
FT_MODERRDEF( CID, 0x500, "CID module" ) FT_MODERRDEF( CFF, 0x500, "CFF module" )
FT_MODERRDEF( Gzip, 0x600, "Gzip module" ) FT_MODERRDEF( CID, 0x600, "CID module" )
FT_MODERRDEF( LZW, 0x700, "LZW module" ) FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" ) FT_MODERRDEF( LZW, 0x800, "LZW module" )
FT_MODERRDEF( PCF, 0x900, "PCF module" ) FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
FT_MODERRDEF( PFR, 0xA00, "PFR module" ) FT_MODERRDEF( PCF, 0xA00, "PCF module" )
FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" ) FT_MODERRDEF( PFR, 0xB00, "PFR module" )
FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" ) FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
FT_MODERRDEF( PSnames, 0xD00, "PS names module" ) FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
FT_MODERRDEF( Raster, 0xE00, "raster module" ) FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
FT_MODERRDEF( SFNT, 0xF00, "SFNT module" ) FT_MODERRDEF( Raster, 0xF00, "raster module" )
FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" ) FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
FT_MODERRDEF( TrueType, 0x1100, "TrueType module" ) FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
FT_MODERRDEF( Type1, 0x1200, "Type 1 module" ) FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
FT_MODERRDEF( Type42, 0x1300, "Type 42 module" ) FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" ) FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
#ifdef FT_MODERR_END_LIST #ifdef FT_MODERR_END_LIST

View File

@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */ /* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */ /* most scalable font formats (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008 by */ /* Copyright 1996-2003, 2005-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -59,6 +59,7 @@ FT_BEGIN_HEADER
/* FT_Outline_Translate */ /* FT_Outline_Translate */
/* FT_Outline_Transform */ /* FT_Outline_Transform */
/* FT_Outline_Embolden */ /* FT_Outline_Embolden */
/* FT_Outline_EmboldenXY */
/* FT_Outline_Reverse */ /* FT_Outline_Reverse */
/* FT_Outline_Check */ /* FT_Outline_Check */
/* */ /* */
@ -85,9 +86,8 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* Walk over an outline's structure to decompose it into individual */ /* Walk over an outline's structure to decompose it into individual */
/* segments and Bézier arcs. This function is also able to emit */ /* segments and Bézier arcs. This function also emits `move to' */
/* `move to' and `close to' operations to indicate the start and end */ /* operations to indicate the start of new contours in the outline. */
/* of new contours in the outline. */
/* */ /* */
/* <Input> */ /* <Input> */
/* outline :: A pointer to the source target. */ /* outline :: A pointer to the source target. */
@ -125,13 +125,12 @@ FT_BEGIN_HEADER
/* outline will *not* necessarily be *freed*, when */ /* outline will *not* necessarily be *freed*, when */
/* destroying the library, by @FT_Done_FreeType. */ /* destroying the library, by @FT_Done_FreeType. */
/* */ /* */
/* numPoints :: The maximal number of points within the outline. */ /* numPoints :: The maximum number of points within the outline. */
/* */ /* */
/* numContours :: The maximal number of contours within the outline. */ /* numContours :: The maximum number of contours within the outline. */
/* */ /* */
/* <Output> */ /* <Output> */
/* anoutline :: A handle to the new outline. NULL in case of */ /* anoutline :: A handle to the new outline. */
/* error. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
@ -229,6 +228,9 @@ FT_BEGIN_HEADER
/* <Output> */ /* <Output> */
/* acbox :: The outline's control box. */ /* acbox :: The outline's control box. */
/* */ /* */
/* <Note> */
/* See @FT_Glyph_Get_CBox for a discussion of tricky fonts. */
/* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Outline_Get_CBox( const FT_Outline* outline, FT_Outline_Get_CBox( const FT_Outline* outline,
FT_BBox *acbox ); FT_BBox *acbox );
@ -334,7 +336,7 @@ FT_BEGIN_HEADER
/* handled incorrectly. */ /* handled incorrectly. */
/* */ /* */
/* If you need `better' metrics values you should call */ /* 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: */ /* Example call: */
/* */ /* */
@ -349,6 +351,23 @@ FT_BEGIN_HEADER
FT_Pos strength ); FT_Pos strength );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_EmboldenXY */
/* */
/* <Description> */
/* Embolden an outline. The new outline will be `xstrength' pixels */
/* wider and `ystrength' pixels higher. Otherwise, it is similar to */
/* @FT_Outline_Embolden, which uses the same strength in both */
/* directions. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_EmboldenXY( FT_Outline* outline,
FT_Pos xstrength,
FT_Pos ystrength );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -362,7 +381,7 @@ FT_BEGIN_HEADER
/* outline :: A pointer to the target outline descriptor. */ /* outline :: A pointer to the target outline descriptor. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */ /* This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in */
/* the outline's `flags' field. */ /* the outline's `flags' field. */
/* */ /* */
/* It shouldn't be used by a normal client application, unless it */ /* It shouldn't be used by a normal client application, unless it */
@ -416,7 +435,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Description> */ /* <Description> */
/* Render an outline within a bitmap using the current scan-convert. */ /* Render an outline within a bitmap using the current scan-convert. */
/* This functions uses an @FT_Raster_Params structure as an argument, */ /* This function uses an @FT_Raster_Params structure as an argument, */
/* allowing advanced features like direct composition, translucency, */ /* allowing advanced features like direct composition, translucency, */
/* etc. */ /* etc. */
/* */ /* */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType API for accessing PFR-specific data (specification only). */ /* FreeType API for accessing PFR-specific data (specification only). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -62,8 +62,8 @@ FT_BEGIN_HEADER
* *
* @output: * @output:
* aoutline_resolution :: * aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM'. * Outline resolution. This is equivalent to `face->units_per_EM'
* Optional (parameter can be NULL). * for non-PFR fonts. Optional (parameter can be NULL).
* *
* ametrics_resolution :: * ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution' * Metrics resolution. This is equivalent to `outline_resolution'

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType renderer modules public interface (specification). */ /* FreeType renderer modules public interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2005, 2006 by */ /* Copyright 1996-2001, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -141,10 +141,6 @@ FT_BEGIN_HEADER
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to its raster's class. */ /* This is a pointer to its raster's class. */
/* */ /* */
/* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to the corresponding raster */
/* object, if any. */
/* */
typedef struct FT_Renderer_Class_ typedef struct FT_Renderer_Class_
{ {
FT_Module_Class root; FT_Module_Class root;
@ -216,6 +212,14 @@ FT_BEGIN_HEADER
/* */ /* */
/* This doesn't change the current renderer for other formats. */ /* 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_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library, FT_Set_Renderer( FT_Library library,
FT_Renderer renderer, FT_Renderer renderer,

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType size objects management (specification). */ /* FreeType size objects management (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2004, 2006 by */ /* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -129,8 +129,8 @@ FT_BEGIN_HEADER
/* <Description> */ /* <Description> */
/* Even though it is possible to create several size objects for a */ /* Even though it is possible to create several size objects for a */
/* given face (see @FT_New_Size for details), functions like */ /* given face (see @FT_New_Size for details), functions like */
/* @FT_Load_Glyph or @FT_Load_Char only use the last-created one to */ /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */
/* determine the `current character pixel size'. */ /* activated last to determine the `current character pixel size'. */
/* */ /* */
/* This function can be used to `activate' a previously created size */ /* This function can be used to `activate' a previously created size */
/* object. */ /* object. */

View File

@ -7,7 +7,7 @@
/* */ /* */
/* This is _not_ used to retrieve glyph names! */ /* This is _not_ used to retrieve glyph names! */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -147,7 +147,8 @@ FT_BEGIN_HEADER
/* */ /* */
/* <Note> */ /* <Note> */
/* The `string' array returned in the `aname' structure is not */ /* The `string' array returned in the `aname' structure is not */
/* null-terminated. */ /* null-terminated. The application should deallocate it if it is no */
/* longer in use. */
/* */ /* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */ /* `name' table entries, then do a loop until you get the right */
@ -159,6 +160,35 @@ FT_BEGIN_HEADER
FT_SfntName *aname ); FT_SfntName *aname );
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred family subfamily names in `name'
* table since OpenType version 1.4. For backwards compatibility with
* legacy systems which has 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred subfamily names in `name' table since
* OpenType version 1.4. For backwards compatibility with legacy
* systems which has 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* */ /* */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType path stroker (specification). */ /* FreeType path stroker (specification). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2008 by */ /* Copyright 2002-2006, 2008, 2009, 2011-2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* 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. * to join two lines smoothly.
* *
* FT_STROKER_LINEJOIN_BEVEL :: * FT_STROKER_LINEJOIN_BEVEL ::
* Used to render beveled line joins; i.e., the two joining lines * Used to render beveled line joins. The outer corner of
* are extended until they intersect. * 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 :: * FT_STROKER_LINEJOIN_MITER ::
* Same as beveled rendering, except that an additional line * Used to render mitered line joins, with variable bevels if
* break is added if the angle between the two joining lines * the miter limit is exceeded. The intersection of the
* is too closed (this is useful to avoid unpleasant spikes * strokes is clipped at a line perpendicular to the bisector
* in beveled rendering). * 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_ typedef enum FT_Stroker_LineJoin_
{ {
FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_ROUND = 0,
FT_STROKER_LINEJOIN_BEVEL, FT_STROKER_LINEJOIN_BEVEL = 1,
FT_STROKER_LINEJOIN_MITER FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE,
FT_STROKER_LINEJOIN_MITER_FIXED = 3
} FT_Stroker_LineJoin; } FT_Stroker_LineJoin;
@ -171,7 +195,7 @@ FT_BEGIN_HEADER
* The source outline handle. * The source outline handle.
* *
* @return: * @return:
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
* outlines. * outlines.
*/ */
FT_EXPORT( FT_StrokerBorder ) FT_EXPORT( FT_StrokerBorder )
@ -245,7 +269,8 @@ FT_BEGIN_HEADER
* The line join style. * The line join style.
* *
* miter_limit :: * 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. * expressed as 16.16 fixed point value.
* *
* @note: * @note:
@ -598,7 +623,7 @@ FT_BEGIN_HEADER
* *
* @description: * @description:
* Call this function after @FT_Stroker_GetBorderCounts to * Call this function after @FT_Stroker_GetBorderCounts to
* export the all borders to your own @FT_Outline structure. * export all borders to your own @FT_Outline structure.
* *
* Note that this function appends the border points and * Note that this function appends the border points and
* contours to your outline, but does not try to resize its * contours to your outline, but does not try to resize its
@ -657,6 +682,11 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* The source glyph is untouched in case of error. * The source glyph is untouched in case of error.
*
* Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts
* to account for this added size.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Glyph_Stroke( FT_Glyph *pglyph, FT_Glyph_Stroke( FT_Glyph *pglyph,
@ -694,6 +724,11 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* The source glyph is untouched in case of error. * The source glyph is untouched in case of error.
*
* Adding stroke may yield a significantly wider and taller glyph
* depending on how large of a radius was used to stroke the glyph. You
* may need to manually adjust horizontal and vertical advance amounts
* to account for this added size.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Glyph_StrokeBorder( FT_Glyph *pglyph, FT_Glyph_StrokeBorder( FT_Glyph *pglyph,

View File

@ -5,7 +5,7 @@
/* FreeType synthesizing code for emboldening and slanting */ /* FreeType synthesizing code for emboldening and slanting */
/* (specification). */ /* (specification). */
/* */ /* */
/* Copyright 2000-2001, 2003, 2006, 2008 by */ /* Copyright 2000-2001, 2003, 2006, 2008, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -61,8 +61,9 @@ FT_BEGIN_HEADER
/* taste). This function is actually a convenience function, providing */ /* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */ /* */
/* For emboldened outlines the metrics are estimates only; if you need */ /* For emboldened outlines the height, width, and advance metrics are */
/* precise values you should call @FT_Outline_Get_CBox. */ /* increased by the strength of the emboldening. You can also call */
/* @FT_Outline_Get_CBox to get precise values. */
FT_EXPORT( void ) FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); FT_GlyphSlot_Embolden( FT_GlyphSlot slot );

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType low-level system interface definition (specification). */ /* FreeType low-level system interface definition (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2005 by */ /* Copyright 1996-2001, 2002, 2005, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -240,7 +240,8 @@ FT_BEGIN_HEADER
* *
* @note: * @note:
* This function might be called to perform a seek or skip operation * This function might be called to perform a seek or skip operation
* with a `count' of~0. * with a `count' of~0. A non-zero return value then indicates an
* error.
* *
*/ */
typedef unsigned long typedef unsigned long
@ -301,7 +302,7 @@ FT_BEGIN_HEADER
* The stream's input function. * The stream's input function.
* *
* close :: * close ::
* The stream;s close function. * The stream's close function.
* *
* memory :: * memory ::
* The memory manager to use to preload frames. This is set * The memory manager to use to preload frames. This is set

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType simple types definitions (specification only). */ /* FreeType simple types definitions (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by */ /* Copyright 1996-2002, 2004, 2006-2009, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -167,7 +167,7 @@ FT_BEGIN_HEADER
/* FT_Tag */ /* FT_Tag */
/* */ /* */
/* <Description> */ /* <Description> */
/* A typedef for 32-bit tags (as used in the SFNT format). */ /* A typedef for 32-bit tags (as used in the SFNT format). */
/* */ /* */
typedef FT_UInt32 FT_Tag; typedef FT_UInt32 FT_Tag;
@ -434,7 +434,7 @@ FT_BEGIN_HEADER
/* variety of FreeType core objects. For example, a text layout API */ /* variety of FreeType core objects. For example, a text layout API */
/* might want to associate a glyph cache to a given size object. */ /* might want to associate a glyph cache to a given size object. */
/* */ /* */
/* Most FreeType object contains a `generic' field, of type */ /* Some FreeType object contains a `generic' field, of type */
/* FT_Generic, which usage is left to client applications and font */ /* FT_Generic, which usage is left to client applications and font */
/* servers. */ /* servers. */
/* */ /* */
@ -474,6 +474,7 @@ FT_BEGIN_HEADER
/* this macro. */ /* this macro. */
/* */ /* */
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
(FT_Tag) \
( ( (FT_ULong)_x1 << 24 ) | \ ( ( (FT_ULong)_x1 << 24 ) | \
( (FT_ULong)_x2 << 16 ) | \ ( (FT_ULong)_x2 << 16 ) | \
( (FT_ULong)_x3 << 8 ) | \ ( (FT_ULong)_x3 << 8 ) | \

View File

@ -49,6 +49,9 @@ FT_BEGIN_HEADER
/* however, there are special cases (like in PDF devices) where it is */ /* however, there are special cases (like in PDF devices) where it is */
/* important to differentiate, in spite of FreeType's uniform API. */ /* important to differentiate, in spite of FreeType's uniform API. */
/* */ /* */
/* This function is in the X11/xf86 namespace for historical reasons */
/* and in no way depends on that windowing system. */
/* */
/*************************************************************************/ /*************************************************************************/

View File

@ -5,7 +5,7 @@
/* Basic Type 1/Type 2 tables definitions and interface (specification */ /* Basic Type 1/Type 2 tables definitions and interface (specification */
/* only). */ /* only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ /* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -78,10 +78,6 @@ FT_BEGIN_HEADER
FT_Short underline_position; FT_Short underline_position;
FT_UShort underline_thickness; FT_UShort underline_thickness;
/* since 2.3.8 */
FT_UShort fs_type;
} PS_FontInfoRec; } PS_FontInfoRec;
@ -486,19 +482,177 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* The string pointers within the font info structure are owned by * The string pointers within the @PS_PrivateRec structure are owned by
* the face and don't need to be freed by the caller. * the face and don't need to be freed by the caller.
* *
* If the font's format is not PostScript-based, this function will * If the font's format is not PostScript-based, this function returns
* return the `FT_Err_Invalid_Argument' error code. * the `FT_Err_Invalid_Argument' error code.
* *
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_PS_Font_Private( FT_Face face, FT_Get_PS_Font_Private( FT_Face face,
PS_Private afont_private ); PS_Private afont_private );
/* */
/*************************************************************************/
/* */
/* <Enum> */
/* T1_EncodingType */
/* */
/* <Description> */
/* An enumeration describing the `Encoding' entry in a Type 1 */
/* dictionary. */
/* */
typedef enum T1_EncodingType_
{
T1_ENCODING_TYPE_NONE = 0,
T1_ENCODING_TYPE_ARRAY,
T1_ENCODING_TYPE_STANDARD,
T1_ENCODING_TYPE_ISOLATIN1,
T1_ENCODING_TYPE_EXPERT
} T1_EncodingType;
/*************************************************************************/
/* */
/* <Enum> */
/* PS_Dict_Keys */
/* */
/* <Description> */
/* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
/* the Type~1 dictionary entry to retrieve. */
/* */
typedef enum PS_Dict_Keys_
{
/* conventionally in the font dictionary */
PS_DICT_FONT_TYPE, /* FT_Byte */
PS_DICT_FONT_MATRIX, /* FT_Fixed */
PS_DICT_FONT_BBOX, /* FT_Fixed */
PS_DICT_PAINT_TYPE, /* FT_Byte */
PS_DICT_FONT_NAME, /* FT_String* */
PS_DICT_UNIQUE_ID, /* FT_Int */
PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */
PS_DICT_CHAR_STRING_KEY, /* FT_String* */
PS_DICT_CHAR_STRING, /* FT_String* */
PS_DICT_ENCODING_TYPE, /* T1_EncodingType */
PS_DICT_ENCODING_ENTRY, /* FT_String* */
/* conventionally in the font Private dictionary */
PS_DICT_NUM_SUBRS, /* FT_Int */
PS_DICT_SUBR, /* FT_String* */
PS_DICT_STD_HW, /* FT_UShort */
PS_DICT_STD_VW, /* FT_UShort */
PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */
PS_DICT_BLUE_VALUE, /* FT_Short */
PS_DICT_BLUE_FUZZ, /* FT_Int */
PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */
PS_DICT_OTHER_BLUE, /* FT_Short */
PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */
PS_DICT_FAMILY_BLUE, /* FT_Short */
PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */
PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */
PS_DICT_BLUE_SCALE, /* FT_Fixed */
PS_DICT_BLUE_SHIFT, /* FT_Int */
PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */
PS_DICT_STEM_SNAP_H, /* FT_Short */
PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */
PS_DICT_STEM_SNAP_V, /* FT_Short */
PS_DICT_FORCE_BOLD, /* FT_Bool */
PS_DICT_RND_STEM_UP, /* FT_Bool */
PS_DICT_MIN_FEATURE, /* FT_Short */
PS_DICT_LEN_IV, /* FT_Int */
PS_DICT_PASSWORD, /* FT_Long */
PS_DICT_LANGUAGE_GROUP, /* FT_Long */
/* conventionally in the font FontInfo dictionary */
PS_DICT_VERSION, /* FT_String* */
PS_DICT_NOTICE, /* FT_String* */
PS_DICT_FULL_NAME, /* FT_String* */
PS_DICT_FAMILY_NAME, /* FT_String* */
PS_DICT_WEIGHT, /* FT_String* */
PS_DICT_IS_FIXED_PITCH, /* FT_Bool */
PS_DICT_UNDERLINE_POSITION, /* FT_Short */
PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */
PS_DICT_FS_TYPE, /* FT_UShort */
PS_DICT_ITALIC_ANGLE, /* FT_Long */
PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
} PS_Dict_Keys;
/************************************************************************
*
* @function:
* FT_Get_PS_Font_Value
*
* @description:
* Retrieve the value for the supplied key from a PostScript font.
*
* @input:
* face ::
* PostScript face handle.
*
* key ::
* An enumeration value representing the dictionary key to retrieve.
*
* idx ::
* For array values, this specifies the index to be returned.
*
* value ::
* A pointer to memory into which to write the value.
*
* valen_len ::
* The size, in bytes, of the memory supplied for the value.
*
* @output:
* value ::
* The value matching the above key, if it exists.
*
* @return:
* The amount of memory (in bytes) required to hold the requested
* value (if it exists, -1 otherwise).
*
* @note:
* The values returned are not pointers into the internal structures of
* the face, but are `fresh' copies, so that the memory containing them
* belongs to the calling application. This also enforces the
* `read-only' nature of these values, i.e., this function cannot be
* used to manipulate the face.
*
* `value' is a void pointer because the values returned can be of
* various types.
*
* If either `value' is NULL or `value_len' is too small, just the
* required memory size for the requested entry is returned.
*
* The `idx' parameter is used, not only to retrieve elements of, for
* example, the FontMatrix or FontBBox, but also to retrieve name keys
* from the CharStrings dictionary, and the charstrings themselves. It
* is ignored for atomic values.
*
* PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To
* get the value as in the font stream, you need to divide by
* 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).
*
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
* be retrieved. So, for example, PostScript procedures such as NP,
* ND, and RD are not available. Arbitrary keys are, obviously, not be
* available either.
*
* If the font's format is not PostScript-based, this function returns
* the `FT_Err_Invalid_Argument' error code.
*
*/
FT_EXPORT( FT_Long )
FT_Get_PS_Font_Value( FT_Face face,
PS_Dict_Keys key,
FT_UInt idx,
void *value,
FT_Long value_len );
/* */
FT_END_HEADER FT_END_HEADER

View File

@ -64,7 +64,7 @@ FT_BEGIN_HEADER
* MacOS systems (even if they contain a Microsoft charmap as well). * MacOS systems (even if they contain a Microsoft charmap as well).
* *
* TT_PLATFORM_ISO :: * TT_PLATFORM_ISO ::
* This value was used to specify Unicode charmaps. It is however * This value was used to specify ISO/IEC 10646 charmaps. It is however
* now deprecated. See @TT_ISO_ID_XXX for a list of corresponding * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding
* `encoding_id' values. * `encoding_id' values.
* *

View File

@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */ /* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */ /* (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008 by */ /* Copyright 1996-2005, 2008-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -557,13 +557,13 @@ FT_BEGIN_HEADER
/* */ /* */
typedef enum FT_Sfnt_Tag_ typedef enum FT_Sfnt_Tag_
{ {
ft_sfnt_head = 0, ft_sfnt_head = 0, /* TT_Header */
ft_sfnt_maxp = 1, ft_sfnt_maxp = 1, /* TT_MaxProfile */
ft_sfnt_os2 = 2, ft_sfnt_os2 = 2, /* TT_OS2 */
ft_sfnt_hhea = 3, ft_sfnt_hhea = 3, /* TT_HoriHeader */
ft_sfnt_vhea = 4, ft_sfnt_vhea = 4, /* TT_VertHeader */
ft_sfnt_post = 5, ft_sfnt_post = 5, /* TT_Postscript */
ft_sfnt_pclt = 6, ft_sfnt_pclt = 6, /* TT_PCLT */
sfnt_max /* internal end mark */ sfnt_max /* internal end mark */
@ -590,6 +590,9 @@ FT_BEGIN_HEADER
/* error, or if the corresponding table was not found *OR* loaded */ /* error, or if the corresponding table was not found *OR* loaded */
/* from the file. */ /* from the file. */
/* */ /* */
/* Use a typecast according to `tag' to access the structure */
/* elements. */
/* */
/* <Note> */ /* <Note> */
/* The table is owned by the face object and disappears with it. */ /* The table is owned by the face object and disappears with it. */
/* */ /* */
@ -684,18 +687,23 @@ FT_BEGIN_HEADER
* The index of an SFNT table. The function returns * The index of an SFNT table. The function returns
* FT_Err_Table_Missing for an invalid value. * FT_Err_Table_Missing for an invalid value.
* *
* @output: * @inout:
* tag :: * 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 :: * length ::
* The length of the SFNT table. * The length of the SFNT table (or the number of SFNT tables, depending
* on `tag').
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* SFNT tables with length zero are treated as missing by Windows. * While parsing fonts, FreeType handles SFNT tables with length zero as
* missing.
* *
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )

View File

@ -2,9 +2,10 @@
/* */ /* */
/* ft2build.h */ /* ft2build.h */
/* */ /* */
/* Build macros of the FreeType 2 library. */ /* FreeType 2 build and setup macros. */
/* (Generic version) */
/* */ /* */
/* Copyright 1996-2001, 2003, 2006 by */ /* Copyright 1996-2001, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -18,44 +19,21 @@
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This is a Unix-specific version of <ft2build.h> that should be used */ /* This file corresponds to the default `ft2build.h' file for */
/* exclusively *after* installation of the library. */ /* FreeType 2. It uses the `freetype' include root. */
/* */ /* */
/* It assumes that `/usr/local/include/freetype2' (or whatever is */ /* Note that specific platforms might use a different configuration. */
/* returned by the `freetype-config --cflags' or `pkg-config --cflags' */ /* See builds/unix/ft2unix.h for an example. */
/* command) is in your compilation include path. */
/* */
/* We don't need to do anything special in this release. However, for */
/* a future FreeType 2 release, the following installation changes will */
/* be performed: */
/* */
/* - The contents of `freetype-2.x/include/freetype' will be installed */
/* to `/usr/local/include/freetype2' instead of */
/* `/usr/local/include/freetype2/freetype'. */
/* */
/* - This file will #include <freetype2/config/ftheader.h>, instead */
/* of <freetype/config/ftheader.h>. */
/* */
/* - The contents of `ftheader.h' will be processed with `sed' to */
/* replace all `<freetype/xxx>' with `<freetype2/xxx>'. */
/* */
/* - Adding `/usr/local/include/freetype2' to your compilation include */
/* path will not be necessary anymore. */
/* */
/* These changes will be transparent to client applications which use */
/* freetype-config (or pkg-config). No modifications will be necessary */
/* to compile with the new scheme. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FT2_BUILD_UNIX_H__ #ifndef __FT2_BUILD_GENERIC_H__
#define __FT2_BUILD_UNIX_H__ #define __FT2_BUILD_GENERIC_H__
/* `<prefix>/include/freetype2' must be in your current inclusion path */
#include <freetype/config/ftheader.h> #include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_UNIX_H__ */ #endif /* __FT2_BUILD_GENERIC_H__ */
/* END */ /* END */

View File

@ -1,304 +1,304 @@
/* /*
* jerror.h * jerror.h
* *
* Copyright (C) 1994-1997, Thomas G. Lane. * Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding. * Modified 1997-2009 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
* This file defines the error and message codes for the JPEG library. * This file defines the error and message codes for the JPEG library.
* Edit this file to add new codes, or to translate the message strings to * Edit this file to add new codes, or to translate the message strings to
* some other language. * some other language.
* A set of error-reporting macros are defined too. Some applications using * A set of error-reporting macros are defined too. Some applications using
* the JPEG library may wish to include this file to get the error codes * the JPEG library may wish to include this file to get the error codes
* and/or the macros. * and/or the macros.
*/ */
/* /*
* To define the enum list of message codes, include this file without * To define the enum list of message codes, include this file without
* defining macro JMESSAGE. To create a message string table, include it * defining macro JMESSAGE. To create a message string table, include it
* again with a suitable JMESSAGE definition (see jerror.c for an example). * again with a suitable JMESSAGE definition (see jerror.c for an example).
*/ */
#ifndef JMESSAGE #ifndef JMESSAGE
#ifndef JERROR_H #ifndef JERROR_H
/* First time through, define the enum list */ /* First time through, define the enum list */
#define JMAKE_ENUM_LIST #define JMAKE_ENUM_LIST
#else #else
/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
#define JMESSAGE(code,string) #define JMESSAGE(code,string)
#endif /* JERROR_H */ #endif /* JERROR_H */
#endif /* JMESSAGE */ #endif /* JMESSAGE */
#ifdef JMAKE_ENUM_LIST #ifdef JMAKE_ENUM_LIST
typedef enum { typedef enum {
#define JMESSAGE(code,string) code , #define JMESSAGE(code,string) code ,
#endif /* JMAKE_ENUM_LIST */ #endif /* JMAKE_ENUM_LIST */
JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
/* For maintenance convenience, list is alphabetical by message code name */ /* For maintenance convenience, list is alphabetical by message code name */
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported")
JMESSAGE(JERR_BAD_DROP_SAMPLING, JMESSAGE(JERR_BAD_DROP_SAMPLING,
"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
JMESSAGE(JERR_BAD_LIB_VERSION, JMESSAGE(JERR_BAD_LIB_VERSION,
"Wrong JPEG library version: library is %d, caller expects %d") "Wrong JPEG library version: library is %d, caller expects %d")
JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
JMESSAGE(JERR_BAD_PROGRESSION, JMESSAGE(JERR_BAD_PROGRESSION,
"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
JMESSAGE(JERR_BAD_PROG_SCRIPT, JMESSAGE(JERR_BAD_PROG_SCRIPT,
"Invalid progressive parameters at scan script entry %d") "Invalid progressive parameters at scan script entry %d")
JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
JMESSAGE(JERR_BAD_STRUCT_SIZE, JMESSAGE(JERR_BAD_STRUCT_SIZE,
"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
JMESSAGE(JERR_EMS_READ, "Read from EMS failed") JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
JMESSAGE(JERR_FILE_READ, "Input file read error") JMESSAGE(JERR_FILE_READ, "Input file read error")
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
"Cannot transcode due to multiple use of quantization table %d") "Cannot transcode due to multiple use of quantization table %d")
JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
JMESSAGE(JERR_NOTIMPL, "Not implemented yet") JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
JMESSAGE(JERR_QUANT_COMPONENTS, JMESSAGE(JERR_QUANT_COMPONENTS,
"Cannot quantize more than %d color components") "Cannot quantize more than %d color components")
JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
JMESSAGE(JERR_TFILE_WRITE, JMESSAGE(JERR_TFILE_WRITE,
"Write failed on temporary file --- out of disk space?") "Write failed on temporary file --- out of disk space?")
JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
JMESSAGE(JERR_XMS_READ, "Read from XMS failed") JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
JMESSAGE(JMSG_VERSION, JVERSION) JMESSAGE(JMSG_VERSION, JVERSION)
JMESSAGE(JTRC_16BIT_TABLES, JMESSAGE(JTRC_16BIT_TABLES,
"Caution: quantization tables are too coarse for baseline JPEG") "Caution: quantization tables are too coarse for baseline JPEG")
JMESSAGE(JTRC_ADOBE, JMESSAGE(JTRC_ADOBE,
"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
JMESSAGE(JTRC_DRI, "Define Restart Interval %u") JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
JMESSAGE(JTRC_EOI, "End Of Image") JMESSAGE(JTRC_EOI, "End Of Image")
JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
"Warning: thumbnail image size does not match data length %u") "Warning: thumbnail image size does not match data length %u")
JMESSAGE(JTRC_JFIF_EXTENSION, JMESSAGE(JTRC_JFIF_EXTENSION,
"JFIF extension marker: type 0x%02x, length %u") "JFIF extension marker: type 0x%02x, length %u")
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
JMESSAGE(JTRC_RST, "RST%d") JMESSAGE(JTRC_RST, "RST%d")
JMESSAGE(JTRC_SMOOTH_NOTIMPL, JMESSAGE(JTRC_SMOOTH_NOTIMPL,
"Smoothing not supported with nonstandard sampling ratios") "Smoothing not supported with nonstandard sampling ratios")
JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
JMESSAGE(JTRC_SOI, "Start of Image") JMESSAGE(JTRC_SOI, "Start of Image")
JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
JMESSAGE(JTRC_THUMB_JPEG, JMESSAGE(JTRC_THUMB_JPEG,
"JFIF extension marker: JPEG-compressed thumbnail image, length %u") "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_PALETTE, JMESSAGE(JTRC_THUMB_PALETTE,
"JFIF extension marker: palette thumbnail image, length %u") "JFIF extension marker: palette thumbnail image, length %u")
JMESSAGE(JTRC_THUMB_RGB, JMESSAGE(JTRC_THUMB_RGB,
"JFIF extension marker: RGB thumbnail image, length %u") "JFIF extension marker: RGB thumbnail image, length %u")
JMESSAGE(JTRC_UNKNOWN_IDS, JMESSAGE(JTRC_UNKNOWN_IDS,
"Unrecognized component IDs %d %d %d, assuming YCbCr") "Unrecognized component IDs %d %d %d, assuming YCbCr")
JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
JMESSAGE(JWRN_BOGUS_PROGRESSION, JMESSAGE(JWRN_BOGUS_PROGRESSION,
"Inconsistent progression sequence for component %d coefficient %d") "Inconsistent progression sequence for component %d coefficient %d")
JMESSAGE(JWRN_EXTRANEOUS_DATA, JMESSAGE(JWRN_EXTRANEOUS_DATA,
"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
JMESSAGE(JWRN_MUST_RESYNC, JMESSAGE(JWRN_MUST_RESYNC,
"Corrupt JPEG data: found marker 0x%02x instead of RST%d") "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
#ifdef JMAKE_ENUM_LIST #ifdef JMAKE_ENUM_LIST
JMSG_LASTMSGCODE JMSG_LASTMSGCODE
} J_MESSAGE_CODE; } J_MESSAGE_CODE;
#undef JMAKE_ENUM_LIST #undef JMAKE_ENUM_LIST
#endif /* JMAKE_ENUM_LIST */ #endif /* JMAKE_ENUM_LIST */
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
#undef JMESSAGE #undef JMESSAGE
#ifndef JERROR_H #ifndef JERROR_H
#define JERROR_H #define JERROR_H
/* Macros to simplify using the error and trace message stuff */ /* Macros to simplify using the error and trace message stuff */
/* The first parameter is either type of cinfo pointer */ /* The first parameter is either type of cinfo pointer */
/* Fatal errors (print message and exit) */ /* Fatal errors (print message and exit) */
#define ERREXIT(cinfo,code) \ #define ERREXIT(cinfo,code) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT1(cinfo,code,p1) \ #define ERREXIT1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT2(cinfo,code,p1,p2) \ #define ERREXIT2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT3(cinfo,code,p1,p2,p3) \ #define ERREXIT3(cinfo,code,p1,p2,p3) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \ (cinfo)->err->msg_parm.i[2] = (p3), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ #define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \ (cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \ (cinfo)->err->msg_parm.i[3] = (p4), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ #define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[1] = (p2), \
(cinfo)->err->msg_parm.i[2] = (p3), \ (cinfo)->err->msg_parm.i[2] = (p3), \
(cinfo)->err->msg_parm.i[3] = (p4), \ (cinfo)->err->msg_parm.i[3] = (p4), \
(cinfo)->err->msg_parm.i[4] = (p5), \ (cinfo)->err->msg_parm.i[4] = (p5), \
(cinfo)->err->msg_parm.i[5] = (p6), \ (cinfo)->err->msg_parm.i[5] = (p6), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define ERREXITS(cinfo,code,str) \ #define ERREXITS(cinfo,code,str) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
#define MAKESTMT(stuff) do { stuff } while (0) #define MAKESTMT(stuff) do { stuff } while (0)
/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ /* Nonfatal errors (we can keep going, but the data is probably corrupt) */
#define WARNMS(cinfo,code) \ #define WARNMS(cinfo,code) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS1(cinfo,code,p1) \ #define WARNMS1(cinfo,code,p1) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
#define WARNMS2(cinfo,code,p1,p2) \ #define WARNMS2(cinfo,code,p1,p2) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
/* Informational/debugging messages */ /* Informational/debugging messages */
#define TRACEMS(cinfo,lvl,code) \ #define TRACEMS(cinfo,lvl,code) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS1(cinfo,lvl,code,p1) \ #define TRACEMS1(cinfo,lvl,code,p1) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS2(cinfo,lvl,code,p1,p2) \ #define TRACEMS2(cinfo,lvl,code,p1,p2) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
(cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[0] = (p1), \
(cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[1] = (p2), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ #define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
(cinfo)->err->msg_code = (code); \ (cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ #define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
(cinfo)->err->msg_code = (code); \ (cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ #define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); \ _mp[4] = (p5); \
(cinfo)->err->msg_code = (code); \ (cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ #define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
_mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
_mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
(cinfo)->err->msg_code = (code); \ (cinfo)->err->msg_code = (code); \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
#define TRACEMSS(cinfo,lvl,code,str) \ #define TRACEMSS(cinfo,lvl,code,str) \
((cinfo)->err->msg_code = (code), \ ((cinfo)->err->msg_code = (code), \
strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
(*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
#endif /* JERROR_H */ #endif /* JERROR_H */

View File

@ -1,371 +1,369 @@
/* /*
* jmorecfg.h * jmorecfg.h
* *
* Copyright (C) 1991-1997, Thomas G. Lane. * Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 1997-2009 by Guido Vollbeding. * Modified 1997-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
* This file contains additional configuration options that customize the * This file contains additional configuration options that customize the
* JPEG software for special applications or support machine-dependent * JPEG software for special applications or support machine-dependent
* optimizations. Most users will not need to touch this file. * optimizations. Most users will not need to touch this file.
*/ */
/* /*
* Define BITS_IN_JSAMPLE as either * Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting) * 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values * 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the * Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else! * JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry. * We do not support run-time selection of data precision, sorry.
*/ */
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
/* /*
* Maximum number of components (color channels) allowed in JPEG image. * Maximum number of components (color channels) allowed in JPEG image.
* To meet the letter of the JPEG spec, set this to 255. However, darn * To meet the letter of the JPEG spec, set this to 255. However, darn
* few applications need more than 4 channels (maybe 5 for CMYK + alpha * few applications need more than 4 channels (maybe 5 for CMYK + alpha
* mask). We recommend 10 as a reasonable compromise; use 4 if you are * mask). We recommend 10 as a reasonable compromise; use 4 if you are
* really short on memory. (Each allowed component costs a hundred or so * really short on memory. (Each allowed component costs a hundred or so
* bytes of storage, whether actually used in an image or not.) * bytes of storage, whether actually used in an image or not.)
*/ */
#define MAX_COMPONENTS 10 /* maximum number of image components */ #define MAX_COMPONENTS 10 /* maximum number of image components */
/* /*
* Basic data types. * Basic data types.
* You may need to change these if you have a machine with unusual data * You may need to change these if you have a machine with unusual data
* type sizes; for example, "char" not 8 bits, "short" not 16 bits, * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
* but it had better be at least 16. * but it had better be at least 16.
*/ */
/* Representation of a single sample (pixel element value). /* Representation of a single sample (pixel element value).
* We frequently allocate large arrays of these, so it's important to keep * We frequently allocate large arrays of these, so it's important to keep
* them small. But if you have memory to burn and access to char or short * them small. But if you have memory to burn and access to char or short
* arrays is very slow on your hardware, you might want to change these. * arrays is very slow on your hardware, you might want to change these.
*/ */
#if BITS_IN_JSAMPLE == 8 #if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255. /* JSAMPLE should be the smallest type that will hold the values 0..255.
* You can use a signed char by having GETJSAMPLE mask it with 0xFF. * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
*/ */
#ifdef HAVE_UNSIGNED_CHAR #ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char JSAMPLE; typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int) (value)) #define GETJSAMPLE(value) ((int) (value))
#else /* not HAVE_UNSIGNED_CHAR */ #else /* not HAVE_UNSIGNED_CHAR */
typedef char JSAMPLE; typedef char JSAMPLE;
#ifdef CHAR_IS_UNSIGNED #ifdef CHAR_IS_UNSIGNED
#define GETJSAMPLE(value) ((int) (value)) #define GETJSAMPLE(value) ((int) (value))
#else #else
#define GETJSAMPLE(value) ((int) (value) & 0xFF) #define GETJSAMPLE(value) ((int) (value) & 0xFF)
#endif /* CHAR_IS_UNSIGNED */ #endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */ #endif /* HAVE_UNSIGNED_CHAR */
#define MAXJSAMPLE 255 #define MAXJSAMPLE 255
#define CENTERJSAMPLE 128 #define CENTERJSAMPLE 128
#endif /* BITS_IN_JSAMPLE == 8 */ #endif /* BITS_IN_JSAMPLE == 8 */
#if BITS_IN_JSAMPLE == 12 #if BITS_IN_JSAMPLE == 12
/* JSAMPLE should be the smallest type that will hold the values 0..4095. /* JSAMPLE should be the smallest type that will hold the values 0..4095.
* On nearly all machines "short" will do nicely. * On nearly all machines "short" will do nicely.
*/ */
typedef short JSAMPLE; typedef short JSAMPLE;
#define GETJSAMPLE(value) ((int) (value)) #define GETJSAMPLE(value) ((int) (value))
#define MAXJSAMPLE 4095 #define MAXJSAMPLE 4095
#define CENTERJSAMPLE 2048 #define CENTERJSAMPLE 2048
#endif /* BITS_IN_JSAMPLE == 12 */ #endif /* BITS_IN_JSAMPLE == 12 */
/* Representation of a DCT frequency coefficient. /* Representation of a DCT frequency coefficient.
* This should be a signed value of at least 16 bits; "short" is usually OK. * This should be a signed value of at least 16 bits; "short" is usually OK.
* Again, we allocate large arrays of these, but you can change to int * Again, we allocate large arrays of these, but you can change to int
* if you have memory to burn and "short" is really slow. * if you have memory to burn and "short" is really slow.
*/ */
typedef short JCOEF; typedef short JCOEF;
/* Compressed datastreams are represented as arrays of JOCTET. /* Compressed datastreams are represented as arrays of JOCTET.
* These must be EXACTLY 8 bits wide, at least once they are written to * These must be EXACTLY 8 bits wide, at least once they are written to
* external storage. Note that when using the stdio data source/destination * external storage. Note that when using the stdio data source/destination
* managers, this is also the data type passed to fread/fwrite. * managers, this is also the data type passed to fread/fwrite.
*/ */
#ifdef HAVE_UNSIGNED_CHAR #ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char JOCTET; typedef unsigned char JOCTET;
#define GETJOCTET(value) (value) #define GETJOCTET(value) (value)
#else /* not HAVE_UNSIGNED_CHAR */ #else /* not HAVE_UNSIGNED_CHAR */
typedef char JOCTET; typedef char JOCTET;
#ifdef CHAR_IS_UNSIGNED #ifdef CHAR_IS_UNSIGNED
#define GETJOCTET(value) (value) #define GETJOCTET(value) (value)
#else #else
#define GETJOCTET(value) ((value) & 0xFF) #define GETJOCTET(value) ((value) & 0xFF)
#endif /* CHAR_IS_UNSIGNED */ #endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */ #endif /* HAVE_UNSIGNED_CHAR */
/* These typedefs are used for various table entries and so forth. /* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big * They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special * won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these * extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.) * typedefs live at a different point on the speed/space tradeoff curve.)
*/ */
/* UINT8 must hold at least the values 0..255. */ /* UINT8 must hold at least the values 0..255. */
#ifdef HAVE_UNSIGNED_CHAR #ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char UINT8; typedef unsigned char UINT8;
#else /* not HAVE_UNSIGNED_CHAR */ #else /* not HAVE_UNSIGNED_CHAR */
#ifdef CHAR_IS_UNSIGNED #ifdef CHAR_IS_UNSIGNED
typedef char UINT8; typedef char UINT8;
#else /* not CHAR_IS_UNSIGNED */ #else /* not CHAR_IS_UNSIGNED */
typedef short UINT8; typedef short UINT8;
#endif /* CHAR_IS_UNSIGNED */ #endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */ #endif /* HAVE_UNSIGNED_CHAR */
/* UINT16 must hold at least the values 0..65535. */ /* UINT16 must hold at least the values 0..65535. */
#ifdef HAVE_UNSIGNED_SHORT #ifdef HAVE_UNSIGNED_SHORT
typedef unsigned short UINT16; typedef unsigned short UINT16;
#else /* not HAVE_UNSIGNED_SHORT */ #else /* not HAVE_UNSIGNED_SHORT */
typedef unsigned int UINT16; typedef unsigned int UINT16;
#endif /* HAVE_UNSIGNED_SHORT */ #endif /* HAVE_UNSIGNED_SHORT */
/* INT16 must hold at least the values -32768..32767. */ /* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ #ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16; typedef short INT16;
#endif #endif
/* INT32 must hold at least signed 32-bit values. */ /* INT32 must hold at least signed 32-bit values. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ #ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
#ifndef _BASETSD_H /* MinGW is slightly different */ #ifndef _BASETSD_H /* MinGW is slightly different */
#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
typedef long INT32; typedef long INT32;
#endif #endif
#endif #endif
#endif #endif
#endif #endif
/* Datatype used for image dimensions. The JPEG standard only supports /* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
* "unsigned int" is sufficient on all machines. However, if you need to * "unsigned int" is sufficient on all machines. However, if you need to
* handle larger images and you don't mind deviating from the spec, you * handle larger images and you don't mind deviating from the spec, you
* can change this datatype. * can change this datatype.
*/ */
typedef unsigned int JDIMENSION; typedef unsigned int JDIMENSION;
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ #define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
/* These macros are used in all function definitions and extern declarations. /* These macros are used in all function definitions and extern declarations.
* You could modify them if you need to change function linkage conventions; * You could modify them if you need to change function linkage conventions;
* in particular, you'll need to do that to make the library a Windows DLL. * in particular, you'll need to do that to make the library a Windows DLL.
* Another application is to make all functions global for use with debuggers * Another application is to make all functions global for use with debuggers
* or code profilers that require it. * or code profilers that require it.
*/ */
/* a function called through method pointers: */ /* a function called through method pointers: */
#define METHODDEF(type) static type #define METHODDEF(type) static type
/* a function used only in its module: */ /* a function used only in its module: */
#define LOCAL(type) static type #define LOCAL(type) static type
/* a function referenced thru EXTERNs: */ /* a function referenced thru EXTERNs: */
#define GLOBAL(type) type #define GLOBAL(type) type
/* a reference to a GLOBAL function: */ /* a reference to a GLOBAL function: */
#define EXTERN(type) extern type #define EXTERN(type) extern type
/* This macro is used to declare a "method", that is, a function pointer. /* This macro is used to declare a "method", that is, a function pointer.
* We want to supply prototype parameters if the compiler can cope. * We want to supply prototype parameters if the compiler can cope.
* Note that the arglist parameter must be parenthesized! * Note that the arglist parameter must be parenthesized!
* Again, you can customize this if you need special linkage keywords. * Again, you can customize this if you need special linkage keywords.
*/ */
#ifdef HAVE_PROTOTYPES #ifdef HAVE_PROTOTYPES
#define JMETHOD(type,methodname,arglist) type (*methodname) arglist #define JMETHOD(type,methodname,arglist) type (*methodname) arglist
#else #else
#define JMETHOD(type,methodname,arglist) type (*methodname) () #define JMETHOD(type,methodname,arglist) type (*methodname) ()
#endif #endif
/* Here is the pseudo-keyword for declaring pointers that must be "far" /* Here is the pseudo-keyword for declaring pointers that must be "far"
* on 80x86 machines. Most of the specialized coding for 80x86 is handled * on 80x86 machines. Most of the specialized coding for 80x86 is handled
* by just saying "FAR *" where such a pointer is needed. In a few places * by just saying "FAR *" where such a pointer is needed. In a few places
* explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
*/ */
#ifndef FAR #ifndef FAR
#ifdef NEED_FAR_POINTERS #ifdef NEED_FAR_POINTERS
#define FAR far #define FAR far
#else #else
#define FAR #define FAR
#endif #endif
#endif #endif
/* /*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear * On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application- * in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files. * specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work. * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/ */
#ifndef HAVE_BOOLEAN #ifndef HAVE_BOOLEAN
typedef int boolean; typedef int boolean;
#endif #endif
#ifndef FALSE /* in case these macros already exist */ #ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */ #define FALSE 0 /* values of boolean */
#endif #endif
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#endif #endif
/* /*
* The remaining options affect code selection within the JPEG library, * The remaining options affect code selection within the JPEG library,
* but they don't need to be visible to most applications using the library. * but they don't need to be visible to most applications using the library.
* To minimize application namespace pollution, the symbols won't be * To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
*/ */
#ifdef JPEG_INTERNALS #ifdef JPEG_INTERNALS
#define JPEG_INTERNAL_OPTIONS #define JPEG_INTERNAL_OPTIONS
#endif #endif
#ifdef JPEG_INTERNAL_OPTIONS #ifdef JPEG_INTERNAL_OPTIONS
/* /*
* These defines indicate whether to include various optional functions. * These defines indicate whether to include various optional functions.
* Undefining some of these symbols will produce a smaller but less capable * Undefining some of these symbols will produce a smaller but less capable
* library. Note that you can leave certain source files out of the * library. Note that you can leave certain source files out of the
* compilation/linking process if you've #undef'd the corresponding symbols. * compilation/linking process if you've #undef'd the corresponding symbols.
* (You may HAVE to do that if your compiler doesn't like null source files.) * (You may HAVE to do that if your compiler doesn't like null source files.)
*/ */
/* Capability options common to encoder and decoder: */ /* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ #define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ #define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ #define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
/* Encoder capability options: */ /* Encoder capability options: */
#define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ #define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ #define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off /* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
* precision, so jchuff.c normally uses entropy optimization to compute * precision, so jchuff.c normally uses entropy optimization to compute
* usable tables for higher precision. If you don't want to do optimization, * usable tables for higher precision. If you don't want to do optimization,
* you'll have to supply different default Huffman tables. * you'll have to supply different default Huffman tables.
* The exact same statements apply for progressive JPEG: the default tables * The exact same statements apply for progressive JPEG: the default tables
* don't work for progressive mode. (This may get fixed, however.) * don't work for progressive mode. (This may get fixed, however.)
*/ */
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ #define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
/* Decoder capability options: */ /* Decoder capability options: */
#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ #define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ #define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ #define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ #define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
/* more capability options later, no doubt */ /* more capability options later, no doubt */
/* /*
* Ordering of RGB data in scanlines passed to or from the application. * Ordering of RGB data in scanlines passed to or from the application.
* If your application wants to deal with data in the order B,G,R, just * If your application wants to deal with data in the order B,G,R, just
* change these macros. You can also deal with formats such as R,G,B,X * change these macros. You can also deal with formats such as R,G,B,X
* (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
* the offsets will also change the order in which colormap data is organized. * the offsets will also change the order in which colormap data is organized.
* RESTRICTIONS: * RESTRICTIONS:
* 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
* 2. These macros only affect RGB<=>YCbCr color conversion, so they are not * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
* useful if you are using JPEG color spaces other than YCbCr or grayscale. * is not 3 (they don't understand about dummy color components!). So you
* 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE * can't use color quantization if you change that value.
* is not 3 (they don't understand about dummy color components!). So you */
* can't use color quantization if you change that value.
*/ #define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ #define RGB_BLUE 2 /* Offset of Blue */
#define RGB_GREEN 1 /* Offset of Green */ #define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
/* Definitions for speed-related optimizations. */
/* Definitions for speed-related optimizations. */
/* If your compiler supports inline functions, define INLINE
* as the inline keyword; otherwise define it as empty.
/* If your compiler supports inline functions, define INLINE */
* as the inline keyword; otherwise define it as empty.
*/ #ifndef INLINE
#ifdef __GNUC__ /* for instance, GNU C knows about inline */
#ifndef INLINE #define INLINE __inline__
#ifdef __GNUC__ /* for instance, GNU C knows about inline */ #endif
#define INLINE __inline__ #ifndef INLINE
#endif #define INLINE /* default is to define it as empty */
#ifndef INLINE #endif
#define INLINE /* default is to define it as empty */ #endif
#endif
#endif
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying * as short on such a machine. MULTIPLIER must be at least 16 bits wide.
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER */
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
*/ #ifndef MULTIPLIER
#define MULTIPLIER int /* type for fastest integer multiply */
#ifndef MULTIPLIER #endif
#define MULTIPLIER int /* type for fastest integer multiply */
#endif
/* FAST_FLOAT should be either float or double, whichever is done faster
* by your compiler. (Note that this type is only used in the floating point
/* FAST_FLOAT should be either float or double, whichever is done faster * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
* by your compiler. (Note that this type is only used in the floating point * Typically, float is faster in ANSI C compilers, while double is faster in
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) * pre-ANSI compilers (because they insist on converting to double anyway).
* Typically, float is faster in ANSI C compilers, while double is faster in * The code below therefore chooses float if we have ANSI-style prototypes.
* pre-ANSI compilers (because they insist on converting to double anyway). */
* The code below therefore chooses float if we have ANSI-style prototypes.
*/ #ifndef FAST_FLOAT
#ifdef HAVE_PROTOTYPES
#ifndef FAST_FLOAT #define FAST_FLOAT float
#ifdef HAVE_PROTOTYPES #else
#define FAST_FLOAT float #define FAST_FLOAT double
#else #endif
#define FAST_FLOAT double #endif
#endif
#endif #endif /* JPEG_INTERNAL_OPTIONS */
#endif /* JPEG_INTERNAL_OPTIONS */

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library /* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2010 Jean-loup Gailly. * Copyright (C) 1995-2012 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
@ -15,6 +15,7 @@
* this permanently in zconf.h using "./configure --zprefix". * this permanently in zconf.h using "./configure --zprefix".
*/ */
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
# define Z_PREFIX_SET
/* all linked symbols */ /* all linked symbols */
# define _dist_code z__dist_code # define _dist_code z__dist_code
@ -27,9 +28,11 @@
# define adler32 z_adler32 # define adler32 z_adler32
# define adler32_combine z_adler32_combine # define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64 # define adler32_combine64 z_adler32_combine64
# define compress z_compress # ifndef Z_SOLO
# define compress2 z_compress2 # define compress z_compress
# define compressBound z_compressBound # define compress2 z_compress2
# define compressBound z_compressBound
# endif
# define crc32 z_crc32 # define crc32 z_crc32
# define crc32_combine z_crc32_combine # define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64 # define crc32_combine64 z_crc32_combine64
@ -40,44 +43,52 @@
# define deflateInit2_ z_deflateInit2_ # define deflateInit2_ z_deflateInit2_
# define deflateInit_ z_deflateInit_ # define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams # define deflateParams z_deflateParams
# define deflatePending z_deflatePending
# define deflatePrime z_deflatePrime # define deflatePrime z_deflatePrime
# define deflateReset z_deflateReset # define deflateReset z_deflateReset
# define deflateResetKeep z_deflateResetKeep
# define deflateSetDictionary z_deflateSetDictionary # define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader # define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune # define deflateTune z_deflateTune
# define deflate_copyright z_deflate_copyright # define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table # define get_crc_table z_get_crc_table
# define gz_error z_gz_error # ifndef Z_SOLO
# define gz_intmax z_gz_intmax # define gz_error z_gz_error
# define gz_strwinerror z_gz_strwinerror # define gz_intmax z_gz_intmax
# define gzbuffer z_gzbuffer # define gz_strwinerror z_gz_strwinerror
# define gzclearerr z_gzclearerr # define gzbuffer z_gzbuffer
# define gzclose z_gzclose # define gzclearerr z_gzclearerr
# define gzclose_r z_gzclose_r # define gzclose z_gzclose
# define gzclose_w z_gzclose_w # define gzclose_r z_gzclose_r
# define gzdirect z_gzdirect # define gzclose_w z_gzclose_w
# define gzdopen z_gzdopen # define gzdirect z_gzdirect
# define gzeof z_gzeof # define gzdopen z_gzdopen
# define gzerror z_gzerror # define gzeof z_gzeof
# define gzflush z_gzflush # define gzerror z_gzerror
# define gzgetc z_gzgetc # define gzflush z_gzflush
# define gzgets z_gzgets # define gzgetc z_gzgetc
# define gzoffset z_gzoffset # define gzgetc_ z_gzgetc_
# define gzoffset64 z_gzoffset64 # define gzgets z_gzgets
# define gzopen z_gzopen # define gzoffset z_gzoffset
# define gzopen64 z_gzopen64 # define gzoffset64 z_gzoffset64
# define gzprintf z_gzprintf # define gzopen z_gzopen
# define gzputc z_gzputc # define gzopen64 z_gzopen64
# define gzputs z_gzputs # ifdef _WIN32
# define gzread z_gzread # define gzopen_w z_gzopen_w
# define gzrewind z_gzrewind # endif
# define gzseek z_gzseek # define gzprintf z_gzprintf
# define gzseek64 z_gzseek64 # define gzputc z_gzputc
# define gzsetparams z_gzsetparams # define gzputs z_gzputs
# define gztell z_gztell # define gzread z_gzread
# define gztell64 z_gztell64 # define gzrewind z_gzrewind
# define gzungetc z_gzungetc # define gzseek z_gzseek
# define gzwrite z_gzwrite # define gzseek64 z_gzseek64
# define gzsetparams z_gzsetparams
# define gztell z_gztell
# define gztell64 z_gztell64
# define gzungetc z_gzungetc
# define gzwrite z_gzwrite
# endif
# define inflate z_inflate # define inflate z_inflate
# define inflateBack z_inflateBack # define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd # define inflateBackEnd z_inflateBackEnd
@ -95,13 +106,18 @@
# define inflateSync z_inflateSync # define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint # define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine # define inflateUndermine z_inflateUndermine
# define inflateResetKeep z_inflateResetKeep
# define inflate_copyright z_inflate_copyright # define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast # define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table # define inflate_table z_inflate_table
# define uncompress z_uncompress # ifndef Z_SOLO
# define uncompress z_uncompress
# endif
# define zError z_zError # define zError z_zError
# define zcalloc z_zcalloc # ifndef Z_SOLO
# define zcfree z_zcfree # define zcalloc z_zcalloc
# define zcfree z_zcfree
# endif
# define zlibCompileFlags z_zlibCompileFlags # define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion # define zlibVersion z_zlibVersion
@ -111,7 +127,9 @@
# define alloc_func z_alloc_func # define alloc_func z_alloc_func
# define charf z_charf # define charf z_charf
# define free_func z_free_func # define free_func z_free_func
# define gzFile z_gzFile # ifndef Z_SOLO
# define gzFile z_gzFile
# endif
# define gz_header z_gz_header # define gz_header z_gz_header
# define gz_headerp z_gz_headerp # define gz_headerp z_gz_headerp
# define in_func z_in_func # define in_func z_in_func
@ -197,6 +215,12 @@
# endif # endif
#endif #endif
#if defined(ZLIB_CONST) && !defined(z_const)
# define z_const const
#else
# define z_const
#endif
/* Some Mac compilers merge all .h files incorrectly: */ /* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL # define NO_DUMMY_DECL
@ -243,6 +267,14 @@
# endif # endif
#endif #endif
#ifndef Z_ARG /* function prototypes for stdarg */
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
# define Z_ARG(args) args
# else
# define Z_ARG(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed /* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations). * model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have * This was tested only with MSC; for other MSDOS compilers you may have
@ -356,12 +388,24 @@ typedef uLong FAR uLongf;
typedef Byte *voidp; typedef Byte *voidp;
#endif #endif
#if 1 /* was set to #if 1 by ./configure */ typedef unsigned long z_crc_t;
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H # define Z_HAVE_UNISTD_H
#endif #endif
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif
#ifdef STDC #ifdef STDC
# include <sys/types.h> /* for off_t */ # ifndef Z_SOLO
# include <sys/types.h> /* for off_t */
# endif
#endif
#ifdef _WIN32
# include <stddef.h> /* for wchar_t */
#endif #endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
@ -370,21 +414,38 @@ typedef uLong FAR uLongf;
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations * equivalently requesting no 64-bit operations
*/ */
#if -_LARGEFILE64_SOURCE - -1 == 1 #if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE # undef _LARGEFILE64_SOURCE
#endif #endif
#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
# include <unistd.h> /* for SEEK_* and off_t */ # define Z_HAVE_UNISTD_H
# ifdef VMS #endif
# include <unixio.h> /* for off_t */ #ifndef Z_SOLO
# endif # if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE)
# ifndef z_off_t # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# define z_off_t off_t # ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# ifndef z_off_t
# define z_off_t off_t
# endif
# endif # endif
#endif #endif
#ifndef SEEK_SET #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
# define Z_LFS64
#endif
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
# define Z_LARGE64
#endif
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
# define Z_WANT64
#endif
#if !defined(SEEK_SET) && !defined(Z_SOLO)
# define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
@ -394,18 +455,14 @@ typedef uLong FAR uLongf;
# define z_off_t long # define z_off_t long
#endif #endif
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 #if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t # define z_off64_t off64_t
#else #else
# define z_off64_t z_off_t # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
#endif # define z_off64_t __int64
# else
#if defined(__OS400__) # define z_off64_t z_off_t
# define NO_vsnprintf # endif
#endif
#if defined(__MVS__)
# define NO_vsnprintf
#endif #endif
/* MVS linker does not support external names larger than 8 bytes */ /* MVS linker does not support external names larger than 8 bytes */

View File

@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library /* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.5, April 19th, 2010 version 1.2.7, May 2nd, 2012
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -24,8 +24,8 @@
The data format used by the zlib library is described by RFCs (Request for The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
*/ */
#ifndef ZLIB_H #ifndef ZLIB_H
@ -37,11 +37,11 @@
extern "C" { extern "C" {
#endif #endif
#define ZLIB_VERSION "1.2.5" #define ZLIB_VERSION "1.2.7"
#define ZLIB_VERNUM 0x1250 #define ZLIB_VERNUM 0x1270
#define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2 #define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 5 #define ZLIB_VER_REVISION 7
#define ZLIB_VER_SUBREVISION 0 #define ZLIB_VER_SUBREVISION 0
/* /*
@ -83,15 +83,15 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address));
struct internal_state; struct internal_state;
typedef struct z_stream_s { typedef struct z_stream_s {
Bytef *next_in; /* next input byte */ z_const Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */ uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */ uLong total_in; /* total number of input bytes read so far */
Bytef *next_out; /* next output byte should be put there */ Bytef *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */ uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */ uLong total_out; /* total number of bytes output so far */
char *msg; /* last error message, NULL if no error */ z_const char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */ struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */ alloc_func zalloc; /* used to allocate the internal state */
@ -327,8 +327,9 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
Z_FINISH can be used immediately after deflateInit if all the compression Z_FINISH can be used immediately after deflateInit if all the compression
is to be done in a single step. In this case, avail_out must be at least the is to be done in a single step. In this case, avail_out must be at least the
value returned by deflateBound (see below). If deflate does not return value returned by deflateBound (see below). Then deflate is guaranteed to
Z_STREAM_END, then it must be called again as described above. return Z_STREAM_END. If not enough output space is provided, deflate will
not return Z_STREAM_END, and it must be called again as described above.
deflate() sets strm->adler to the adler32 checksum of all input read deflate() sets strm->adler to the adler32 checksum of all input read
so far (that is, total_in bytes). so far (that is, total_in bytes).
@ -451,23 +452,29 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
error. However if all decompression is to be performed in a single step (a error. However if all decompression is to be performed in a single step (a
single call of inflate), the parameter flush should be set to Z_FINISH. In single call of inflate), the parameter flush should be set to Z_FINISH. In
this case all pending input is processed and all pending output is flushed; this case all pending input is processed and all pending output is flushed;
avail_out must be large enough to hold all the uncompressed data. (The size avail_out must be large enough to hold all of the uncompressed data for the
of the uncompressed data may have been saved by the compressor for this operation to complete. (The size of the uncompressed data may have been
purpose.) The next operation on this stream must be inflateEnd to deallocate saved by the compressor for this purpose.) The use of Z_FINISH is not
the decompression state. The use of Z_FINISH is never required, but can be required to perform an inflation in one step. However it may be used to
used to inform inflate that a faster approach may be used for the single inform inflate that a faster approach can be used for the single inflate()
inflate() call. call. Z_FINISH also informs inflate to not maintain a sliding window if the
stream completes, which reduces inflate's memory footprint. If the stream
does not complete, either because not all of the stream is provided or not
enough output space is provided, then a sliding window will be allocated and
inflate() can be called again to continue the operation as if Z_NO_FLUSH had
been used.
In this implementation, inflate() always flushes as much output as In this implementation, inflate() always flushes as much output as
possible to the output buffer, and always uses the faster approach on the possible to the output buffer, and always uses the faster approach on the
first call. So the only effect of the flush parameter in this implementation first call. So the effects of the flush parameter in this implementation are
is on the return value of inflate(), as noted below, or when it returns early on the return value of inflate() as noted below, when inflate() returns early
because Z_BLOCK or Z_TREES is used. when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
memory for a sliding window when Z_FINISH is used.
If a preset dictionary is needed after this call (see inflateSetDictionary If a preset dictionary is needed after this call (see inflateSetDictionary
below), inflate sets strm->adler to the adler32 checksum of the dictionary below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
strm->adler to the adler32 checksum of all output produced so far (that is, strm->adler to the Adler-32 checksum of all output produced so far (that is,
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
below. At the end of the stream, inflate() checks that its computed adler32 below. At the end of the stream, inflate() checks that its computed adler32
checksum is equal to that saved by the compressor and returns Z_STREAM_END checksum is equal to that saved by the compressor and returns Z_STREAM_END
@ -478,7 +485,9 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
initializing with inflateInit2(). Any information contained in the gzip initializing with inflateInit2(). Any information contained in the gzip
header is not retained, so applications that need that information should header is not retained, so applications that need that information should
instead use raw inflate, see inflateInit2() below, or inflateBack() and instead use raw inflate, see inflateInit2() below, or inflateBack() and
perform their own processing of the gzip header and trailer. perform their own processing of the gzip header and trailer. When processing
gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
producted so far. The CRC-32 is checked against the gzip trailer.
inflate() returns Z_OK if some progress has been made (more input processed inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has or more output produced), Z_STREAM_END if the end of the compressed data has
@ -580,10 +589,15 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
uInt dictLength)); uInt dictLength));
/* /*
Initializes the compression dictionary from the given byte sequence Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called without producing any compressed output. When using the zlib format, this
immediately after deflateInit, deflateInit2 or deflateReset, before any call function must be called immediately after deflateInit, deflateInit2 or
of deflate. The compressor and decompressor must use exactly the same deflateReset, and before any call of deflate. When doing raw deflate, this
dictionary (see inflateSetDictionary). function must be called either before any call of deflate, or immediately
after the completion of a deflate block, i.e. after all input has been
consumed and all output has been delivered when using any of the flush
options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
compressor and decompressor must use exactly the same dictionary (see
inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly to be encountered later in the data to be compressed, with the most commonly
@ -610,8 +624,8 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent (for example if deflate has already been called for this stream inconsistent (for example if deflate has already been called for this stream
or if the compression method is bsort). deflateSetDictionary does not or if not at a block boundary for raw deflate). deflateSetDictionary does
perform any compression: this will be done by deflate(). not perform any compression: this will be done by deflate().
*/ */
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
@ -688,9 +702,29 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
deflation of sourceLen bytes. It must be called after deflateInit() or deflation of sourceLen bytes. It must be called after deflateInit() or
deflateInit2(), and after deflateSetHeader(), if used. This would be used deflateInit2(), and after deflateSetHeader(), if used. This would be used
to allocate an output buffer for deflation in a single pass, and so would be to allocate an output buffer for deflation in a single pass, and so would be
called before deflate(). called before deflate(). If that first deflate() call is provided the
sourceLen input bytes, an output buffer allocated to the size returned by
deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
to return Z_STREAM_END. Note that it is possible for the compressed size to
be larger than the value returned by deflateBound() if flush options other
than Z_FINISH or Z_NO_FLUSH are used.
*/ */
ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
unsigned *pending,
int *bits));
/*
deflatePending() returns the number of bytes and bits of output that have
been generated, but not yet provided in the available output. The bytes not
provided would be due to the available output space having being consumed.
The number of bits of output not provided are between 0 and 7, where they
await more bits to join them in order to fill out a full byte. If pending
or bits are Z_NULL, then those values are not set.
deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
int bits, int bits,
int value)); int value));
@ -703,8 +737,9 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
than or equal to 16, and that many of the least significant bits of value than or equal to 16, and that many of the least significant bits of value
will be inserted in the output. will be inserted in the output.
deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
stream state was inconsistent. room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
source stream state was inconsistent.
*/ */
ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
@ -790,10 +825,11 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
if that call returned Z_NEED_DICT. The dictionary chosen by the compressor if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
can be determined from the adler32 value returned by that call of inflate. can be determined from the adler32 value returned by that call of inflate.
The compressor and decompressor must use exactly the same dictionary (see The compressor and decompressor must use exactly the same dictionary (see
deflateSetDictionary). For raw inflate, this function can be called deflateSetDictionary). For raw inflate, this function can be called at any
immediately after inflateInit2() or inflateReset() and before any call of time to set the dictionary. If the provided dictionary is smaller than the
inflate() to set the dictionary. The application must insure that the window and there is already data in the window, then the provided dictionary
dictionary that was used for compression is provided. will amend what's there. The application must insure that the dictionary
that was used for compression is provided.
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
@ -805,17 +841,21 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/* /*
Skips invalid compressed data until a full flush point (see above the Skips invalid compressed data until a possible full flush point (see above
description of deflate with Z_FULL_FLUSH) can be found, or until all for the description of deflate with Z_FULL_FLUSH) can be found, or until all
available input is skipped. No output is provided. available input is skipped. No output is provided.
inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR inflateSync searches for a 00 00 FF FF pattern in the compressed data.
if no more input was provided, Z_DATA_ERROR if no flush point has been All full flush points have this pattern, but not all occurences of this
found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the pattern are full flush points.
success case, the application may save the current current value of total_in
which indicates where valid compressed data was found. In the error case, inflateSync returns Z_OK if a possible full flush point has been found,
the application may repeatedly call inflateSync, providing more input each Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
time, until success or end of the input data. has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
In the success case, the application may save the current current value of
total_in which indicates where valid compressed data was found. In the
error case, the application may repeatedly call inflateSync, providing more
input each time, until success or end of the input data.
*/ */
ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
@ -962,7 +1002,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
See inflateBack() for the usage of these routines. See inflateBack() for the usage of these routines.
inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
the paramaters are invalid, Z_MEM_ERROR if the internal state could not be the parameters are invalid, Z_MEM_ERROR if the internal state could not be
allocated, or Z_VERSION_ERROR if the version of the library does not match allocated, or Z_VERSION_ERROR if the version of the library does not match
the version of the header file. the version of the header file.
*/ */
@ -1088,6 +1128,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
27-31: 0 (reserved) 27-31: 0 (reserved)
*/ */
#ifndef Z_SOLO
/* utility functions */ /* utility functions */
@ -1149,10 +1190,11 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
the case where there is not enough room, uncompress() will fill the output
buffer with the uncompressed data up to that point.
*/ */
/* gzip file access functions */ /* gzip file access functions */
/* /*
@ -1162,7 +1204,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
wrapper, documented in RFC 1952, wrapped around a deflate stream. wrapper, documented in RFC 1952, wrapped around a deflate stream.
*/ */
typedef voidp gzFile; /* opaque gzip file descriptor */ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
/* /*
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
@ -1172,13 +1214,28 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
for fixed code compression as in "wb9F". (See the description of for fixed code compression as in "wb9F". (See the description of
deflateInit2 for more information about the strategy parameter.) Also "a" deflateInit2 for more information about the strategy parameter.) 'T' will
can be used instead of "w" to request that the gzip stream that will be request transparent writing or appending with no compression and not using
written be appended to the file. "+" will result in an error, since reading the gzip format.
and writing to the same gzip file is not supported.
"a" can be used instead of "w" to request that the gzip stream that will
be written be appended to the file. "+" will result in an error, since
reading and writing to the same gzip file is not supported. The addition of
"x" when writing will create the file exclusively, which fails if the file
already exists. On systems that support it, the addition of "e" when
reading or writing will set the flag to close the file on an execve() call.
These functions, as well as gzip, will read and decode a sequence of gzip
streams in a file. The append function of gzopen() can be used to create
such a file. (Also see gzflush() for another way to do this.) When
appending, gzopen does not test whether the file begins with a gzip stream,
nor does it look for the end of the gzip streams to begin appending. gzopen
will simply append a gzip stream to the existing file.
gzopen can be used to read a file which is not in gzip format; in this gzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression. case gzread will directly read from the file without decompression. When
reading, this will be detected automatically by looking for the magic two-
byte gzip header.
gzopen returns NULL if the file could not be opened, if there was gzopen returns NULL if the file could not be opened, if there was
insufficient memory to allocate the gzFile state, or if an invalid mode was insufficient memory to allocate the gzFile state, or if an invalid mode was
@ -1197,7 +1254,11 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
mode);. The duplicated descriptor should be saved to avoid a leak, since mode);. The duplicated descriptor should be saved to avoid a leak, since
gzdopen does not close fd if it fails. gzdopen does not close fd if it fails. If you are using fileno() to get the
file descriptor from a FILE *, then you will have to use dup() to avoid
double-close()ing the file descriptor. Both gzclose() and fclose() will
close the associated file descriptor, so they need to have different file
descriptors.
gzdopen returns NULL if there was insufficient memory to allocate the gzdopen returns NULL if there was insufficient memory to allocate the
gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
@ -1235,14 +1296,26 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/* /*
Reads the given number of uncompressed bytes from the compressed file. If Reads the given number of uncompressed bytes from the compressed file. If
the input file was not in gzip format, gzread copies the given number of the input file is not in gzip format, gzread copies the given number of
bytes into the buffer. bytes into the buffer directly from the file.
After reaching the end of a gzip stream in the input, gzread will continue After reaching the end of a gzip stream in the input, gzread will continue
to read, looking for another gzip stream, or failing that, reading the rest to read, looking for another gzip stream. Any number of gzip streams may be
of the input file directly without decompression. The entire input file concatenated in the input file, and will all be decompressed by gzread().
will be read if gzread is called until it returns less than the requested If something other than a gzip stream is encountered after a gzip stream,
len. that remaining trailing garbage is ignored (and no error is returned).
gzread can be used to read a gzip file that is being concurrently written.
Upon reaching the end of the input, gzread will return with the available
data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
gzclearerr can be used to clear the end of file indicator in order to permit
gzread to be tried again. Z_OK indicates that a gzip stream was completed
on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
middle of a gzip stream. Note that gzread does not return -1 in the event
of an incomplete gzip stream. This error is deferred until gzclose(), which
will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
stream. Alternatively, gzerror can be used before gzclose to detect this
case.
gzread returns the number of uncompressed bytes actually read, less than gzread returns the number of uncompressed bytes actually read, less than
len for end of file, or -1 for error. len for end of file, or -1 for error.
@ -1256,7 +1329,7 @@ ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
error. error.
*/ */
ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
/* /*
Converts, formats, and writes the arguments to the compressed file under Converts, formats, and writes the arguments to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of control of the format string, as in fprintf. gzprintf returns the number of
@ -1301,7 +1374,10 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/* /*
Reads one byte from the compressed file. gzgetc returns this byte or -1 Reads one byte from the compressed file. gzgetc returns this byte or -1
in case of end of file or error. in case of end of file or error. This is implemented as a macro for speed.
As such, it does not do all of the checking the other functions do. I.e.
it does not check to see if file is NULL, nor whether the structure file
points to has been clobbered or not.
*/ */
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
@ -1397,9 +1473,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
/* /*
Returns true (1) if file is being copied directly while reading, or false Returns true (1) if file is being copied directly while reading, or false
(0) if file is a gzip stream being decompressed. This state can change from (0) if file is a gzip stream being decompressed.
false to true while reading the input file if the end of a gzip stream is
reached, but is followed by data that is not another gzip stream.
If the input file is empty, gzdirect() will return true, since the input If the input file is empty, gzdirect() will return true, since the input
does not contain a gzip stream. does not contain a gzip stream.
@ -1408,6 +1482,13 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
cause buffers to be allocated to allow reading the file to determine if it cause buffers to be allocated to allow reading the file to determine if it
is a gzip file. Therefore if gzbuffer() is used, it should be called before is a gzip file. Therefore if gzbuffer() is used, it should be called before
gzdirect(). gzdirect().
When writing, gzdirect() returns true (1) if transparent writing was
requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
gzdirect() is not needed when writing. Transparent writing must be
explicitly requested, so the application already knows the answer. When
linking statically, using gzdirect() will include all of the zlib code for
gzip file reading and decompression, which may not be desired.)
*/ */
ZEXTERN int ZEXPORT gzclose OF((gzFile file)); ZEXTERN int ZEXPORT gzclose OF((gzFile file));
@ -1419,7 +1500,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file));
must not be called more than once on the same allocation. must not be called more than once on the same allocation.
gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
file operation error, or Z_OK on success. file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
last read ended in the middle of a gzip stream, or Z_OK on success.
*/ */
ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
@ -1457,6 +1539,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
file that is being written concurrently. file that is being written concurrently.
*/ */
#endif /* !Z_SOLO */
/* checksum functions */ /* checksum functions */
@ -1492,16 +1575,17 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
that the z_off_t type (like off_t) is a signed integer. If len2 is
negative, the result has no meaning or utility.
*/ */
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/* /*
Update a running CRC-32 with the bytes buf[0..len-1] and return the Update a running CRC-32 with the bytes buf[0..len-1] and return the
updated CRC-32. If buf is Z_NULL, this function returns the required updated CRC-32. If buf is Z_NULL, this function returns the required
initial value for the for the crc. Pre- and post-conditioning (one's initial value for the crc. Pre- and post-conditioning (one's complement) is
complement) is performed within this function so it shouldn't be done by the performed within this function so it shouldn't be done by the application.
application.
Usage example: Usage example:
@ -1544,17 +1628,42 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
const char *version, const char *version,
int stream_size)); int stream_size));
#define deflateInit(strm, level) \ #define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
#define inflateInit(strm) \ #define inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, sizeof(z_stream)) (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
#define inflateInit2(strm, windowBits) \ #define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
(int)sizeof(z_stream))
#define inflateBackInit(strm, windowBits, window) \ #define inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \ inflateBackInit_((strm), (windowBits), (window), \
ZLIB_VERSION, sizeof(z_stream)) ZLIB_VERSION, (int)sizeof(z_stream))
#ifndef Z_SOLO
/* gzgetc() macro and its supporting function and exposed data structure. Note
* that the real internal state is much larger than the exposed structure.
* This abbreviated structure exposes just enough for the gzgetc() macro. The
* user should not mess with these exposed elements, since their names or
* behavior could change in the future, perhaps even capriciously. They can
* only be used by the gzgetc() macro. You have been warned.
*/
struct gzFile_s {
unsigned have;
unsigned char *next;
z_off64_t pos;
};
ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
#ifdef Z_PREFIX_SET
# undef z_gzgetc
# define z_gzgetc(g) \
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
#else
# define gzgetc(g) \
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
#endif
/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
* change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
@ -1562,7 +1671,7 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
* functions are changed to 64 bits) -- in case these are set on systems * functions are changed to 64 bits) -- in case these are set on systems
* without large file support, _LFS64_LARGEFILE must also be true * without large file support, _LFS64_LARGEFILE must also be true
*/ */
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 #ifdef Z_LARGE64
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
@ -1571,14 +1680,23 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
#endif #endif
#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
# define gzopen gzopen64 # ifdef Z_PREFIX_SET
# define gzseek gzseek64 # define z_gzopen z_gzopen64
# define gztell gztell64 # define z_gzseek z_gzseek64
# define gzoffset gzoffset64 # define z_gztell z_gztell64
# define adler32_combine adler32_combine64 # define z_gzoffset z_gzoffset64
# define crc32_combine crc32_combine64 # define z_adler32_combine z_adler32_combine64
# ifdef _LARGEFILE64_SOURCE # define z_crc32_combine z_crc32_combine64
# else
# define gzopen gzopen64
# define gzseek gzseek64
# define gztell gztell64
# define gzoffset gzoffset64
# define adler32_combine adler32_combine64
# define crc32_combine crc32_combine64
# endif
# ifndef Z_LARGE64
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
@ -1595,6 +1713,13 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
#endif #endif
#else /* Z_SOLO */
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
#endif /* !Z_SOLO */
/* hack for buggy compilers */ /* hack for buggy compilers */
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;}; struct internal_state {int dummy;};
@ -1603,8 +1728,14 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
/* undocumented functions */ /* undocumented functions */
ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN const char * ZEXPORT zError OF((int));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
#if defined(_WIN32) && !defined(Z_SOLO)
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
const char *mode));
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -9,6 +9,7 @@ More info : http://frontier-dev.net
********************************************************************************************/ ********************************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include "pngu.h" #include "pngu.h"
#include "png.h" #include "png.h"

View File

@ -25,7 +25,7 @@ public:
bool fromBuffer(const SmartBuf &buffer, u32 bufferSize, u32 size, u32 lspacing, u32 w = 0, u32 idx = 0, const char *genKey = NULL); bool fromBuffer(const SmartBuf &buffer, u32 bufferSize, u32 size, u32 lspacing, u32 w = 0, u32 idx = 0, const char *genKey = NULL);
bool fromFile(const char *filename, u32 size, u32 lspacing, u32 w = 0, u32 idx = 0); bool fromFile(const char *filename, u32 size, u32 lspacing, u32 w = 0, u32 idx = 0);
SFont(void) : data(SmartBuf(NULL, SmartBuf::SRCALL_MEM2)), dataSize(0), font(SmartPtr<FreeTypeGX>(new FreeTypeGX)), lineSpacing(0), weight(0), index(0) { } SFont(void) : data(SmartBuf(NULL, SmartBuf::SRCALL_MEM2)), dataSize(0), font(SmartPtr<FreeTypeGX>(new FreeTypeGX)), lineSpacing(0), weight(0), index(0) { }
~SFont(void) { font.release(); } ~SFont(void) { }
}; };
class CText class CText

View File

@ -129,7 +129,7 @@ int main(int argc, char **argv)
ret = mainMenu->main(); ret = mainMenu->main();
} }
} }
delete mainMenu; mainMenu->cleanup();
ISFS_Deinitialize(); ISFS_Deinitialize();
Sys_Exit(); Sys_Exit();

View File

@ -32,6 +32,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h>
#include "ZipFile.h" #include "ZipFile.h"
#include "gc/fileOps.h" #include "gc/fileOps.h"