- Now compiled with ppc r36 and libogc 1.8.24

- fix in menu.cpp for scummvm.ini in apps/scummvm folder
- v5.5.0 beta 1
This commit is contained in:
Fledge68 2021-09-01 15:51:09 -05:00
parent 85198bdeb8
commit c90587576b
95 changed files with 10849 additions and 8705 deletions

View File

@ -16,45 +16,32 @@ jobs:
path: cache
key: ${{ runner.os }}-cache-1
- name: Download devkitPPC r30, libogc 1.8.19, bin2s and elf2dol
- name: Download devkitPPC r36, libogc 1.8.24, bin2s and elf2dol
if: steps.cache-1.outputs.cache-hit != 'true'
# general-tools is needed for bin2s and gamecube-tools is needed for elf2dol
run: |
mkdir cache && cd cache
wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r30-1-linux.pkg.tar.xz"
wget "https://wii.leseratte10.de/devkitPro/file.php/libogc-1.8.19-1-any.pkg.tar.xz"
wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r36-1-linux.pkg.tar.xz"
wget "https://wii.leseratte10.de/devkitPro/file.php/libogc-1.8.24-1-any.pkg.tar.xz"
wget "https://wii.leseratte10.de/devkitPro/file.php/general-tools-1.2.0-1-linux.pkg.tar.xz"
wget "https://wii.leseratte10.de/devkitPro/file.php/gamecube-tools-1.0.2-1-linux.pkg.tar.xz"
cd ..
- name: Extract devkitPPC r30, libogc 1.8.19, bin2s and elf2dol
- name: Extract devkitPPC r36, libogc 1.8.24, bin2s and elf2dol
# general-tools is needed for bin2s and gamecube-tools is needed for elf2dol
run: |
tar -xf cache/devkitPPC-r30-1-linux.pkg.tar.xz opt/devkitpro/devkitPPC --strip-components=1
tar -xf cache/libogc-1.8.19-1-any.pkg.tar.xz opt/devkitpro/libogc --strip-components=1
tar -xf cache/devkitPPC-r36-1-linux.pkg.tar.xz opt/devkitpro/devkitPPC --strip-components=1
tar -xf cache/libogc-1.8.24-1-any.pkg.tar.xz opt/devkitpro/libogc --strip-components=1
tar -xf cache/general-tools-1.2.0-1-linux.pkg.tar.xz opt/devkitpro/tools/bin/bin2s --strip-components=4
sudo cp bin2s /usr/local/bin/bin2s
tar -xf cache/gamecube-tools-1.0.2-1-linux.pkg.tar.xz opt/devkitpro/tools/bin/elf2dol --strip-components=4
sudo cp elf2dol /usr/local/bin/elf2dol
- name: Patch libogc
run: |
if [[ "$(xxd -s 608918 -g4 -l4 $(pwd)/devkitpro/libogc/lib/wii/libogc.a | cut -d\ -f2)" == "38800001" ]]; then
echo "Found correct value at offset 608918 (0x94a96) -> patching libogc ..."
printf '\x38\x80\x00\x03' | dd of=$(pwd)/devkitpro/libogc/lib/wii/libogc.a bs=1 seek=608918 count=4 conv=notrunc
if [[ "$(xxd -s 608918 -g4 -l4 $(pwd)/devkitpro/libogc/lib/wii/libogc.a | cut -d\ -f2)" == "38800003" ]]; then
echo "Patch successful"
else
echo "Patch failed!!"
/bin/false
fi
else
echo "Fail: $(xxd -s 608918 -g4 -l4 $(pwd)/devkitpro/libogc/lib/wii/libogc.a | cut -d\ -f2)"
fi
- name: Compile
run: |
PATH=$(pwd)/devkitpro/devkitPPC/bin:$PATH DEVKITPPC=$(pwd)/devkitpro/devkitPPC DEVKITPRO=$(pwd)/devkitpro make
- name: Package
- name: Package
id: pack
run: |
cp -r wii/apps apps

View File

@ -71,13 +71,14 @@ endif
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lwolfssl -lcustomfat -lcustomntfs -lcustomext2fs -lpng -lturbojpeg -lm -lz -lwiiuse -lwupc -lwiidrc -lbte -lasnd -logc -lfreetype -lvorbisidec -lmad -lsicksaxis
LIBS := -lwolfssl -lcustomfat -lcustomntfs -lcustomext2fs -lpng -lturbojpeg -lm -lz -lwiiuse -lbte -lwupc -lwiidrc -lsicksaxis -lasnd -lmad -lvorbisidec -logg -lfreetype -lbz2 -logc
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(CURDIR)/portlibs
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
@ -127,14 +128,13 @@ export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
#---------------------------------------------------------------------------------
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) -I$(LIBOGC_INC) \
-I$(PORTLIBS)/include
-I$(CURDIR)/$(BUILD) -I$(LIBOGC_INC)
#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
-L$(CURDIR)/source/libwolfssl/ -L$(LIBOGC_LIB) -L$(PORTLIBS)/lib
-L$(CURDIR)/source/libwolfssl -L$(LIBOGC_LIB)
export OUTPUT := $(CURDIR)/out/$(TARGET)
.PHONY: $(BUILD) all clean

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

282
portlibs/include/bzlib.h Normal file
View File

@ -0,0 +1,282 @@
/*-------------------------------------------------------------*/
/*--- Public header file for the library. ---*/
/*--- bzlib.h ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#ifndef _BZLIB_H
#define _BZLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#define BZ_RUN 0
#define BZ_FLUSH 1
#define BZ_FINISH 2
#define BZ_OK 0
#define BZ_RUN_OK 1
#define BZ_FLUSH_OK 2
#define BZ_FINISH_OK 3
#define BZ_STREAM_END 4
#define BZ_SEQUENCE_ERROR (-1)
#define BZ_PARAM_ERROR (-2)
#define BZ_MEM_ERROR (-3)
#define BZ_DATA_ERROR (-4)
#define BZ_DATA_ERROR_MAGIC (-5)
#define BZ_IO_ERROR (-6)
#define BZ_UNEXPECTED_EOF (-7)
#define BZ_OUTBUFF_FULL (-8)
#define BZ_CONFIG_ERROR (-9)
typedef
struct {
char *next_in;
unsigned int avail_in;
unsigned int total_in_lo32;
unsigned int total_in_hi32;
char *next_out;
unsigned int avail_out;
unsigned int total_out_lo32;
unsigned int total_out_hi32;
void *state;
void *(*bzalloc)(void *,int,int);
void (*bzfree)(void *,void *);
void *opaque;
}
bz_stream;
#ifndef BZ_IMPORT
#define BZ_EXPORT
#endif
#ifndef BZ_NO_STDIO
/* Need a definitition for FILE */
#include <stdio.h>
#endif
#ifdef _WIN32
# include <windows.h>
# ifdef small
/* windows.h define small to char */
# undef small
# endif
# ifdef BZ_EXPORT
# define BZ_API(func) WINAPI func
# define BZ_EXTERN extern
# else
/* import windows dll dynamically */
# define BZ_API(func) (WINAPI * func)
# define BZ_EXTERN
# endif
#else
# define BZ_API(func) func
# define BZ_EXTERN extern
#endif
/*-- Core (low-level) library functions --*/
BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
bz_stream* strm,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzCompress) (
bz_stream* strm,
int action
);
BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
bz_stream *strm,
int verbosity,
int small
);
BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
bz_stream *strm
);
/*-- High(er) level library functions --*/
#ifndef BZ_NO_STDIO
#define BZ_MAX_UNUSED 5000
typedef void BZFILE;
BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
int* bzerror,
FILE* f,
int verbosity,
int small,
void* unused,
int nUnused
);
BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
int* bzerror,
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
int* bzerror,
BZFILE* b,
void** unused,
int* nUnused
);
BZ_EXTERN int BZ_API(BZ2_bzRead) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN void BZ_API(BZ2_bzWrite) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in,
unsigned int* nbytes_out
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32
);
#endif
/*-- Utility functions --*/
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int small,
int verbosity
);
/*--
Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
to support better zlib compatibility.
This code is not _officially_ part of libbzip2 (yet);
I haven't tested it, documented it, or considered the
threading-safeness of it.
If this code breaks, please contact both Yoshioka and me.
--*/
BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
void
);
#ifndef BZ_NO_STDIO
BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
const char *path,
const char *mode
);
BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
int fd,
const char *mode
);
BZ_EXTERN int BZ_API(BZ2_bzread) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzwrite) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzflush) (
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzclose) (
BZFILE* b
);
BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
BZFILE *b,
int *errnum
);
#endif
#ifdef __cplusplus
}
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib.h ---*/
/*-------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*
fat.h
Simple functionality for startup, mounting and unmounting of FAT-based devices.
Copyright (c) 2006 - 2012
Michael "Chishm" Chisholm
Dave "WinterMute" Murphy
@ -73,7 +73,7 @@ extern bool fatInitDefault (void);
/*
Mount the device pointed to by interface, and set up a devoptab entry for it as "name:".
You can then access the filesystem using "name:/".
This will mount the active partition or the first valid partition on the disc,
This will mount the active partition or the first valid partition on the disc,
and will use a cache size optimized for the host system.
*/
extern bool fatMountSimple (const char* name, const DISC_INTERFACE* interface);
@ -111,7 +111,7 @@ extern void fatGetVolumeLabel (const char* name, char *label);
Methods to modify DOS File Attributes
*/
int FAT_getAttr(const char *file);
int FAT_setAttr(const char *file, int attr );
int FAT_setAttr(const char *file, uint8_t attr );
#define LIBFAT_FEOS_MULTICWD

View File

@ -5,7 +5,7 @@
/* */
/* UNIX-specific configuration file (specification only). */
/* */
/* Copyright 1996-2004, 2006-2009, 2011, 2013 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -28,15 +28,15 @@
/* Note however that if some specific modifications are needed, we */
/* advise you to place a modified copy in your build directory. */
/* */
/* The build directory is usually `freetype/builds/<system>', and */
/* contains system-specific files that are always included first when */
/* building the library. */
/* The build directory is usually `builds/<system>', and contains */
/* system-specific files that are always included first when building */
/* the library. */
/* */
/*************************************************************************/
#ifndef __FTCONFIG_H__
#define __FTCONFIG_H__
#ifndef FTCONFIG_H_
#define FTCONFIG_H_
#include <ft2build.h>
#include FT_CONFIG_OPTIONS_H
@ -53,7 +53,7 @@ FT_BEGIN_HEADER
/* These macros can be toggled to suit a specific system. The current */
/* ones are defaults used to compile FreeType in an ANSI C environment */
/* (16bit compilers are also supported). Copy this file to your own */
/* `freetype/builds/<system>' directory, and edit it to port the engine. */
/* `builds/<system>' directory, and edit it to port the engine. */
/* */
/*************************************************************************/
@ -90,7 +90,7 @@ FT_BEGIN_HEADER
/* 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. */
/* do not use configure script. */
/* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFUL
@ -243,6 +243,18 @@ FT_BEGIN_HEADER
/* */
typedef signed XXX FT_Int64;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt64 */
/* */
/* A typedef for a 64bit unsigned integer type. The size depends on */
/* the configuration. Only defined if there is real 64bit support; */
/* otherwise, it gets emulated with a structure (if necessary). */
/* */
typedef unsigned XXX FT_UInt64;
/* */
#endif
@ -276,19 +288,46 @@ FT_BEGIN_HEADER
#endif
/* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */
/* determine whether we have a 64-bit int type */
/* (mostly for environments without `autoconf') */
#if FT_SIZEOF_LONG == 8
/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#define FT_INT64 long
#define FT_UINT64 unsigned long
/* we handle the LLP64 scheme separately for GCC and clang, */
/* suppressing the `long long' warning */
#elif ( FT_SIZEOF_LONG == 4 ) && \
defined( HAVE_LONG_LONG_INT ) && \
defined( __GNUC__ )
#pragma GCC diagnostic ignored "-Wlong-long"
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
/*************************************************************************/
/* */
/* A 64-bit data type may create compilation problems if you compile */
/* in strict ANSI mode. To avoid them, we disable other 64-bit data */
/* types if __STDC__ is defined. You can however ignore this rule */
/* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
/* */
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */
@ -297,7 +336,8 @@ FT_BEGIN_HEADER
/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __WATCOMC__ ) /* Watcom C++ */
@ -306,42 +346,40 @@ FT_BEGIN_HEADER
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
#define FT_LONG64
#define FT_INT64 long long int
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( __GNUC__ )
/* GCC provides the `long long' type */
#define FT_LONG64
#define FT_INT64 long long int
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#endif /* __STDC_VERSION__ >= 199901L */
#endif /* FT_SIZEOF_LONG == 8 */
#ifdef FT_LONG64
typedef FT_INT64 FT_Int64;
typedef FT_UINT64 FT_UInt64;
#endif
#ifdef _WIN64
/* only 64bit Windows uses the LLP64 data model, i.e., */
/* 32bit integers, 64bit pointers */
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
#else
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
#endif
/*************************************************************************/
/* */
/* A 64-bit data type will create compilation problems if you compile */
/* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */
/* is defined. You can however ignore this rule by defining the */
/* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
/* miscellaneous */
/* */
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
#ifdef __STDC__
/* 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_INT64
#endif /* __STDC__ */
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
#ifdef FT_LONG64
typedef FT_INT64 FT_Int64;
#endif
/*************************************************************************/
#define FT_BEGIN_STMNT do {
@ -349,148 +387,25 @@ FT_BEGIN_HEADER
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
/* Provide assembler fragments for performance-critical functions. */
/* 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__
#if defined( __arm__ ) && !defined( __thumb__ ) && \
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
#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__ __volatile__ (
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
"adds %1, %1, %0\n\t" /* %1 += %0 */
"adc %2, %2, #0\n\t" /* %2 += carry */
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
"orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b)
: "cc" );
return a;
}
#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
#if defined( __i386__ )
#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__ __volatile__ (
"imul %%edx\n"
"movl %%edx, %%ecx\n"
"sarl $31, %%ecx\n"
"addl $0x8000, %%ecx\n"
"addl %%ecx, %%eax\n"
"adcl $0, %%edx\n"
"shrl $16, %%eax\n"
"shll $16, %%edx\n"
"addl %%edx, %%eax\n"
: "=a"(result), "=d"(b)
: "a"(a), "d"(b)
: "%ecx", "cc" );
return result;
}
#endif /* i386 */
#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 */
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
#ifdef FT_MULFIX_ASSEMBLER
#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER
#endif
/* typeof condition taken from gnulib's `intprops.h' header file */
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
#else
#define FT_TYPEOF( type ) /* empty */
#endif
/* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */
/* a function that gets used only within the scope of a module. */
/* Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */
/* FT_LOCAL_ARRAY_DEF. */
/* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
@ -508,7 +423,16 @@ FT_BEGIN_HEADER
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
#define FT_LOCAL_ARRAY( x ) extern const x
#define FT_LOCAL_ARRAY_DEF( x ) const x
/* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header */
/* file in the `include/freetype/internal' directory, and the */
/* function body is in a file in `src/base'. */
/* */
#ifndef FT_BASE
#ifdef __cplusplus
@ -531,14 +455,63 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. */
/* */
/* To export a variable, use FT_EXPORT_VAR. */
/* */
#ifndef FT_EXPORT
#ifdef __cplusplus
#ifdef FT2_BUILD_LIBRARY
#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) )
#define FT_EXPORT( x ) __declspec( dllexport ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
#else
#if defined( FT2_DLLIMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
#endif
#endif /* !FT_EXPORT */
@ -574,7 +547,13 @@ FT_BEGIN_HEADER
/* functions which are accessed by (global) function pointers. */
/* */
/* */
/* FT_CALLBACK_DEF is used to _define_ a callback function. */
/* FT_CALLBACK_DEF is used to _define_ a callback function, */
/* located in the same source code file as the structure that uses */
/* it. */
/* */
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
/* and define a callback function, respectively, in a similar way */
/* as FT_BASE and FT_BASE_DEF work. */
/* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */
@ -594,6 +573,16 @@ FT_BEGIN_HEADER
#endif
#endif /* FT_CALLBACK_DEF */
#ifndef FT_BASE_CALLBACK
#ifdef __cplusplus
#define FT_BASE_CALLBACK( x ) extern "C" x
#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_BASE_CALLBACK( x ) extern x
#define FT_BASE_CALLBACK_DEF( x ) x
#endif
#endif /* FT_BASE_CALLBACK */
#ifndef FT_CALLBACK_TABLE
#ifdef __cplusplus
#define FT_CALLBACK_TABLE extern "C"
@ -608,7 +597,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTCONFIG_H__ */
#endif /* FTCONFIG_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2008, 2010, 2012, 2013 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -15,8 +15,8 @@
/* */
/***************************************************************************/
#ifndef __FT_HEADER_H__
#define __FT_HEADER_H__
#ifndef FTHEADER_H_
#define FTHEADER_H_
/*@***********************************************************************/
@ -315,6 +315,19 @@
#define FT_RENDER_H <freetype/ftrender.h>
/*************************************************************************
*
* @macro:
* FT_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* structures and macros related to the driver modules.
*
*/
#define FT_DRIVER_H <freetype/ftdriver.h>
/*************************************************************************
*
* @macro:
@ -324,8 +337,10 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the auto-hinting module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_AUTOHINTER_H <freetype/ftautoh.h>
#define FT_AUTOHINTER_H FT_DRIVER_H
/*************************************************************************
@ -337,8 +352,40 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the CFF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_CFF_DRIVER_H <freetype/ftcffdrv.h>
#define FT_CFF_DRIVER_H FT_DRIVER_H
/*************************************************************************
*
* @macro:
* FT_TRUETYPE_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* structures and macros related to the TrueType driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
/*************************************************************************
*
* @macro:
* FT_PCF_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* structures and macros related to the PCF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_PCF_DRIVER_H FT_DRIVER_H
/*************************************************************************
@ -528,63 +575,6 @@
#define FT_CACHE_H <freetype/ftcache.h>
/*************************************************************************
*
* @macro:
* FT_CACHE_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `glyph image' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for @FT_Glyph elements. You can also
* use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
* store small glyph bitmaps, as it will use less memory.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* glyph image-related cache declarations.
*
*/
#define FT_CACHE_IMAGE_H FT_CACHE_H
/*************************************************************************
*
* @macro:
* FT_CACHE_SMALL_BITMAPS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `small bitmaps' API of the FreeType~2 cache sub-system.
*
* It is used to define a cache for small glyph bitmaps in a relatively
* memory-efficient way. You can also use the API defined in
* @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
* including scalable outlines.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* small bitmaps-related cache declarations.
*
*/
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
/*************************************************************************
*
* @macro:
* FT_CACHE_CHARMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* `charmap' API of the FreeType~2 cache sub-system.
*
* This macro is deprecated. Simply include @FT_CACHE_H to have all
* charmap-based cache declarations.
*
*/
#define FT_CACHE_CHARMAP_H FT_CACHE_H
/*************************************************************************
*
* @macro:
@ -697,14 +687,16 @@
/*************************************************************************
*
* @macro:
* FT_XFREE86_H
* FT_FONT_FORMATS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which provides functions specific to the XFree86 and
* X.Org X11 servers.
* FreeType~2 API which provides functions specific to font formats.
*/
#define FT_XFREE86_H <freetype/ftxf86.h>
#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
/* deprecated */
#define FT_XFREE86_H FT_FONT_FORMATS_H
/*************************************************************************
@ -732,18 +724,6 @@
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
/*************************************************************************
*
* @macro:
* FT_UNPATENTED_HINTING_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
/*************************************************************************
*
* @macro:
@ -751,7 +731,7 @@
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
* FreeType~2 API which performs incremental glyph loading.
*/
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
@ -782,29 +762,34 @@
/* */
/* These header files don't need to be included by the user. */
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
#define FT_PARAMETER_TAGS_H <freetype/ftparams.h>
/* Deprecated macros. */
#define FT_UNPATENTED_HINTING_H <freetype/ftparams.h>
#define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h>
/* FT_CACHE_H is the only header file needed for the cache subsystem. */
#define FT_CACHE_IMAGE_H FT_CACHE_H
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
#define FT_CACHE_CHARMAP_H FT_CACHE_H
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* */
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
#define FT_CACHE_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_CACHE_H FT_CACHE_H
#define FT_CACHE_INTERNAL_GLYPH_H FT_CACHE_H
#define FT_CACHE_INTERNAL_IMAGE_H FT_CACHE_H
#define FT_CACHE_INTERNAL_SBITS_H FT_CACHE_H
/*
* Include internal headers definitions from <freetype/internal/...>
* Include internal headers definitions from <internal/...>
* only when building the library.
*/
#ifdef FT2_BUILD_LIBRARY
@ -813,7 +798,7 @@
#endif /* FT2_BUILD_LIBRARY */
#endif /* __FT2_BUILD_H__ */
#endif /* FTHEADER_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
/* Copyright 1996-2013 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTOPTION_H__
#define __FTOPTION_H__
#ifndef FTOPTION_H_
#define FTOPTION_H_
#include <ft2build.h>
@ -61,7 +61,7 @@ FT_BEGIN_HEADER
/* that are statically linked to the library at compile time. By */
/* default, this file is <freetype/config/ftmodule.h>. */
/* */
/* We highly recommend using the third method whenever possible. */
/* We highly recommend using the third method whenever possible. */
/* */
/*************************************************************************/
@ -75,22 +75,52 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*#***********************************************************************/
/* */
/* If you enable this configuration option, FreeType recognizes an */
/* environment variable called `FREETYPE_PROPERTIES', which can be used */
/* to control the various font drivers and modules. The controllable */
/* properties are listed in the section @properties. */
/* */
/* You have to undefine this configuration option on platforms that lack */
/* the concept of environment variables (and thus don't have the */
/* `getenv' function), for example Windows CE. */
/* */
/* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
/* multiple lines for better readability). */
/* */
/* { */
/* <optional whitespace> */
/* <module-name1> ':' */
/* <property-name1> '=' <property-value1> */
/* <whitespace> */
/* <module-name2> ':' */
/* <property-name2> '=' <property-value2> */
/* ... */
/* } */
/* */
/* Example: */
/* */
/* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
/* cff:no-stem-darkening=1 \ */
/* autofitter:warping=1 */
/* */
#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
/*************************************************************************/
/* */
/* Uncomment the line below if you want to activate sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* Uncomment the line below if you want to activate LCD rendering */
/* technology similar to ClearType in this build of the library. This */
/* technology triples the resolution in the direction color subpixels. */
/* To mitigate color fringes inherent to this technology, you also need */
/* to explicitly set up LCD filtering. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
/* the original size in case this macro isn't defined; however, each */
/* triplet of subpixels has R=G=B. */
/* */
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* When this macro is not defined, FreeType offers alternative LCD */
/* rendering technology that produces excellent output without LCD */
/* filtering. */
/* */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
@ -184,7 +214,11 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
#define FT_CONFIG_OPTION_SYSTEM_ZLIB
/*************************************************************************/
@ -200,7 +234,11 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
/* #define FT_CONFIG_OPTION_USE_BZIP2 */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
#define FT_CONFIG_OPTION_USE_BZIP2
/*************************************************************************/
@ -216,44 +254,37 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* DLL export compilation */
/* PNG bitmap support. */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
/* special keyword in front OR after the return type of function */
/* declarations. */
/* FreeType now handles loading color bitmap glyphs in the PNG format. */
/* This requires help from the external libpng library. Uncompressed */
/* color bitmaps do not need any external libraries and will be */
/* supported regardless of this configuration. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* Define this macro if you want to enable this `feature'. */
/* */
/* FT_EXPORT( return_type ) */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
/* is used in a function declaration, as in */
#define FT_CONFIG_OPTION_USE_PNG
/*************************************************************************/
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* HarfBuzz support. */
/* */
/* FreeType uses the HarfBuzz library to improve auto-hinting of */
/* OpenType fonts. If available, many glyphs not directly addressable */
/* by a font's character map will be hinted also. */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* Define this macro if you want to enable this `feature'. */
/* */
/* is used in a function definition, as in */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
/* #undef FT_CONFIG_OPTION_USE_HARFBUZZ */
/*************************************************************************/
@ -270,7 +301,7 @@ FT_BEGIN_HEADER
/* */
/* - The TrueType driver will provide its own set of glyph names, */
/* if you build it to support postscript names in the TrueType */
/* `post' table. */
/* `post' table, but will not synthesize a missing Unicode charmap. */
/* */
/* - The Type 1 driver will not be able to synthesize a Unicode */
/* charmap out of the glyphs found in the fonts. */
@ -351,10 +382,6 @@ FT_BEGIN_HEADER
/* The size in bytes of the render pool used by the scan-line converter */
/* to do all of its work. */
/* */
/* This must be greater than 4KByte if you use FreeType to rasterize */
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
/* allocation of the render pool. */
/* */
#define FT_RENDER_POOL_SIZE 16384L
@ -408,6 +435,8 @@ FT_BEGIN_HEADER
/* af_glyph_hints_dump_points */
/* af_glyph_hints_dump_segments */
/* af_glyph_hints_dump_edges */
/* af_glyph_hints_get_num_segments */
/* af_glyph_hints_get_segment_offset */
/* */
/* As an argument, they use another global variable: */
/* */
@ -467,7 +496,21 @@ FT_BEGIN_HEADER
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
/* fixups, such as BREW. */
/* fixups, such as BREW. [Note that standard compilers like gcc or */
/* clang handle PIC generation automatically; you don't have to set */
/* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
/* compilers.] */
/* */
/* Note that FT_CONFIG_OPTION_PIC support is not available for all */
/* modules (see `modules.cfg' for a complete list). For building with */
/* FT_CONFIG_OPTION_PIC support, do the following. */
/* */
/* 0. Clone the repository. */
/* 1. Define FT_CONFIG_OPTION_PIC. */
/* 2. Remove all subdirectories in `src' that don't have */
/* FT_CONFIG_OPTION_PIC support. */
/* 3. Comment out the corresponding modules in `modules.cfg'. */
/* 4. Compile. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
@ -514,7 +557,7 @@ FT_BEGIN_HEADER
/* does not contain any glyph name though. */
/* */
/* Accessing SFNT names is done through the functions declared in */
/* `freetype/ftsnames.h'. */
/* `ftsnames.h'. */
/* */
#define TT_CONFIG_OPTION_SFNT_NAMES
@ -555,92 +598,68 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
/* replaces the native TrueType hinting mechanism when anything but */
/* FT_RENDER_MODE_MONO is requested. */
/* subpixel hinting support into the TrueType driver. This modifies the */
/* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
/* requested. */
/* */
/* Enabling this causes the TrueType driver to ignore instructions under */
/* certain conditions. This is done in accordance with the guide here, */
/* with some minor differences: */
/* In particular, it modifies the bytecode interpreter to interpret (or */
/* not) instructions in a certain way so that all TrueType fonts look */
/* like they do in a Windows ClearType (DirectWrite) environment. See */
/* [1] for a technical overview on what this means. See `ttinterp.h' */
/* for more details on the LEAN option. */
/* */
/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* There are three possible values. */
/* */
/* By undefining this, you only compile the code necessary to hint */
/* TrueType glyphs with native TT hinting. */
/* Value 1: */
/* This value is associated with the `Infinality' moniker, */
/* contributed by an individual nicknamed Infinality with the goal of */
/* making TrueType fonts render better than on Windows. A high */
/* amount of configurability and flexibility, down to rules for */
/* single glyphs in fonts, but also very slow. Its experimental and */
/* slow nature and the original developer losing interest meant that */
/* this option was never enabled in default builds. */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* The corresponding interpreter version is v38. */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/*************************************************************************/
/* Value 2: */
/* The new default mode for the TrueType driver. The Infinality code */
/* base was stripped to the bare minimum and all configurability */
/* removed in the name of speed and simplicity. The configurability */
/* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
/* Courier. Legacy fonts are fonts that modify vertical stems to */
/* achieve clean black-and-white bitmaps. The new mode focuses on */
/* applying a minimal set of rules to all fonts indiscriminately so */
/* that modern and web fonts render well while legacy fonts render */
/* okay. */
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. The patents related to */
/* TrueType hinting have expired worldwide since May 2010; this option */
/* is now deprecated. */
/* The corresponding interpreter version is v40. */
/* */
/* 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. */
/* Value 3: */
/* Compile both, making both v38 and v40 available (the latter is the */
/* default). */
/* */
/* This macro is only useful for a small number of font files (mostly */
/* for Asian scripts) that require bytecode interpretation to properly */
/* load glyphs. For all other fonts, this produces unpleasant results, */
/* thus the unpatented interpreter is never used to load glyphs from */
/* TrueType fonts unless one of the following two options is used. */
/* By undefining these, you get rendering behavior like on Windows */
/* without ClearType, i.e., Windows XP without ClearType enabled and */
/* Win9x (interpreter version v35). Or not, depending on how much */
/* hinting blood and testing tears the font designer put into a given */
/* font. If you define one or both subpixel hinting options, you can */
/* switch between between v35 and the ones you define (using */
/* `FT_Property_Set'). */
/* */
/* - The unpatented interpreter is explicitly activated by the user */
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
/* when opening the FT_Face. */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* */
/* - FreeType detects that the FT_Face corresponds to one of the */
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
/* contains a hard-coded list of font names and other matching */
/* parameters (see function `tt_face_init' in file */
/* `src/truetype/ttobjs.c'). */
/* [1] https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
/* */
/* { */
/* FT_Parameter parameter; */
/* FT_Open_Args open_args; */
/* */
/* */
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
/* */
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
/* open_args.pathname = my_font_pathname; */
/* open_args.num_params = 1; */
/* open_args.params = &parameter; */
/* */
/* error = FT_Open_Face( library, &open_args, index, &face ); */
/* ... */
/* } */
/* */
#define TT_CONFIG_OPTION_UNPATENTED_HINTING
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
/* bytecode interpreter with a huge switch statement, rather than a call */
/* table. This results in smaller and faster code for a number of */
/* architectures. */
/* */
/* Note however that on some compiler/processor combinations, undefining */
/* this macro will generate faster, though larger, code. */
/* */
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
/*************************************************************************/
@ -656,8 +675,8 @@ FT_BEGIN_HEADER
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
/* http://www.microsoft.com/typography/otspec/glyf.htm */
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
/* https://www.microsoft.com/typography/otspec/glyf.htm */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@ -680,6 +699,24 @@ FT_BEGIN_HEADER
#define TT_CONFIG_OPTION_BDF
/*************************************************************************/
/* */
/* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */
/* number of bytecode instructions executed for a single run of the */
/* bytecode interpreter, needed to prevent infinite loops. You don't */
/* want to change this except for very special situations (e.g., making */
/* a library fuzzer spend less time to handle broken fonts). */
/* */
/* It is not expected that this value is ever modified by a configuring */
/* script; instead, it gets surrounded with #ifndef ... #endif so that */
/* the value can be set as a preprocessor option on the compiler's */
/* command line. */
/* */
#ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES
#define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L
#endif
/*************************************************************************/
/*************************************************************************/
/**** ****/
@ -735,6 +772,86 @@ FT_BEGIN_HEADER
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
/*************************************************************************/
/* */
/* T1_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe Type 1 */
/* engine gets compiled into FreeType. If defined, it is possible to */
/* switch between the two engines using the `hinting-engine' property of */
/* the type1 driver module. */
/* */
/* #define T1_CONFIG_OPTION_OLD_ENGINE */
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** C F F D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */
/* possible to set up the default values of the four control points that */
/* define the stem darkening behaviour of the (new) CFF engine. For */
/* more details please read the documentation of the */
/* `darkening-parameters' property (file `ftdriver.h'), which allows the */
/* control at run-time. */
/* */
/* Do *not* undefine these macros! */
/* */
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333
#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0
/*************************************************************************/
/* */
/* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
/* engine gets compiled into FreeType. If defined, it is possible to */
/* switch between the two engines using the `hinting-engine' property of */
/* the cff driver module. */
/* */
/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** P C F D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* There are many PCF fonts just called `Fixed' which look completely */
/* different, and which have nothing to do with each other. When */
/* selecting `Fixed' in KDE or Gnome one gets results that appear rather */
/* random, the style changes often if one changes the size and one */
/* cannot select some fonts at all. This option makes the PCF module */
/* prepend the foundry name (plus a space) to the family name. */
/* */
/* We also check whether we have `wide' characters; all put together, we */
/* get family names like `Sony Fixed' or `Misc Fixed Wide'. */
/* */
/* If this option is activated, it can be controlled with the */
/* `no-long-family-names' property of the pcf driver module. */
/* */
/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
/*************************************************************************/
/*************************************************************************/
/**** ****/
@ -753,7 +870,9 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* Compile autofit module with Indic script support. */
/* Compile autofit module with fallback Indic script support, covering */
/* some scripts that the `latin' submodule of the autofit module doesn't */
/* (yet) handle. */
/* */
#define AF_CONFIG_OPTION_INDIC
@ -765,63 +884,94 @@ FT_BEGIN_HEADER
/* 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. */
/* This experimental option is active only if the rendering mode is */
/* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */
/* `warping' property of the auto-hinter (see file `ftdriver.h' for more */
/* information; by default it is switched off). */
/* */
/* #define AF_CONFIG_OPTION_USE_WARPER */
#define AF_CONFIG_OPTION_USE_WARPER
/*************************************************************************/
/* */
/* Use TrueType-like size metrics for `light' auto-hinting. */
/* */
/* It is strongly recommended to avoid this option, which exists only to */
/* help some legacy applications retain its appearance and behaviour */
/* with respect to auto-hinted TrueType fonts. */
/* */
/* The very reason this option exists at all are GNU/Linux distributions */
/* like Fedora that did not un-patch the following change (which was */
/* present in FreeType between versions 2.4.6 and 2.7.1, inclusive). */
/* */
/* 2011-07-16 Steven Chu <steven.f.chu@gmail.com> */
/* */
/* [truetype] Fix metrics on size request for scalable fonts. */
/* */
/* This problematic commit is now reverted (more or less). */
/* */
/* #define AF_CONFIG_OPTION_TT_SIZE_METRICS */
/* */
/*
* Define this variable if you want to keep the layout of internal
* structures that was used prior to FreeType 2.2. This also compiles in
* a few obsolete functions to avoid linking problems on typical Unix
* distributions.
*
* For embedded systems or building a new distribution from scratch, it
* is recommended to disable the macro since it reduces the library's code
* size and activates a few memory-saving optimizations as well.
* This macro is obsolete. Support has been removed in FreeType
* version 2.5.
*/
/* #define FT_CONFIG_OPTION_OLD_INTERNALS */
/*
* To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
* we restrict the number of charmaps in a font. The current API of
* FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
* takes charcode only. To determine the passed value is for cmap_index
* or charcode, the possible cmap_index is restricted not to exceed
* the minimum possible charcode by a rogue client. It is also very
* unlikely that a rogue client is interested in Unicode values 0 to 15.
*
* NOTE: The original threshold was 4 deduced from popular number of
* cmap subtables in UCS-4 TrueType fonts, but now it is not
* irregular for OpenType fonts to have more than 4 subtables,
* because variation selector subtables are available for Apple
* and Microsoft platforms.
* This macro is defined if native TrueType hinting is requested by the
* definitions above.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_MAX_CHARMAP_CACHEABLE 15
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
#endif
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif
#endif
/*
* This macro is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
* Check CFF darkening parameters. The checks are the same as in function
* `cff_property_set' in file `cffdrivr.c'.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
#define TT_USE_BYTECODE_INTERPRETER
#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \
\
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \
\
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \
\
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
#error "Invalid CFF darkening parameters!"
#endif
FT_END_HEADER
#endif /* __FTOPTION_H__ */
#endif /* FTOPTION_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002-2007, 2009, 2011-2012 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -23,14 +23,13 @@
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines __FTSTDLIB_H__ before this one to override */
/* it. */
/* Load a file which defines FTSTDLIB_H_ before this one to override it. */
/* */
/*************************************************************************/
#ifndef __FTSTDLIB_H__
#define __FTSTDLIB_H__
#ifndef FTSTDLIB_H_
#define FTSTDLIB_H_
#include <stddef.h>
@ -64,6 +63,8 @@
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
@ -141,8 +142,8 @@
/**********************************************************************/
#define ft_atol atol
#define ft_labs labs
#define ft_strtol strtol
#define ft_getenv getenv
/**********************************************************************/
@ -168,7 +169,7 @@
#include <stdarg.h>
#endif /* __FTSTDLIB_H__ */
#endif /* FTSTDLIB_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (specification only). */
/* */
/* Copyright 2008 by */
/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTADVANC_H__
#define __FTADVANC_H__
#ifndef FTADVANC_H_
#define FTADVANC_H_
#include <ft2build.h>
@ -48,6 +48,11 @@ FT_BEGIN_HEADER
* @description:
* This section contains functions to quickly extract advance values
* without handling glyph outlines, if possible.
*
* @order:
* FT_Get_Advance
* FT_Get_Advances
*
*/
@ -64,15 +69,15 @@ FT_BEGIN_HEADER
/* corresponding hinting mode or font driver doesn't allow for very */
/* quick advance computation. */
/* */
/* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
/* Typically, glyphs that are either unscaled, unhinted, bitmapped, */
/* or light-hinted can have their advance width computed very */
/* quickly. */
/* */
/* Normal and bytecode hinted modes, which require loading, scaling, */
/* Normal and bytecode hinted modes that require loading, scaling, */
/* and hinting of the glyph outline, are extremely slow by */
/* comparison. */
/* */
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
/*************************************************************************/
@ -82,8 +87,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Retrieve the advance value of a given glyph outline in an */
/* @FT_Face. By default, the unhinted advance is returned in font */
/* units. */
/* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
@ -94,8 +98,9 @@ FT_BEGIN_HEADER
/* calling @FT_Load_Glyph, used to determine what kind */
/* of advances you need. */
/* <Output> */
/* padvance :: The advance value, in either font units or 16.16 */
/* format. */
/* padvance :: The advance value. If scaling is performed (based on */
/* the value of `load_flags'), the advance value is in */
/* 16.16 format. Otherwise, it is in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
/* vertical advance corresponding to a vertical layout. */
@ -127,8 +132,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Retrieve the advance values of several glyph outlines in an */
/* @FT_Face. By default, the unhinted advances are returned in font */
/* units. */
/* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
@ -141,8 +145,12 @@ FT_BEGIN_HEADER
/* calling @FT_Load_Glyph. */
/* */
/* <Output> */
/* padvance :: The advances, in either font units or 16.16 format. */
/* This array must contain at least `count' elements. */
/* padvance :: The advance values. This array, to be provided by the */
/* caller, must contain at least `count' elements. */
/* */
/* If scaling is performed (based on the value of */
/* `load_flags'), the advance values are in 16.16 format. */
/* Otherwise, they are in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
/* vertical advances corresponding to a vertical layout. */
@ -168,12 +176,12 @@ FT_BEGIN_HEADER
FT_Int32 load_flags,
FT_Fixed *padvances );
/* */
/* */
FT_END_HEADER
#endif /* __FTADVANC_H__ */
#endif /* FTADVANC_H_ */
/* END */

View File

@ -1,349 +0,0 @@
/***************************************************************************/
/* */
/* ftautoh.h */
/* */
/* FreeType API for controlling the auto-hinter (specification only). */
/* */
/* Copyright 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTAUTOH_H__
#define __FTAUTOH_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:
* auto_hinter
*
* @title:
* The auto-hinter
*
* @abstract:
* Controlling the auto-hinting module.
*
* @description:
* While FreeType's auto-hinter doesn't expose API functions by itself,
* it is possible to control its behaviour with @FT_Property_Set and
* @FT_Property_Get. The following lists the available properties
* together with the necessary macros and structures.
*
* Note that the auto-hinter's module name is `autofitter' for
* historical reasons.
*
*/
/**************************************************************************
*
* @property:
* glyph-to-script-map
*
* @description:
* The auto-hinter provides various script modules to hint glyphs.
* Examples of supported scripts are Latin or CJK. Before a glyph is
* auto-hinted, the Unicode character map of the font gets examined, and
* the script is then determined based on Unicode character ranges, see
* below.
*
* OpenType fonts, however, often provide much more glyphs than
* character codes (small caps, superscripts, ligatures, swashes, etc.),
* to be controlled by so-called `features'. Handling OpenType features
* can be quite complicated and thus needs a separate library on top of
* FreeType.
*
* The mapping between glyph indices and scripts (in the auto-hinter
* sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
* array with `num_glyphs' elements, as found in the font's @FT_Face
* structure. The `glyph-to-script-map' property returns a pointer to
* this array which can be modified as needed. Note that the
* modification should happen before the first glyph gets processed by
* the auto-hinter so that the global analysis of the font shapes
* actually uses the modified mapping.
*
* The following example code demonstrates how to access it (omitting
* the error handling).
*
* {
* FT_Library library;
* FT_Face face;
* FT_Prop_GlyphToScriptMap prop;
*
*
* FT_Init_FreeType( &library );
* FT_New_Face( library, "foo.ttf", 0, &face );
*
* prop.face = face;
*
* FT_Property_Get( library, "autofitter",
* "glyph-to-script-map", &prop );
*
* // adjust `prop.map' as needed right here
*
* FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
* }
*
*/
/**************************************************************************
*
* @enum:
* FT_AUTOHINTER_SCRIPT_XXX
*
* @description:
* A list of constants used for the @glyph-to-script-map property to
* specify the script submodule the auto-hinter should use for hinting a
* particular glyph.
*
* @values:
* FT_AUTOHINTER_SCRIPT_NONE ::
* Don't auto-hint this glyph.
*
* FT_AUTOHINTER_SCRIPT_LATIN ::
* Apply the latin auto-hinter. For the auto-hinter, `latin' is a
* very broad term, including Cyrillic and Greek also since characters
* from those scripts share the same design constraints.
*
* By default, characters from the following Unicode ranges are
* assigned to this submodule.
*
* {
* U+0020 - U+007F // Basic Latin (no control characters)
* U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
* U+0100 - U+017F // Latin Extended-A
* U+0180 - U+024F // Latin Extended-B
* U+0250 - U+02AF // IPA Extensions
* U+02B0 - U+02FF // Spacing Modifier Letters
* U+0300 - U+036F // Combining Diacritical Marks
* U+0370 - U+03FF // Greek and Coptic
* U+0400 - U+04FF // Cyrillic
* U+0500 - U+052F // Cyrillic Supplement
* U+1D00 - U+1D7F // Phonetic Extensions
* U+1D80 - U+1DBF // Phonetic Extensions Supplement
* U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
* U+1E00 - U+1EFF // Latin Extended Additional
* U+1F00 - U+1FFF // Greek Extended
* U+2000 - U+206F // General Punctuation
* U+2070 - U+209F // Superscripts and Subscripts
* U+20A0 - U+20CF // Currency Symbols
* U+2150 - U+218F // Number Forms
* U+2460 - U+24FF // Enclosed Alphanumerics
* U+2C60 - U+2C7F // Latin Extended-C
* U+2DE0 - U+2DFF // Cyrillic Extended-A
* U+2E00 - U+2E7F // Supplemental Punctuation
* U+A640 - U+A69F // Cyrillic Extended-B
* U+A720 - U+A7FF // Latin Extended-D
* U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
* U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
* U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
* }
*
* FT_AUTOHINTER_SCRIPT_CJK ::
* Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
* Vietnamese, and some other scripts.
*
* By default, characters from the following Unicode ranges are
* assigned to this submodule.
*
* {
* U+1100 - U+11FF // Hangul Jamo
* U+2E80 - U+2EFF // CJK Radicals Supplement
* U+2F00 - U+2FDF // Kangxi Radicals
* U+2FF0 - U+2FFF // Ideographic Description Characters
* U+3000 - U+303F // CJK Symbols and Punctuation
* U+3040 - U+309F // Hiragana
* U+30A0 - U+30FF // Katakana
* U+3100 - U+312F // Bopomofo
* U+3130 - U+318F // Hangul Compatibility Jamo
* U+3190 - U+319F // Kanbun
* U+31A0 - U+31BF // Bopomofo Extended
* U+31C0 - U+31EF // CJK Strokes
* U+31F0 - U+31FF // Katakana Phonetic Extensions
* U+3200 - U+32FF // Enclosed CJK Letters and Months
* U+3300 - U+33FF // CJK Compatibility
* U+3400 - U+4DBF // CJK Unified Ideographs Extension A
* U+4DC0 - U+4DFF // Yijing Hexagram Symbols
* U+4E00 - U+9FFF // CJK Unified Ideographs
* U+A960 - U+A97F // Hangul Jamo Extended-A
* U+AC00 - U+D7AF // Hangul Syllables
* U+D7B0 - U+D7FF // Hangul Jamo Extended-B
* U+F900 - U+FAFF // CJK Compatibility Ideographs
* U+FE10 - U+FE1F // Vertical forms
* U+FE30 - U+FE4F // CJK Compatibility Forms
* U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
* U+1B000 - U+1B0FF // Kana Supplement
* U+1D300 - U+1D35F // Tai Xuan Hing Symbols
* U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
* U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
* U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
* U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
* U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
* }
*
* FT_AUTOHINTER_SCRIPT_INDIC ::
* Apply the indic auto-hinter, covering all major scripts from the
* Indian sub-continent and some other related scripts like Thai, Lao,
* or Tibetan.
*
* By default, characters from the following Unicode ranges are
* assigned to this submodule.
*
* {
* U+0900 - U+0DFF // Indic Range
* U+0F00 - U+0FFF // Tibetan
* U+1900 - U+194F // Limbu
* U+1B80 - U+1BBF // Sundanese
* U+1C80 - U+1CDF // Meetei Mayak
* U+A800 - U+A82F // Syloti Nagri
* U+11800 - U+118DF // Sharada
* }
*
* Note that currently Indic support is rudimentary only, missing blue
* zone support.
*
*/
#define FT_AUTOHINTER_SCRIPT_NONE 0
#define FT_AUTOHINTER_SCRIPT_LATIN 1
#define FT_AUTOHINTER_SCRIPT_CJK 2
#define FT_AUTOHINTER_SCRIPT_INDIC 3
/**************************************************************************
*
* @struct:
* FT_Prop_GlyphToScriptMap
*
* @description:
* The data exchange structure for the @glyph-to-script-map property.
*
*/
typedef struct FT_Prop_GlyphToScriptMap_
{
FT_Face face;
FT_Byte* map;
} FT_Prop_GlyphToScriptMap;
/**************************************************************************
*
* @property:
* fallback-script
*
* @description:
* If no auto-hinter script module can be assigned to a glyph, a
* fallback script gets assigned to it (see also the
* @glyph-to-script-map property). By default, this is
* @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property,
* this fallback value can be changed.
*
* {
* FT_Library library;
* FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "autofitter",
* "fallback-script", &fallback_script );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* It's important to use the right timing for changing this value: The
* creation of the glyph-to-script map which eventually uses the
* fallback script value gets triggered either by setting or reading a
* face-specific property like @glyph-to-script-map, or by auto-hinting
* any glyph from that face. In particular, if you have already created
* an @FT_Face structure but not loaded any glyph (using the
* auto-hinter), a change of the fallback glyph will affect this face.
*
*/
/**************************************************************************
*
* @property:
* increase-x-height
*
* @description:
* For ppem values in the range 6~<= ppem <= `increase-x-height', round
* up the font's x~height much more often than normally. If the value
* is set to~0, which is the default, this feature is switched off. Use
* this property to improve the legibility of small font sizes if
* necessary.
*
* {
* FT_Library library;
* FT_Face face;
* FT_Prop_IncreaseXHeight prop;
*
*
* FT_Init_FreeType( &library );
* FT_New_Face( library, "foo.ttf", 0, &face );
* FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
*
* prop.face = face;
* prop.limit = 14;
*
* FT_Property_Set( library, "autofitter",
* "increase-x-height", &prop );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* Set this value right after calling @FT_Set_Char_Size, but before
* loading any glyph (using the auto-hinter).
*
*/
/**************************************************************************
*
* @struct:
* FT_Prop_IncreaseXHeight
*
* @description:
* The data exchange structure for the @increase-x-height property.
*
*/
typedef struct FT_Prop_IncreaseXHeight_
{
FT_Face face;
FT_UInt limit;
} FT_Prop_IncreaseXHeight;
/* */
FT_END_HEADER
#endif /* __FTAUTOH_H__ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2001, 2003, 2007, 2011 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -27,8 +27,8 @@
/*************************************************************************/
#ifndef __FTBBOX_H__
#define __FTBBOX_H__
#ifndef FTBBOX_H_
#define FTBBOX_H_
#include <ft2build.h>
@ -60,8 +60,8 @@ FT_BEGIN_HEADER
/* <Description> */
/* Compute the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm which returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bézier arcs are traversed to */
/* algorithm that returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bezier arcs are traversed to */
/* extract their extrema. */
/* */
/* <Input> */
@ -78,20 +78,19 @@ FT_BEGIN_HEADER
/* @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 */
/* properly shift and scale the subglyphs), then extracting the BBox, */
/* which can be eventually converted back to font units. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
/* */
FT_END_HEADER
#endif /* __FTBBOX_H__ */
#endif /* FTBBOX_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
/* Copyright 2002, 2003, 2004, 2006, 2009 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTBDF_H__
#define __FTBDF_H__
#ifndef FTBDF_H_
#define FTBDF_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -53,7 +53,7 @@ FT_BEGIN_HEADER
/**********************************************************************
*
* @enum:
* FT_PropertyType
* BDF_PropertyType
*
* @description:
* A list of BDF property types.
@ -106,7 +106,8 @@ FT_BEGIN_HEADER
* The property type.
*
* u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be
* NULL, indicating an empty string.
*
* u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
@ -199,11 +200,11 @@ FT_BEGIN_HEADER
const char* prop_name,
BDF_PropertyRec *aproperty );
/* */
/* */
FT_END_HEADER
#endif /* __FTBDF_H__ */
#endif /* FTBDF_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
/* Copyright 2004, 2005, 2006, 2008 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTBITMAP_H__
#define __FTBITMAP_H__
#ifndef FTBITMAP_H_
#define FTBITMAP_H_
#include <ft2build.h>
@ -45,7 +45,9 @@ FT_BEGIN_HEADER
/* Handling FT_Bitmap objects. */
/* */
/* <Description> */
/* This section contains functions for converting FT_Bitmap objects. */
/* This section contains functions for handling @FT_Bitmap objects. */
/* Note that none of the functions changes the bitmap's `flow' (as */
/* indicated by the sign of the `pitch' field in `FT_Bitmap'). */
/* */
/*************************************************************************/
@ -53,7 +55,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_New */
/* FT_Bitmap_Init */
/* */
/* <Description> */
/* Initialize a pointer to an @FT_Bitmap structure. */
@ -61,6 +63,14 @@ FT_BEGIN_HEADER
/* <InOut> */
/* abitmap :: A pointer to the bitmap structure. */
/* */
/* <Note> */
/* A deprecated name for the same function is `FT_Bitmap_New'. */
/* */
FT_EXPORT( void )
FT_Bitmap_Init( FT_Bitmap *abitmap );
/* deprecated */
FT_EXPORT( void )
FT_Bitmap_New( FT_Bitmap *abitmap );
@ -87,7 +97,7 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target);
FT_Bitmap *target );
/*************************************************************************/
@ -122,6 +132,9 @@ FT_BEGIN_HEADER
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
/* */
/* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */
/* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
@ -135,9 +148,9 @@ FT_BEGIN_HEADER
/* FT_Bitmap_Convert */
/* */
/* <Description> */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
/* bitmap object with depth 8bpp, making the number of used bytes per */
/* line (a.k.a. the `pitch') a multiple of `alignment'. */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
/* to a bitmap object with depth 8bpp, making the number of used */
/* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
@ -197,7 +210,7 @@ FT_BEGIN_HEADER
/* FT_Bitmap_Done */
/* */
/* <Description> */
/* Destroy a bitmap object created with @FT_Bitmap_New. */
/* Destroy a bitmap object initialized with @FT_Bitmap_Init. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
@ -221,7 +234,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTBITMAP_H__ */
#endif /* FTBITMAP_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Bzip2-compressed stream support. */
/* */
/* Copyright 2010 by */
/* Copyright 2010-2018 by */
/* Joel Klinghed. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTBZIP2_H__
#define __FTBZIP2_H__
#ifndef FTBZIP2_H_
#define FTBZIP2_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -91,12 +91,12 @@ FT_BEGIN_HEADER
FT_Stream_OpenBzip2( FT_Stream stream,
FT_Stream source );
/* */
/* */
FT_END_HEADER
#endif /* __FTBZIP2_H__ */
#endif /* FTBZIP2_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType Cache subsystem (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTCACHE_H__
#define __FTCACHE_H__
#ifndef FTCACHE_H_
#define FTCACHE_H_
#include <ft2build.h>
@ -156,7 +156,7 @@ FT_BEGIN_HEADER
* @note:
* Never use NULL as a valid @FTC_FaceID.
*
* Face IDs are passed by the client to the cache manager, which calls,
* Face IDs are passed by the client to the cache manager that calls,
* when needed, the @FTC_Face_Requester to translate them into new
* @FT_Face objects.
*
@ -209,22 +209,11 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FTC_Face_Requester)( FTC_FaceID face_id,
FT_Library library,
FT_Pointer request_data,
FT_Pointer req_data,
FT_Face* aface );
/* */
/* */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
/* these macros are incompatible with LLP64, should not be used */
#define FT_POINTER_TO_ULONG( p ) ( (FT_ULong)(FT_Pointer)(p) )
#define FTC_FACE_ID_HASH( i ) \
((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/
/*************************************************************************/
@ -381,7 +370,7 @@ FT_BEGIN_HEADER
/* should never try to discard it yourself. */
/* */
/* The @FT_Face object doesn't necessarily have a current size object */
/* (i.e., face->size can be 0). If you need a specific `font size', */
/* (i.e., face->size can be~0). If you need a specific `font size', */
/* use @FTC_Manager_LookupSize instead. */
/* */
/* Never change the face's transformation matrix (i.e., never call */
@ -551,13 +540,6 @@ FT_BEGIN_HEADER
FTC_FaceID face_id );
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
@ -634,14 +616,6 @@ FT_BEGIN_HEADER
FT_UInt32 char_code );
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@ -678,8 +652,8 @@ FT_BEGIN_HEADER
typedef struct FTC_ImageTypeRec_
{
FTC_FaceID face_id;
FT_Int width;
FT_Int height;
FT_UInt width;
FT_UInt height;
FT_Int32 flags;
} FTC_ImageTypeRec;
@ -705,17 +679,6 @@ FT_BEGIN_HEADER
(d1)->width == (d2)->width && \
(d1)->flags == (d2)->flags )
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
/* this macro is incompatible with LLP64, should not be used */
#define FTC_IMAGE_TYPE_HASH( d ) \
(FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
( (d)->width << 8 ) ^ (d)->height ^ \
( (d)->flags << 4 ) )
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/
/* */
@ -723,7 +686,7 @@ FT_BEGIN_HEADER
/* FTC_ImageCache */
/* */
/* <Description> */
/* A handle to an glyph image cache object. They are designed to */
/* A handle to a glyph image cache object. They are designed to */
/* hold many distinct glyph images while not exceeding a certain */
/* memory threshold. */
/* */
@ -771,7 +734,7 @@ FT_BEGIN_HEADER
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* anode :: Used to return the address of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
@ -824,7 +787,7 @@ FT_BEGIN_HEADER
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* anode :: Used to return the address of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
@ -979,7 +942,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* anode :: Used to return the address of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
@ -1034,7 +997,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* anode :: Used to return the address of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
@ -1068,73 +1031,12 @@ FT_BEGIN_HEADER
FTC_SBit *sbit,
FTC_Node *anode );
/* */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
/*@***********************************************************************/
/* */
/* <Struct> */
/* FTC_FontRec */
/* */
/* <Description> */
/* A simple structure used to describe a given `font' to the cache */
/* manager. Note that a `font' is the combination of a given face */
/* with a given character size. */
/* */
/* <Fields> */
/* face_id :: The ID of the face to use. */
/* */
/* pix_width :: The character width in integer pixels. */
/* */
/* pix_height :: The character height in integer pixels. */
/* */
typedef struct FTC_FontRec_
{
FTC_FaceID face_id;
FT_UShort pix_width;
FT_UShort pix_height;
} FTC_FontRec;
/* */
#define FTC_FONT_COMPARE( f1, f2 ) \
( (f1)->face_id == (f2)->face_id && \
(f1)->pix_width == (f2)->pix_width && \
(f1)->pix_height == (f2)->pix_height )
/* this macro is incompatible with LLP64, should not be used */
#define FTC_FONT_HASH( f ) \
(FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
((f)->pix_width << 8) ^ \
((f)->pix_height) )
typedef FTC_FontRec* FTC_Font;
FT_EXPORT( FT_Error )
FTC_Manager_Lookup_Face( FTC_Manager manager,
FTC_FaceID face_id,
FT_Face *aface );
FT_EXPORT( FT_Error )
FTC_Manager_Lookup_Size( FTC_Manager manager,
FTC_Font font,
FT_Face *aface,
FT_Size *asize );
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/* */
FT_END_HEADER
#endif /* __FTCACHE_H__ */
#endif /* FTCACHE_H_ */
/* END */

View File

@ -1,150 +0,0 @@
/***************************************************************************/
/* */
/* ftcffdrv.h */
/* */
/* FreeType API for controlling the CFF driver (specification only). */
/* */
/* Copyright 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTCFFDRV_H__
#define __FTCFFDRV_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* cff_driver
*
* @title:
* The CFF driver
*
* @abstract:
* Controlling the CFF driver module.
*
* @description:
* While FreeType's CFF driver doesn't expose API functions by itself,
* it is possible to control its behaviour with @FT_Property_Set and
* @FT_Property_Get. The following lists the available properties
* together with the necessary macros and structures.
*
* The CFF driver's module name is `cff'.
*
*/
/**************************************************************************
*
* @property:
* hinting-engine
*
* @description:
* Thanks to Adobe, which contributed a new hinting (and parsing)
* engine, an application can select between `freetype' and `adobe'.
*
* Right now, the default engine is `freetype'. However, this will
* change: After a certain time of intensive testing it is planned to
* make `adobe' the default due to its superior rendering results.
*
* The following example code demonstrates how to select Adobe's hinting
* engine (omitting the error handling).
*
* {
* FT_Library library;
* FT_Face face;
* FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "cff",
* "hinting-engine", &hinting_engine );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
*/
/**************************************************************************
*
* @enum:
* FT_CFF_HINTING_XXX
*
* @description:
* A list of constants used for the @hinting-engine property to select
* the hinting engine for CFF fonts.
*
* @values:
* FT_CFF_HINTING_FREETYPE ::
* Use the old FreeType hinting engine.
*
* FT_CFF_HINTING_ADOBE ::
* Use the hinting engine contributed by Adobe.
*
*/
#define FT_CFF_HINTING_FREETYPE 0
#define FT_CFF_HINTING_ADOBE 1
/**************************************************************************
*
* @property:
* no-stem-darkening
*
* @description:
* By default, the Adobe CFF engine darkens stems at smaller sizes,
* regardless of hinting, to enhance contrast. Setting this property,
* stem darkening gets switched off.
*
* Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
*
* {
* FT_Library library;
* FT_Face face;
* FT_Bool no_stem_darkening = TRUE;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "cff",
* "no-stem-darkening", &no_stem_darkening );
* }
*
* @note:
* This property can be used with @FT_Property_Get also.
*
*/
/* */
FT_END_HEADER
#endif /* __FTCFFDRV_H__ */
/* END */

View File

@ -1,7 +1,7 @@
/***************************************************************************/
/* */
/* This file defines the structure of the FreeType reference. */
/* It is used by the python script which generates the HTML files. */
/* It is used by the python script that generates the HTML files. */
/* */
/***************************************************************************/
@ -15,6 +15,7 @@
/* General Remarks */
/* */
/* <Sections> */
/* header_inclusion */
/* user_allocation */
/* */
/***************************************************************************/
@ -67,27 +68,19 @@
/***************************************************************************/
/* */
/* <Chapter> */
/* auto_hinter */
/* module_specific */
/* */
/* <Title> */
/* The Auto-Hinter */
/* Controlling FreeType Modules */
/* */
/* <Sections> */
/* auto_hinter */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* cff_driver */
/* */
/* <Title> */
/* The CFF Driver */
/* */
/* <Sections> */
/* cff_driver */
/* t1_cid_driver */
/* tt_driver */
/* pcf_driver */
/* properties */
/* parameter_tags */
/* */
/***************************************************************************/
@ -130,3 +123,17 @@
/* lcd_filtering */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* error_codes */
/* */
/* <Title> */
/* Error Codes */
/* */
/* <Sections> */
/* error_enumerations */
/* error_code_values */
/* */
/***************************************************************************/

View File

@ -4,7 +4,8 @@
/* */
/* FreeType API for accessing CID font information (specification). */
/* */
/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */
/* Copyright 2007-2018 by */
/* Dereg Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@ -15,8 +16,8 @@
/***************************************************************************/
#ifndef __FTCID_H__
#define __FTCID_H__
#ifndef FTCID_H_
#define FTCID_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -86,7 +87,7 @@ FT_BEGIN_HEADER
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry,
const char* *ordering,
FT_Int *supplement);
FT_Int *supplement );
/**********************************************************************
@ -96,8 +97,8 @@ FT_BEGIN_HEADER
*
* @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.
* contrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SFNT wrapper.
*
* @input:
* face ::
@ -156,11 +157,12 @@ FT_BEGIN_HEADER
FT_UInt glyph_index,
FT_UInt *cid );
/* */
/* */
FT_END_HEADER
#endif /* __FTCID_H__ */
#endif /* FTCID_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
/* */
/* FreeType error codes (specification). */
/* */
/* Copyright 2002, 2004, 2006, 2007, 2010-2013 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,234 +16,265 @@
/***************************************************************************/
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** LIST OF ERROR CODES/MESSAGES *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
/*************************************************************************/
/* */
/* <Section> */
/* error_code_values */
/* */
/* <Title> */
/* Error Code Values */
/* */
/* <Abstract> */
/* All possible error codes returned by FreeType functions. */
/* */
/* <Description> */
/* The list below is taken verbatim from the file `fterrdef.h' */
/* (loaded automatically by including `FT_FREETYPE_H'). The first */
/* argument of the `FT_ERROR_DEF_' macro is the error label; by */
/* default, the prefix `FT_Err_' gets added so that you get error */
/* names like `FT_Err_Cannot_Open_Resource'. The second argument is */
/* the error code, and the last argument an error string, which is not */
/* used by FreeType. */
/* */
/* Within your application you should *only* use error names and */
/* *never* its numeric values! The latter might (and actually do) */
/* change in forthcoming FreeType versions. */
/* */
/* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */
/* See the `Error Enumerations' subsection how to automatically */
/* generate a list of error strings. */
/* */
/*************************************************************************/
/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
/* including this file. */
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Err_XXX */
/* */
/*************************************************************************/
/* generic errors */
FT_NOERRORDEF_( Ok, 0x00, \
FT_NOERRORDEF_( Ok, 0x00,
"no error" )
FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
FT_ERRORDEF_( Cannot_Open_Resource, 0x01,
"cannot open resource" )
FT_ERRORDEF_( Unknown_File_Format, 0x02, \
FT_ERRORDEF_( Unknown_File_Format, 0x02,
"unknown file format" )
FT_ERRORDEF_( Invalid_File_Format, 0x03, \
FT_ERRORDEF_( Invalid_File_Format, 0x03,
"broken file" )
FT_ERRORDEF_( Invalid_Version, 0x04, \
FT_ERRORDEF_( Invalid_Version, 0x04,
"invalid FreeType version" )
FT_ERRORDEF_( Lower_Module_Version, 0x05, \
FT_ERRORDEF_( Lower_Module_Version, 0x05,
"module version is too low" )
FT_ERRORDEF_( Invalid_Argument, 0x06, \
FT_ERRORDEF_( Invalid_Argument, 0x06,
"invalid argument" )
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
FT_ERRORDEF_( Unimplemented_Feature, 0x07,
"unimplemented feature" )
FT_ERRORDEF_( Invalid_Table, 0x08, \
FT_ERRORDEF_( Invalid_Table, 0x08,
"broken table" )
FT_ERRORDEF_( Invalid_Offset, 0x09, \
FT_ERRORDEF_( Invalid_Offset, 0x09,
"broken offset within table" )
FT_ERRORDEF_( Array_Too_Large, 0x0A, \
FT_ERRORDEF_( Array_Too_Large, 0x0A,
"array allocation size too large" )
FT_ERRORDEF_( Missing_Module, 0x0B, \
FT_ERRORDEF_( Missing_Module, 0x0B,
"missing module" )
FT_ERRORDEF_( Missing_Property, 0x0C, \
FT_ERRORDEF_( Missing_Property, 0x0C,
"missing property" )
/* glyph/character errors */
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10,
"invalid glyph index" )
FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
FT_ERRORDEF_( Invalid_Character_Code, 0x11,
"invalid character code" )
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12,
"unsupported glyph image format" )
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13,
"cannot render this glyph format" )
FT_ERRORDEF_( Invalid_Outline, 0x14, \
FT_ERRORDEF_( Invalid_Outline, 0x14,
"invalid outline" )
FT_ERRORDEF_( Invalid_Composite, 0x15, \
FT_ERRORDEF_( Invalid_Composite, 0x15,
"invalid composite glyph" )
FT_ERRORDEF_( Too_Many_Hints, 0x16, \
FT_ERRORDEF_( Too_Many_Hints, 0x16,
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
"invalid pixel size" )
/* handle errors */
FT_ERRORDEF_( Invalid_Handle, 0x20, \
FT_ERRORDEF_( Invalid_Handle, 0x20,
"invalid object handle" )
FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
FT_ERRORDEF_( Invalid_Library_Handle, 0x21,
"invalid library handle" )
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22,
"invalid module handle" )
FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
FT_ERRORDEF_( Invalid_Face_Handle, 0x23,
"invalid face handle" )
FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
FT_ERRORDEF_( Invalid_Size_Handle, 0x24,
"invalid size handle" )
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25,
"invalid glyph slot handle" )
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26,
"invalid charmap handle" )
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27,
"invalid cache manager handle" )
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28,
"invalid stream handle" )
/* driver errors */
FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
FT_ERRORDEF_( Too_Many_Drivers, 0x30,
"too many modules" )
FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
FT_ERRORDEF_( Too_Many_Extensions, 0x31,
"too many extensions" )
/* memory errors */
FT_ERRORDEF_( Out_Of_Memory, 0x40, \
FT_ERRORDEF_( Out_Of_Memory, 0x40,
"out of memory" )
FT_ERRORDEF_( Unlisted_Object, 0x41, \
FT_ERRORDEF_( Unlisted_Object, 0x41,
"unlisted object" )
/* stream errors */
FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
FT_ERRORDEF_( Cannot_Open_Stream, 0x51,
"cannot open stream" )
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52,
"invalid stream seek" )
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53,
"invalid stream skip" )
FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
FT_ERRORDEF_( Invalid_Stream_Read, 0x54,
"invalid stream read" )
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55,
"invalid stream operation" )
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56,
"invalid frame operation" )
FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
FT_ERRORDEF_( Nested_Frame_Access, 0x57,
"nested frame access" )
FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
FT_ERRORDEF_( Invalid_Frame_Read, 0x58,
"invalid frame read" )
/* raster errors */
FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
FT_ERRORDEF_( Raster_Uninitialized, 0x60,
"raster uninitialized" )
FT_ERRORDEF_( Raster_Corrupted, 0x61, \
FT_ERRORDEF_( Raster_Corrupted, 0x61,
"raster corrupted" )
FT_ERRORDEF_( Raster_Overflow, 0x62, \
FT_ERRORDEF_( Raster_Overflow, 0x62,
"raster overflow" )
FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
FT_ERRORDEF_( Raster_Negative_Height, 0x63,
"negative height while rastering" )
/* cache errors */
FT_ERRORDEF_( Too_Many_Caches, 0x70, \
FT_ERRORDEF_( Too_Many_Caches, 0x70,
"too many registered caches" )
/* TrueType and SFNT errors */
FT_ERRORDEF_( Invalid_Opcode, 0x80, \
FT_ERRORDEF_( Invalid_Opcode, 0x80,
"invalid opcode" )
FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
FT_ERRORDEF_( Too_Few_Arguments, 0x81,
"too few arguments" )
FT_ERRORDEF_( Stack_Overflow, 0x82, \
FT_ERRORDEF_( Stack_Overflow, 0x82,
"stack overflow" )
FT_ERRORDEF_( Code_Overflow, 0x83, \
FT_ERRORDEF_( Code_Overflow, 0x83,
"code overflow" )
FT_ERRORDEF_( Bad_Argument, 0x84, \
FT_ERRORDEF_( Bad_Argument, 0x84,
"bad argument" )
FT_ERRORDEF_( Divide_By_Zero, 0x85, \
FT_ERRORDEF_( Divide_By_Zero, 0x85,
"division by zero" )
FT_ERRORDEF_( Invalid_Reference, 0x86, \
FT_ERRORDEF_( Invalid_Reference, 0x86,
"invalid reference" )
FT_ERRORDEF_( Debug_OpCode, 0x87, \
FT_ERRORDEF_( Debug_OpCode, 0x87,
"found debug opcode" )
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88,
"found ENDF opcode in execution stream" )
FT_ERRORDEF_( Nested_DEFS, 0x89, \
FT_ERRORDEF_( Nested_DEFS, 0x89,
"nested DEFS" )
FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
FT_ERRORDEF_( Invalid_CodeRange, 0x8A,
"invalid code range" )
FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
FT_ERRORDEF_( Execution_Too_Long, 0x8B,
"execution context too long" )
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C,
"too many function definitions" )
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D,
"too many instruction definitions" )
FT_ERRORDEF_( Table_Missing, 0x8E, \
FT_ERRORDEF_( Table_Missing, 0x8E,
"SFNT font table missing" )
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F,
"horizontal header (hhea) table missing" )
FT_ERRORDEF_( Locations_Missing, 0x90, \
FT_ERRORDEF_( Locations_Missing, 0x90,
"locations (loca) table missing" )
FT_ERRORDEF_( Name_Table_Missing, 0x91, \
FT_ERRORDEF_( Name_Table_Missing, 0x91,
"name table missing" )
FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
FT_ERRORDEF_( CMap_Table_Missing, 0x92,
"character map (cmap) table missing" )
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93,
"horizontal metrics (hmtx) table missing" )
FT_ERRORDEF_( Post_Table_Missing, 0x94, \
FT_ERRORDEF_( Post_Table_Missing, 0x94,
"PostScript (post) table missing" )
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95,
"invalid horizontal metrics" )
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96,
"invalid character map (cmap) format" )
FT_ERRORDEF_( Invalid_PPem, 0x97, \
FT_ERRORDEF_( Invalid_PPem, 0x97,
"invalid ppem value" )
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98,
"invalid vertical metrics" )
FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
FT_ERRORDEF_( Could_Not_Find_Context, 0x99,
"could not find context" )
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A,
"invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
"invalid PostScript (post) table" )
FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C,
"found FDEF or IDEF opcode in glyf bytecode" )
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
"missing bitmap in strike" )
/* CFF, CID, and Type 1 errors */
FT_ERRORDEF_( Syntax_Error, 0xA0, \
FT_ERRORDEF_( Syntax_Error, 0xA0,
"opcode syntax error" )
FT_ERRORDEF_( Stack_Underflow, 0xA1, \
FT_ERRORDEF_( Stack_Underflow, 0xA1,
"argument stack underflow" )
FT_ERRORDEF_( Ignore, 0xA2, \
FT_ERRORDEF_( Ignore, 0xA2,
"ignore" )
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
"no Unicode glyph name found" )
FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \
"glyph to big for hinting" )
FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
"glyph too big for hinting" )
/* BDF errors */
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0,
"`STARTFONT' field missing" )
FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
FT_ERRORDEF_( Missing_Font_Field, 0xB1,
"`FONT' field missing" )
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
FT_ERRORDEF_( Missing_Size_Field, 0xB2,
"`SIZE' field missing" )
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3,
"`FONTBOUNDINGBOX' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
FT_ERRORDEF_( Missing_Chars_Field, 0xB4,
"`CHARS' field missing" )
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5,
"`STARTCHAR' field missing" )
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6,
"`ENCODING' field missing" )
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7,
"`BBX' field missing" )
FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
FT_ERRORDEF_( Bbx_Too_Big, 0xB8,
"`BBX' too big" )
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9,
"Font header corrupted or missing fields" )
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
"Font glyphs corrupted or missing fields" )
/* */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType error code handling (specification). */
/* */
/* Copyright 1996-2002, 2004, 2007, 2013 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -18,70 +18,98 @@
/*************************************************************************/
/* */
/* This special header file is used to define the handling of FT2 */
/* enumeration constants. It can also be used to generate error message */
/* strings with a small macro trick explained below. */
/* <Section> */
/* error_enumerations */
/* */
/* I - Error Formats */
/* ----------------- */
/* <Title> */
/* Error Enumerations */
/* */
/* <Abstract> */
/* How to handle errors and error strings. */
/* */
/* <Description> */
/* The header file `fterrors.h' (which is automatically included by */
/* `freetype.h' defines the handling of FreeType's enumeration */
/* constants. It can also be used to generate error message strings */
/* with a small macro trick explained below. */
/* */
/* *Error* *Formats* */
/* */
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* defined in ftoption.h in order to make the higher byte indicate */
/* defined in `ftoption.h' in order to make the higher byte indicate */
/* the module where the error has happened (this is not compatible */
/* with standard builds of FreeType 2). See the file `ftmoderr.h' for */
/* more details. */
/* with standard builds of FreeType~2, however). See the file */
/* `ftmoderr.h' for more details. */
/* */
/* *Error* *Message* *Strings* */
/* */
/* II - Error Message strings */
/* -------------------------- */
/* */
/* The error definitions below are made through special macros that */
/* allow client applications to build a table of error message strings */
/* if they need it. The strings are not included in a normal build of */
/* FreeType 2 to save space (most client applications do not use */
/* them). */
/* Error definitions are set up with special macros that allow client */
/* applications to build a table of error message strings. The */
/* strings are not included in a normal build of FreeType~2 to save */
/* space (most client applications do not use them). */
/* */
/* To do so, you have to define the following macros before including */
/* this file: */
/* */
/* FT_ERROR_START_LIST :: */
/* This macro is called before anything else to define the start of */
/* the error list. It is followed by several FT_ERROR_DEF calls */
/* (see below). */
/* */
/* FT_ERROR_DEF( e, v, s ) :: */
/* This macro is called to define one single error. */
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
/* `v' is the error numerical value. */
/* `s' is the corresponding error string. */
/* */
/* FT_ERROR_END_LIST :: */
/* This macro ends the list. */
/* */
/* Additionally, you have to undefine __FTERRORS_H__ before #including */
/* this file. */
/* */
/* Here is a simple example: */
/* { */
/* FT_ERROR_START_LIST */
/* } */
/* */
/* This macro is called before anything else to define the start of */
/* the error list. It is followed by several FT_ERROR_DEF calls. */
/* */
/* { */
/* FT_ERROR_DEF( e, v, s ) */
/* } */
/* */
/* This macro is called to define one single error. `e' is the error */
/* code identifier (e.g., `Invalid_Argument'), `v' is the error's */
/* numerical value, and `s' is the corresponding error string. */
/* */
/* { */
/* FT_ERROR_END_LIST */
/* } */
/* */
/* This macro ends the list. */
/* */
/* Additionally, you have to undefine `FTERRORS_H_' before #including */
/* this file. */
/* */
/* Here is a simple example. */
/* */
/* { */
/* #undef FTERRORS_H_ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, NULL } }; */
/* */
/* const struct */
/* { */
/* #undef __FTERRORS_H__ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
/* int err_code; */
/* const char* err_msg; */
/* } ft_errors[] = */
/* */
/* const struct */
/* { */
/* int err_code; */
/* const char* err_msg; */
/* } ft_errors[] = */
/* #include FT_ERRORS_H */
/* } */
/* */
/* #include FT_ERRORS_H */
/* } */
/* Note that `FT_Err_Ok' is _not_ defined with `FT_ERRORDEF' but with */
/* `FT_NOERRORDEF'; it is always zero. */
/* */
/*************************************************************************/
/* */
#ifndef __FTERRORS_H__
/* In previous FreeType versions we used `__FTERRORS_H__'. However, */
/* using two successive underscores in a non-system symbol name */
/* violates the C (and C++) standard, so it was changed to the */
/* current form. In spite of this, we have to make */
/* */
/* #undefine __FTERRORS_H__ */
/* */
/* work for backward compatibility. */
/* */
#if !( defined( FTERRORS_H_ ) && defined ( __FTERRORS_H__ ) )
#define FTERRORS_H_
#define __FTERRORS_H__
@ -192,7 +220,7 @@
#undef FT_ERR_PREFIX
#endif
#endif /* __FTERRORS_H__ */
#endif /* !(FTERRORS_H_ && __FTERRORS_H__) */
/* END */

View File

@ -1,10 +1,10 @@
/***************************************************************************/
/* */
/* ftxf86.h */
/* ftfntfmt.h */
/* */
/* Support functions for X11. */
/* Support functions for font formats. */
/* */
/* Copyright 2002, 2003, 2004, 2006, 2007 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTXF86_H__
#define __FTXF86_H__
#ifndef FTFNTFMT_H_
#define FTFNTFMT_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -49,22 +49,20 @@ FT_BEGIN_HEADER
/* however, there are special cases (like in PDF devices) where it is */
/* 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. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_X11_Font_Format */
/* FT_Get_Font_Format */
/* */
/* <Description> */
/* Return a string describing the format of a given face, using values */
/* which can be used as an X11 FONT_PROPERTY. Possible values are */
/* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
/* `PFR', and `Windows~FNT'. */
/* Return a string describing the format of a given face. Possible */
/* values are `TrueType', `Type~1', `BDF', `PCF', `Type~42', */
/* `CID~Type~1', `CFF', `PFR', and `Windows~FNT'. */
/* */
/* The return value is suitable to be used as an X11 FONT_PROPERTY. */
/* */
/* <Input> */
/* face :: */
@ -73,11 +71,25 @@ FT_BEGIN_HEADER
/* <Return> */
/* Font format string. NULL in case of error. */
/* */
/* <Note> */
/* A deprecated name for the same function is */
/* `FT_Get_X11_Font_Format'. */
/* */
FT_EXPORT( const char* )
FT_Get_Font_Format( FT_Face face );
/* deprecated */
FT_EXPORT( const char* )
FT_Get_X11_Font_Format( FT_Face face );
/* */
/* */
FT_END_HEADER
#endif /* __FTXF86_H__ */
#endif /* FTFNTFMT_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
/* Copyright 2007, 2008, 2011 by */
/* Copyright 2007-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef _FT_GASP_H_
#define _FT_GASP_H_
#ifndef FTGASP_H_
#define FTGASP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -29,6 +29,9 @@
#endif
FT_BEGIN_HEADER
/***************************************************************************
*
* @section:
@ -92,8 +95,8 @@
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_GRIDFIT 0x04
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/*************************************************************************
@ -102,17 +105,25 @@
* FT_Get_Gasp
*
* @description:
* Read the `gasp' table from a TrueType or OpenType font file and
* return the entry corresponding to a given character pixel size.
* For a TrueType or OpenType font file, return the rasterizer behaviour
* flags from the font's `gasp' table corresponding to a given
* character pixel size.
*
* @input:
* face :: The source face handle.
*
* ppem :: The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
* `gasp' table in the face.
*
* @note:
* If you want to use the MM functionality of OpenType variation fonts
* (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
* function *after* setting an instance since the return values can
* change.
*
* @since:
* 2.3.0
*/
@ -120,9 +131,12 @@
FT_Get_Gasp( FT_Face face,
FT_UInt ppem );
/* */
/* */
#endif /* _FT_GASP_H_ */
FT_END_HEADER
#endif /* FTGASP_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
/* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -29,8 +29,8 @@
/*************************************************************************/
#ifndef __FTGLYPH_H__
#define __FTGLYPH_H__
#ifndef FTGLYPH_H_
#define FTGLYPH_H_
#include <ft2build.h>
@ -231,6 +231,12 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* Because `*aglyph->advance.x' and '*aglyph->advance.y' are 16.16 */
/* fixed-point numbers, `slot->advance.x' and `slot->advance.y' */
/* (which are in 26.6 fixed-point format) must be in the range */
/* ]-32768;32768[. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph( FT_GlyphSlot slot,
FT_Glyph *aglyph );
@ -325,22 +331,8 @@ FT_BEGIN_HEADER
} FT_Glyph_BBox_Mode;
/*************************************************************************/
/* */
/* <Enum> */
/* ft_glyph_bbox_xxx */
/* */
/* <Description> */
/* These constants are deprecated. Use the corresponding */
/* @FT_Glyph_BBox_Mode values instead. */
/* */
/* <Values> */
/* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
/* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
/* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
/* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
/* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
/* */
/* these constants are deprecated; use the corresponding */
/* `FT_Glyph_BBox_Mode' values instead */
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
@ -355,20 +347,20 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return a glyph's `control box'. The control box encloses all the */
/* outline's points, including Bézier control points. Though it */
/* outline's points, including Bezier control points. Though it */
/* coincides with the exact bounding box for most glyphs, it can be */
/* slightly larger in some situations (like when rotating an outline */
/* which contains Bézier outside arcs). */
/* that contains Bezier outside arcs). */
/* */
/* Computing the control box is very fast, while getting the bounding */
/* box can take much more time as it needs to walk over all segments */
/* and arcs in the outline. To get the latter, you can use the */
/* `ftbbox' component which is dedicated to this single task. */
/* `ftbbox' component, which is dedicated to this single task. */
/* */
/* <Input> */
/* glyph :: A handle to the source glyph object. */
/* */
/* mode :: The mode which indicates how to interpret the returned */
/* mode :: The mode that indicates how to interpret the returned */
/* bounding box values. */
/* */
/* <Output> */
@ -388,7 +380,7 @@ FT_BEGIN_HEADER
/* @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 */
/* 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 */
@ -467,7 +459,7 @@ FT_BEGIN_HEADER
/* */
/* */
/* // load glyph */
/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT ); */
/* */
/* // extract glyph image */
/* error = FT_Get_Glyph( face->glyph, &glyph ); */
@ -580,6 +572,9 @@ FT_BEGIN_HEADER
/* <Note> */
/* The result is undefined if either `a' or `b' is zero. */
/* */
/* Since the function uses wrap-around arithmetic, results become */
/* meaningless if the arguments are very large. */
/* */
FT_EXPORT( void )
FT_Matrix_Multiply( const FT_Matrix* a,
FT_Matrix* b );
@ -603,13 +598,12 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Error )
FT_Matrix_Invert( FT_Matrix* matrix );
/* */
FT_END_HEADER
#endif /* __FTGLYPH_H__ */
#endif /* FTGLYPH_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004, 2005, 2006 by */
/* Copyright 2004-2018 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@ -25,8 +25,8 @@
/***************************************************************************/
#ifndef __FTGXVAL_H__
#define __FTGXVAL_H__
#ifndef FTGXVAL_H_
#define FTGXVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -57,9 +57,19 @@ FT_BEGIN_HEADER
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
/* trak, prop, lcar). */
/* */
/* <Order> */
/* FT_TrueTypeGX_Validate */
/* FT_TrueTypeGX_Free */
/* */
/* FT_ClassicKern_Validate */
/* FT_ClassicKern_Free */
/* */
/* FT_VALIDATE_GX_LENGTH */
/* FT_VALIDATE_GXXXX */
/* FT_VALIDATE_CKERNXXX */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* */
@ -91,15 +101,15 @@ FT_BEGIN_HEADER
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
#define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
/* */
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
@ -171,8 +181,6 @@ FT_BEGIN_HEADER
FT_VALIDATE_lcar )
/* */
/**********************************************************************
*
* @function:
@ -180,7 +188,7 @@ FT_BEGIN_HEADER
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
@ -189,7 +197,7 @@ FT_BEGIN_HEADER
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the tables to be validated. See
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
@ -221,8 +229,6 @@ FT_BEGIN_HEADER
FT_UInt table_length );
/* */
/**********************************************************************
*
* @function:
@ -248,8 +254,6 @@ FT_BEGIN_HEADER
FT_Bytes table );
/* */
/**********************************************************************
*
* @enum:
@ -277,8 +281,6 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/* */
/**********************************************************************
*
* @function:
@ -286,7 +288,7 @@ FT_BEGIN_HEADER
*
* @description:
* Validate classic (16-bit format) kern table to assure that the offsets
* and indices are valid. The idea is that a higher-level library which
* and indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
@ -299,7 +301,7 @@ FT_BEGIN_HEADER
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the dialect to be validated. See
* A bit field that specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
@ -320,8 +322,6 @@ FT_BEGIN_HEADER
FT_Bytes *ckern_table );
/* */
/**********************************************************************
*
* @function:
@ -346,13 +346,12 @@ FT_BEGIN_HEADER
FT_ClassicKern_Free( FT_Face face,
FT_Bytes table );
/* */
/* */
FT_END_HEADER
#endif /* __FTGXVAL_H__ */
#endif /* FTGXVAL_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Gzip-compressed stream support. */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTGZIP_H__
#define __FTGZIP_H__
#ifndef FTGZIP_H_
#define FTGZIP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -91,12 +91,61 @@ FT_BEGIN_HEADER
FT_Stream_OpenGzip( FT_Stream stream,
FT_Stream source );
/* */
/************************************************************************
*
* @function:
* FT_Gzip_Uncompress
*
* @description:
* Decompress a zipped input buffer into an output buffer. This function
* is modeled after zlib's `uncompress' function.
*
* @input:
* memory ::
* A FreeType memory handle.
*
* input ::
* The input buffer.
*
* input_len ::
* The length of the input buffer.
*
* @output:
* output::
* The output buffer.
*
* @inout:
* output_len ::
* Before calling the function, this is the total size of the output
* buffer, which must be large enough to hold the entire uncompressed
* data (so the size of the uncompressed data must be known in
* advance). After calling the function, `output_len' is the size of
* the used data in `output'.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
*
* @since:
* 2.5.1
*/
FT_EXPORT( FT_Error )
FT_Gzip_Uncompress( FT_Memory memory,
FT_Byte* output,
FT_ULong* output_len,
const FT_Byte* input,
FT_ULong input_len );
/* */
FT_END_HEADER
#endif /* __FTGZIP_H__ */
#endif /* FTGZIP_H_ */
/* END */

View File

@ -5,8 +5,7 @@
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -25,12 +24,12 @@
/*************************************************************************/
#ifndef __FTIMAGE_H__
#define __FTIMAGE_H__
#ifndef FTIMAGE_H_
#define FTIMAGE_H_
/* _STANDALONE_ is from ftgrays.c */
#ifndef _STANDALONE_
/* STANDALONE_ is from ftgrays.c */
#ifndef STANDALONE_
#include <ft2build.h>
#endif
@ -169,6 +168,15 @@ FT_BEGIN_HEADER
/* times taller than the original glyph image. See also */
/* @FT_RENDER_MODE_LCD_V. */
/* */
/* FT_PIXEL_MODE_BGRA :: */
/* [Since 2.5] An image with four 8-bit channels per pixel, */
/* representing a color image (such as emoticons) with alpha */
/* channel. For each pixel, the format is BGRA, which means, the */
/* blue channel comes first in memory. The color channels are */
/* pre-multiplied and in the sRGB colorspace. For example, full */
/* red at half-translucent opacity will be represented as */
/* `00,00,80,80', not `00,00,FF,80'. See also @FT_LOAD_COLOR. */
/* */
typedef enum FT_Pixel_Mode_
{
FT_PIXEL_MODE_NONE = 0,
@ -178,73 +186,21 @@ FT_BEGIN_HEADER
FT_PIXEL_MODE_GRAY4,
FT_PIXEL_MODE_LCD,
FT_PIXEL_MODE_LCD_V,
FT_PIXEL_MODE_BGRA,
FT_PIXEL_MODE_MAX /* do not remove */
} FT_Pixel_Mode;
/*************************************************************************/
/* */
/* <Enum> */
/* ft_pixel_mode_xxx */
/* */
/* <Description> */
/* A list of deprecated constants. Use the corresponding */
/* @FT_Pixel_Mode values instead. */
/* */
/* <Values> */
/* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */
/* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */
/* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */
/* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */
/* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */
/* */
/* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */
/* values instead. */
#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
/* */
#if 0
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Palette_Mode */
/* */
/* <Description> */
/* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
/* */
/* An enumeration type to describe the format of a bitmap palette, */
/* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
/* */
/* <Values> */
/* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */
/* records. */
/* */
/* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */
/* records. */
/* */
/* <Note> */
/* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
/* FreeType, these types are not handled by the library itself. */
/* */
typedef enum FT_Palette_Mode_
{
ft_palette_mode_rgb = 0,
ft_palette_mode_rgba,
ft_palette_mode_max /* do not remove */
} FT_Palette_Mode;
/* */
#endif
/*************************************************************************/
/* */
@ -302,20 +258,15 @@ FT_BEGIN_HEADER
/* field is intended for paletted pixel modes. Not */
/* used currently. */
/* */
/* <Note> */
/* For now, the only pixel modes supported by FreeType are mono and */
/* grays. However, drivers might be added in the future to support */
/* more `colorful' options. */
/* */
typedef struct FT_Bitmap_
{
int rows;
int width;
unsigned int rows;
unsigned int width;
int pitch;
unsigned char* buffer;
short num_grays;
char pixel_mode;
char palette_mode;
unsigned short num_grays;
unsigned char pixel_mode;
unsigned char palette_mode;
void* palette;
} FT_Bitmap;
@ -350,11 +301,11 @@ FT_BEGIN_HEADER
/* each outline point's type. */
/* */
/* If bit~0 is unset, the point is `off' the curve, */
/* i.e., a Bézier control point, while it is `on' if */
/* i.e., a Bezier control point, while it is `on' 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 Bezier arc control point; */
/* and a second-order control point if unset. */
/* */
/* If bit~2 is set, bits 5-7 contain the drop-out mode */
@ -372,7 +323,7 @@ FT_BEGIN_HEADER
/* */
/* flags :: A set of bit flags used to characterize the outline */
/* and give hints to the scan-converter and hinter on */
/* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */
/* how to convert/grid-fit it. See @FT_OUTLINE_XXX. */
/* */
/* <Note> */
/* The B/W rasterizer only checks bit~2 in the `tags' array for the */
@ -393,6 +344,8 @@ FT_BEGIN_HEADER
} FT_Outline;
/* */
/* Following limits must be consistent with */
/* FT_Outline.{n_contours,n_points} */
#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
@ -402,7 +355,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Enum> */
/* FT_OUTLINE_FLAGS */
/* FT_OUTLINE_XXX */
/* */
/* <Description> */
/* A list of bit-field constants use for the flags in an outline's */
@ -483,24 +436,8 @@ FT_BEGIN_HEADER
#define FT_OUTLINE_SINGLE_PASS 0x200
/*************************************************************************
*
* @enum:
* ft_outline_flags
*
* @description:
* These constants are deprecated. Please use the corresponding
* @FT_OUTLINE_FLAGS values.
*
* @values:
* ft_outline_none :: See @FT_OUTLINE_NONE.
* ft_outline_owner :: See @FT_OUTLINE_OWNER.
* ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL.
* ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL.
* ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
* ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION.
* ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS.
*/
/* these constants are deprecated; use the corresponding */
/* `FT_OUTLINE_XXX' values instead */
#define ft_outline_none FT_OUTLINE_NONE
#define ft_outline_owner FT_OUTLINE_OWNER
#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
@ -546,7 +483,7 @@ FT_BEGIN_HEADER
/* <Input> */
/* to :: A pointer to the target point of the `move to'. */
/* */
/* user :: A typeless pointer which is passed from the caller of the */
/* user :: A typeless pointer, which is passed from the caller of the */
/* decomposition function. */
/* */
/* <Return> */
@ -573,7 +510,7 @@ FT_BEGIN_HEADER
/* <Input> */
/* to :: A pointer to the target point of the `line to'. */
/* */
/* user :: A typeless pointer which is passed from the caller of the */
/* user :: A typeless pointer, which is passed from the caller of the */
/* decomposition function. */
/* */
/* <Return> */
@ -595,7 +532,7 @@ FT_BEGIN_HEADER
/* A function pointer type used to describe the signature of a `conic */
/* 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 Bezier arc in */
/* the outline. */
/* */
/* <Input> */
@ -604,7 +541,7 @@ FT_BEGIN_HEADER
/* */
/* to :: A pointer to the target end point of the conic arc. */
/* */
/* user :: A typeless pointer which is passed from the caller of */
/* user :: A typeless pointer, which is passed from the caller of */
/* the decomposition function. */
/* */
/* <Return> */
@ -627,16 +564,16 @@ FT_BEGIN_HEADER
/* A function pointer type used to describe the signature of a `cubic */
/* 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 Bezier arc. */
/* */
/* <Input> */
/* control1 :: A pointer to the first Bézier control point. */
/* control1 :: A pointer to the first Bezier control point. */
/* */
/* control2 :: A pointer to the second Bézier control point. */
/* control2 :: A pointer to the second Bezier control point. */
/* */
/* to :: A pointer to the target end point. */
/* */
/* user :: A typeless pointer which is passed from the caller of */
/* user :: A typeless pointer, which is passed from the caller of */
/* the decomposition function. */
/* */
/* <Return> */
@ -658,16 +595,16 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* 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 Beziers. */
/* */
/* <Fields> */
/* move_to :: The `move to' emitter. */
/* */
/* line_to :: The segment emitter. */
/* */
/* conic_to :: The second-order Bézier arc emitter. */
/* conic_to :: The second-order Bezier arc emitter. */
/* */
/* cubic_to :: The third-order Bézier arc emitter. */
/* cubic_to :: The third-order Bezier arc emitter. */
/* */
/* shift :: The shift that is applied to coordinates before they */
/* are sent to the emitter. */
@ -682,7 +619,7 @@ FT_BEGIN_HEADER
/* */
/* { */
/* x' = (x << shift) - delta */
/* y' = (x << shift) - delta */
/* y' = (y << shift) - delta */
/* } */
/* */
/* Set the values of `shift' and `delta' to~0 to get the original */
@ -764,7 +701,7 @@ FT_BEGIN_HEADER
/* */
/* FT_GLYPH_FORMAT_OUTLINE :: */
/* The glyph image is a vectorial outline made of line segments */
/* and Bézier arcs; it can be described as an @FT_Outline; you */
/* and Bezier arcs; it can be described as an @FT_Outline; you */
/* generally want to access the `outline' field of the */
/* @FT_GlyphSlotRec structure to read it. */
/* */
@ -787,22 +724,8 @@ FT_BEGIN_HEADER
} FT_Glyph_Format;
/*************************************************************************/
/* */
/* <Enum> */
/* ft_glyph_format_xxx */
/* */
/* <Description> */
/* A list of deprecated constants. Use the corresponding */
/* @FT_Glyph_Format values instead. */
/* */
/* <Values> */
/* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */
/* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */
/* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */
/* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */
/* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */
/* */
/* these constants are deprecated; use the corresponding */
/* `FT_Glyph_Format' values instead. */
#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
@ -824,11 +747,11 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* A raster is a scan converter, in charge of rendering an outline into */
/* a a bitmap. This section contains the public API for rasters. */
/* a bitmap. This section contains the public API for rasters. */
/* */
/* Note that in FreeType 2, all rasters are now encapsulated within */
/* specific modules called `renderers'. See `freetype/ftrender.h' for */
/* more details on renderers. */
/* specific modules called `renderers'. See `ftrender.h' for more */
/* details on renderers. */
/* */
/*************************************************************************/
@ -847,6 +770,21 @@ FT_BEGIN_HEADER
/* <Description> */
/* This section contains technical definitions. */
/* */
/* <Order> */
/* FT_Raster */
/* FT_Span */
/* FT_SpanFunc */
/* */
/* FT_Raster_Params */
/* FT_RASTER_FLAG_XXX */
/* */
/* FT_Raster_NewFunc */
/* FT_Raster_DoneFunc */
/* FT_Raster_ResetFunc */
/* FT_Raster_SetModeFunc */
/* FT_Raster_RenderFunc */
/* FT_Raster_Funcs */
/* */
/*************************************************************************/
@ -856,8 +794,8 @@ FT_BEGIN_HEADER
/* FT_Raster */
/* */
/* <Description> */
/* A handle (pointer) to a raster object. Each object can be used */
/* independently to convert an outline into a bitmap or pixmap. */
/* An opaque handle (pointer) to a raster object. Each object can be */
/* used independently to convert an outline into a bitmap or pixmap. */
/* */
typedef struct FT_RasterRec_* FT_Raster;
@ -868,8 +806,8 @@ FT_BEGIN_HEADER
/* FT_Span */
/* */
/* <Description> */
/* A structure used to model a single span of gray (or black) pixels */
/* when rendering a monochrome or anti-aliased bitmap. */
/* A structure used to model a single span of gray pixels when */
/* rendering an anti-aliased bitmap. */
/* */
/* <Fields> */
/* x :: The span's horizontal start position. */
@ -877,13 +815,12 @@ FT_BEGIN_HEADER
/* len :: The span's length in pixels. */
/* */
/* coverage :: The span color/coverage, ranging from 0 (background) */
/* to 255 (foreground). Only used for anti-aliased */
/* rendering. */
/* to 255 (foreground). */
/* */
/* <Note> */
/* This structure is used by the span drawing callback type named */
/* @FT_SpanFunc which takes the y~coordinate of the span as a */
/* a parameter. */
/* @FT_SpanFunc that takes the y~coordinate of the span as a */
/* parameter. */
/* */
/* The coverage value is always between 0 and 255. If you want less */
/* gray values, the callback function has to reduce them. */
@ -923,16 +860,6 @@ FT_BEGIN_HEADER
/* This can be used to write anti-aliased outlines directly to a */
/* given background bitmap, and even perform translucency. */
/* */
/* Note that the `count' field cannot be greater than a fixed value */
/* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */
/* `ftoption.h'. By default, this value is set to~32, which means */
/* that if there are more than 32~spans on a given scanline, the */
/* callback is called several times with the same `y' parameter in */
/* order to draw all callbacks. */
/* */
/* Otherwise, the callback is only called once per scan-line, and */
/* only for those scanlines that do have `gray' pixels on them. */
/* */
typedef void
(*FT_SpanFunc)( int y,
int count,
@ -948,22 +875,7 @@ FT_BEGIN_HEADER
/* FT_Raster_BitTest_Func */
/* */
/* <Description> */
/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
/* */
/* A function used as a call-back by the monochrome scan-converter */
/* to test whether a given target pixel is already set to the drawing */
/* `color'. These tests are crucial to implement drop-out control */
/* per-se the TrueType spec. */
/* */
/* <Input> */
/* y :: The pixel's y~coordinate. */
/* */
/* x :: The pixel's x~coordinate. */
/* */
/* user :: User-supplied data that is passed to the callback. */
/* */
/* <Return> */
/* 1~if the pixel is `set', 0~otherwise. */
/* Deprecated, unimplemented. */
/* */
typedef int
(*FT_Raster_BitTest_Func)( int y,
@ -977,21 +889,7 @@ FT_BEGIN_HEADER
/* FT_Raster_BitSet_Func */
/* */
/* <Description> */
/* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
/* */
/* A function used as a call-back by the monochrome scan-converter */
/* to set an individual target pixel. This is crucial to implement */
/* drop-out control according to the TrueType specification. */
/* */
/* <Input> */
/* y :: The pixel's y~coordinate. */
/* */
/* x :: The pixel's x~coordinate. */
/* */
/* user :: User-supplied data that is passed to the callback. */
/* */
/* <Return> */
/* 1~if the pixel is `set', 0~otherwise. */
/* Deprecated, unimplemented. */
/* */
typedef void
(*FT_Raster_BitSet_Func)( int y,
@ -1025,8 +923,8 @@ FT_BEGIN_HEADER
/* pixmap's buffer _must_ be zeroed before */
/* rendering. */
/* */
/* Note that for now, direct rendering is */
/* only possible with anti-aliased glyphs. */
/* Direct rendering is only possible with */
/* anti-aliased glyphs. */
/* */
/* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
/* rendering mode. If set, the output will */
@ -1044,7 +942,8 @@ FT_BEGIN_HEADER
#define FT_RASTER_FLAG_DIRECT 0x2
#define FT_RASTER_FLAG_CLIP 0x4
/* deprecated */
/* these constants are deprecated; use the corresponding */
/* `FT_RASTER_FLAG_XXX' values instead */
#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
#define ft_raster_flag_aa FT_RASTER_FLAG_AA
#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
@ -1070,11 +969,11 @@ FT_BEGIN_HEADER
/* */
/* gray_spans :: The gray span drawing callback. */
/* */
/* black_spans :: The black span drawing callback. UNIMPLEMENTED! */
/* black_spans :: Unused. */
/* */
/* bit_test :: The bit test callback. UNIMPLEMENTED! */
/* bit_test :: Unused. */
/* */
/* bit_set :: The bit set callback. UNIMPLEMENTED! */
/* bit_set :: Unused. */
/* */
/* user :: User-supplied data that is passed to each drawing */
/* callback. */
@ -1091,15 +990,9 @@ FT_BEGIN_HEADER
/* */
/* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
/* raster will call the `gray_spans' callback to draw gray pixel */
/* spans, in the case of an aa glyph bitmap, it will call */
/* `black_spans', and `bit_test' and `bit_set' in the case of a */
/* monochrome bitmap. This allows direct composition over a */
/* pre-existing bitmap through user-provided callbacks to perform the */
/* span drawing/composition. */
/* */
/* Note that the `bit_test' and `bit_set' callbacks are required when */
/* rendering a monochrome bitmap, as they are crucial to implement */
/* correct drop-out control as defined in the TrueType specification. */
/* spans. This allows direct composition over a pre-existing bitmap */
/* through user-provided callbacks to perform the span drawing and */
/* composition. Not supported by the monochrome rasterizer. */
/* */
typedef struct FT_Raster_Params_
{
@ -1107,9 +1000,9 @@ FT_BEGIN_HEADER
const void* source;
int flags;
FT_SpanFunc gray_spans;
FT_SpanFunc black_spans; /* doesn't work! */
FT_Raster_BitTest_Func bit_test; /* doesn't work! */
FT_Raster_BitSet_Func bit_set; /* doesn't work! */
FT_SpanFunc black_spans; /* unused */
FT_Raster_BitTest_Func bit_test; /* unused */
FT_Raster_BitSet_Func bit_set; /* unused */
void* user;
FT_BBox clip_box;
@ -1170,26 +1063,25 @@ FT_BEGIN_HEADER
/* FT_Raster_ResetFunc */
/* */
/* <Description> */
/* FreeType provides an area of memory called the `render pool', */
/* available to all registered rasters. This pool can be freely used */
/* during a given scan-conversion but is shared by all rasters. Its */
/* content is thus transient. */
/* FreeType used to provide an area of memory called the `render */
/* pool' available to all registered rasterizers. This was not */
/* thread safe, however, and now FreeType never allocates this pool. */
/* */
/* This function is called each time the render pool changes, or just */
/* after a new raster object is created. */
/* This function is called after a new raster object is created. */
/* */
/* <Input> */
/* raster :: A handle to the new raster object. */
/* */
/* pool_base :: The address in memory of the render pool. */
/* pool_base :: Previously, the address in memory of the render pool. */
/* Set this to NULL. */
/* */
/* pool_size :: The size in bytes of the render pool. */
/* pool_size :: Previously, the size in bytes of the render pool. */
/* Set this to 0. */
/* */
/* <Note> */
/* Rasters can ignore the render pool and rely on dynamic memory */
/* allocation if they want to (a handle to the memory allocator is */
/* passed to the raster constructor). However, this is not */
/* recommended for efficiency purposes. */
/* Rasterizers should rely on dynamic or stack allocation if they */
/* want to (a handle to the memory allocator is passed to the */
/* rasterizer constructor). */
/* */
typedef void
(*FT_Raster_ResetFunc)( FT_Raster raster,
@ -1256,7 +1148,7 @@ FT_BEGIN_HEADER
/* XXX: For now, the standard raster doesn't support direct */
/* composition but this should change for the final release (see */
/* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */
/* for examples of distinct implementations which support direct */
/* for examples of distinct implementations that support direct */
/* composition). */
/* */
typedef int
@ -1288,6 +1180,7 @@ FT_BEGIN_HEADER
typedef struct FT_Raster_Funcs_
{
FT_Glyph_Format glyph_format;
FT_Raster_NewFunc raster_new;
FT_Raster_ResetFunc raster_reset;
FT_Raster_SetModeFunc raster_set_mode;
@ -1296,13 +1189,12 @@ FT_BEGIN_HEADER
} FT_Raster_Funcs;
/* */
FT_END_HEADER
#endif /* __FTIMAGE_H__ */
#endif /* FTIMAGE_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType incremental loading (specification). */
/* */
/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,11 +16,12 @@
/***************************************************************************/
#ifndef __FTINCREM_H__
#define __FTINCREM_H__
#ifndef FTINCREM_H_
#define FTINCREM_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@ -45,7 +46,7 @@ FT_BEGIN_HEADER
* @description:
* This section contains various functions used to perform so-called
* `incremental' glyph loading. This is a mode where all glyphs loaded
* from a given @FT_Face are provided by the client application,
* from a given @FT_Face are provided by the client application.
*
* Apart from that, all other tables are loaded normally from the font
* file. This mode is useful when FreeType is used within another
@ -331,23 +332,12 @@ FT_BEGIN_HEADER
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* A constant used as the tag of @FT_Parameter structures to indicate
* an incremental loading object to be used by FreeType.
*
*/
#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/* */
FT_END_HEADER
#endif /* __FTINCREM_H__ */
#endif /* FTINCREM_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
/* Copyright 2006, 2007, 2008, 2010 by */
/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -17,11 +17,12 @@
/***************************************************************************/
#ifndef __FT_LCD_FILTER_H__
#define __FT_LCD_FILTER_H__
#ifndef FTLCDFIL_H_
#define FTLCDFIL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@ -41,56 +42,92 @@ FT_BEGIN_HEADER
* LCD Filtering
*
* @abstract:
* Reduce color fringes of LCD-optimized bitmaps.
* Reduce color fringes of subpixel-rendered bitmaps.
*
* @description:
* The @FT_Library_SetLcdFilter API can be used to specify a low-pass
* filter which is then applied to LCD-optimized bitmaps generated
* through @FT_Render_Glyph. This is useful to reduce color fringes
* which would occur with unfiltered rendering.
* Should you #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your
* `ftoption.h', which enables patented ClearType-style rendering,
* the LCD-optimized glyph bitmaps should be filtered to reduce color
* fringes inherent to this technology. The default FreeType LCD
* rendering uses different technology, and API described below,
* although available, does nothing.
*
* Note that no filter is active by default, and that this function is
* *not* implemented in default builds of the library. You need to
* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
* in order to activate it.
* ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of
* the stripe (usually horizontal RGB) by a factor of~3. Since these
* subpixels are color pixels, using them unfiltered creates severe
* color fringes. Use the @FT_Library_SetLcdFilter API to specify a
* low-pass filter, which is then applied to subpixel-rendered bitmaps
* generated through @FT_Render_Glyph. The filter sacrifices some of
* the higher resolution to reduce color fringes, making the glyph image
* slightly blurrier. Positional improvements will remain.
*
* FreeType generates alpha coverage maps, which are linear by nature.
* For instance, the value 0x80 in bitmap representation means that
* (within numerical precision) 0x80/0xff fraction of that pixel is
* covered by the glyph's outline. The blending function for placing
* text over a background is
* A filter should have two properties:
*
* {
* dst = alpha * src + (1 - alpha) * dst ,
* }
* 1) It should be normalized, meaning the sum of the 5~components
* should be 256 (0x100). It is possible to go above or under this
* target sum, however: going under means tossing out contrast, going
* over means invoking clamping and thereby non-linearities that
* increase contrast somewhat at the expense of greater distortion
* and color-fringing. Contrast is better enhanced through stem
* darkening.
*
* which is known as OVER. However, when calculating the output of the
* OVER operator, the source colors should first be transformed to a
* linear color space, then alpha blended in that space, and transformed
* back to the output color space.
* 2) It should be color-balanced, meaning a filter `{~a, b, c, b, a~}'
* where a~+ b~=~c. It distributes the computed coverage for one
* subpixel to all subpixels equally, sacrificing some won resolution
* but drastically reducing color-fringing. Positioning improvements
* remain! Note that color-fringing can only really be minimized
* when using a color-balanced filter and alpha-blending the glyph
* onto a surface in linear space; see @FT_Render_Glyph.
*
* When linear light blending is used, the default FIR5 filtering
* weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
* they have been designed for black on white rendering while lacking
* gamma correction. To preserve color neutrality, weights for a FIR5
* filter should be chosen according to two free parameters `a' and `c',
* and the FIR weights should be
* Regarding the form, a filter can be a `boxy' filter or a `beveled'
* filter. Boxy filters are sharper but are less forgiving of non-ideal
* gamma curves of a screen (viewing angles!), beveled filters are
* fuzzier but more tolerant.
*
* {
* [a - c, a + c, 2 * a, a + c, a - c] .
* }
* Examples:
*
* This formula generates equal weights for all the color primaries
* across the filter kernel, which makes it colorless. One suggested
* set of weights is
* - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor
* normalized.
*
* {
* [0x10, 0x50, 0x60, 0x50, 0x10] ,
* }
* - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not
* normalized.
*
* where `a' has value 0x30 and `b' value 0x20. The weights in filter
* may have a sum larger than 0x100, which increases coloration slightly
* but also improves contrast.
* - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not
* balanced.
*
* - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not
* balanced.
*
* - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost
* balanced.
*
* - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost
* balanced.
*
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @FT_Load_Glyph, and @FT_Load_Char. It does _not_ affect the output
* of @FT_Outline_Render and @FT_Outline_Get_Bitmap.
*
* If this feature is activated, the dimensions of LCD glyph bitmaps are
* either wider or taller than the dimensions of the corresponding
* outline with regard to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds 3~subpixels to the left, and
* 3~subpixels to the right. The bitmap offset values are adjusted
* accordingly, so clients shouldn't need to modify their layout and
* glyph positioning code when enabling the filter.
*
* It is important to understand that linear alpha blending and gamma
* correction is critical for correctly rendering glyphs onto surfaces
* without artifacts and even more critical when subpixel rendering is
* involved.
*
* Each of the 3~alpha values (subpixels) is independently used to blend
* one color channel. That is, red alpha blends the red channel of the
* text color with the red channel of the background pixel. The
* distribution of density values by the color-balanced filter assumes
* alpha blending is done in linear space; only then color artifacts
* cancel out.
*/
@ -111,10 +148,23 @@ FT_BEGIN_HEADER
* The default filter reduces color fringes considerably, at the cost
* of a slight blurriness in the output.
*
* It is a beveled, normalized, and color-balanced five-tap filter
* that is more forgiving to screens with non-ideal gamma curves and
* viewing angles. Note that while color-fringing is reduced, it can
* only be minimized by using linear alpha blending and gamma
* correction to render glyphs onto surfaces. The default filter
* weights are [0x08 0x4D 0x56 0x4D 0x08].
*
* FT_LCD_FILTER_LIGHT ::
* The light filter is a variant that produces less blurriness at the
* cost of slightly more color fringes than the default one. It might
* be better, depending on taste, your monitor, or your personal vision.
* The light filter is a variant that is sharper at the cost of
* slightly more color fringes than the default one.
*
* It is a boxy, normalized, and color-balanced three-tap filter that
* is less forgiving to screens with non-ideal gamma curves and
* viewing angles. This filter works best when the rendering system
* uses linear alpha blending and gamma correction to render glyphs
* onto surfaces. The light filter weights are
* [0x00 0x55 0x56 0x55 0x00].
*
* FT_LCD_FILTER_LEGACY ::
* This filter corresponds to the original libXft color filter. It
@ -126,14 +176,23 @@ FT_BEGIN_HEADER
* This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future.
*
* FT_LCD_FILTER_LEGACY1 ::
* For historical reasons, the FontConfig library returns a different
* enumeration value for legacy LCD filtering. To make code work that
* (incorrectly) forwards FontConfig's enumeration value to
* @FT_Library_SetLcdFilter without proper mapping, it is thus easiest
* to have another enumeration value, which is completely equal to
* `FT_LCD_FILTER_LEGACY'.
*
* @since:
* 2.3.0
* 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2)
*/
typedef enum FT_LcdFilter_
{
FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2,
FT_LCD_FILTER_LEGACY1 = 3,
FT_LCD_FILTER_LEGACY = 16,
FT_LCD_FILTER_MAX /* do not remove */
@ -176,22 +235,6 @@ FT_BEGIN_HEADER
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
*
* It does _not_ affect the output of @FT_Outline_Render and
* @FT_Outline_Get_Bitmap.
*
* If this feature is activated, the dimensions of LCD glyph bitmaps are
* either larger or taller than the dimensions of the corresponding
* outline with regards to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
* up to 3~pixels to the right.
*
* The bitmap offset values are adjusted correctly, so clients shouldn't
* need to modify their layout and glyph positioning code when enabling
* the filter.
*
* @since:
* 2.3.0
*/
@ -206,11 +249,8 @@ FT_BEGIN_HEADER
* 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.
* This function can be used to enable LCD filter with custom weights,
* instead of using presets in @FT_Library_SetLcdFilter.
*
* @input:
* library ::
@ -230,8 +270,8 @@ FT_BEGIN_HEADER
* 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.
* LCD filter weights can also be set per face using @FT_Face_Properties
* with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
*
* @since:
* 2.4.0
@ -240,12 +280,30 @@ FT_BEGIN_HEADER
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights );
/*
* @type:
* FT_LcdFiveTapFilter
*
* @description:
* A typedef for passing the five LCD filter weights to
* @FT_Face_Properties within an @FT_Parameter structure.
*
* @since:
* 2.8
*
*/
#define FT_LCD_FILTER_FIVE_TAPS 5
typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];
/* */
FT_END_HEADER
#endif /* __FT_LCD_FILTER_H__ */
#endif /* FTLCDFIL_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Generic list support for FreeType (specification). */
/* */
/* Copyright 1996-2001, 2003, 2007, 2010 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -24,8 +24,8 @@
/*************************************************************************/
#ifndef __FTLIST_H__
#define __FTLIST_H__
#ifndef FTLIST_H_
#define FTLIST_H_
#include <ft2build.h>
@ -173,7 +173,7 @@ FT_BEGIN_HEADER
/* FT_List_Iterator */
/* */
/* <Description> */
/* An FT_List iterator function which is called during a list parse */
/* An FT_List iterator function that is called during a list parse */
/* by @FT_List_Iterate. */
/* */
/* <Input> */
@ -200,7 +200,7 @@ FT_BEGIN_HEADER
/* <Input> */
/* list :: A handle to the list. */
/* iterator :: An iterator function, called on each node of the list. */
/* user :: A user-supplied field which is passed as the second */
/* user :: A user-supplied field that is passed as the second */
/* argument to the iterator. */
/* */
/* <Return> */
@ -218,7 +218,7 @@ FT_BEGIN_HEADER
/* FT_List_Destructor */
/* */
/* <Description> */
/* An @FT_List iterator function which is called during a list */
/* An @FT_List iterator function that is called during a list */
/* finalization by @FT_List_Finalize to destroy all elements in a */
/* given list. */
/* */
@ -248,11 +248,11 @@ FT_BEGIN_HEADER
/* list :: A handle to the list. */
/* */
/* destroy :: A list destructor that will be applied to each element */
/* of the list. */
/* of the list. Set this to NULL if not needed. */
/* */
/* memory :: The current memory object which handles deallocation. */
/* memory :: The current memory object that handles deallocation. */
/* */
/* user :: A user-supplied field which is passed as the last */
/* user :: A user-supplied field that is passed as the last */
/* argument to the destructor. */
/* */
/* <Note> */
@ -265,13 +265,12 @@ FT_BEGIN_HEADER
FT_Memory memory,
void* user );
/* */
FT_END_HEADER
#endif /* __FTLIST_H__ */
#endif /* FTLIST_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* LZW-compressed stream support. */
/* */
/* Copyright 2004, 2006 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTLZW_H__
#define __FTLZW_H__
#ifndef FTLZW_H_
#define FTLZW_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -88,12 +88,12 @@ FT_BEGIN_HEADER
FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source );
/* */
/* */
FT_END_HEADER
#endif /* __FTLZW_H__ */
#endif /* FTLZW_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Additional Mac-specific API. */
/* */
/* Copyright 1996-2001, 2004, 2006, 2007 by */
/* Copyright 1996-2018 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -18,15 +18,15 @@
/***************************************************************************/
/* */
/* NOTE: Include this file after <freetype/freetype.h> and after any */
/* NOTE: Include this file after FT_FREETYPE_H and after any */
/* Mac-specific headers (because this header uses Mac types such as */
/* Handle, FSSpec, FSRef, etc.) */
/* */
/***************************************************************************/
#ifndef __FTMAC_H__
#define __FTMAC_H__
#ifndef FTMAC_H_
#define FTMAC_H_
#include <ft2build.h>
@ -35,11 +35,12 @@
FT_BEGIN_HEADER
/* gcc-3.4.1 and later can warn about functions tagged as deprecated */
/* gcc-3.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE
#if defined(__GNUC__) && \
((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#if defined( __GNUC__ ) && \
( ( __GNUC__ >= 4 ) || \
( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) )
#define FT_DEPRECATED_ATTRIBUTE __attribute__(( deprecated ))
#else
#define FT_DEPRECATED_ATTRIBUTE
#endif
@ -168,7 +169,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return a pathname of the disk file and face index for given font */
/* name which is handled by ATS framework. */
/* name that is handled by ATS framework. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
@ -268,7 +269,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTMAC_H__ */
#endif /* FTMAC_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTMM_H__
#define __FTMM_H__
#ifndef FTMM_H_
#define FTMM_H_
#include <ft2build.h>
@ -43,11 +43,10 @@ FT_BEGIN_HEADER
/* Master fonts, i.e., the selection of specific design instances by */
/* setting design axis coordinates. */
/* */
/* George Williams has extended this interface to make it work with */
/* both Type~1 Multiple Masters fonts and GX distortable (var) */
/* fonts. Some of these routines only work with MM fonts, others */
/* will work with both types. They are similar enough that a */
/* consistent interface makes sense. */
/* Besides Adobe MM fonts, the interface supports Apple's TrueType GX */
/* and OpenType variation fonts. Some of the routines only work with */
/* Adobe MM fonts, others will work with all three types. They are */
/* similar enough that a consistent interface makes sense. */
/* */
/*************************************************************************/
@ -58,10 +57,11 @@ FT_BEGIN_HEADER
/* FT_MM_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters fonts. */
/* A structure to model a given axis in design space for Multiple */
/* Masters fonts. */
/* */
/* This structure can't be used for GX var fonts. */
/* This structure can't be used for TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
@ -85,18 +85,19 @@ FT_BEGIN_HEADER
/* FT_Multi_Master */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* A structure to model the axes and space of a Multiple Masters */
/* font. */
/* */
/* This structure can't be used for GX var fonts. */
/* This structure can't be used for TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <Fields> */
/* num_axis :: Number of axes. Cannot exceed~4. */
/* */
/* num_designs :: Number of designs; should be normally 2^num_axis */
/* even though the Type~1 specification strangely */
/* allows for intermediate designs to be present. This */
/* number cannot exceed~16. */
/* allows for intermediate designs to be present. */
/* This number cannot exceed~16. */
/* */
/* axis :: A table of axis descriptors. */
/* */
@ -115,27 +116,35 @@ FT_BEGIN_HEADER
/* FT_Var_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters and GX var fonts. */
/* A structure to model a given axis in design space for Multiple */
/* Masters, TrueType GX, and OpenType variation fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* Not always meaningful for GX. */
/* Not always meaningful for TrueType GX or OpenType */
/* variation fonts. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* def :: The axis's default design coordinate. */
/* FreeType computes meaningful default values for MM; it */
/* is then an integer value, not in 16.16 format. */
/* FreeType computes meaningful default values for Adobe */
/* MM fonts. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
/* tag :: The axis's tag (the GX equivalent to `name'). */
/* FreeType provides default values for MM if possible. */
/* tag :: The axis's tag (the equivalent to `name' for TrueType */
/* GX and OpenType variation fonts). FreeType provides */
/* default values for Adobe MM fonts if possible. */
/* */
/* strid :: The entry in `name' table (another GX version of */
/* `name'). */
/* Not meaningful for MM. */
/* strid :: The axis name entry in the font's `name' table. This */
/* is another (and often better) version of the `name' */
/* field for TrueType GX or OpenType variation fonts. Not */
/* meaningful for Adobe MM fonts. */
/* */
/* <Note> */
/* The fields `minimum', `def', and `maximum' are 16.16 fractional */
/* values for TrueType GX and OpenType variation fonts. For Adobe MM */
/* fonts, the values are integers. */
/* */
typedef struct FT_Var_Axis_
{
@ -157,20 +166,26 @@ FT_BEGIN_HEADER
/* FT_Var_Named_Style */
/* */
/* <Description> */
/* A simple structure used to model a named style in a GX var font. */
/* A structure to model a named instance in a TrueType GX or OpenType */
/* variation font. */
/* */
/* This structure can't be used for MM fonts. */
/* This structure can't be used for Adobe MM fonts. */
/* */
/* <Fields> */
/* coords :: The design coordinates for this style. */
/* coords :: The design coordinates for this instance. */
/* This is an array with one entry for each axis. */
/* */
/* strid :: The entry in `name' table identifying this style. */
/* strid :: The entry in `name' table identifying this instance. */
/* */
/* psid :: The entry in `name' table identifying a PostScript name */
/* for this instance. Value 0xFFFF indicates a missing */
/* entry. */
/* */
typedef struct FT_Var_Named_Style_
{
FT_Fixed* coords;
FT_UInt strid;
FT_UInt psid; /* since 2.7.1 */
} FT_Var_Named_Style;
@ -181,31 +196,43 @@ FT_BEGIN_HEADER
/* FT_MM_Var */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* or GX var distortable font. */
/* A structure to model the axes and space of an Adobe MM, TrueType */
/* GX, or OpenType variation font. */
/* */
/* Some fields are specific to one format and not to the other. */
/* Some fields are specific to one format and not to the others. */
/* */
/* <Fields> */
/* num_axis :: The number of axes. The maximum value is~4 for */
/* MM; no limit in GX. */
/* Adobe MM fonts; no limit in TrueType GX or */
/* OpenType variation fonts. */
/* */
/* num_designs :: The number of designs; should be normally */
/* 2^num_axis for MM fonts. Not meaningful for GX */
/* 2^num_axis for Adobe MM fonts. Not meaningful */
/* for TrueType GX or OpenType variation fonts */
/* (where every glyph could have a different */
/* number of designs). */
/* */
/* num_namedstyles :: The number of named styles; only meaningful for */
/* GX which allows certain design coordinates to */
/* have a string ID (in the `name' table) */
/* associated with them. The font can tell the */
/* user that, for example, Weight=1.5 is `Bold'. */
/* num_namedstyles :: The number of named styles; a `named style' is */
/* a tuple of design coordinates that has a string */
/* ID (in the `name' table) associated with it. */
/* The font can tell the user that, for example, */
/* [Weight=1.5,Width=1.1] is `Bold'. Another name */
/* for `named style' is `named instance'. */
/* */
/* axis :: A table of axis descriptors. */
/* GX fonts contain slightly more data than MM. */
/* For Adobe Multiple Masters fonts, this value is */
/* always zero because the format does not support */
/* named styles. */
/* */
/* namedstyles :: A table of named styles. */
/* Only meaningful with GX. */
/* axis :: An axis descriptor table. */
/* TrueType GX and OpenType variation fonts */
/* contain slightly more data than Adobe MM fonts. */
/* Memory management of this pointer is done */
/* internally by FreeType. */
/* */
/* namedstyle :: A named style (instance) table. */
/* Only meaningful for TrueType GX and OpenType */
/* variation fonts. Memory management of this */
/* pointer is done internally by FreeType. */
/* */
typedef struct FT_MM_Var_
{
@ -218,18 +245,16 @@ FT_BEGIN_HEADER
} FT_MM_Var;
/* */
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Multi_Master */
/* */
/* <Description> */
/* Retrieve the Multiple Master descriptor of a given font. */
/* Retrieve a variation descriptor of a given Adobe MM font. */
/* */
/* This function can't be used with GX fonts. */
/* This function can't be used with TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
@ -251,15 +276,17 @@ FT_BEGIN_HEADER
/* FT_Get_MM_Var */
/* */
/* <Description> */
/* Retrieve the Multiple Master/GX var descriptor of a given font. */
/* Retrieve a variation descriptor for a given font. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters/GX var descriptor. */
/* Allocates a data structure, which the user must free */
/* (a single call to FT_FREE will do it). */
/* amaster :: The variation descriptor. */
/* Allocates a data structure, which the user must */
/* deallocate with a call to @FT_Done_MM_Var after use. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
@ -269,29 +296,61 @@ FT_BEGIN_HEADER
FT_MM_Var* *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_MM_Var */
/* */
/* <Description> */
/* Free the memory allocated by @FT_Get_MM_Var. */
/* */
/* <Input> */
/* library :: A handle of the face's parent library object that was */
/* used in the call to @FT_Get_MM_Var to create `amaster'. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_MM_Var( FT_Library library,
FT_MM_Var *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */
/* through design coordinates. */
/* For Adobe MM fonts, choose an interpolated font design through */
/* design coordinates. */
/* */
/* This function can't be used with GX fonts. */
/* This function can't be used with TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* num_coords :: The number of available design coordinates. If it */
/* is larger than the number of axes, ignore the excess */
/* values. If it is smaller than the number of axes, */
/* use default values for the remaining axes. */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* [Since 2.8.1] To reset all axes to the default values, call the */
/* function with `num_coords' set to zero and `coords' set to NULL. */
/* */
/* [Since 2.9] If `num_coords' is larger than zero, this function */
/* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
/* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
/* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
@ -304,55 +363,153 @@ FT_BEGIN_HEADER
/* FT_Set_Var_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Master or GX Var fonts, choose an interpolated font */
/* design through design coordinates. */
/* Choose an interpolated font design through design coordinates. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* num_coords :: The number of available design coordinates. If it */
/* is larger than the number of axes, ignore the excess */
/* values. If it is smaller than the number of axes, */
/* use default values for the remaining axes. */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* [Since 2.8.1] To reset all axes to the default values, call the */
/* function with `num_coords' set to zero and `coords' set to NULL. */
/* [Since 2.9] `Default values' means the currently selected named */
/* instance (or the base font if no named instance is selected). */
/* */
/* [Since 2.9] If `num_coords' is larger than zero, this function */
/* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
/* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
/* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Var_Design_Coordinates */
/* */
/* <Description> */
/* Get the design coordinates of the currently selected interpolated */
/* font. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* num_coords :: The number of design coordinates to retrieve. If it */
/* is larger than the number of axes, set the excess */
/* values to~0. */
/* */
/* <Output> */
/* coords :: The design coordinates array. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.7.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters and GX var fonts, choose an interpolated font */
/* design through normalized blend coordinates. */
/* Choose an interpolated font design through normalized blend */
/* coordinates. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* num_coords :: The number of available design coordinates. If it */
/* is larger than the number of axes, ignore the excess */
/* values. If it is smaller than the number of axes, */
/* use default values for the remaining axes. */
/* */
/* coords :: The design coordinates array (each element must be */
/* between 0 and 1.0). */
/* between 0 and 1.0 for Adobe MM fonts, and between */
/* -1.0 and 1.0 for TrueType GX and OpenType variation */
/* fonts). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* [Since 2.8.1] To reset all axes to the default values, call the */
/* function with `num_coords' set to zero and `coords' set to NULL. */
/* [Since 2.9] `Default values' means the currently selected named */
/* instance (or the base font if no named instance is selected). */
/* */
/* [Since 2.9] If `num_coords' is larger than zero, this function */
/* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
/* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
/* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_MM_Blend_Coordinates */
/* */
/* <Description> */
/* Get the normalized blend coordinates of the currently selected */
/* interpolated font. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* num_coords :: The number of normalized blend coordinates to */
/* retrieve. If it is larger than the number of axes, */
/* set the excess values to~0.5 for Adobe MM fonts, and */
/* to~0 for TrueType GX and OpenType variation fonts. */
/* */
/* <Output> */
/* coords :: The normalized blend coordinates array. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.7.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
@ -367,12 +524,115 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Var_Blend_Coordinates */
/* */
/* <Description> */
/* This is another name of @FT_Get_MM_Blend_Coordinates. */
/* */
/* <Since> */
/* 2.7.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Enum> */
/* FT_VAR_AXIS_FLAG_XXX */
/* */
/* <Description> */
/* A list of bit flags used in the return value of */
/* @FT_Get_Var_Axis_Flags. */
/* */
/* <Values> */
/* FT_VAR_AXIS_FLAG_HIDDEN :: */
/* The variation axis should not be exposed to user interfaces. */
/* */
/* <Since> */
/* 2.8.1 */
/* */
#define FT_VAR_AXIS_FLAG_HIDDEN 1
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Var_Axis_Flags */
/* */
/* <Description> */
/* Get the `flags' field of an OpenType Variation Axis Record. */
/* */
/* Not meaningful for Adobe MM fonts (`*flags' is always zero). */
/* */
/* <Input> */
/* master :: The variation descriptor. */
/* */
/* axis_index :: The index of the requested variation axis. */
/* */
/* <Output> */
/* flags :: The `flags' field. See @FT_VAR_AXIS_FLAG_XXX for */
/* possible values. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.8.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Var_Axis_Flags( FT_MM_Var* master,
FT_UInt axis_index,
FT_UInt* flags );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Named_Instance */
/* */
/* <Description> */
/* Set or change the current named instance. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* instance_index :: The index of the requested instance, starting */
/* with value 1. If set to value 0, FreeType */
/* switches to font access without a named */
/* instance. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The function uses the value of `instance_index' to set bits 16-30 */
/* of the face's `face_index' field. It also resets any variation */
/* applied to the font, and the @FT_FACE_FLAG_VARIATION bit of the */
/* face's `face_flags' field gets reset to zero (i.e., */
/* @FT_IS_VARIATION will return false). */
/* */
/* For Adobe MM fonts (which don't have named instances) this */
/* function simply resets the current face to the default instance. */
/* */
/* <Since> */
/* 2.9 */
/* */
FT_EXPORT( FT_Error )
FT_Set_Named_Instance( FT_Face face,
FT_UInt instance_index );
/* */
FT_END_HEADER
#endif /* __FTMM_H__ */
#endif /* FTMM_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType modules public interface (specification). */
/* */
/* Copyright 1996-2003, 2006, 2008-2010, 2012 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTMODAPI_H__
#define __FTMODAPI_H__
#ifndef FTMODAPI_H_
#define FTMODAPI_H_
#include <ft2build.h>
@ -63,7 +63,7 @@ FT_BEGIN_HEADER
/* psaux */
/* pshinter */
/* psnames */
/* raster1, raster5 */
/* raster1 */
/* sfnt */
/* smooth, smooth-lcd, smooth-lcdv */
/* truetype */
@ -75,6 +75,34 @@ FT_BEGIN_HEADER
/* */
/* Note that the FreeType Cache sub-system is not a FreeType module. */
/* */
/* <Order> */
/* FT_Module */
/* FT_Module_Constructor */
/* FT_Module_Destructor */
/* FT_Module_Requester */
/* FT_Module_Class */
/* */
/* FT_Add_Module */
/* FT_Get_Module */
/* FT_Remove_Module */
/* FT_Add_Default_Modules */
/* */
/* FT_Property_Set */
/* FT_Property_Get */
/* FT_Set_Default_Properties */
/* */
/* FT_New_Library */
/* FT_Done_Library */
/* FT_Reference_Library */
/* */
/* FT_Renderer */
/* FT_Renderer_Class */
/* */
/* FT_Get_Renderer */
/* FT_Set_Renderer */
/* */
/* FT_Set_Debug_Hook */
/* */
/*************************************************************************/
@ -84,12 +112,14 @@ FT_BEGIN_HEADER
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
#define FT_MODULE_STYLER 8 /* this module is a styler */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
/* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
/* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
/* own hinter */
#define FT_MODULE_DRIVER_HINTS_LIGHTLY 0x800 /* the driver's hinter */
/* produces LIGHT hints */
/* deprecated values */
@ -98,9 +128,10 @@ FT_BEGIN_HEADER
#define ft_module_hinter FT_MODULE_HINTER
#define ft_module_styler FT_MODULE_STYLER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
#define ft_module_driver_hints_lightly FT_MODULE_DRIVER_HINTS_LIGHTLY
typedef FT_Pointer FT_Module_Interface;
@ -292,16 +323,15 @@ FT_BEGIN_HEADER
* The module name.
*
* property_name ::
* The property name. Properties are described in the `Synopsis'
* subsection of the module's documentation.
* The property name. Properties are described in section
* @properties.
*
* Note that only a few modules have properties.
*
* value ::
* A generic pointer to a variable or structure which gives the new
* A generic pointer to a variable or structure that gives the new
* value of the property. The exact definition of `value' is
* dependent on the property; see the `Synopsis' subsection of the
* module's documentation.
* dependent on the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
@ -322,14 +352,21 @@ FT_BEGIN_HEADER
* FT_Property_Set( library, "foo", "bar", &bar );
* }
*
* Note that the FreeType Cache sub-system doesn't recognize module
* property changes. To avoid glyph lookup confusion within the cache
* you should call @FTC_Manager_Reset to completely flush the cache if
* a module property gets changed after @FTC_Manager_New has been
* called.
*
* It is not possible to set properties of the FreeType Cache
* sub-system with FT_Property_Set; use @FTC_Property_Set instead.
* sub-system itself with FT_Property_Set; use @FTC_Property_Set
* instead.
*
* @since:
* 2.4.11
*
*/
FT_Error
FT_EXPORT( FT_Error )
FT_Property_Set( FT_Library library,
const FT_String* module_name,
const FT_String* property_name,
@ -352,15 +389,14 @@ FT_BEGIN_HEADER
* The module name.
*
* property_name ::
* The property name. Properties are described in the `Synopsis'
* subsection of the module's documentation.
* The property name. Properties are described in section
* @properties.
*
* @inout:
* value ::
* A generic pointer to a variable or structure which gives the
* A generic pointer to a variable or structure that gives the
* value of the property. The exact definition of `value' is
* dependent on the property; see the `Synopsis' subsection of the
* module's documentation.
* dependent on the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
@ -393,13 +429,57 @@ FT_BEGIN_HEADER
* 2.4.11
*
*/
FT_Error
FT_EXPORT( FT_Error )
FT_Property_Get( FT_Library library,
const FT_String* module_name,
const FT_String* property_name,
void* value );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Default_Properties */
/* */
/* <Description> */
/* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
/* set, this function reads the `FREETYPE_PROPERTIES' environment */
/* variable to control driver properties. See section @properties */
/* for more. */
/* */
/* If the compilation option is not set, this function does nothing. */
/* */
/* `FREETYPE_PROPERTIES' has the following syntax form (broken here */
/* into multiple lines for better readability). */
/* */
/* { */
/* <optional whitespace> */
/* <module-name1> ':' */
/* <property-name1> '=' <property-value1> */
/* <whitespace> */
/* <module-name2> ':' */
/* <property-name2> '=' <property-value2> */
/* ... */
/* } */
/* */
/* Example: */
/* */
/* { */
/* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
/* cff:no-stem-darkening=1 \ */
/* autofitter:warping=1 */
/* } */
/* */
/* <InOut> */
/* library :: A handle to a new library object. */
/* */
/* <Since> */
/* 2.8 */
/* */
FT_EXPORT( void )
FT_Set_Default_Properties( FT_Library library );
/*************************************************************************/
/* */
/* <Function> */
@ -411,7 +491,7 @@ FT_BEGIN_HEADER
/* @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 */
/* This function helps in managing life-cycles of structures that */
/* reference @FT_Library objects. */
/* */
/* <Input> */
@ -435,11 +515,14 @@ FT_BEGIN_HEADER
/* <Description> */
/* This function is used to create a new FreeType library instance */
/* 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. Note, */
/* however, that the used @FT_Memory structure is expected to remain */
/* valid for the life of the @FT_Library object. */
/* */
/* 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. */
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, */
/* and a call to @FT_Set_Default_Properties) 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. */
@ -484,7 +567,7 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Error )
FT_Done_Library( FT_Library library );
/* */
/* */
typedef void
(*FT_DebugHook_Func)( void* arg );
@ -574,12 +657,7 @@ FT_BEGIN_HEADER
* The library doesn't implement any kind of bytecode interpreter.
*
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
* The library implements a bytecode interpreter that doesn't
* support the patented operations of the TrueType virtual machine.
*
* Its main use is to load certain Asian fonts which position and
* scale glyph components with bytecode instructions. It produces
* bad output for most other fonts.
* Deprecated and removed.
*
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers
@ -622,13 +700,12 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_TrueTypeEngineType )
FT_Get_TrueType_Engine_Type( FT_Library library );
/* */
FT_END_HEADER
#endif /* __FTMODAPI_H__ */
#endif /* FTMODAPI_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType module error offsets (specification). */
/* */
/* Copyright 2001-2005, 2010, 2013 by */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -74,7 +74,7 @@
/* with something like */
/* */
/* { */
/* #undef __FTMODERR_H__ */
/* #undef FTMODERR_H_ */
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
/* #define FT_MODERR_START_LIST { */
/* #define FT_MODERR_END_LIST { 0, 0 } }; */
@ -91,8 +91,8 @@
/*************************************************************************/
#ifndef __FTMODERR_H__
#define __FTMODERR_H__
#ifndef FTMODERR_H_
#define FTMODERR_H_
/*******************************************************************/
@ -188,7 +188,7 @@
#undef FT_NEED_EXTERN_C
#endif /* __FTMODERR_H__ */
#endif /* FTMODERR_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
/* Copyright 2004, 2005, 2006, 2007 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -27,8 +27,8 @@
/***************************************************************************/
#ifndef __FTOTVAL_H__
#define __FTOTVAL_H__
#ifndef FTOTVAL_H_
#define FTOTVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -58,6 +58,12 @@ FT_BEGIN_HEADER
/* This section contains the declaration of functions to validate */
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
/* */
/* <Order> */
/* FT_OpenType_Validate */
/* FT_OpenType_Free */
/* */
/* FT_VALIDATE_OTXXX */
/* */
/*************************************************************************/
@ -100,14 +106,12 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_MATH 0x2000
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH
/* */
#define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH )
/**********************************************************************
*
@ -116,7 +120,7 @@ FT_BEGIN_HEADER
*
* @description:
* Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
@ -125,7 +129,7 @@ FT_BEGIN_HEADER
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the tables to be validated. See
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values.
*
* @output:
@ -165,8 +169,6 @@ FT_BEGIN_HEADER
FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table );
/* */
/**********************************************************************
*
* @function:
@ -191,13 +193,12 @@ FT_BEGIN_HEADER
FT_OpenType_Free( FT_Face face,
FT_Bytes table );
/* */
/* */
FT_END_HEADER
#endif /* __FTOTVAL_H__ */
#endif /* FTOTVAL_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */
/* */
/* Copyright 1996-2003, 2005-2012 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -17,8 +17,8 @@
/***************************************************************************/
#ifndef __FTOUTLN_H__
#define __FTOUTLN_H__
#ifndef FTOUTLN_H_
#define FTOUTLN_H_
#include <ft2build.h>
@ -52,7 +52,6 @@ FT_BEGIN_HEADER
/* */
/* <Order> */
/* FT_Outline */
/* FT_OUTLINE_FLAGS */
/* FT_Outline_New */
/* FT_Outline_Done */
/* FT_Outline_Copy */
@ -68,13 +67,17 @@ FT_BEGIN_HEADER
/* */
/* FT_Outline_Get_Bitmap */
/* FT_Outline_Render */
/* */
/* FT_Outline_Decompose */
/* FT_Outline_Funcs */
/* FT_Outline_MoveTo_Func */
/* FT_Outline_LineTo_Func */
/* FT_Outline_ConicTo_Func */
/* FT_Outline_CubicTo_Func */
/* FT_Outline_MoveToFunc */
/* FT_Outline_LineToFunc */
/* FT_Outline_ConicToFunc */
/* FT_Outline_CubicToFunc */
/* */
/* FT_Orientation */
/* FT_Outline_Get_Orientation */
/* */
/* FT_OUTLINE_XXX */
/* */
/*************************************************************************/
@ -86,7 +89,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Walk over an outline's structure to decompose it into individual */
/* segments and Bézier arcs. This function also emits `move to' */
/* segments and Bezier arcs. This function also emits `move to' */
/* operations to indicate the start of new contours in the outline. */
/* */
/* <Input> */
@ -97,7 +100,7 @@ FT_BEGIN_HEADER
/* operations. */
/* */
/* <InOut> */
/* user :: A typeless pointer which is passed to each */
/* user :: A typeless pointer that is passed to each */
/* emitter during the decomposition. It can be */
/* used to store the state during the */
/* decomposition. */
@ -105,6 +108,17 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* A contour that contains a single point only is represented by a */
/* `move to' operation followed by `line to' to the same point. In */
/* most cases, it is best to filter this out before using the */
/* outline for stroking purposes (otherwise it would result in a */
/* visible dot when round caps are used). */
/* */
/* Similarly, the function returns success for an empty outline also */
/* (doing nothing, this is, not calling any emitter); if necessary, */
/* you should filter this out, too. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Decompose( FT_Outline* outline,
const FT_Outline_Funcs* func_interface,
@ -176,9 +190,6 @@ FT_BEGIN_HEADER
/* If the outline's `owner' field is not set, only the outline */
/* descriptor will be released. */
/* */
/* The reason why this function takes an `library' parameter is */
/* simply to use ft_mem_free(). */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Done( FT_Library library,
FT_Outline* outline );
@ -203,6 +214,10 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* An empty outline, or an outline with a single point only is also */
/* valid. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Check( FT_Outline* outline );
@ -214,15 +229,15 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return an outline's `control box'. The control box encloses all */
/* the outline's points, including Bézier control points. Though it */
/* the outline's points, including Bezier control points. Though it */
/* coincides with the exact bounding box for most glyphs, it can be */
/* slightly larger in some situations (like when rotating an outline */
/* which contains Bézier outside arcs). */
/* that contains Bezier outside arcs). */
/* */
/* Computing the control box is very fast, while getting the bounding */
/* box can take much more time as it needs to walk over all segments */
/* and arcs in the outline. To get the latter, you can use the */
/* `ftbbox' component which is dedicated to this single task. */
/* `ftbbox' component, which is dedicated to this single task. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline descriptor. */
@ -344,10 +359,13 @@ FT_BEGIN_HEADER
/* */
/* { */
/* FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); */
/* if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE ) */
/* FT_Outline_Embolden( &face->slot->outline, strength ); */
/* if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) */
/* FT_Outline_Embolden( &face->glyph->outline, strength ); */
/* } */
/* */
/* To get meaningful results, font scaling values must be set with */
/* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Embolden( FT_Outline* outline,
FT_Pos strength );
@ -364,6 +382,9 @@ FT_BEGIN_HEADER
/* @FT_Outline_Embolden, which uses the same strength in both */
/* directions. */
/* */
/* <Since> */
/* 2.4.10 */
/* */
FT_EXPORT( FT_Error )
FT_Outline_EmboldenXY( FT_Outline* outline,
FT_Pos xstrength,
@ -525,9 +546,11 @@ FT_BEGIN_HEADER
*
* @description:
* This function analyzes a glyph outline and tries to compute its
* fill orientation (see @FT_Orientation). This is done by computing
* the direction of each global horizontal and/or vertical extrema
* within the outline.
* fill orientation (see @FT_Orientation). This is done by integrating
* the total area covered by the outline. The positive integral
* corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT
* is returned. The negative integral corresponds to the counter-clockwise
* orientation and @FT_ORIENTATION_TRUETYPE is returned.
*
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty
* outlines.
@ -543,13 +566,12 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Orientation )
FT_Outline_Get_Orientation( FT_Outline* outline );
/* */
FT_END_HEADER
#endif /* __FTOUTLN_H__ */
#endif /* FTOUTLN_H_ */
/* END */

View File

@ -0,0 +1,205 @@
/***************************************************************************/
/* */
/* ftparams.h */
/* */
/* FreeType API for possible FT_Parameter tags (specification only). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTPARAMS_H_
#define FTPARAMS_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:
* parameter_tags
*
* @title:
* Parameter Tags
*
* @abstract:
* Macros for driver property and font loading parameter tags.
*
* @description:
* This section contains macros for the @FT_Parameter structure that are
* used with various functions to activate some special functionality or
* different behaviour of various components of FreeType.
*
*/
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* family names in the `name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* subfamily names in the `name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* An @FT_Parameter tag to be used with @FT_Open_Face to indicate
* incremental glyph loading.
*
*/
#define FT_PARAM_TAG_INCREMENTAL \
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding argument specifies the five LCD filter weights for a
* given face (if using @FT_LOAD_TARGET_LCD, for example), overriding
* the global default values or the values set up with
* @FT_Library_SetLcdFilterWeights.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \
FT_MAKE_TAG( 'l', 'c', 'd', 'f' )
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_RANDOM_SEED
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding 32bit signed integer argument overrides the font
* driver's random seed value with a face-specific one; see
* @random-seed.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_RANDOM_SEED \
FT_MAKE_TAG( 's', 'e', 'e', 'd' )
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_STEM_DARKENING
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding Boolean argument specifies whether to apply stem
* darkening, overriding the global default values or the values set up
* with @FT_Property_Set (see @no-stem-darkening).
*
* This is a passive setting that only takes effect if the font driver
* or autohinter honors it, which the CFF, Type~1, and CID drivers
* always do, but the autohinter only in `light' hinting mode (as of
* version 2.9).
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_STEM_DARKENING \
FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* Deprecated, no effect.
*
* Previously: A constant used as the tag of an @FT_Parameter structure to
* indicate that unpatented methods only should be used by the TrueType
* bytecode interpreter for a typeface opened by @FT_Open_Face.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING \
FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
/* */
FT_END_HEADER
#endif /* FTPARAMS_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTPFR_H__
#define __FTPFR_H__
#ifndef FTPFR_H_
#define FTPFR_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -71,7 +71,7 @@ FT_BEGIN_HEADER
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed
* in metrics units to device sub-pixels. This is equivalent to
* in metrics units to device subpixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL).
*
@ -123,7 +123,7 @@ FT_BEGIN_HEADER
* mode, which always returns distances converted to outline units.
*
* You can use the value of the `x_scale' and `y_scale' parameters
* returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
* returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face,
@ -154,19 +154,19 @@ FT_BEGIN_HEADER
*
* @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
* to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
FT_UInt gindex,
FT_Pos *aadvance );
/* */
/* */
FT_END_HEADER
#endif /* __FTPFR_H__ */
#endif /* FTPFR_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType renderer modules public interface (specification). */
/* */
/* Copyright 1996-2001, 2005, 2006, 2010 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTRENDER_H__
#define __FTRENDER_H__
#ifndef FTRENDER_H_
#define FTRENDER_H_
#include <ft2build.h>
@ -75,6 +75,7 @@ FT_BEGIN_HEADER
{
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy;
@ -87,7 +88,7 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_UInt mode,
FT_Render_Mode mode,
const FT_Vector* origin );
typedef FT_Error
@ -212,13 +213,8 @@ FT_BEGIN_HEADER
/* */
/* This doesn't change the current renderer for other formats. */
/* */
/* Currently, only the B/W renderer, if compiled with */
/* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */
/* anti-aliasing mode; this option must be set directly in */
/* `ftraster.c' and is undefined by default) accepts a single tag */
/* `pal5' to set its gray palette as a character string with */
/* 5~elements. Consequently, the third and fourth argument are zero */
/* normally. */
/* Currently, no FreeType renderer module uses `parameters'; you */
/* should thus always pass NULL as the value. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library,
@ -226,13 +222,12 @@ FT_BEGIN_HEADER
FT_UInt num_params,
FT_Parameter* parameters );
/* */
FT_END_HEADER
#endif /* __FTRENDER_H__ */
#endif /* FTRENDER_H_ */
/* END */

View File

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

View File

@ -2,12 +2,12 @@
/* */
/* ftsnames.h */
/* */
/* Simple interface to access SFNT name tables (which are used */
/* Simple interface to access SFNT `name' tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -19,12 +19,13 @@
/***************************************************************************/
#ifndef __FT_SFNT_NAMES_H__
#define __FT_SFNT_NAMES_H__
#ifndef FTSNAMES_H_
#define FTSNAMES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@ -49,7 +50,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* The TrueType and OpenType specifications allow the inclusion of */
/* a special `names table' in font files. This table contains */
/* a special names table (`name') in font files. This table contains */
/* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */
/* */
@ -70,30 +71,37 @@ FT_BEGIN_HEADER
/* */
/* <Fields> */
/* platform_id :: The platform ID for `string'. */
/* See @TT_PLATFORM_XXX for possible values. */
/* */
/* encoding_id :: The encoding ID for `string'. */
/* See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX */
/* for possible values. */
/* */
/* language_id :: The language ID for `string'. */
/* See @TT_MAC_LANGID_XXX and @TT_MS_LANGID_XXX for */
/* possible values. */
/* */
/* Registered OpenType values for `language_id' are */
/* always smaller than 0x8000; values equal or larger */
/* than 0x8000 usually indicate a language tag string */
/* (introduced in OpenType version 1.6). Use function */
/* @FT_Get_Sfnt_LangTag with `language_id' as its */
/* argument to retrieve the associated language tag. */
/* */
/* name_id :: An identifier for `string'. */
/* See @TT_NAME_ID_XXX for possible values. */
/* */
/* string :: The `name' string. Note that its format differs */
/* depending on the (platform,encoding) pair. It can */
/* be a Pascal String, a UTF-16 one, etc. */
/* */
/* Generally speaking, the string is not */
/* zero-terminated. Please refer to the TrueType */
/* specification for details. */
/* depending on the (platform,encoding) pair, being */
/* either a string of bytes (without a terminating */
/* NULL byte) or containing UTF-16BE entities. */
/* */
/* string_len :: The length of `string' in bytes. */
/* */
/* <Note> */
/* Possible values for `platform_id', `encoding_id', `language_id', */
/* and `name_id' are given in the file `ttnameid.h'. For details */
/* please refer to the TrueType or OpenType specification. */
/* */
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
/* Please refer to the TrueType or OpenType specification for more */
/* details. */
/* */
typedef struct FT_SfntName_
{
@ -103,7 +111,7 @@ FT_BEGIN_HEADER
FT_UShort name_id;
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
FT_UInt string_len; /* in bytes */
} FT_SfntName;
@ -147,54 +155,99 @@ FT_BEGIN_HEADER
/* */
/* <Note> */
/* The `string' array returned in the `aname' structure is not */
/* null-terminated. The application should deallocate it if it is no */
/* longer in use. */
/* null-terminated. Note that you don't have to deallocate `string' */
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* 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 */
/* platform, encoding, and name ID. */
/* */
/* `name' table format~1 entries can use language tags also, see */
/* @FT_Get_Sfnt_LangTag. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
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' )
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SfntLangTag */
/* */
/* <Description> */
/* A structure to model a language tag entry from an SFNT `name' */
/* table. */
/* */
/* <Fields> */
/* string :: The language tag string, encoded in UTF-16BE */
/* (without trailing NULL bytes). */
/* */
/* string_len :: The length of `string' in *bytes*. */
/* */
/* <Note> */
/* Please refer to the TrueType or OpenType specification for more */
/* details. */
/* */
/* <Since> */
/* 2.8 */
/* */
typedef struct FT_SfntLangTag_
{
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
} FT_SfntLangTag;
/***************************************************************************
*
* @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' )
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_LangTag */
/* */
/* <Description> */
/* Retrieve the language tag associated with a language ID of an SFNT */
/* `name' table entry. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* langID :: The language ID, as returned by @FT_Get_Sfnt_Name. */
/* This is always a value larger than 0x8000. */
/* */
/* <Output> */
/* alangTag :: The language tag associated with the `name' table */
/* entry's language ID. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `string' array returned in the `alangTag' structure is not */
/* null-terminated. Note that you don't have to deallocate `string' */
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* Only `name' table format~1 supports language tags. For format~0 */
/* tables, this function always returns FT_Err_Invalid_Table. For */
/* invalid format~1 language ID values, FT_Err_Invalid_Argument is */
/* returned. */
/* */
/* <Since> */
/* 2.8 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_LangTag( FT_Face face,
FT_UInt langID,
FT_SfntLangTag *alangTag );
/* */
FT_END_HEADER
#endif /* __FT_SFNT_NAMES_H__ */
#endif /* FTSNAMES_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (specification). */
/* */
/* Copyright 2002-2006, 2008, 2009, 2011-2012 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FT_STROKE_H__
#define __FT_STROKE_H__
#ifndef FTSTROKE_H_
#define FTSTROKE_H_
#include <ft2build.h>
#include FT_OUTLINE_H
@ -46,6 +46,38 @@ FT_BEGIN_HEADER
* This can be useful to generate `bordered' glyph, i.e., glyphs
* displayed with a coloured (and anti-aliased) border around their
* shape.
*
* @order:
* FT_Stroker
*
* FT_Stroker_LineJoin
* FT_Stroker_LineCap
* FT_StrokerBorder
*
* FT_Outline_GetInsideBorder
* FT_Outline_GetOutsideBorder
*
* FT_Glyph_Stroke
* FT_Glyph_StrokeBorder
*
* FT_Stroker_New
* FT_Stroker_Set
* FT_Stroker_Rewind
* FT_Stroker_ParseOutline
* FT_Stroker_Done
*
* FT_Stroker_BeginSubPath
* FT_Stroker_EndSubPath
*
* FT_Stroker_LineTo
* FT_Stroker_ConicTo
* FT_Stroker_CubicTo
*
* FT_Stroker_GetBorderCounts
* FT_Stroker_ExportBorder
* FT_Stroker_GetCounts
* FT_Stroker_Export
*
*/
@ -55,7 +87,7 @@ FT_BEGIN_HEADER
* FT_Stroker
*
* @description:
* Opaque handler to a path stroker object.
* Opaque handle to a path stroker object.
*/
typedef struct FT_StrokerRec_* FT_Stroker;
@ -104,7 +136,7 @@ FT_BEGIN_HEADER
* 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.
* backward compatibility.
*/
typedef enum FT_Stroker_LineJoin_
{
@ -276,6 +308,8 @@ FT_BEGIN_HEADER
* @note:
* The radius is expressed in the same units as the outline
* coordinates.
*
* This function calls @FT_Stroker_Rewind automatically.
*/
FT_EXPORT( void )
FT_Stroker_Set( FT_Stroker stroker,
@ -432,7 +466,7 @@ FT_BEGIN_HEADER
* FT_Stroker_ConicTo
*
* @description:
* `Draw' a single quadratic Bézier in the stroker's current sub-path,
* `Draw' a single quadratic Bezier in the stroker's current sub-path,
* from the last position.
*
* @input:
@ -440,7 +474,7 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* control ::
* A pointer to a Bézier control point.
* A pointer to a Bezier control point.
*
* to ::
* A pointer to the destination point.
@ -464,7 +498,7 @@ FT_BEGIN_HEADER
* FT_Stroker_CubicTo
*
* @description:
* `Draw' a single cubic Bézier in the stroker's current sub-path,
* `Draw' a single cubic Bezier in the stroker's current sub-path,
* from the last position.
*
* @input:
@ -472,10 +506,10 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* control1 ::
* A pointer to the first Bézier control point.
* A pointer to the first Bezier control point.
*
* control2 ::
* A pointer to second Bézier control point.
* A pointer to second Bezier control point.
*
* to ::
* A pointer to the destination point.
@ -570,10 +604,10 @@ FT_BEGIN_HEADER
* receive all new data.
*
* When an outline, or a sub-path, is `closed', the stroker generates
* two independent `border' outlines, named `left' and `right'
* two independent `border' outlines, named `left' and `right'.
*
* When the outline, or a sub-path, is `opened', the stroker merges
* the `border' outlines with caps. The `left' border receives all
* the `border' outlines with caps. The `left' border receives all
* points, while the `right' border becomes empty.
*
* Use the function @FT_Stroker_Export instead if you want to
@ -736,11 +770,11 @@ FT_BEGIN_HEADER
FT_Bool inside,
FT_Bool destroy );
/* */
/* */
FT_END_HEADER
#endif /* __FT_STROKE_H__ */
#endif /* FTSTROKE_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
/* Copyright 2000-2001, 2003, 2006, 2008, 2012 by */
/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -37,12 +37,12 @@
/* Main reason for not lifting the functions in this module to a */
/* `standard' API is that the used parameters for emboldening and */
/* slanting are not configurable. Consider the functions as a */
/* code resource which should be copied into the application and */
/* code resource that should be copied into the application and */
/* adapted to the particular needs. */
#ifndef __FTSYNTH_H__
#define __FTSYNTH_H__
#ifndef FTSYNTH_H_
#define FTSYNTH_H_
#include <ft2build.h>
@ -62,8 +62,10 @@ FT_BEGIN_HEADER
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */
/* For emboldened outlines the height, width, and advance metrics are */
/* increased by the strength of the emboldening. You can also call */
/* @FT_Outline_Get_CBox to get precise values. */
/* increased by the strength of the emboldening -- this even affects */
/* mono-width fonts! */
/* */
/* You can also call @FT_Outline_Get_CBox to get precise values. */
FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
@ -73,9 +75,10 @@ FT_BEGIN_HEADER
/* */
FT_END_HEADER
#endif /* __FTSYNTH_H__ */
#endif /* FTSYNTH_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType low-level system interface definition (specification). */
/* */
/* Copyright 1996-2001, 2002, 2005, 2010 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTSYSTEM_H__
#define __FTSYSTEM_H__
#ifndef FTSYSTEM_H_
#define FTSYSTEM_H_
#include <ft2build.h>
@ -192,6 +192,10 @@ FT_BEGIN_HEADER
* @description:
* A handle to an input stream.
*
* @also:
* See @FT_StreamRec for the publicly accessible fields of a given
* stream object.
*
*/
typedef struct FT_StreamRec_* FT_Stream;
@ -285,6 +289,11 @@ FT_BEGIN_HEADER
* size ::
* The stream size in bytes.
*
* In case of compressed streams where the size is unknown before
* actually doing the decompression, the value is set to 0x7FFFFFFF.
* (Note that this size value can occur for normal streams also; it is
* thus just a hint.)
*
* pos ::
* The current position within the stream.
*
@ -335,13 +344,12 @@ FT_BEGIN_HEADER
} FT_StreamRec;
/* */
FT_END_HEADER
#endif /* __FTSYSTEM_H__ */
#endif /* FTSYSTEM_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (specification). */
/* */
/* Copyright 2001, 2003, 2005, 2007, 2013 by */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTTRIGON_H__
#define __FTTRIGON_H__
#ifndef FTTRIGON_H_
#define FTTRIGON_H_
#include FT_FREETYPE_H
@ -225,8 +225,8 @@ FT_BEGIN_HEADER
*
* @description:
* Return the unit vector corresponding to a given angle. After the
* call, the value of `vec.x' will be `sin(angle)', and the value of
* `vec.y' will be `cos(angle)'.
* call, the value of `vec.x' will be `cos(angle)', and the value of
* `vec.y' will be `sin(angle)'.
*
* This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly.
@ -237,7 +237,7 @@ FT_BEGIN_HEADER
*
* @input:
* angle ::
* The address of angle.
* The input angle.
*
*/
FT_EXPORT( void )
@ -259,7 +259,7 @@ FT_BEGIN_HEADER
*
* @input:
* angle ::
* The address of angle.
* The input angle.
*
*/
FT_EXPORT( void )
@ -344,7 +344,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTTRIGON_H__ */
#endif /* FTTRIGON_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType simple types definitions (specification only). */
/* */
/* Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTTYPES_H__
#define __FTTYPES_H__
#ifndef FTTYPES_H_
#define FTTYPES_H_
#include <ft2build.h>
@ -57,6 +57,8 @@ FT_BEGIN_HEADER
/* FT_UInt16 */
/* FT_Int32 */
/* FT_UInt32 */
/* FT_Int64 */
/* FT_UInt64 */
/* FT_Short */
/* FT_UShort */
/* FT_Long */
@ -78,7 +80,9 @@ FT_BEGIN_HEADER
/* FT_F2Dot14 */
/* FT_UnitVector */
/* FT_F26Dot6 */
/* FT_Data */
/* */
/* FT_MAKE_TAG */
/* */
/* FT_Generic */
/* FT_Generic_Finalizer */
@ -418,10 +422,10 @@ FT_BEGIN_HEADER
/* details of usage. */
/* */
/* <Input> */
/* The address of the FreeType object which is under finalization. */
/* The address of the FreeType object that is under finalization. */
/* Its client data is accessed through its `generic' field. */
/* */
typedef void (*FT_Generic_Finalizer)(void* object);
typedef void (*FT_Generic_Finalizer)( void* object );
/*************************************************************************/
@ -466,8 +470,8 @@ FT_BEGIN_HEADER
/* FT_MAKE_TAG */
/* */
/* <Description> */
/* This macro converts four-letter tags which are used to label */
/* TrueType tables into an unsigned long to be used within FreeType. */
/* This macro converts four-letter tags that are used to label */
/* TrueType tables into an unsigned long, to be used within FreeType. */
/* */
/* <Note> */
/* The produced values *must* be 32-bit integers. Don't redefine */
@ -567,9 +571,9 @@ FT_BEGIN_HEADER
} FT_ListRec;
/* */
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
#define FT_BOOL( x ) ( (FT_Bool)( x ) )
@ -592,7 +596,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTTYPES_H__ */
#endif /* FTTYPES_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
/* Copyright 2003, 2004, 2008 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTWINFNT_H__
#define __FTWINFNT_H__
#ifndef FTWINFNT_H_
#define FTWINFNT_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -58,9 +58,10 @@ FT_BEGIN_HEADER
* @description:
* A list of valid values for the `charset' byte in
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
* encodings (except for cp1361) can be found at ftp://ftp.unicode.org
* in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
* roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
* encodings (except for cp1361) can be found at
* ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
* subdirectory. cp1361 is roughly a superset of
* MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
*
* @values:
* FT_WinFNT_ID_DEFAULT ::
@ -77,7 +78,7 @@ FT_BEGIN_HEADER
* Mac Roman encoding.
*
* FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <michael@poettgen.de>:
* From Michael Poettgen <michael@poettgen.de>:
*
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
* is used for the charset of vector fonts, like `modern.fon',
@ -94,7 +95,7 @@ FT_BEGIN_HEADER
* second default codepage that most international versions of
* Windows have. It is one of the OEM codepages from
*
* http://www.microsoft.com/globaldev/reference/cphome.mspx,
* https://msdn.microsoft.com/en-us/goglobal/bb964655,
*
* and is used for the `DOS boxes', to support legacy applications.
* A German Windows version for example usually uses ANSI codepage
@ -258,12 +259,12 @@ FT_BEGIN_HEADER
FT_Get_WinFNT_Header( FT_Face face,
FT_WinFNT_HeaderRec *aheader );
/* */
FT_END_HEADER
#endif /* __FTWINFNT_H__ */
#endif /* FTWINFNT_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* Basic Type 1/Type 2 tables definitions and interface (specification */
/* only). */
/* */
/* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -17,8 +17,8 @@
/***************************************************************************/
#ifndef __T1TABLES_H__
#define __T1TABLES_H__
#ifndef T1TABLES_H_
#define T1TABLES_H_
#include <ft2build.h>
@ -49,6 +49,26 @@ FT_BEGIN_HEADER
/* This section contains the definition of Type 1-specific tables, */
/* including structures related to other PostScript font formats. */
/* */
/* <Order> */
/* PS_FontInfoRec */
/* PS_FontInfo */
/* PS_PrivateRec */
/* PS_Private */
/* */
/* CID_FaceDictRec */
/* CID_FaceDict */
/* CID_FaceInfoRec */
/* CID_FaceInfo */
/* */
/* FT_Has_PS_Glyph_Names */
/* FT_Get_PS_Font_Info */
/* FT_Get_PS_Font_Private */
/* FT_Get_PS_Font_Value */
/* */
/* T1_Blend_Flags */
/* T1_EncodingType */
/* PS_Dict_Keys */
/* */
/*************************************************************************/
@ -190,14 +210,30 @@ FT_BEGIN_HEADER
/* given blend dictionary (font info or private). Used to support */
/* Multiple Masters fonts. */
/* */
/* <Values> */
/* T1_BLEND_UNDERLINE_POSITION :: */
/* T1_BLEND_UNDERLINE_THICKNESS :: */
/* T1_BLEND_ITALIC_ANGLE :: */
/* T1_BLEND_BLUE_VALUES :: */
/* T1_BLEND_OTHER_BLUES :: */
/* T1_BLEND_STANDARD_WIDTH :: */
/* T1_BLEND_STANDARD_HEIGHT :: */
/* T1_BLEND_STEM_SNAP_WIDTHS :: */
/* T1_BLEND_STEM_SNAP_HEIGHTS :: */
/* T1_BLEND_BLUE_SCALE :: */
/* T1_BLEND_BLUE_SHIFT :: */
/* T1_BLEND_FAMILY_BLUES :: */
/* T1_BLEND_FAMILY_OTHER_BLUES :: */
/* T1_BLEND_FORCE_BOLD :: */
/* */
typedef enum T1_Blend_Flags_
{
/*# required fields in a FontInfo blend dictionary */
/* required fields in a FontInfo blend dictionary */
T1_BLEND_UNDERLINE_POSITION = 0,
T1_BLEND_UNDERLINE_THICKNESS,
T1_BLEND_ITALIC_ANGLE,
/*# required fields in a Private blend dictionary */
/* required fields in a Private blend dictionary */
T1_BLEND_BLUE_VALUES,
T1_BLEND_OTHER_BLUES,
T1_BLEND_STANDARD_WIDTH,
@ -210,15 +246,13 @@ FT_BEGIN_HEADER
T1_BLEND_FAMILY_OTHER_BLUES,
T1_BLEND_FORCE_BOLD,
/*# never remove */
T1_BLEND_MAX
T1_BLEND_MAX /* do not remove */
} T1_Blend_Flags;
/* */
/*# backwards compatible definitions */
/* these constants are deprecated; use the corresponding */
/* `T1_Blend_Flags' values instead */
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
@ -235,6 +269,8 @@ FT_BEGIN_HEADER
#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
#define t1_blend_max T1_BLEND_MAX
/* */
/* maximum number of Multiple Masters designs, as defined in the spec */
#define T1_MAX_MM_DESIGNS 16
@ -255,7 +291,7 @@ FT_BEGIN_HEADER
} PS_DesignMapRec, *PS_DesignMap;
/* backwards-compatible definition */
/* backward compatible definition */
typedef PS_DesignMapRec T1_DesignMap;
@ -290,7 +326,7 @@ FT_BEGIN_HEADER
} PS_BlendRec, *PS_Blend;
/* backwards-compatible definition */
/* backward compatible definition */
typedef PS_BlendRec T1_Blend;
@ -333,10 +369,17 @@ FT_BEGIN_HEADER
/* */
typedef struct CID_FaceDictRec_* CID_FaceDict;
/* */
/* backwards-compatible definition */
/*************************************************************************/
/* */
/* <Struct> */
/* CID_FontDict */
/* */
/* <Description> */
/* This type is equivalent to @CID_FaceDictRec. It is deprecated but */
/* kept to maintain source compatibility between various versions of */
/* FreeType. */
/* */
typedef CID_FaceDictRec CID_FontDict;
@ -449,8 +492,9 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* The string pointers within the font info structure are owned by
* the face and don't need to be freed by the caller.
* String pointers within the @PS_FontInfoRec structure are owned by
* the face and don't need to be freed by the caller. Missing entries
* in the font's FontInfo dictionary are represented by NULL pointers.
*
* If the font's format is not PostScript-based, this function will
* return the `FT_Err_Invalid_Argument' error code.
@ -503,6 +547,16 @@ FT_BEGIN_HEADER
/* An enumeration describing the `Encoding' entry in a Type 1 */
/* dictionary. */
/* */
/* <Values> */
/* T1_ENCODING_TYPE_NONE :: */
/* T1_ENCODING_TYPE_ARRAY :: */
/* T1_ENCODING_TYPE_STANDARD :: */
/* T1_ENCODING_TYPE_ISOLATIN1 :: */
/* T1_ENCODING_TYPE_EXPERT :: */
/* */
/* <Since> */
/* 2.4.8 */
/* */
typedef enum T1_EncodingType_
{
T1_ENCODING_TYPE_NONE = 0,
@ -523,6 +577,57 @@ FT_BEGIN_HEADER
/* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */
/* the Type~1 dictionary entry to retrieve. */
/* */
/* <Values> */
/* PS_DICT_FONT_TYPE :: */
/* PS_DICT_FONT_MATRIX :: */
/* PS_DICT_FONT_BBOX :: */
/* PS_DICT_PAINT_TYPE :: */
/* PS_DICT_FONT_NAME :: */
/* PS_DICT_UNIQUE_ID :: */
/* PS_DICT_NUM_CHAR_STRINGS :: */
/* PS_DICT_CHAR_STRING_KEY :: */
/* PS_DICT_CHAR_STRING :: */
/* PS_DICT_ENCODING_TYPE :: */
/* PS_DICT_ENCODING_ENTRY :: */
/* PS_DICT_NUM_SUBRS :: */
/* PS_DICT_SUBR :: */
/* PS_DICT_STD_HW :: */
/* PS_DICT_STD_VW :: */
/* PS_DICT_NUM_BLUE_VALUES :: */
/* PS_DICT_BLUE_VALUE :: */
/* PS_DICT_BLUE_FUZZ :: */
/* PS_DICT_NUM_OTHER_BLUES :: */
/* PS_DICT_OTHER_BLUE :: */
/* PS_DICT_NUM_FAMILY_BLUES :: */
/* PS_DICT_FAMILY_BLUE :: */
/* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */
/* PS_DICT_FAMILY_OTHER_BLUE :: */
/* PS_DICT_BLUE_SCALE :: */
/* PS_DICT_BLUE_SHIFT :: */
/* PS_DICT_NUM_STEM_SNAP_H :: */
/* PS_DICT_STEM_SNAP_H :: */
/* PS_DICT_NUM_STEM_SNAP_V :: */
/* PS_DICT_STEM_SNAP_V :: */
/* PS_DICT_FORCE_BOLD :: */
/* PS_DICT_RND_STEM_UP :: */
/* PS_DICT_MIN_FEATURE :: */
/* PS_DICT_LEN_IV :: */
/* PS_DICT_PASSWORD :: */
/* PS_DICT_LANGUAGE_GROUP :: */
/* PS_DICT_VERSION :: */
/* PS_DICT_NOTICE :: */
/* PS_DICT_FULL_NAME :: */
/* PS_DICT_FAMILY_NAME :: */
/* PS_DICT_WEIGHT :: */
/* PS_DICT_IS_FIXED_PITCH :: */
/* PS_DICT_UNDERLINE_POSITION :: */
/* PS_DICT_UNDERLINE_THICKNESS :: */
/* PS_DICT_FS_TYPE :: */
/* PS_DICT_ITALIC_ANGLE :: */
/* */
/* <Since> */
/* 2.4.8 */
/* */
typedef enum PS_Dict_Keys_
{
/* conventionally in the font dictionary */
@ -644,6 +749,9 @@ FT_BEGIN_HEADER
* If the font's format is not PostScript-based, this function returns
* the `FT_Err_Invalid_Argument' error code.
*
* @since:
* 2.4.8
*
*/
FT_EXPORT( FT_Long )
FT_Get_PS_Font_Value( FT_Face face,
@ -656,7 +764,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __T1TABLES_H__ */
#endif /* T1TABLES_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */
/* */
/* Copyright 1996-2005, 2008-2012 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -17,8 +17,8 @@
/***************************************************************************/
#ifndef __TTTABLES_H__
#define __TTTABLES_H__
#ifndef TTTABLES_H_
#define TTTABLES_H_
#include <ft2build.h>
@ -45,8 +45,28 @@ FT_BEGIN_HEADER
/* TrueType specific table types and functions. */
/* */
/* <Description> */
/* This section contains the definition of TrueType-specific tables */
/* as well as some routines used to access and process them. */
/* This section contains definitions of some basic tables specific to */
/* TrueType and OpenType as well as some routines used to access and */
/* process them. */
/* */
/* <Order> */
/* TT_Header */
/* TT_HoriHeader */
/* TT_VertHeader */
/* TT_OS2 */
/* TT_Postscript */
/* TT_PCLT */
/* TT_MaxProfile */
/* */
/* FT_Sfnt_Tag */
/* FT_Get_Sfnt_Table */
/* FT_Load_Sfnt_Table */
/* FT_Sfnt_Table_Info */
/* */
/* FT_Get_CMap_Language_ID */
/* FT_Get_CMap_Format */
/* */
/* FT_PARAM_TAG_UNPATENTED_HINTING */
/* */
/*************************************************************************/
@ -57,8 +77,8 @@ FT_BEGIN_HEADER
/* TT_Header */
/* */
/* <Description> */
/* A structure used to model a TrueType font header table. All */
/* fields follow the TrueType specification. */
/* A structure to model a TrueType font header table. All fields */
/* follow the OpenType specification. */
/* */
typedef struct TT_Header_
{
@ -95,9 +115,9 @@ FT_BEGIN_HEADER
/* TT_HoriHeader */
/* */
/* <Description> */
/* A structure used to model a TrueType horizontal header, the `hhea' */
/* A structure to model a TrueType horizontal header, the `hhea' */
/* table, as well as the corresponding horizontal metrics table, */
/* i.e., the `hmtx' table. */
/* `hmtx'. */
/* */
/* <Fields> */
/* Version :: The table version. */
@ -112,7 +132,7 @@ FT_BEGIN_HEADER
/* glyphs found in the font (maybe ASCII). */
/* */
/* You should use the `sTypoAscender' field */
/* of the OS/2 table instead if you want */
/* of the `OS/2' table instead if you want */
/* the correct one. */
/* */
/* Descender :: The font's descender, i.e., the distance */
@ -126,7 +146,7 @@ FT_BEGIN_HEADER
/* glyphs found in the font (maybe ASCII). */
/* */
/* You should use the `sTypoDescender' */
/* field of the OS/2 table instead if you */
/* field of the `OS/2' table instead if you */
/* want the correct one. */
/* */
/* Line_Gap :: The font's line gap, i.e., the distance */
@ -156,6 +176,8 @@ FT_BEGIN_HEADER
/* caret_Slope_Run :: The run coefficient of the cursor's */
/* slope. */
/* */
/* caret_Offset :: The cursor's offset for slanted fonts. */
/* */
/* Reserved :: 8~reserved bytes. */
/* */
/* metric_Data_Format :: Always~0. */
@ -169,13 +191,10 @@ FT_BEGIN_HEADER
/* short_metrics :: A pointer into the `hmtx' table. */
/* */
/* <Note> */
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
/* be identical except for the names of their fields which */
/* are different. */
/* */
/* This ensures that a single function in the `ttload' */
/* module is able to read both the horizontal and vertical */
/* headers. */
/* For an OpenType variation font, the values of the following fields */
/* can change after a call to @FT_Set_Var_Design_Coordinates (and */
/* friends) if the font contains an `MVAR' table: `caret_Slope_Rise', */
/* `caret_Slope_Run', and `caret_Offset'. */
/* */
typedef struct TT_HoriHeader_
{
@ -198,9 +217,9 @@ FT_BEGIN_HEADER
FT_Short metric_Data_Format;
FT_UShort number_Of_HMetrics;
/* The following fields are not defined by the TrueType specification */
/* The following fields are not defined by the OpenType specification */
/* but they are used to connect the metrics header to the relevant */
/* `HMTX' table. */
/* `hmtx' table. */
void* long_metrics;
void* short_metrics;
@ -215,8 +234,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* A structure used to model a TrueType vertical header, the `vhea' */
/* table, as well as the corresponding vertical metrics table, i.e., */
/* the `vmtx' table. */
/* table, as well as the corresponding vertical metrics table, */
/* `vmtx'. */
/* */
/* <Fields> */
/* Version :: The table version. */
@ -232,8 +251,8 @@ FT_BEGIN_HEADER
/* ASCII). */
/* */
/* You should use the `sTypoAscender' */
/* field of the OS/2 table instead if you */
/* want the correct one. */
/* field of the `OS/2' table instead if */
/* you want the correct one. */
/* */
/* Descender :: The font's descender, i.e., the */
/* distance from the baseline to the */
@ -247,8 +266,8 @@ FT_BEGIN_HEADER
/* ASCII). */
/* */
/* You should use the `sTypoDescender' */
/* field of the OS/2 table instead if you */
/* want the correct one. */
/* field of the `OS/2' table instead if */
/* you want the correct one. */
/* */
/* Line_Gap :: The font's line gap, i.e., the distance */
/* to add to the ascender and descender to */
@ -278,30 +297,26 @@ FT_BEGIN_HEADER
/* slope. */
/* */
/* caret_Offset :: The cursor's offset for slanted fonts. */
/* This value is `reserved' in vmtx */
/* version 1.0. */
/* */
/* Reserved :: 8~reserved bytes. */
/* */
/* metric_Data_Format :: Always~0. */
/* */
/* number_Of_HMetrics :: Number of VMetrics entries in the */
/* number_Of_VMetrics :: Number of VMetrics entries in the */
/* `vmtx' table -- this value can be */
/* smaller than the total number of glyphs */
/* in the font. */
/* */
/* long_metrics :: A pointer into the `vmtx' table. */
/* long_metrics :: A pointer into the `vmtx' table. */
/* */
/* short_metrics :: A pointer into the `vmtx' table. */
/* short_metrics :: A pointer into the `vmtx' table. */
/* */
/* <Note> */
/* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
/* be identical except for the names of their fields which */
/* are different. */
/* */
/* This ensures that a single function in the `ttload' */
/* module is able to read both the horizontal and vertical */
/* headers. */
/* For an OpenType variation font, the values of the following fields */
/* can change after a call to @FT_Set_Var_Design_Coordinates (and */
/* friends) if the font contains an `MVAR' table: `Ascender', */
/* `Descender', `Line_Gap', `caret_Slope_Rise', `caret_Slope_Run', */
/* and `caret_Offset'. */
/* */
typedef struct TT_VertHeader_
{
@ -312,9 +327,9 @@ FT_BEGIN_HEADER
FT_UShort advance_Height_Max; /* advance height maximum */
FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
FT_Short yMax_Extent; /* xmax or ymax extents */
FT_Short min_Top_Side_Bearing; /* minimum top-sb */
FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */
FT_Short yMax_Extent; /* ymax extents */
FT_Short caret_Slope_Rise;
FT_Short caret_Slope_Run;
FT_Short caret_Offset;
@ -324,9 +339,9 @@ FT_BEGIN_HEADER
FT_Short metric_Data_Format;
FT_UShort number_Of_VMetrics;
/* The following fields are not defined by the TrueType specification */
/* but they're used to connect the metrics header to the relevant */
/* `HMTX' or `VMTX' table. */
/* The following fields are not defined by the OpenType specification */
/* but they are used to connect the metrics header to the relevant */
/* `vmtx' table. */
void* long_metrics;
void* short_metrics;
@ -340,20 +355,35 @@ FT_BEGIN_HEADER
/* TT_OS2 */
/* */
/* <Description> */
/* A structure used to model a TrueType OS/2 table. This is the long */
/* table version. All fields comply to the TrueType specification. */
/* A structure to model a TrueType `OS/2' table. All fields comply */
/* to the OpenType specification. */
/* */
/* Note that we now support old Mac fonts which do not include an */
/* OS/2 table. In this case, the `version' field is always set to */
/* Note that we now support old Mac fonts that do not include an */
/* `OS/2' table. In this case, the `version' field is always set to */
/* 0xFFFF. */
/* */
/* <Note> */
/* For an OpenType variation font, the values of the following fields */
/* can change after a call to @FT_Set_Var_Design_Coordinates (and */
/* friends) if the font contains an `MVAR' table: `sCapHeight', */
/* `sTypoAscender', `sTypoDescender', `sTypoLineGap', `sxHeight', */
/* `usWinAscent', `usWinDescent', `yStrikeoutPosition', */
/* `yStrikeoutSize', `ySubscriptXOffset', `ySubScriptXSize', */
/* `ySubscriptYOffset', `ySubscriptYSize', `ySuperscriptXOffset', */
/* `ySuperscriptXSize', `ySuperscriptYOffset', and */
/* `ySuperscriptYSize'. */
/* */
/* Possible values for bits in the `ulUnicodeRangeX' fields are given */
/* by the @TT_UCR_XXX macros. */
/* */
typedef struct TT_OS2_
{
FT_UShort version; /* 0x0001 - more or 0xFFFF */
FT_Short xAvgCharWidth;
FT_UShort usWeightClass;
FT_UShort usWidthClass;
FT_Short fsType;
FT_UShort fsType;
FT_Short ySubscriptXSize;
FT_Short ySubscriptYSize;
FT_Short ySubscriptXOffset;
@ -384,12 +414,12 @@ FT_BEGIN_HEADER
FT_UShort usWinAscent;
FT_UShort usWinDescent;
/* only version 1 tables: */
/* only version 1 and higher: */
FT_ULong ulCodePageRange1; /* Bits 0-31 */
FT_ULong ulCodePageRange2; /* Bits 32-63 */
/* only version 2 tables: */
/* only version 2 and higher: */
FT_Short sxHeight;
FT_Short sCapHeight;
@ -397,6 +427,11 @@ FT_BEGIN_HEADER
FT_UShort usBreakChar;
FT_UShort usMaxContext;
/* only version 5 and higher: */
FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
} TT_OS2;
@ -406,10 +441,16 @@ FT_BEGIN_HEADER
/* TT_Postscript */
/* */
/* <Description> */
/* A structure used to model a TrueType PostScript table. All fields */
/* comply to the TrueType specification. This structure does not */
/* reference the PostScript glyph names, which can be nevertheless */
/* accessed with the `ttpost' module. */
/* A structure to model a TrueType `post' table. All fields comply */
/* to the OpenType specification. This structure does not reference */
/* a font's PostScript glyph names; use @FT_Get_Glyph_Name to */
/* retrieve them. */
/* */
/* <Note> */
/* For an OpenType variation font, the values of the following fields */
/* can change after a call to @FT_Set_Var_Design_Coordinates (and */
/* friends) if the font contains an `MVAR' table: `underlinePosition' */
/* and `underlineThickness'. */
/* */
typedef struct TT_Postscript_
{
@ -423,8 +464,8 @@ FT_BEGIN_HEADER
FT_ULong minMemType1;
FT_ULong maxMemType1;
/* Glyph names follow in the file, but we don't */
/* load them by default. See the ttpost.c file. */
/* Glyph names follow in the `post' table, but we don't */
/* load them by default. */
} TT_Postscript;
@ -435,8 +476,8 @@ FT_BEGIN_HEADER
/* TT_PCLT */
/* */
/* <Description> */
/* A structure used to model a TrueType PCLT table. All fields */
/* comply to the TrueType specification. */
/* A structure to model a TrueType `PCLT' table. All fields comply */
/* to the OpenType specification. */
/* */
typedef struct TT_PCLT_
{
@ -465,9 +506,9 @@ FT_BEGIN_HEADER
/* TT_MaxProfile */
/* */
/* <Description> */
/* The maximum profile is a table containing many max values which */
/* can be used to pre-allocate arrays. This ensures that no memory */
/* allocation occurs during a glyph load. */
/* The maximum profile (`maxp') table contains many max values, which */
/* can be used to pre-allocate arrays for speeding up glyph loading */
/* and hinting. */
/* */
/* <Fields> */
/* version :: The version number. */
@ -477,21 +518,19 @@ FT_BEGIN_HEADER
/* */
/* maxPoints :: The maximum number of points in a */
/* non-composite TrueType glyph. See also */
/* the structure element */
/* `maxCompositePoints'. */
/* */
/* maxContours :: The maximum number of contours in a */
/* non-composite TrueType glyph. See also */
/* the structure element */
/* `maxCompositeContours'. */
/* */
/* maxCompositePoints :: The maximum number of points in a */
/* composite TrueType glyph. See also the */
/* structure element `maxPoints'. */
/* composite TrueType glyph. See also */
/* `maxPoints'. */
/* */
/* maxCompositeContours :: The maximum number of contours in a */
/* composite TrueType glyph. See also the */
/* structure element `maxContours'. */
/* composite TrueType glyph. See also */
/* `maxContours'. */
/* */
/* maxZones :: The maximum number of zones used for */
/* glyph hinting. */
@ -552,24 +591,48 @@ FT_BEGIN_HEADER
/* FT_Sfnt_Tag */
/* */
/* <Description> */
/* An enumeration used to specify the index of an SFNT table. */
/* Used in the @FT_Get_Sfnt_Table API function. */
/* An enumeration to specify indices of SFNT tables loaded and parsed */
/* by FreeType during initialization of an SFNT font. Used in the */
/* @FT_Get_Sfnt_Table API function. */
/* */
/* <Values> */
/* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */
/* */
/* FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure. */
/* */
/* FT_SFNT_OS2 :: To access the font's @TT_OS2 structure. */
/* */
/* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */
/* */
/* FT_SFNT_VHEA :: To access the font's @TT_VertHeader structure. */
/* */
/* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */
/* */
/* FT_SFNT_PCLT :: To access the font's @TT_PCLT structure. */
/* */
typedef enum FT_Sfnt_Tag_
{
ft_sfnt_head = 0, /* TT_Header */
ft_sfnt_maxp = 1, /* TT_MaxProfile */
ft_sfnt_os2 = 2, /* TT_OS2 */
ft_sfnt_hhea = 3, /* TT_HoriHeader */
ft_sfnt_vhea = 4, /* TT_VertHeader */
ft_sfnt_post = 5, /* TT_Postscript */
ft_sfnt_pclt = 6, /* TT_PCLT */
FT_SFNT_HEAD,
FT_SFNT_MAXP,
FT_SFNT_OS2,
FT_SFNT_HHEA,
FT_SFNT_VHEA,
FT_SFNT_POST,
FT_SFNT_PCLT,
sfnt_max /* internal end mark */
FT_SFNT_MAX
} FT_Sfnt_Tag;
/* */
/* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */
/* values instead */
#define ft_sfnt_head FT_SFNT_HEAD
#define ft_sfnt_maxp FT_SFNT_MAXP
#define ft_sfnt_os2 FT_SFNT_OS2
#define ft_sfnt_hhea FT_SFNT_HHEA
#define ft_sfnt_vhea FT_SFNT_VHEA
#define ft_sfnt_post FT_SFNT_POST
#define ft_sfnt_pclt FT_SFNT_PCLT
/*************************************************************************/
@ -578,7 +641,7 @@ FT_BEGIN_HEADER
/* FT_Get_Sfnt_Table */
/* */
/* <Description> */
/* Return a pointer to a given SFNT table within a face. */
/* Return a pointer to a given SFNT table stored within a face. */
/* */
/* <Input> */
/* face :: A handle to the source. */
@ -586,7 +649,7 @@ FT_BEGIN_HEADER
/* tag :: The index of the SFNT table. */
/* */
/* <Return> */
/* A type-less pointer to the table. This will be~0 in case of */
/* A type-less pointer to the table. This will be NULL in case of */
/* error, or if the corresponding table was not found *OR* loaded */
/* from the file. */
/* */
@ -607,7 +670,7 @@ FT_BEGIN_HEADER
/* */
/* */
/* vert_header = */
/* (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea ); */
/* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); */
/* } */
/* */
FT_EXPORT( void* )
@ -615,64 +678,70 @@ FT_BEGIN_HEADER
FT_Sfnt_Tag tag );
/**************************************************************************
*
* @function:
* FT_Load_Sfnt_Table
*
* @description:
* Load any font table into client memory.
*
* @input:
* face ::
* A handle to the source face.
*
* tag ::
* The four-byte tag of the table to load. Use the value~0 if you want
* to access the whole font file. Otherwise, you can use one of the
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
* one with @FT_MAKE_TAG.
*
* offset ::
* The starting offset in the table (or file if tag == 0).
*
* @output:
* buffer ::
* The target buffer address. The client must ensure that the memory
* array is big enough to hold the data.
*
* @inout:
* length ::
* If the `length' parameter is NULL, then try to load the whole table.
* Return an error code if it fails.
*
* Else, if `*length' is~0, exit immediately while returning the
* table's (or file) full size in it.
*
* Else the number of bytes to read from the table or file, from the
* starting offset.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If you need to determine the table's length you should first call this
* function with `*length' set to~0, as in the following example:
*
* {
* FT_ULong length = 0;
*
*
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
* if ( error ) { ... table does not exist ... }
*
* buffer = malloc( length );
* if ( buffer == NULL ) { ... not enough memory ... }
*
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
* if ( error ) { ... could not load table ... }
* }
*/
/**************************************************************************
*
* @function:
* FT_Load_Sfnt_Table
*
* @description:
* Load any SFNT font table into client memory.
*
* @input:
* face ::
* A handle to the source face.
*
* tag ::
* The four-byte tag of the table to load. Use value~0 if you want
* to access the whole font file. Otherwise, you can use one of the
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
* one with @FT_MAKE_TAG.
*
* offset ::
* The starting offset in the table (or file if tag~==~0).
*
* @output:
* buffer ::
* The target buffer address. The client must ensure that the memory
* array is big enough to hold the data.
*
* @inout:
* length ::
* If the `length' parameter is NULL, try to load the whole table.
* Return an error code if it fails.
*
* Else, if `*length' is~0, exit immediately while returning the
* table's (or file) full size in it.
*
* Else the number of bytes to read from the table or file, from the
* starting offset.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If you need to determine the table's length you should first call this
* function with `*length' set to~0, as in the following example:
*
* {
* FT_ULong length = 0;
*
*
* error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
* if ( error ) { ... table does not exist ... }
*
* buffer = malloc( length );
* if ( buffer == NULL ) { ... not enough memory ... }
*
* error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
* if ( error ) { ... could not load table ... }
* }
*
* Note that structures like @TT_Header or @TT_OS2 can't be used with
* this function; they are limited to @FT_Get_Sfnt_Table. Reason is that
* those structures depend on the processor architecture, with varying
* size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).
*
*/
FT_EXPORT( FT_Error )
FT_Load_Sfnt_Table( FT_Face face,
FT_ULong tag,
@ -681,41 +750,41 @@ FT_BEGIN_HEADER
FT_ULong* length );
/**************************************************************************
*
* @function:
* FT_Sfnt_Table_Info
*
* @description:
* Return information on an SFNT table.
*
* @input:
* face ::
* A handle to the source face.
*
* table_index ::
* The index of an SFNT table. The function returns
* FT_Err_Table_Missing for an invalid value.
*
* @inout:
* tag ::
* The name tag of the SFNT table. If the value is NULL, `table_index'
* is ignored, and `length' returns the number of SFNT tables in the
* font.
*
* @output:
* length ::
* The length of the SFNT table (or the number of SFNT tables, depending
* on `tag').
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* While parsing fonts, FreeType handles SFNT tables with length zero as
* missing.
*
*/
/**************************************************************************
*
* @function:
* FT_Sfnt_Table_Info
*
* @description:
* Return information on an SFNT table.
*
* @input:
* face ::
* A handle to the source face.
*
* table_index ::
* The index of an SFNT table. The function returns
* FT_Err_Table_Missing for an invalid value.
*
* @inout:
* tag ::
* The name tag of the SFNT table. If the value is NULL, `table_index'
* is ignored, and `length' returns the number of SFNT tables in the
* font.
*
* @output:
* length ::
* The length of the SFNT table (or the number of SFNT tables, depending
* on `tag').
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* While parsing fonts, FreeType handles SFNT tables with length zero as
* missing.
*
*/
FT_EXPORT( FT_Error )
FT_Sfnt_Table_Info( FT_Face face,
FT_UInt table_index,
@ -729,16 +798,16 @@ FT_BEGIN_HEADER
/* FT_Get_CMap_Language_ID */
/* */
/* <Description> */
/* Return TrueType/sfnt specific cmap language ID. Definitions of */
/* language ID values are in `freetype/ttnameid.h'. */
/* Return cmap language ID as specified in the OpenType standard. */
/* Definitions of language ID values are in file @FT_TRUETYPE_IDS_H. */
/* */
/* <Input> */
/* charmap :: */
/* The target charmap. */
/* */
/* <Return> */
/* The language ID of `charmap'. If `charmap' doesn't belong to a */
/* TrueType/sfnt face, just return~0 as the default value. */
/* The language ID of `charmap'. If `charmap' doesn't belong to an */
/* SFNT face, just return~0 as the default value. */
/* */
/* For a format~14 cmap (to access Unicode IVS), the return value is */
/* 0xFFFFFFFF. */
@ -753,15 +822,15 @@ FT_BEGIN_HEADER
/* FT_Get_CMap_Format */
/* */
/* <Description> */
/* Return TrueType/sfnt specific cmap format. */
/* Return the format of an SFNT `cmap' table. */
/* */
/* <Input> */
/* charmap :: */
/* The target charmap. */
/* */
/* <Return> */
/* The format of `charmap'. If `charmap' doesn't belong to a */
/* TrueType/sfnt face, return -1. */
/* The format of `charmap'. If `charmap' doesn't belong to an SFNT */
/* face, return -1. */
/* */
FT_EXPORT( FT_Long )
FT_Get_CMap_Format( FT_CharMap charmap );
@ -771,7 +840,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __TTTABLES_H__ */
#endif /* TTTABLES_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __TTAGS_H__
#define __TTAGS_H__
#ifndef TTAGS_H_
#define TTAGS_H_
#include <ft2build.h>
@ -40,7 +40,10 @@ FT_BEGIN_HEADER
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
#define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' )
#define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
@ -59,6 +62,7 @@ FT_BEGIN_HEADER
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
#define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
@ -77,6 +81,7 @@ FT_BEGIN_HEADER
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
#define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
@ -86,6 +91,7 @@ FT_BEGIN_HEADER
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
@ -97,11 +103,19 @@ FT_BEGIN_HEADER
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
#define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' )
#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' )
/* used by "Keyboard.dfont" on legacy Mac OS X */
#define TTAG_0xA5kbd FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' )
/* used by "LastResort.dfont" on legacy Mac OS X */
#define TTAG_0xA5lst FT_MAKE_TAG( 0xA5, 'l', 's', 't' )
FT_END_HEADER
#endif /* __TTAGS_H__ */
#endif /* TTAGS_H_ */
/* END */

View File

@ -1,59 +0,0 @@
/***************************************************************************/
/* */
/* ttunpat.h */
/* */
/* Definitions for the unpatented TrueType hinting system */
/* */
/* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by Graham Asher <graham.asher@btinternet.com> */
/* */
/* 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 __TTUNPAT_H__
#define __TTUNPAT_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
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* A constant used as the tag of an @FT_Parameter structure to indicate
* that unpatented methods only should be used by the TrueType bytecode
* interpreter for a typeface opened by @FT_Open_Face.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
/* */
FT_END_HEADER
#endif /* __TTUNPAT_H__ */
/* END */

View File

@ -2,9 +2,9 @@
/* */
/* ft2build.h */
/* */
/* Build macros of the FreeType 2 library. */
/* FreeType 2 build and setup macros. */
/* */
/* Copyright 1996-2001, 2003, 2006 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -18,44 +18,25 @@
/*************************************************************************/
/* */
/* This is a Unix-specific version of <ft2build.h> that should be used */
/* exclusively *after* installation of the library. */
/* This is the `entry point' for FreeType header file inclusions. It is */
/* the only header file which should be included directly; all other */
/* FreeType header files should be accessed with macro names (after */
/* including `ft2build.h'). */
/* */
/* It assumes that `/usr/local/include/freetype2' (or whatever is */
/* returned by the `freetype-config --cflags' or `pkg-config --cflags' */
/* command) is in your compilation include path. */
/* A typical example is */
/* */
/* 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. */
/* #include <ft2build.h> */
/* #include FT_FREETYPE_H */
/* */
/*************************************************************************/
#ifndef __FT2_BUILD_UNIX_H__
#define __FT2_BUILD_UNIX_H__
#ifndef FT2BUILD_H_
#define FT2BUILD_H_
/* `<prefix>/include/freetype2' must be in your current inclusion path */
#include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_UNIX_H__ */
#endif /* FT2BUILD_H_ */
/* END */

View File

@ -2,9 +2,9 @@
#define __LIBFATVERSION_H__
#define _LIBFAT_MAJOR_ 1
#define _LIBFAT_MINOR_ 0
#define _LIBFAT_PATCH_ 12
#define _LIBFAT_MINOR_ 1
#define _LIBFAT_PATCH_ 1
#define _LIBFAT_STRING "libFAT Release 1.0.12"
#define _LIBFAT_STRING "libFAT Release 1.1.1"
#endif // __LIBFATVERSION_H__

View File

@ -0,0 +1,25 @@
#ifndef __CONFIG_TYPES_H__
#define __CONFIG_TYPES_H__
/* these are filled in by configure */
#define INCLUDE_INTTYPES_H 1
#define INCLUDE_STDINT_H 1
#define INCLUDE_SYS_TYPES_H 1
#if INCLUDE_INTTYPES_H
# include <inttypes.h>
#endif
#if INCLUDE_STDINT_H
# include <stdint.h>
#endif
#if INCLUDE_SYS_TYPES_H
# include <sys/types.h>
#endif
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
#endif

210
portlibs/include/ogg/ogg.h Normal file
View File

@ -0,0 +1,210 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel libogg include
last mod: $Id$
********************************************************************/
#ifndef _OGG_H
#define _OGG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <ogg/os_types.h>
typedef struct {
void *iov_base;
size_t iov_len;
} ogg_iovec_t;
typedef struct {
long endbyte;
int endbit;
unsigned char *buffer;
unsigned char *ptr;
long storage;
} oggpack_buffer;
/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
typedef struct {
unsigned char *header;
long header_len;
unsigned char *body;
long body_len;
} ogg_page;
/* ogg_stream_state contains the current encode/decode state of a logical
Ogg bitstream **********************************************************/
typedef struct {
unsigned char *body_data; /* bytes from packet bodies */
long body_storage; /* storage elements allocated */
long body_fill; /* elements stored; fill mark */
long body_returned; /* elements of fill returned */
int *lacing_vals; /* The values that will go to the segment table */
ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
this way, but it is simple coupled to the
lacing fifo */
long lacing_storage;
long lacing_fill;
long lacing_packet;
long lacing_returned;
unsigned char header[282]; /* working space for header encode */
int header_fill;
int e_o_s; /* set when we have buffered the last packet in the
logical bitstream */
int b_o_s; /* set after we've written the initial page
of a logical bitstream */
long serialno;
long pageno;
ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a separate abstraction
layer) also knows about the gap */
ogg_int64_t granulepos;
} ogg_stream_state;
/* ogg_packet is used to encapsulate the data and metadata belonging
to a single raw Ogg/Vorbis packet *************************************/
typedef struct {
unsigned char *packet;
long bytes;
long b_o_s;
long e_o_s;
ogg_int64_t granulepos;
ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a separate abstraction
layer) also knows about the gap */
} ogg_packet;
typedef struct {
unsigned char *data;
int storage;
int fill;
int returned;
int unsynced;
int headerbytes;
int bodybytes;
} ogg_sync_state;
/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
extern void oggpack_writeinit(oggpack_buffer *b);
extern int oggpack_writecheck(oggpack_buffer *b);
extern void oggpack_writetrunc(oggpack_buffer *b,long bits);
extern void oggpack_writealign(oggpack_buffer *b);
extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
extern void oggpack_reset(oggpack_buffer *b);
extern void oggpack_writeclear(oggpack_buffer *b);
extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
extern long oggpack_look(oggpack_buffer *b,int bits);
extern long oggpack_look1(oggpack_buffer *b);
extern void oggpack_adv(oggpack_buffer *b,int bits);
extern void oggpack_adv1(oggpack_buffer *b);
extern long oggpack_read(oggpack_buffer *b,int bits);
extern long oggpack_read1(oggpack_buffer *b);
extern long oggpack_bytes(oggpack_buffer *b);
extern long oggpack_bits(oggpack_buffer *b);
extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);
extern void oggpackB_writeinit(oggpack_buffer *b);
extern int oggpackB_writecheck(oggpack_buffer *b);
extern void oggpackB_writetrunc(oggpack_buffer *b,long bits);
extern void oggpackB_writealign(oggpack_buffer *b);
extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
extern void oggpackB_reset(oggpack_buffer *b);
extern void oggpackB_writeclear(oggpack_buffer *b);
extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
extern long oggpackB_look(oggpack_buffer *b,int bits);
extern long oggpackB_look1(oggpack_buffer *b);
extern void oggpackB_adv(oggpack_buffer *b,int bits);
extern void oggpackB_adv1(oggpack_buffer *b);
extern long oggpackB_read(oggpack_buffer *b,int bits);
extern long oggpackB_read1(oggpack_buffer *b);
extern long oggpackB_bytes(oggpack_buffer *b);
extern long oggpackB_bits(oggpack_buffer *b);
extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
/* Ogg BITSTREAM PRIMITIVES: encoding **************************/
extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov,
int count, long e_o_s, ogg_int64_t granulepos);
extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);
extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
extern int ogg_sync_init(ogg_sync_state *oy);
extern int ogg_sync_clear(ogg_sync_state *oy);
extern int ogg_sync_reset(ogg_sync_state *oy);
extern int ogg_sync_destroy(ogg_sync_state *oy);
extern int ogg_sync_check(ogg_sync_state *oy);
extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
extern int ogg_stream_init(ogg_stream_state *os,int serialno);
extern int ogg_stream_clear(ogg_stream_state *os);
extern int ogg_stream_reset(ogg_stream_state *os);
extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
extern int ogg_stream_destroy(ogg_stream_state *os);
extern int ogg_stream_check(ogg_stream_state *os);
extern int ogg_stream_eos(ogg_stream_state *os);
extern void ogg_page_checksum_set(ogg_page *og);
extern int ogg_page_version(const ogg_page *og);
extern int ogg_page_continued(const ogg_page *og);
extern int ogg_page_bos(const ogg_page *og);
extern int ogg_page_eos(const ogg_page *og);
extern ogg_int64_t ogg_page_granulepos(const ogg_page *og);
extern int ogg_page_serialno(const ogg_page *og);
extern long ogg_page_pageno(const ogg_page *og);
extern int ogg_page_packets(const ogg_page *og);
extern void ogg_packet_clear(ogg_packet *op);
#ifdef __cplusplus
}
#endif
#endif /* _OGG_H */

View File

@ -0,0 +1,148 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
last mod: $Id$
********************************************************************/
#ifndef _OS_TYPES_H
#define _OS_TYPES_H
/* make it easy on the folks that want to compile the libs with a
different malloc than stdlib */
#define _ogg_malloc malloc
#define _ogg_calloc calloc
#define _ogg_realloc realloc
#define _ogg_free free
#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <stdint.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
typedef uint64_t ogg_uint64_t;
# elif defined(__MINGW32__)
# include <sys/types.h>
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
typedef unsigned long long ogg_uint64_t;
# elif defined(__MWERKS__)
typedef long long ogg_int64_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
# else
# if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */
# include <stdint.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
typedef uint64_t ogg_uint64_t;
# else
/* MSVC/Borland */
typedef __int64 ogg_int64_t;
typedef __int32 ogg_int32_t;
typedef unsigned __int32 ogg_uint32_t;
typedef __int16 ogg_int16_t;
typedef unsigned __int16 ogg_uint16_t;
# endif
# endif
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <inttypes.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
#elif defined(__HAIKU__)
/* Haiku */
# include <sys/types.h>
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
#elif defined(__BEOS__)
/* Be */
# include <inttypes.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
#elif defined (__EMX__)
/* OS/2 GCC */
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
#elif defined (DJGPP)
/* DJGPP */
typedef short ogg_int16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
#elif defined(R5900)
/* PS2 EE */
typedef long ogg_int64_t;
typedef int ogg_int32_t;
typedef unsigned ogg_uint32_t;
typedef short ogg_int16_t;
#elif defined(__SYMBIAN32__)
/* Symbian GCC */
typedef signed short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef signed int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long int ogg_int64_t;
#elif defined(__TMS320C6X__)
/* TI C64x compiler */
typedef signed short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef signed int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long int ogg_int64_t;
#else
# include <ogg/config_types.h>
#endif
#endif /* _OS_TYPES_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,219 @@
/* pnglibconf.h - library build configuration */
/* libpng version 1.6.37 */
/* Copyright (c) 2018-2019 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
/* and license in png.h */
/* pnglibconf.h */
/* Machine generated file: DO NOT EDIT */
/* Derived from: scripts/pnglibconf.dfa */
#ifndef PNGLCONF_H
#define PNGLCONF_H
/* options */
#define PNG_16BIT_SUPPORTED
#define PNG_ALIGNED_MEMORY_SUPPORTED
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_COLORSPACE_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
#define PNG_CONVERT_tIME_SUPPORTED
#define PNG_EASY_ACCESS_SUPPORTED
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
#define PNG_ERROR_TEXT_SUPPORTED
#define PNG_FIXED_POINT_SUPPORTED
#define PNG_FLOATING_ARITHMETIC_SUPPORTED
#define PNG_FLOATING_POINT_SUPPORTED
#define PNG_FORMAT_AFIRST_SUPPORTED
#define PNG_FORMAT_BGR_SUPPORTED
#define PNG_GAMMA_SUPPORTED
#define PNG_GET_PALETTE_MAX_SUPPORTED
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_IO_STATE_SUPPORTED
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
#define PNG_PROGRESSIVE_READ_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
#define PNG_READ_ALPHA_MODE_SUPPORTED
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_READ_BACKGROUND_SUPPORTED
#define PNG_READ_BGR_SUPPORTED
#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
#define PNG_READ_EXPAND_16_SUPPORTED
#define PNG_READ_EXPAND_SUPPORTED
#define PNG_READ_FILLER_SUPPORTED
#define PNG_READ_GAMMA_SUPPORTED
#define PNG_READ_GET_PALETTE_MAX_SUPPORTED
#define PNG_READ_GRAY_TO_RGB_SUPPORTED
#define PNG_READ_INTERLACING_SUPPORTED
#define PNG_READ_INT_FUNCTIONS_SUPPORTED
#define PNG_READ_INVERT_ALPHA_SUPPORTED
#define PNG_READ_INVERT_SUPPORTED
#define PNG_READ_OPT_PLTE_SUPPORTED
#define PNG_READ_PACKSWAP_SUPPORTED
#define PNG_READ_PACK_SUPPORTED
#define PNG_READ_QUANTIZE_SUPPORTED
#define PNG_READ_RGB_TO_GRAY_SUPPORTED
#define PNG_READ_SCALE_16_TO_8_SUPPORTED
#define PNG_READ_SHIFT_SUPPORTED
#define PNG_READ_STRIP_16_TO_8_SUPPORTED
#define PNG_READ_STRIP_ALPHA_SUPPORTED
#define PNG_READ_SUPPORTED
#define PNG_READ_SWAP_ALPHA_SUPPORTED
#define PNG_READ_SWAP_SUPPORTED
#define PNG_READ_TEXT_SUPPORTED
#define PNG_READ_TRANSFORMS_SUPPORTED
#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_READ_USER_CHUNKS_SUPPORTED
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
#define PNG_READ_eXIf_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
#define PNG_READ_iTXt_SUPPORTED
#define PNG_READ_oFFs_SUPPORTED
#define PNG_READ_pCAL_SUPPORTED
#define PNG_READ_pHYs_SUPPORTED
#define PNG_READ_sBIT_SUPPORTED
#define PNG_READ_sCAL_SUPPORTED
#define PNG_READ_sPLT_SUPPORTED
#define PNG_READ_sRGB_SUPPORTED
#define PNG_READ_tEXt_SUPPORTED
#define PNG_READ_tIME_SUPPORTED
#define PNG_READ_tRNS_SUPPORTED
#define PNG_READ_zTXt_SUPPORTED
#define PNG_SAVE_INT_32_SUPPORTED
#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED
#define PNG_SETJMP_SUPPORTED
#define PNG_SET_OPTION_SUPPORTED
#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SET_USER_LIMITS_SUPPORTED
#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED
#define PNG_SIMPLIFIED_READ_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_SUPPORTED
#define PNG_STDIO_SUPPORTED
#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_TEXT_SUPPORTED
#define PNG_TIME_RFC1123_SUPPORTED
#define PNG_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_USER_CHUNKS_SUPPORTED
#define PNG_USER_LIMITS_SUPPORTED
#define PNG_USER_MEM_SUPPORTED
#define PNG_USER_TRANSFORM_INFO_SUPPORTED
#define PNG_USER_TRANSFORM_PTR_SUPPORTED
#define PNG_WARNINGS_SUPPORTED
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_WRITE_BGR_SUPPORTED
#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
#define PNG_WRITE_FILLER_SUPPORTED
#define PNG_WRITE_FILTER_SUPPORTED
#define PNG_WRITE_FLUSH_SUPPORTED
#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
#define PNG_WRITE_INTERLACING_SUPPORTED
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
#define PNG_WRITE_INVERT_SUPPORTED
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
#define PNG_WRITE_PACKSWAP_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
#define PNG_WRITE_SHIFT_SUPPORTED
#define PNG_WRITE_SUPPORTED
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
#define PNG_WRITE_SWAP_SUPPORTED
#define PNG_WRITE_TEXT_SUPPORTED
#define PNG_WRITE_TRANSFORMS_SUPPORTED
#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
#define PNG_WRITE_eXIf_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
#define PNG_WRITE_iTXt_SUPPORTED
#define PNG_WRITE_oFFs_SUPPORTED
#define PNG_WRITE_pCAL_SUPPORTED
#define PNG_WRITE_pHYs_SUPPORTED
#define PNG_WRITE_sBIT_SUPPORTED
#define PNG_WRITE_sCAL_SUPPORTED
#define PNG_WRITE_sPLT_SUPPORTED
#define PNG_WRITE_sRGB_SUPPORTED
#define PNG_WRITE_tEXt_SUPPORTED
#define PNG_WRITE_tIME_SUPPORTED
#define PNG_WRITE_tRNS_SUPPORTED
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_cHRM_SUPPORTED
#define PNG_eXIf_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
#define PNG_iTXt_SUPPORTED
#define PNG_oFFs_SUPPORTED
#define PNG_pCAL_SUPPORTED
#define PNG_pHYs_SUPPORTED
#define PNG_sBIT_SUPPORTED
#define PNG_sCAL_SUPPORTED
#define PNG_sPLT_SUPPORTED
#define PNG_sRGB_SUPPORTED
#define PNG_tEXt_SUPPORTED
#define PNG_tIME_SUPPORTED
#define PNG_tRNS_SUPPORTED
#define PNG_zTXt_SUPPORTED
/* end of options */
/* settings */
#define PNG_API_RULE 0
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_GAMMA_THRESHOLD_FIXED 5000
#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
#define PNG_INFLATE_BUF_SIZE 1024
#define PNG_LINKAGE_API extern
#define PNG_LINKAGE_CALLBACK extern
#define PNG_LINKAGE_DATA extern
#define PNG_LINKAGE_FUNCTION extern
#define PNG_MAX_GAMMA_8 11
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_QUANTIZE_GREEN_BITS 5
#define PNG_QUANTIZE_RED_BITS 5
#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
#define PNG_USER_CHUNK_CACHE_MAX 1000
#define PNG_USER_CHUNK_MALLOC_MAX 8000000
#define PNG_USER_HEIGHT_MAX 1000000
#define PNG_USER_WIDTH_MAX 1000000
#define PNG_ZBUF_SIZE 8192
#define PNG_ZLIB_VERNUM 0x12b0
#define PNG_Z_DEFAULT_COMPRESSION (-1)
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
#define PNG_Z_DEFAULT_STRATEGY 1
#define PNG_sCAL_PRECISION 5
#define PNG_sRGB_PROFILE_CHECKS 2
/* end of settings */
#endif /* PNGLCONF_H */

View File

@ -1,26 +1,25 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
********************************************************************/
#ifndef _OS_CVTYPES_H
#define _OS_CVTYPES_H
typedef long long ogg_int64_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
#endif
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
********************************************************************/
#ifndef _OS_CVTYPES_H
#define _OS_CVTYPES_H
typedef long long ogg_int64_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef short ogg_int16_t;
#endif

View File

@ -1,104 +1,204 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: libvorbis codec headers
********************************************************************/
#ifndef _vorbis_codec_h_
#define _vorbis_codec_h_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "ogg.h"
struct vorbis_dsp_state;
typedef struct vorbis_dsp_state vorbis_dsp_state;
typedef struct vorbis_info{
int version;
int channels;
long rate;
/* The below bitrate declarations are *hints*.
Combinations of the three values carry the following implications:
all three set to the same value:
implies a fixed rate bitstream
only nominal set:
implies a VBR stream that averages the nominal bitrate. No hard
upper/lower limit
upper and or lower set:
implies a VBR bitstream that obeys the bitrate limits. nominal
may also be set to give a nominal rate.
none set:
the coder does not care to speculate.
*/
long bitrate_upper;
long bitrate_nominal;
long bitrate_lower;
long bitrate_window;
void *codec_setup;
} vorbis_info;
typedef struct vorbis_comment{
char **user_comments;
int *comment_lengths;
int comments;
char *vendor;
} vorbis_comment;
/* Vorbis PRIMITIVES: general ***************************************/
extern void vorbis_info_init(vorbis_info *vi);
extern void vorbis_info_clear(vorbis_info *vi);
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
extern void vorbis_comment_init(vorbis_comment *vc);
extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
extern void vorbis_comment_add_tag(vorbis_comment *vc,
char *tag, char *contents);
extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
extern void vorbis_comment_clear(vorbis_comment *vc);
/* Vorbis ERRORS and return codes ***********************************/
#define OV_FALSE -1
#define OV_EOF -2
#define OV_HOLE -3
#define OV_EREAD -128
#define OV_EFAULT -129
#define OV_EIMPL -130
#define OV_EINVAL -131
#define OV_ENOTVORBIS -132
#define OV_EBADHEADER -133
#define OV_EVERSION -134
#define OV_ENOTAUDIO -135
#define OV_EBADPACKET -136
#define OV_EBADLINK -137
#define OV_ENOSEEK -138
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: libvorbis codec headers
********************************************************************/
#ifndef _vorbis_codec_h_
#define _vorbis_codec_h_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include <ogg/ogg.h>
typedef struct vorbis_info{
int version;
int channels;
long rate;
/* The below bitrate declarations are *hints*.
Combinations of the three values carry the following implications:
all three set to the same value:
implies a fixed rate bitstream
only nominal set:
implies a VBR stream that averages the nominal bitrate. No hard
upper/lower limit
upper and or lower set:
implies a VBR bitstream that obeys the bitrate limits. nominal
may also be set to give a nominal rate.
none set:
the coder does not care to speculate.
*/
long bitrate_upper;
long bitrate_nominal;
long bitrate_lower;
long bitrate_window;
void *codec_setup;
} vorbis_info;
/* vorbis_dsp_state buffers the current vorbis audio
analysis/synthesis state. The DSP state belongs to a specific
logical bitstream ****************************************************/
typedef struct vorbis_dsp_state{
int analysisp;
vorbis_info *vi;
ogg_int32_t **pcm;
ogg_int32_t **pcmret;
int pcm_storage;
int pcm_current;
int pcm_returned;
int preextrapolate;
int eofflag;
long lW;
long W;
long nW;
long centerW;
ogg_int64_t granulepos;
ogg_int64_t sequence;
void *backend_state;
} vorbis_dsp_state;
typedef struct vorbis_block{
/* necessary stream state for linking to the framing abstraction */
ogg_int32_t **pcm; /* this is a pointer into local storage */
oggpack_buffer opb;
long lW;
long W;
long nW;
int pcmend;
int mode;
int eofflag;
ogg_int64_t granulepos;
ogg_int64_t sequence;
vorbis_dsp_state *vd; /* For read-only access of configuration */
/* local storage to avoid remallocing; it's up to the mapping to
structure it */
void *localstore;
long localtop;
long localalloc;
long totaluse;
struct alloc_chain *reap;
} vorbis_block;
/* vorbis_block is a single block of data to be processed as part of
the analysis/synthesis stream; it belongs to a specific logical
bitstream, but is independant from other vorbis_blocks belonging to
that logical bitstream. *************************************************/
struct alloc_chain{
void *ptr;
struct alloc_chain *next;
};
/* vorbis_info contains all the setup information specific to the
specific compression/decompression mode in progress (eg,
psychoacoustic settings, channel setup, options, codebook
etc). vorbis_info and substructures are in backends.h.
*********************************************************************/
/* the comments are not part of vorbis_info so that vorbis_info can be
static storage */
typedef struct vorbis_comment{
/* unlimited user comment fields. libvorbis writes 'libvorbis'
whatever vendor is set to in encode */
char **user_comments;
int *comment_lengths;
int comments;
char *vendor;
} vorbis_comment;
/* libvorbis encodes in two abstraction layers; first we perform DSP
and produce a packet (see docs/analysis.txt). The packet is then
coded into a framed OggSquish bitstream by the second layer (see
docs/framing.txt). Decode is the reverse process; we sync/frame
the bitstream and extract individual packets, then decode the
packet back into PCM audio.
The extra framing/packetizing is used in streaming formats, such as
files. Over the net (such as with UDP), the framing and
packetization aren't necessary as they're provided by the transport
and the streaming layer is not used */
/* Vorbis PRIMITIVES: general ***************************************/
extern void vorbis_info_init(vorbis_info *vi);
extern void vorbis_info_clear(vorbis_info *vi);
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
extern void vorbis_comment_init(vorbis_comment *vc);
extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
extern void vorbis_comment_add_tag(vorbis_comment *vc,
char *tag, char *contents);
extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
extern void vorbis_comment_clear(vorbis_comment *vc);
extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
extern int vorbis_block_clear(vorbis_block *vb);
extern void vorbis_dsp_clear(vorbis_dsp_state *v);
/* Vorbis PRIMITIVES: synthesis layer *******************************/
extern int vorbis_synthesis_idheader(ogg_packet *op);
extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,
ogg_packet *op);
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
extern int vorbis_synthesis_restart(vorbis_dsp_state *v);
extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);
extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,ogg_int32_t ***pcm);
extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op);
/* Vorbis ERRORS and return codes ***********************************/
#define OV_FALSE -1
#define OV_EOF -2
#define OV_HOLE -3
#define OV_EREAD -128
#define OV_EFAULT -129
#define OV_EIMPL -130
#define OV_EINVAL -131
#define OV_ENOTVORBIS -132
#define OV_EBADHEADER -133
#define OV_EVERSION -134
#define OV_ENOTAUDIO -135
#define OV_EBADPACKET -136
#define OV_EBADLINK -137
#define OV_ENOSEEK -138
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

View File

@ -1,122 +1,131 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
********************************************************************/
#ifndef _OV_FILE_H_
#define _OV_FILE_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include <stdio.h>
#include "ivorbiscodec.h"
/* The function prototypes for the callbacks are basically the same as for
* the stdio functions fread, fseek, fclose, ftell.
* The one difference is that the FILE * arguments have been replaced with
* a void * - this is to be used as a pointer to whatever internal data these
* functions might need. In the stdio case, it's just a FILE * cast to a void *
*
* If you use other functions, check the docs for these functions and return
* the right values. For seek_func(), you *MUST* return -1 if the stream is
* unseekable
*/
typedef struct {
size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
int (*close_func) (void *datasource);
long (*tell_func) (void *datasource);
} ov_callbacks;
typedef struct OggVorbis_File {
void *datasource; /* Pointer to a FILE *, etc. */
int seekable;
ogg_int64_t offset;
ogg_int64_t end;
ogg_sync_state *oy;
/* If the FILE handle isn't seekable (eg, a pipe), only the current
stream appears */
int links;
ogg_int64_t *offsets;
ogg_int64_t *dataoffsets;
ogg_uint32_t *serialnos;
ogg_int64_t *pcmlengths;
vorbis_info vi;
vorbis_comment vc;
/* Decoding working state local storage */
ogg_int64_t pcm_offset;
int ready_state;
ogg_uint32_t current_serialno;
int current_link;
ogg_int64_t bittrack;
ogg_int64_t samptrack;
ogg_stream_state *os; /* take physical pages, weld into a logical
stream of packets */
vorbis_dsp_state *vd; /* central working state for the packet->PCM decoder */
ov_callbacks callbacks;
} OggVorbis_File;
extern int ov_clear(OggVorbis_File *vf);
extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(OggVorbis_File *vf);
extern long ov_bitrate(OggVorbis_File *vf,int i);
extern long ov_bitrate_instant(OggVorbis_File *vf);
extern long ov_streams(OggVorbis_File *vf);
extern long ov_seekable(OggVorbis_File *vf);
extern long ov_serialnumber(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_time_total(OggVorbis_File *vf,int i);
extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_time_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
extern ogg_int64_t ov_time_tell(OggVorbis_File *vf);
extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
extern long ov_read(OggVorbis_File *vf,void *buffer,int length,
int *bitstream);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
********************************************************************/
#ifndef _OV_FILE_H_
#define _OV_FILE_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include <stdio.h>
#include "ivorbiscodec.h"
#define CHUNKSIZE 65535
#define READSIZE 1024
/* The function prototypes for the callbacks are basically the same as for
* the stdio functions fread, fseek, fclose, ftell.
* The one difference is that the FILE * arguments have been replaced with
* a void * - this is to be used as a pointer to whatever internal data these
* functions might need. In the stdio case, it's just a FILE * cast to a void *
*
* If you use other functions, check the docs for these functions and return
* the right values. For seek_func(), you *MUST* return -1 if the stream is
* unseekable
*/
typedef struct {
size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
int (*close_func) (void *datasource);
long (*tell_func) (void *datasource);
} ov_callbacks;
#define NOTOPEN 0
#define PARTOPEN 1
#define OPENED 2
#define STREAMSET 3
#define INITSET 4
typedef struct OggVorbis_File {
void *datasource; /* Pointer to a FILE *, etc. */
int seekable;
ogg_int64_t offset;
ogg_int64_t end;
ogg_sync_state oy;
/* If the FILE handle isn't seekable (eg, a pipe), only the current
stream appears */
int links;
ogg_int64_t *offsets;
ogg_int64_t *dataoffsets;
ogg_uint32_t *serialnos;
ogg_int64_t *pcmlengths;
vorbis_info *vi;
vorbis_comment *vc;
/* Decoding working state local storage */
ogg_int64_t pcm_offset;
int ready_state;
ogg_uint32_t current_serialno;
int current_link;
ogg_int64_t bittrack;
ogg_int64_t samptrack;
ogg_stream_state os; /* take physical pages, weld into a logical
stream of packets */
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
vorbis_block vb; /* local working space for packet->PCM decode */
ov_callbacks callbacks;
} OggVorbis_File;
extern int ov_clear(OggVorbis_File *vf);
extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(OggVorbis_File *vf);
extern long ov_bitrate(OggVorbis_File *vf,int i);
extern long ov_bitrate_instant(OggVorbis_File *vf);
extern long ov_streams(OggVorbis_File *vf);
extern long ov_seekable(OggVorbis_File *vf);
extern long ov_serialnumber(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_time_total(OggVorbis_File *vf,int i);
extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_time_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
extern ogg_int64_t ov_time_tell(OggVorbis_File *vf);
extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
int *bitstream);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

View File

@ -1,206 +0,0 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: subsumed libogg includes
********************************************************************/
#ifndef _OGG_H
#define _OGG_H
#ifdef __cplusplus
extern "C" {
#endif
#include "os_types.h"
typedef struct ogg_buffer_state{
struct ogg_buffer *unused_buffers;
struct ogg_reference *unused_references;
int outstanding;
int shutdown;
} ogg_buffer_state;
typedef struct ogg_buffer {
unsigned char *data;
long size;
int refcount;
union {
ogg_buffer_state *owner;
struct ogg_buffer *next;
} ptr;
} ogg_buffer;
typedef struct ogg_reference {
ogg_buffer *buffer;
long begin;
long length;
struct ogg_reference *next;
} ogg_reference;
typedef struct oggpack_buffer {
int headbit;
unsigned char *headptr;
long headend;
/* memory management */
ogg_reference *head;
ogg_reference *tail;
/* render the byte/bit counter API constant time */
long count; /* doesn't count the tail */
} oggpack_buffer;
typedef struct oggbyte_buffer {
ogg_reference *baseref;
ogg_reference *ref;
unsigned char *ptr;
long pos;
long end;
} oggbyte_buffer;
typedef struct ogg_sync_state {
/* decode memory management pool */
ogg_buffer_state *bufferpool;
/* stream buffers */
ogg_reference *fifo_head;
ogg_reference *fifo_tail;
long fifo_fill;
/* stream sync management */
int unsynced;
int headerbytes;
int bodybytes;
} ogg_sync_state;
typedef struct ogg_stream_state {
ogg_reference *header_head;
ogg_reference *header_tail;
ogg_reference *body_head;
ogg_reference *body_tail;
int e_o_s; /* set when we have buffered the last
packet in the logical bitstream */
int b_o_s; /* set after we've written the initial page
of a logical bitstream */
long serialno;
long pageno;
ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a seperate abstraction
layer) also knows about the gap */
ogg_int64_t granulepos;
int lacing_fill;
ogg_uint32_t body_fill;
/* decode-side state data */
int holeflag;
int spanflag;
int clearflag;
int laceptr;
ogg_uint32_t body_fill_next;
} ogg_stream_state;
typedef struct {
ogg_reference *packet;
long bytes;
long b_o_s;
long e_o_s;
ogg_int64_t granulepos;
ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a seperate abstraction
layer) also knows about the gap */
} ogg_packet;
typedef struct {
ogg_reference *header;
int header_len;
ogg_reference *body;
long body_len;
} ogg_page;
/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
extern void oggpack_readinit(oggpack_buffer *b,ogg_reference *r);
extern long oggpack_look(oggpack_buffer *b,int bits);
extern void oggpack_adv(oggpack_buffer *b,int bits);
extern long oggpack_read(oggpack_buffer *b,int bits);
extern long oggpack_bytes(oggpack_buffer *b);
extern long oggpack_bits(oggpack_buffer *b);
extern int oggpack_eop(oggpack_buffer *b);
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
extern ogg_sync_state *ogg_sync_create(void);
extern int ogg_sync_destroy(ogg_sync_state *oy);
extern int ogg_sync_reset(ogg_sync_state *oy);
extern unsigned char *ogg_sync_bufferin(ogg_sync_state *oy, long size);
extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
extern ogg_stream_state *ogg_stream_create(int serialno);
extern int ogg_stream_destroy(ogg_stream_state *os);
extern int ogg_stream_reset(ogg_stream_state *os);
extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
extern int ogg_stream_eos(ogg_stream_state *os);
extern int ogg_page_checksum_set(ogg_page *og);
extern int ogg_page_version(ogg_page *og);
extern int ogg_page_continued(ogg_page *og);
extern int ogg_page_bos(ogg_page *og);
extern int ogg_page_eos(ogg_page *og);
extern ogg_int64_t ogg_page_granulepos(ogg_page *og);
extern ogg_uint32_t ogg_page_serialno(ogg_page *og);
extern ogg_uint32_t ogg_page_pageno(ogg_page *og);
extern int ogg_page_packets(ogg_page *og);
extern int ogg_page_getbuffer(ogg_page *og, unsigned char **buffer);
extern int ogg_packet_release(ogg_packet *op);
extern int ogg_page_release(ogg_page *og);
extern void ogg_page_dup(ogg_page *d, ogg_page *s);
/* Ogg BITSTREAM PRIMITIVES: return codes ***************************/
#define OGG_SUCCESS 0
#define OGG_HOLE -10
#define OGG_SPAN -11
#define OGG_EVERSION -12
#define OGG_ESERIAL -13
#define OGG_EINVAL -14
#define OGG_EEOS -15
#ifdef __cplusplus
}
#endif
#endif /* _OGG_H */

View File

@ -1,93 +0,0 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
********************************************************************/
#ifndef _OS_TYPES_H
#define _OS_TYPES_H
#ifdef _LOW_ACCURACY_
# define X(n) (((((n)>>22)+1)>>1) - ((((n)>>22)+1)>>9))
# define LOOKUP_T const unsigned char
#else
# define X(n) (n)
# define LOOKUP_T const ogg_int32_t
#endif
/* make it easy on the folks that want to compile the libs with a
different malloc than stdlib */
#define _ogg_malloc malloc
#define _ogg_calloc calloc
#define _ogg_realloc realloc
#define _ogg_free free
#ifdef _WIN32
# ifndef __GNUC__
/* MSVC/Borland */
typedef __int64 ogg_int64_t;
typedef __int32 ogg_int32_t;
typedef unsigned __int32 ogg_uint32_t;
typedef __int16 ogg_int16_t;
typedef unsigned __int16 ogg_uint16_t;
# else
/* Cygwin */
#include <_G_config.h>
typedef _G_int64_t ogg_int64_t;
typedef _G_int32_t ogg_int32_t;
typedef _G_uint32_t ogg_uint32_t;
typedef _G_int16_t ogg_int16_t;
typedef _G_uint16_t ogg_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
typedef SInt16 ogg_int16_t;
typedef UInt16 ogg_uint16_t;
typedef SInt32 ogg_int32_t;
typedef UInt32 ogg_uint32_t;
typedef SInt64 ogg_int64_t;
#elif defined(__MACOSX__) /* MacOS X Framework build */
# include <sys/types.h>
typedef int16_t ogg_int16_t;
typedef u_int16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef u_int32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
#elif defined(__BEOS__)
/* Be */
# include <inttypes.h>
#elif defined (__EMX__)
/* OS/2 GCC */
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
#else
# include <sys/types.h>
# include "config_types.h"
#endif
#endif /* _OS_TYPES_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2013 Jean-loup Gailly.
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -17,7 +17,7 @@
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
# define Z_PREFIX_SET
/* all linked symbols */
/* all linked symbols and init macros */
# define _dist_code z__dist_code
# define _length_code z__length_code
# define _tr_align z__tr_align
@ -29,6 +29,7 @@
# define adler32 z_adler32
# define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
# define adler32_z z_adler32_z
# ifndef Z_SOLO
# define compress z_compress
# define compress2 z_compress2
@ -37,10 +38,14 @@
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
# define deflateGetDictionary z_deflateGetDictionary
# define deflateInit z_deflateInit
# define deflateInit2 z_deflateInit2
# define deflateInit2_ z_deflateInit2_
# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
@ -67,6 +72,8 @@
# define gzeof z_gzeof
# define gzerror z_gzerror
# define gzflush z_gzflush
# define gzfread z_gzfread
# define gzfwrite z_gzfwrite
# define gzgetc z_gzgetc
# define gzgetc_ z_gzgetc_
# define gzgets z_gzgets
@ -78,7 +85,6 @@
# define gzopen_w z_gzopen_w
# endif
# define gzprintf z_gzprintf
# define gzvprintf z_gzvprintf
# define gzputc z_gzputc
# define gzputs z_gzputs
# define gzread z_gzread
@ -89,32 +95,39 @@
# define gztell z_gztell
# define gztell64 z_gztell64
# define gzungetc z_gzungetc
# define gzvprintf z_gzvprintf
# define gzwrite z_gzwrite
# endif
# define inflate z_inflate
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define inflateBackInit z_inflateBackInit
# define inflateBackInit_ z_inflateBackInit_
# define inflateCodesUsed z_inflateCodesUsed
# define inflateCopy z_inflateCopy
# define inflateEnd z_inflateEnd
# define inflateGetDictionary z_inflateGetDictionary
# define inflateGetHeader z_inflateGetHeader
# define inflateInit z_inflateInit
# define inflateInit2 z_inflateInit2
# define inflateInit2_ z_inflateInit2_
# define inflateInit_ z_inflateInit_
# define inflateMark z_inflateMark
# define inflatePrime z_inflatePrime
# define inflateReset z_inflateReset
# define inflateReset2 z_inflateReset2
# define inflateResetKeep z_inflateResetKeep
# define inflateSetDictionary z_inflateSetDictionary
# define inflateGetDictionary z_inflateGetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
# define inflateResetKeep z_inflateResetKeep
# define inflateValidate z_inflateValidate
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
# ifndef Z_SOLO
# define uncompress z_uncompress
# define uncompress2 z_uncompress2
# endif
# define zError z_zError
# ifndef Z_SOLO
@ -224,9 +237,19 @@
# define z_const
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#ifdef Z_SOLO
typedef unsigned long z_size_t;
#else
# define z_longlong long long
# if defined(NO_SIZE_T)
typedef unsigned NO_SIZE_T z_size_t;
# elif defined(STDC)
# include <stddef.h>
typedef size_t z_size_t;
# else
typedef unsigned long z_size_t;
# endif
# undef z_longlong
#endif
/* Maximum value for memLevel in deflateInit2 */
@ -256,7 +279,7 @@
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
for small objects.
*/

View File

@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.8, April 28th, 2013
version 1.2.11, January 15th, 2017
Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -37,11 +37,11 @@
extern "C" {
#endif
#define ZLIB_VERSION "1.2.8"
#define ZLIB_VERNUM 0x1280
#define ZLIB_VERSION "1.2.11"
#define ZLIB_VERNUM 0x12b0
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 8
#define ZLIB_VER_REVISION 11
#define ZLIB_VER_SUBREVISION 0
/*
@ -65,7 +65,8 @@ extern "C" {
with "gz". The gzip format is different from the zlib format. gzip is a
gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
This library can optionally read and write gzip streams in memory as well.
This library can optionally read and write gzip and raw deflate streams in
memory as well.
The zlib format was designed to be compact and fast for use in memory
and on communications channels. The gzip format was designed for single-
@ -74,7 +75,7 @@ extern "C" {
The library does not install any signal handler. The decoder checks
the consistency of the compressed data, so the library should never crash
even in case of corrupted input.
even in the case of corrupted input.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
@ -87,7 +88,7 @@ typedef struct z_stream_s {
uInt avail_in; /* number of bytes available at next_in */
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 will go here */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total number of bytes output so far */
@ -98,8 +99,9 @@ typedef struct z_stream_s {
free_func zfree; /* used to free the internal state */
voidpf opaque; /* private data object passed to zalloc and zfree */
int data_type; /* best guess about the data type: binary or text */
uLong adler; /* adler32 value of the uncompressed data */
int data_type; /* best guess about the data type: binary or text
for deflate, or the decoding state for inflate */
uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
} z_stream;
@ -142,7 +144,9 @@ typedef gz_header FAR *gz_headerp;
zalloc must return Z_NULL if there is not enough memory for the object.
If zlib is used in a multi-threaded application, zalloc and zfree must be
thread safe.
thread safe. In that case, zlib is thread-safe. When zalloc and zfree are
Z_NULL on entry to the initialization function, they are set to internal
routines that use the standard library functions malloc() and free().
On 16-bit systems, the functions zalloc and zfree must be able to allocate
exactly 65536 bytes, but will not be required to allocate more than this if
@ -155,7 +159,7 @@ typedef gz_header FAR *gz_headerp;
The fields total_in and total_out can be used for statistics or progress
reports. After compression, total_in holds the total size of the
uncompressed data and may be saved for use in the decompressor (particularly
uncompressed data and may be saved for use by the decompressor (particularly
if the decompressor wants to decompress everything in a single step).
*/
@ -200,7 +204,7 @@ typedef gz_header FAR *gz_headerp;
#define Z_TEXT 1
#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
#define Z_UNKNOWN 2
/* Possible values of the data_type field (though see inflate()) */
/* Possible values of the data_type field for deflate() */
#define Z_DEFLATED 8
/* The deflate compression method (the only one supported in this version) */
@ -258,11 +262,11 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
enough room in the output buffer), next_in and avail_in are updated and
processing will resume at this point for the next call of deflate().
- Provide more output starting at next_out and update next_out and avail_out
- Generate more output starting at next_out and update next_out and avail_out
accordingly. This action is forced if the parameter flush is non zero.
Forcing flush frequently degrades the compression ratio, so this parameter
should be set only when necessary (in interactive applications). Some
output may be provided even if flush is not set.
should be set only when necessary. Some output may be provided even if
flush is zero.
Before the call of deflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming more
@ -271,7 +275,9 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
output when it wants, for example when the output buffer is full (avail_out
== 0), or after each call of deflate(). If deflate returns Z_OK and with
zero avail_out, it must be called again after making room in the output
buffer because there might be more output pending.
buffer because there might be more output pending. See deflatePending(),
which can be used if desired to determine whether or not there is more ouput
in that case.
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
decide how much data to accumulate before producing output, in order to
@ -292,8 +298,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
This completes the current deflate block and follows it with an empty fixed
codes block that is 10 bits long. This assures that enough bytes are output
in order for the decompressor to finish the block before the empty fixed code
block.
in order for the decompressor to finish the block before the empty fixed
codes block.
If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
@ -319,34 +325,38 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there was
enough output space; if deflate returns with Z_OK, this function must be
called again with Z_FINISH and more output space (updated avail_out) but no
more input data, until it returns with Z_STREAM_END or an error. After
deflate has returned Z_STREAM_END, the only possible operations on the stream
are deflateReset or deflateEnd.
enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this
function must be called again with Z_FINISH and more output space (updated
avail_out) but no more input data, until it returns with Z_STREAM_END or an
error. After deflate has returned Z_STREAM_END, the only possible operations
on the stream are deflateReset or deflateEnd.
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
value returned by deflateBound (see below). Then deflate is guaranteed to
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.
Z_FINISH can be used in the first deflate call after deflateInit if all the
compression is to be done in a single step. In order to complete in one
call, avail_out must be at least the value returned by deflateBound (see
below). Then deflate is guaranteed to 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
so far (that is, total_in bytes).
deflate() sets strm->adler to the Adler-32 checksum of all input read
so far (that is, total_in bytes). If a gzip stream is being generated, then
strm->adler will be the CRC-32 checksum of the input read so far. (See
deflateInit2 below.)
deflate() may update strm->data_type if it can make a good guess about
the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
binary. This field is only for information purposes and does not affect the
compression algorithm in any manner.
the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is
considered binary. This field is only for information purposes and does not
affect the compression algorithm in any manner.
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
(for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
fatal, and deflate() can be called again with more input and more output
space to continue compressing.
if next_in or next_out was Z_NULL or the state was inadvertently written over
by the application), or Z_BUF_ERROR if no progress is possible (for example
avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and
deflate() can be called again with more input and more output space to
continue compressing.
*/
@ -369,23 +379,21 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
the caller. If next_in is not Z_NULL and avail_in is large enough (the
exact value depends on the compression method), inflateInit determines the
compression method from the zlib header and allocates all data structures
accordingly; otherwise the allocation will be deferred to the first call of
inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
use default allocation functions.
the caller. In the current version of inflate, the provided input is not
read or consumed. The allocation of a sliding window will be deferred to
the first call of inflate (if the decompression does not complete on the
first call). If zalloc and zfree are set to Z_NULL, inflateInit updates
them to use default allocation functions.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller, or Z_STREAM_ERROR if the parameters are
invalid, such as a null pointer to the structure. msg is set to null if
there is no error message. inflateInit does not perform any decompression
apart from possibly reading the zlib header if present: actual decompression
will be done by inflate(). (So next_in and avail_in may be modified, but
next_out and avail_out are unused and unchanged.) The current implementation
of inflateInit() does not process any header information -- that is deferred
until inflate() is called.
there is no error message. inflateInit does not perform any decompression.
Actual decompression will be done by inflate(). So next_in, and avail_in,
next_out, and avail_out are unused and unchanged. The current
implementation of inflateInit() does not process any header information --
that is deferred until inflate() is called.
*/
@ -401,17 +409,20 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in is updated and processing will
resume at this point for the next call of inflate().
enough room in the output buffer), then next_in and avail_in are updated
accordingly, and processing will resume at this point for the next call of
inflate().
- Provide more output starting at next_out and update next_out and avail_out
- Generate more output starting at next_out and update next_out and avail_out
accordingly. inflate() provides as much output as possible, until there is
no more input data or no more space in the output buffer (see below about
the flush parameter).
Before the call of inflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming more
output, and updating the next_* and avail_* values accordingly. The
output, and updating the next_* and avail_* values accordingly. If the
caller of inflate() does not provide both available input and available
output space, it is possible that there will be no progress made. The
application can consume the uncompressed output when it wants, for example
when the output buffer is full (avail_out == 0), or after each call of
inflate(). If inflate returns Z_OK and with zero avail_out, it must be
@ -428,7 +439,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
gets to the end of that block, or when it runs out of data.
The Z_BLOCK option assists in appending to or combining deflate streams.
Also to assist in this, on return inflate() will set strm->data_type to the
To assist in this, on return inflate() always sets strm->data_type to the
number of unused bits in the last byte taken from strm->next_in, plus 64 if
inflate() is currently decoding the last block in the deflate stream, plus
128 if inflate() returned immediately after decoding an end-of-block code or
@ -454,7 +465,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
this case all pending input is processed and all pending output is flushed;
avail_out must be large enough to hold all of the uncompressed data for the
operation to complete. (The size of the uncompressed data may have been
saved by the compressor for this purpose.) The use of Z_FINISH is not
saved by the compressor for this purpose.) The use of Z_FINISH is not
required to perform an inflation in one step. However it may be used to
inform inflate that a faster approach can be used for the single inflate()
call. Z_FINISH also informs inflate to not maintain a sliding window if the
@ -476,32 +487,33 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
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
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 Adler-32
checksum is equal to that saved by the compressor and returns Z_STREAM_END
only if the checksum is correct.
inflate() can decompress and check either zlib-wrapped or gzip-wrapped
deflate data. The header type is detected automatically, if requested when
initializing with inflateInit2(). Any information contained in the gzip
header is not retained, so applications that need that information should
instead use raw inflate, see inflateInit2() below, or inflateBack() and
perform their own processing of the gzip header and trailer. When processing
header is not retained unless inflateGetHeader() is used. 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.
produced so far. The CRC-32 is checked against the gzip trailer, as is the
uncompressed length, modulo 2^32.
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
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
corrupted (input stream not conforming to the zlib format or incorrect check
value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
Z_BUF_ERROR if no progress is possible or if there was not enough room in the
output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
value, in which case strm->msg points to a string with a more specific
error), Z_STREAM_ERROR if the stream structure was inconsistent (for example
next_in or next_out was Z_NULL, or the state was inadvertently written over
by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR
if no progress was possible or if there was not enough room in the output
buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
inflate() can be called again with more input and more output space to
continue decompressing. If Z_DATA_ERROR is returned, the application may
then call inflateSync() to look for a good compression block if a partial
recovery of the data is desired.
recovery of the data is to be attempted.
*/
@ -511,9 +523,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
This function discards any unprocessed input and does not flush any pending
output.
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state
was inconsistent.
*/
@ -544,16 +555,29 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
compression at the expense of memory usage. The default value is 15 if
deflateInit is used instead.
For the current implementation of deflate(), a windowBits value of 8 (a
window size of 256 bytes) is not supported. As a result, a request for 8
will result in 9 (a 512-byte window). In that case, providing 8 to
inflateInit2() will result in an error when the zlib header with 9 is
checked against the initialization of inflate(). The remedy is to not use 8
with deflateInit2() with this initialization, or at least in that case use 9
with inflateInit2().
windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
determines the window size. deflate() will then generate raw deflate data
with no zlib header or trailer, and will not compute an adler32 check value.
with no zlib header or trailer, and will not compute a check value.
windowBits can also be greater than 15 for optional gzip encoding. Add
16 to windowBits to write a simple gzip header and trailer around the
compressed data instead of a zlib wrapper. The gzip header will have no
file name, no extra data, no comment, no modification time (set to zero), no
header crc, and the operating system will be set to 255 (unknown). If a
gzip stream is being written, strm->adler is a crc32 instead of an adler32.
header crc, and the operating system will be set to the appropriate value,
if the operating system was determined at compile time. If a gzip stream is
being written, strm->adler is a CRC-32 instead of an Adler-32.
For raw deflate or gzip encoding, a request for a 256-byte window is
rejected as invalid, since only the zlib header provides a means of
transmitting the window size to the decompressor.
The memLevel parameter specifies how much memory should be allocated
for the internal compression state. memLevel=1 uses minimum memory but is
@ -614,12 +638,12 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
addition, the current implementation of deflate will use at most the window
size minus 262 bytes of the provided dictionary.
Upon return of this function, strm->adler is set to the adler32 value
Upon return of this function, strm->adler is set to the Adler-32 value
of the dictionary; the decompressor may later use this value to determine
which dictionary has been used by the compressor. (The adler32 value
which dictionary has been used by the compressor. (The Adler-32 value
applies to the whole dictionary even if only a subset of the dictionary is
actually used by the compressor.) If a raw deflate was requested, then the
adler32 value is not computed and strm->adler is not set.
Adler-32 value is not computed and strm->adler is not set.
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
@ -628,6 +652,28 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
not perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
Bytef *dictionary,
uInt *dictLength));
/*
Returns the sliding dictionary being maintained by deflate. dictLength is
set to the number of bytes in the dictionary, and that many bytes are copied
to dictionary. dictionary must have enough space, where 32768 bytes is
always enough. If deflateGetDictionary() is called with dictionary equal to
Z_NULL, then only the dictionary length is returned, and nothing is copied.
Similary, if dictLength is Z_NULL, then it is not set.
deflateGetDictionary() may return a length less than the window size, even
when more than the window size in input has been provided. It may return up
to 258 bytes less in that case, due to how zlib's implementation of deflate
manages the sliding window and lookahead for matches, where matches can be
up to 258 bytes long. If the application needs the last window-size bytes of
input, then that would need to be saved by the application outside of zlib.
deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
stream state is inconsistent.
*/
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
z_streamp source));
/*
@ -648,10 +694,10 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
/*
This function is equivalent to deflateEnd followed by deflateInit,
but does not free and reallocate all the internal compression state. The
stream will keep the same compression level and any other attributes that
may have been set by deflateInit2.
This function is equivalent to deflateEnd followed by deflateInit, but
does not free and reallocate the internal compression state. The stream
will leave the compression level and any other attributes that may have been
set unchanged.
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL).
@ -662,20 +708,36 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
int strategy));
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
interpretation of level and strategy is as in deflateInit2(). This can be
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy.
If the compression level is changed, the input available so far is
compressed with the old level (and may be flushed); the new level will take
effect only at the next call of deflate().
If the compression approach (which is a function of the level) or the
strategy is changed, and if any input has been consumed in a previous
deflate() call, then the input available so far is compressed with the old
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
for the compression levels 0, 1..3, and 4..9 respectively. The new level
and strategy will take effect at the next call of deflate().
Before the call of deflateParams, the stream state must be set as for
a call of deflate(), since the currently available input may have to be
compressed and flushed. In particular, strm->avail_out must be non-zero.
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not
take effect. In this case, deflateParams() can be called again with the
same parameters and more output space to try again.
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
strm->avail_out was zero.
In order to assure a change in the parameters on the first try, the
deflate stream should be flushed using deflate() with Z_BLOCK or other flush
request until strm.avail_out is not zero, before calling deflateParams().
Then no more input data should be provided before the deflateParams() call.
If this is done, the old level and strategy will be applied to the data
compressed before deflateParams(), and the new level and strategy will be
applied to the the data compressed after deflateParams().
deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
there was not enough output space to complete the compression of the
available input data before a change in the strategy or approach. Note that
in the case of a Z_BUF_ERROR, the parameters are not changed. A return
value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be
retried with more output space.
*/
ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
@ -793,7 +855,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
is for use with other formats that use the deflate compressed data format
such as zip. Those formats provide their own check values. If a custom
format is developed using the raw deflate format for compressed data, it is
recommended that a check value such as an adler32 or a crc32 be applied to
recommended that a check value such as an Adler-32 or a CRC-32 be applied to
the uncompressed data as is done in the zlib, gzip, and zip formats. For
most applications, the zlib format should be used as is. Note that comments
above on the use in deflateInit2() applies to the magnitude of windowBits.
@ -802,7 +864,10 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
32 to windowBits to enable zlib and gzip decoding with automatic header
detection, or add 16 to decode only the gzip format (the zlib format will
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
crc32 instead of an adler32.
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
below), inflate() will not automatically decode concatenated gzip streams.
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
would need to be reset to continue decoding a subsequent gzip stream.
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
@ -823,7 +888,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate,
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 Adler-32 value returned by that call of inflate.
The compressor and decompressor must use exactly the same dictionary (see
deflateSetDictionary). For raw inflate, this function can be called at any
time to set the dictionary. If the provided dictionary is smaller than the
@ -834,7 +899,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
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
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
expected one (incorrect adler32 value). inflateSetDictionary does not
expected one (incorrect Adler-32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
inflate().
*/
@ -892,7 +957,7 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state. The
but does not free and reallocate the internal decompression state. The
stream will keep attributes that may have been set by inflateInit2.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
@ -904,7 +969,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
/*
This function is the same as inflateReset, but it also permits changing
the wrap and window size requests. The windowBits parameter is interpreted
the same as it is for inflateInit2.
the same as it is for inflateInit2. If the window size is changed, then the
memory allocated for the window is freed, and the window will be reallocated
by inflate() if needed.
inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL), or if
@ -956,7 +1023,7 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
location in the input stream can be determined from avail_in and data_type
as noted in the description for the Z_BLOCK flush parameter for inflate.
inflateMark returns the value noted above or -1 << 16 if the provided
inflateMark returns the value noted above, or -65536 if the provided
source stream state was inconsistent.
*/
@ -1048,9 +1115,9 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
This routine would normally be used in a utility that reads zip or gzip
files and writes out uncompressed files. The utility would decode the
header and process the trailer on its own, hence this routine expects only
the raw deflate stream to decompress. This is different from the normal
behavior of inflate(), which expects either a zlib or gzip header and
trailer around the deflate stream.
the raw deflate stream to decompress. This is different from the default
behavior of inflate(), which expects a zlib header and trailer around the
deflate stream.
inflateBack() uses two subroutines supplied by the caller that are then
called by inflateBack() for input and output. inflateBack() calls those
@ -1059,12 +1126,12 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
parameters and return types are defined above in the in_func and out_func
typedefs. inflateBack() will call in(in_desc, &buf) which should return the
number of bytes of provided input, and a pointer to that input in buf. If
there is no input available, in() must return zero--buf is ignored in that
case--and inflateBack() will return a buffer error. inflateBack() will call
out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
should return zero on success, or non-zero on failure. If out() returns
non-zero, inflateBack() will return with an error. Neither in() nor out()
are permitted to change the contents of the window provided to
there is no input available, in() must return zero -- buf is ignored in that
case -- and inflateBack() will return a buffer error. inflateBack() will
call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].
out() should return zero on success, or non-zero on failure. If out()
returns non-zero, inflateBack() will return with an error. Neither in() nor
out() are permitted to change the contents of the window provided to
inflateBackInit(), which is also the buffer that out() uses to write from.
The length written by out() will be at most the window size. Any non-zero
amount of input may be provided by in().
@ -1092,7 +1159,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
using strm->next_in which will be Z_NULL only if in() returned an error. If
strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
non-zero. (in() will always be called before out(), so strm->next_in is
assured to be defined if out() returns non-zero.) Note that inflateBack()
assured to be defined if out() returns non-zero.) Note that inflateBack()
cannot return Z_OK.
*/
@ -1114,7 +1181,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
7.6: size of z_off_t
Compiler, assembler, and debug options:
8: DEBUG
8: ZLIB_DEBUG
9: ASMV or ASMINF -- use ASM code
10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
11: 0 (reserved)
@ -1164,7 +1231,8 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
the byte length of the source buffer. Upon entry, destLen is the total size
of the destination buffer, which must be at least the value returned by
compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
compressed data. compress() is equivalent to compress2() with a level
parameter of Z_DEFAULT_COMPRESSION.
compress 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
@ -1180,7 +1248,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least the value returned by
compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
compressed data.
compress2 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 buffer,
@ -1203,7 +1271,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
uncompressed data. (The size of the uncompressed data must have been saved
previously by the compressor and transmitted to the decompressor by some
mechanism outside the scope of this compression library.) Upon exit, destLen
is the actual size of the uncompressed buffer.
is the actual size of the uncompressed data.
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
@ -1212,6 +1280,14 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
buffer with the uncompressed data up to that point.
*/
ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong *sourceLen));
/*
Same as uncompress, except that sourceLen is a pointer, where the
length of the source is *sourceLen. On return, *sourceLen is the number of
source bytes consumed.
*/
/* gzip file access functions */
/*
@ -1290,10 +1366,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
default buffer size is 8192 bytes. This function must be called after
gzopen() or gzdopen(), and before any other calls that read or write the
file. The buffer memory allocation is always deferred to the first read or
write. Two buffers are allocated, either both of the specified size when
writing, or one of the specified size and the other twice that size when
reading. A larger buffer size of, for example, 64K or 128K bytes will
noticeably increase the speed of decompression (reading).
write. Three times that size in buffer space is allocated. A larger buffer
size of, for example, 64K or 128K bytes will noticeably increase the speed
of decompression (reading).
The new buffer size also affects the maximum length for gzprintf().
@ -1304,10 +1379,12 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
/*
Dynamically update the compression level or strategy. See the description
of deflateInit2 for the meaning of these parameters.
of deflateInit2 for the meaning of these parameters. Previously provided
data is flushed before the parameter change.
gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
opened for writing.
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
opened for writing, Z_ERRNO if there is an error writing the flushed data,
or Z_MEM_ERROR if there is a memory allocation error.
*/
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
@ -1335,7 +1412,35 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
case.
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. If len is too large to fit in an int,
then nothing is read, -1 is returned, and the error state is set to
Z_STREAM_ERROR.
*/
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
gzFile file));
/*
Read up to nitems items of size size from file to buf, otherwise operating
as gzread() does. This duplicates the interface of stdio's fread(), with
size_t request and return types. If the library defines size_t, then
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
integer type that can contain a pointer.
gzfread() returns the number of full items read of size size, or zero if
the end of the file was reached and a full item could not be read, or if
there was an error. gzerror() must be consulted if zero is returned in
order to determine if there was an error. If the multiplication of size and
nitems overflows, i.e. the product does not fit in a z_size_t, then nothing
is read, zero is returned, and the error state is set to Z_STREAM_ERROR.
In the event that the end of file is reached and only a partial item is
available at the end, i.e. the remaining uncompressed data length is not a
multiple of size, then the final partial item is nevetheless read into buf
and the end-of-file flag is set. The length of the partial item read is not
provided, but could be inferred from the result of gztell(). This behavior
is the same as the behavior of fread() implementations in common libraries,
but it prevents the direct use of gzfread() to read a concurrently written
file, reseting and retrying on end-of-file, when size is not 1.
*/
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
@ -1346,19 +1451,33 @@ ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
error.
*/
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
z_size_t nitems, gzFile file));
/*
gzfwrite() writes nitems items of size size from buf to file, duplicating
the interface of stdio's fwrite(), with size_t request and return types. If
the library defines size_t, then z_size_t is identical to size_t. If not,
then z_size_t is an unsigned integer type that can contain a pointer.
gzfwrite() returns the number of full items written of size size, or zero
if there was an error. If the multiplication of size and nitems overflows,
i.e. the product does not fit in a z_size_t, then nothing is written, zero
is returned, and the error state is set to Z_STREAM_ERROR.
*/
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
/*
Converts, formats, and writes the arguments to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written, or 0 in case of error. The number of
uncompressed bytes written is limited to 8191, or one less than the buffer
size given to gzbuffer(). The caller should assure that this limit is not
exceeded. If it is exceeded, then gzprintf() will return an error (0) with
nothing written. In this case, there may also be a buffer overflow with
unpredictable consequences, which is possible only if zlib was compiled with
the insecure functions sprintf() or vsprintf() because the secure snprintf()
or vsnprintf() functions were not available. This can be determined using
zlibCompileFlags().
uncompressed bytes actually written, or a negative zlib error code in case
of error. The number of uncompressed bytes written is limited to 8191, or
one less than the buffer size given to gzbuffer(). The caller should assure
that this limit is not exceeded. If it is exceeded, then gzprintf() will
return an error (0) with nothing written. In this case, there may also be a
buffer overflow with unpredictable consequences, which is possible only if
zlib was compiled with the insecure functions sprintf() or vsprintf()
because the secure snprintf() or vsnprintf() functions were not available.
This can be determined using zlibCompileFlags().
*/
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
@ -1418,7 +1537,7 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
If the flush parameter is Z_FINISH, the remaining data is written and the
gzip stream is completed in the output. If gzwrite() is called again, a new
gzip stream will be started in the output. gzread() is able to read such
concatented gzip streams.
concatenated gzip streams.
gzflush should be called only when strictly necessary because it will
degrade compression if called too often.
@ -1572,7 +1691,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
return the updated checksum. If buf is Z_NULL, this function returns the
required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
much faster.
Usage example:
@ -1585,6 +1704,12 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (adler != original_adler) error();
*/
ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf,
z_size_t len));
/*
Same as adler32(), but with a size_t length.
*/
/*
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
z_off_t len2));
@ -1614,6 +1739,12 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
if (crc != original_crc) error();
*/
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
z_size_t len));
/*
Same as crc32(), but with a size_t length.
*/
/*
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
@ -1644,19 +1775,35 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
unsigned char FAR *window,
const char *version,
int stream_size));
#define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
#define inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
#define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
(int)sizeof(z_stream))
#define inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
ZLIB_VERSION, (int)sizeof(z_stream))
#ifdef Z_PREFIX_SET
# define z_deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
# define z_inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
# define z_inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
(int)sizeof(z_stream))
# define z_inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
ZLIB_VERSION, (int)sizeof(z_stream))
#else
# define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
# define inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
# define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
(int)sizeof(z_stream))
# define inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
ZLIB_VERSION, (int)sizeof(z_stream))
#endif
#ifndef Z_SOLO
@ -1676,10 +1823,10 @@ 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))
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
#else
# define gzgetc(g) \
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
#endif
/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
@ -1737,19 +1884,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
#endif /* !Z_SOLO */
/* hack for buggy compilers */
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;};
#endif
/* undocumented functions */
ZEXTERN const char * ZEXPORT zError OF((int));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
#if defined(_WIN32) && !defined(Z_SOLO)
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
const char *mode));
#endif

BIN
portlibs/lib/libbz2.a Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
portlibs/lib/libogg.a Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -53,7 +53,7 @@ char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
static u8 *GetDol(u32 bootcontent, u64 title)
{
snprintf(filepath, ISFS_MAXPATH, "/title/%08lx/%08lx/content/%08lx.app", TITLE_UPPER(title), TITLE_LOWER(title), bootcontent);
snprintf(filepath, ISFS_MAXPATH, "/title/%08x/%08x/content/%08x.app", TITLE_UPPER(title), TITLE_LOWER(title), bootcontent);
u32 contentSize = 0;
@ -81,7 +81,7 @@ static bool GetAppNameFromTmd(bool dol, u32 *bootcontent, u64 title, u32 *IOS)
{
bool ret = false;
snprintf(filepath, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
snprintf(filepath, ISFS_MAXPATH, "/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
u32 size;
u8 *data = ISFS_GetFile(filepath, &size, -1);

View File

@ -41,8 +41,8 @@ bool Identify(u64 titleid)
{
char filepath[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
gprintf("Reading TMD for %08lx %08lx...", TITLE_UPPER(titleid), TITLE_LOWER(titleid));
snprintf(filepath, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(titleid), TITLE_LOWER(titleid));
gprintf("Reading TMD for %08x %08x...", TITLE_UPPER(titleid), TITLE_LOWER(titleid));
snprintf(filepath, ISFS_MAXPATH, "/title/%08x/%08x/content/title.tmd", TITLE_UPPER(titleid), TITLE_LOWER(titleid));
u32 tmdSize;
u8 *tmdBuffer = ISFS_GetFile(filepath, &tmdSize, -1);
if (tmdBuffer == NULL || tmdSize == 0)

View File

@ -74,7 +74,7 @@ u8 Channels::GetRequestedIOS(u64 title)
else
{
char tmd[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
snprintf(tmd, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
snprintf(tmd, ISFS_MAXPATH, "/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
titleTMD = ISFS_GetFile(tmd, &size, -1);
}
if(titleTMD == NULL)
@ -118,7 +118,7 @@ bool Channels::GetAppNameFromTmd(u64 title, char *app, u32 *bootcontent)
else
{
char tmd[ISFS_MAXPATH] ATTRIBUTE_ALIGN(32);
snprintf(tmd, ISFS_MAXPATH, "/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
snprintf(tmd, ISFS_MAXPATH, "/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
data = ISFS_GetFile(tmd, &size, -1);
}
if(data == NULL || size < 0x208)
@ -134,7 +134,7 @@ bool Channels::GetAppNameFromTmd(u64 title, char *app, u32 *bootcontent)
if(tmd_file->contents[i].index == 0)
{
*bootcontent = tmd_file->contents[i].cid;
snprintf(app, ISFS_MAXPATH, "/title/%08lx/%08lx/content/%08lx.app", TITLE_UPPER(title), TITLE_LOWER(title), *bootcontent);
snprintf(app, ISFS_MAXPATH, "/title/%08x/%08x/content/%08x.app", TITLE_UPPER(title), TITLE_LOWER(title), *bootcontent);
ret = true;
break;
}

View File

@ -890,11 +890,11 @@ void Nand::CreateTitleTMD(dir_discHdr *hdr)
u32 highTID = *(u32*)(titleTMD+0x18c);
u32 lowTID = *(u32*)(titleTMD+0x190);
CreatePath("%s/title/%08lx/%08lx/data", FullNANDPath, highTID, lowTID);
CreatePath("%s/title/%08lx/%08lx/content", FullNANDPath, highTID, lowTID);
CreatePath("%s/title/%08x/%08x/data", FullNANDPath, highTID, lowTID);
CreatePath("%s/title/%08x/%08x/content", FullNANDPath, highTID, lowTID);
char nandpath[MAX_FAT_PATH];
snprintf(nandpath, sizeof(nandpath), "%s/title/%08lx/%08lx/content/title.tmd", FullNANDPath, highTID, lowTID);
snprintf(nandpath, sizeof(nandpath), "%s/title/%08x/%08x/content/title.tmd", FullNANDPath, highTID, lowTID);
if(fsop_FileExist(nandpath))
{
@ -1226,7 +1226,7 @@ u8 *Nand::GetTMD(u64 title, u32 *size)
{
u8 *tmd_buf = NULL;
u32 tmd_size = 0;
char *tmd_path = fmt_malloc("/title/%08lx/%08lx/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
char *tmd_path = fmt_malloc("/title/%08x/%08x/content/title.tmd", TITLE_UPPER(title), TITLE_LOWER(title));
if(tmd_path != NULL)
{
tmd_buf = GetEmuFile(tmd_path, &tmd_size);

View File

@ -1,6 +1,6 @@
#define APP_NAME "WiiFlow WFL"
#define APP_VERSION "5.4.9"
#define APP_VERSION "5.5.0 beta 1"
#define APP_DATA_DIR "wiiflow"
#define APPS_DIR "apps/wiiflow"

View File

@ -60,8 +60,8 @@ static const devoptab_t gecko_out = {
NULL, // device chmod_r
NULL, // device fchmod_r
NULL, // device rmdir_r
//NULL, // lstat_r
//NULL, // utimes_r
NULL, // lstat_r
NULL, // utimes_r
};
static void USBGeckoOutput()

View File

@ -192,7 +192,7 @@ void FreeTypeGX::loadGlyphData(FT_Bitmap *bmp, ftgxCharData *charData)
uint8_t *src = (uint8_t *)bmp->buffer;
uint8_t *dst = glyphData;
int32_t pos, x1, y1, x, y;
uint32_t pos, x1, y1, x, y;
for(y1 = 0; y1 < bmp->rows; y1 += 8)
{

View File

@ -563,7 +563,7 @@ void CCoverFlow::setBlur(u32 blurResolution, u32 blurRadius, float blurFactor)
static const struct { u32 x; u32 y; } blurRes[] = {
{ 64, 48 }, { 96, 72 }, { 128, 96 }, { 192, 144 }
};
u32 i = min(max(0ul, blurResolution), sizeof blurRes / sizeof blurRes[0] - 1ul);
u32 i = min(max(0u, blurResolution), sizeof blurRes / sizeof blurRes[0] - 1u);
m_effectTex.width = blurRes[i].x;
m_effectTex.height = blurRes[i].y;
if(m_effectTex.data != NULL)
@ -571,7 +571,7 @@ void CCoverFlow::setBlur(u32 blurResolution, u32 blurRadius, float blurFactor)
free(m_effectTex.data);
m_effectTex.data = NULL;
}
m_blurRadius = min(max(1ul, blurRadius), 3ul);
m_blurRadius = min(max(1u, blurRadius), 3u);
m_blurFactor = min(max(1.f, blurFactor), 2.f);
}
@ -2883,7 +2883,7 @@ void * CCoverFlow::_coverLoader(void *obj)
u32 i, j;
bool hq_req = cf->m_useHQcover;
bool cur_pos_hq = false;
u32 bufferSize = min(cf->m_numBufCovers * max(2ul, cf->m_rows), 80ul);
u32 bufferSize = min(cf->m_numBufCovers * max(2u, cf->m_rows), 80u);
while(cf->m_loadingCovers)
{

View File

@ -1108,7 +1108,7 @@ int pngu_decode (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, PNGU_u32 stripAlph
return PNGU_INVALID_WIDTH_OR_HEIGHT;
// Support paletted images
if (ctx->prop.imgColorType == PNG_COLOR_TYPE_PALETTE)
if (ctx->prop.imgColorType == PNGU_COLOR_TYPE_PALETTE)
png_set_palette_to_rgb(ctx->png_ptr);
// Check if color type is supported by PNGU

View File

@ -168,9 +168,9 @@ bool SFont::fromBuffer(const u8 *buffer, const u32 bufferSize, u32 size, u32 lsp
{
if(buffer == NULL)
return false;
fSize = min(max(6ul, size), 1000ul);
lineSpacing = min(max(6ul, lspacing), 1000ul);
weight = min(w, 32ul);
fSize = min(max(6u, size), 1000u);
lineSpacing = min(max(6u, lspacing), 1000u);
weight = min(w, 32u);
index = idx;// currently not used
if(data != NULL)
@ -190,11 +190,11 @@ bool SFont::fromBuffer(const u8 *buffer, const u32 bufferSize, u32 size, u32 lsp
bool SFont::fromFile(const char *path, u32 size, u32 lspacing, u32 w, u32 idx, const char *fontname)
{
fSize = min(max(6ul, size), 1000ul);
weight = min(w, 32ul);
fSize = min(max(6u, size), 1000u);
weight = min(w, 32u);
index = idx;// currently not used
lineSpacing = min(max(6ul, lspacing), 1000ul);
lineSpacing = min(max(6u, lspacing), 1000u);
if(data != NULL)
free(data);

View File

@ -292,8 +292,8 @@ void CVideo::shiftViewPort(float x, float y)
void CVideo::set2DViewport(u32 w, u32 h, int x, int y)
{
m_width2D = std::min(std::max(512ul, w), 800ul);
m_height2D = std::min(std::max(384ul, h), 600ul);
m_width2D = std::min(std::max(512u, w), 800u);
m_height2D = std::min(std::max(384u, h), 600u);
m_x2D = std::min(std::max(-50, x), 50);
m_y2D = std::min(std::max(-50, y), 50);
}

View File

@ -160,7 +160,7 @@ int app_gameconfig_load(const char *discid, u8 *tempgameconf, u32 tempgameconfsi
}
if (strncasecmp("poke", parsebuffer, strlen(parsebuffer)) == 0 && strlen(parsebuffer) == 4)
{
ret = sscanf((char *) tempgameconf + i, "( %lx , %lx", &codeaddr, &codeval);
ret = sscanf((char *) tempgameconf + i, "( %x , %x", &codeaddr, &codeval);
if (ret == 2)
{
*(gameconf + (gameconfsize / 4)) = 0;
@ -176,7 +176,7 @@ int app_gameconfig_load(const char *discid, u8 *tempgameconf, u32 tempgameconfsi
}
if (strncasecmp("pokeifequal", parsebuffer, strlen(parsebuffer)) == 0 && strlen(parsebuffer) == 11)
{
ret = sscanf((char *) (tempgameconf + i), "( %lx , %lx , %lx , %lx", &codeaddr, &codeval, &codeaddr2, &codeval2);
ret = sscanf((char *) (tempgameconf + i), "( %x , %x , %x , %x", &codeaddr, &codeval, &codeaddr2, &codeval2);
if (ret == 4)
{
*(gameconf + (gameconfsize / 4)) = 0;
@ -194,7 +194,7 @@ int app_gameconfig_load(const char *discid, u8 *tempgameconf, u32 tempgameconfsi
}
if (strncasecmp("searchandpoke", parsebuffer, strlen(parsebuffer)) == 0 && strlen(parsebuffer) == 13)
{
ret = sscanf((char *) (tempgameconf + i), "( %lx%ln", &codeval, &tempoffset);
ret = sscanf((char *) (tempgameconf + i), "( %x%n", &codeval, &tempoffset);
if (ret == 1)
{
gameconfsize += 4;
@ -205,10 +205,10 @@ int app_gameconfig_load(const char *discid, u8 *tempgameconf, u32 tempgameconfsi
gameconfsize += 4;
temp++;
i += tempoffset;
ret = sscanf((char *) (tempgameconf + i), " %lx%ln", &codeval, &tempoffset);
ret = sscanf((char *) (tempgameconf + i), " %x%n", &codeval, &tempoffset);
}
*(gameconf + (gameconfsize / 4) - temp - 1) = temp;
ret = sscanf((char *) (tempgameconf + i), " , %lx , %lx , %lx , %lx", &codeaddr, &codeaddr2, &codeoffset, &codeval2);
ret = sscanf((char *) (tempgameconf + i), " , %x , %x , %x , %x", &codeaddr, &codeaddr2, &codeoffset, &codeval2);
if (ret == 4)
{
*(gameconf + (gameconfsize / 4)) = codeaddr;

View File

@ -2551,11 +2551,11 @@ bool CMenu::_loadPluginList()
bool preCachedList = fsop_FileExist(cachedListFile.c_str());
Config scummvm;
if(!scummvm.load(fmt("%s/scummvm.ini", m_pluginsDir.c_str())))
{
if(!scummvm.load(fmt("%s/scummvm/scummvm.ini", m_pluginsDir.c_str())))
scummvm.load(fmt("%s:/apps/scummvm/scummvm.ini", DeviceName[currentPartition]));
}
if(strchr(romDir, ':') == NULL || !fsop_FileExist(romDir))
scummvm.load(fmt("%s/%s", m_pluginsDir.c_str(), romDir));
else
scummvm.load(romDir);
// should add error msg if loading scummvm fails or is not found
string platformName = "";
if(m_platform.loaded())/* convert plugin magic to platform name */
platformName = m_platform.getString("PLUGINS", m_plugin.PluginMagicWord);

View File

@ -16,7 +16,7 @@ void AddLanguage(char *Path)
char lng[32];
memset(lng, 0, 32);
char *lang_chr = strrchr(Path, '/')+1;
memcpy(lng, lang_chr, min(31ul, (u32)(strrchr(lang_chr, '.')-lang_chr)));
memcpy(lng, lang_chr, min(31u, (u32)(strrchr(lang_chr, '.')-lang_chr)));
languages_available.push_back(lng);
}