updated freetype to 2.3.8

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28932 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2009-01-18 12:13:00 +00:00
parent 31562415de
commit d16a95a243
139 changed files with 3438 additions and 1612 deletions
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -43,6 +43,7 @@
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_STANDARD_LIBRARY_H
FT_BEGIN_HEADER
@@ -134,6 +135,14 @@ FT_BEGIN_HEADER
#else
#define FT_MACINTOSH 1
#endif
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC
#define FT_MACINTOSH 1
#endif
#endif
@@ -212,6 +221,7 @@ FT_BEGIN_HEADER
#error "no 32bit type found -- please check your configuration files"
#endif
/* look up an integer type that is at least 32 bits */
#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
@@ -267,17 +277,12 @@ FT_BEGIN_HEADER
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
#define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
/*************************************************************************/
/* */
/* A 64-bit data type will create compilation problems if you compile */
/* in strict ANSI mode. To avoid them, we disable their use if */
/* __STDC__ is defined. You can however ignore this rule by */
/* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
/* 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. */
/* */
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
@@ -292,6 +297,86 @@ FT_BEGIN_HEADER
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
#define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
#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. */
#ifdef __GNUC__
#if defined( __arm__ ) && !defined( __thumb__ )
#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, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b) );
return a;
}
#endif /* __arm__ && !__thumb__ */
#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)
: "%ecx" );
return result;
}
#endif /* i386 */
#endif /* __GNUC__ */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
#ifdef FT_MULFIX_ASSEMBLER
#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER
#endif
#endif
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
@@ -729,6 +729,18 @@
#define FT_GASP_H <freetype/ftgasp.h>
/*************************************************************************
*
* @macro:
* FT_ADVANCES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which returns individual and ranged glyph advances.
*/
#define FT_ADVANCES_H <freetype/ftadvanc.h>
/* */
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
@@ -10,23 +10,23 @@
*
*/
FT_USE_MODULE(autofit_module_class)
FT_USE_MODULE(tt_driver_class)
FT_USE_MODULE(t1_driver_class)
FT_USE_MODULE(cff_driver_class)
FT_USE_MODULE(t1cid_driver_class)
FT_USE_MODULE(pfr_driver_class)
FT_USE_MODULE(t42_driver_class)
FT_USE_MODULE(winfnt_driver_class)
FT_USE_MODULE(pcf_driver_class)
FT_USE_MODULE(psaux_module_class)
FT_USE_MODULE(psnames_module_class)
FT_USE_MODULE(pshinter_module_class)
FT_USE_MODULE(ft_raster1_renderer_class)
FT_USE_MODULE(sfnt_module_class)
FT_USE_MODULE(ft_smooth_renderer_class)
FT_USE_MODULE(ft_smooth_lcd_renderer_class)
FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
FT_USE_MODULE(bdf_driver_class)
FT_USE_MODULE( FT_Module_Class, autofit_module_class )
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
/* EOF */
@@ -112,7 +112,28 @@ FT_BEGIN_HEADER
/* file `ftconfig.h' either statically or through the */
/* `configure' script on supported platforms. */
/* */
#undef FT_CONFIG_OPTION_FORCE_INT64
#undef FT_CONFIG_OPTION_FORCE_INT64
/*************************************************************************/
/* */
/* If this macro is defined, do not try to use an assembler version of */
/* performance-critical functions (e.g. FT_MulFix). You should only do */
/* that to verify that the assembler function works properly, or to */
/* execute benchmark tests of the various implementations. */
/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
/*************************************************************************/
/* */
/* If this macro is defined, try to use an inlined assembler version of */
/* the `FT_MulFix' function, which is a `hotspot' when loading and */
/* hinting glyphs, and which should be executed as fast as possible. */
/* */
/* Note that if your compiler or CPU is not supported, this will default */
/* to the standard and portable implementation found in `ftcalc.c'. */
/* */
#define FT_CONFIG_OPTION_INLINE_MULFIX
/*************************************************************************/
@@ -163,7 +184,7 @@ 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 */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
/*************************************************************************/
@@ -204,27 +225,27 @@ FT_BEGIN_HEADER
/* 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 */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
/*************************************************************************/
/* */
/* Glyph Postscript Names handling */
/* */
/* By default, FreeType 2 is compiled with the `PSNames' module. This */
/* By default, FreeType 2 is compiled with the `psnames' module. This */
/* module is in charge of converting a glyph name string into a */
/* Unicode value, or return a Macintosh standard glyph name for the */
/* use with the TrueType `post' table. */
/* */
/* Undefine this macro if you do not want `PSNames' compiled in your */
/* Undefine this macro if you do not want `psnames' compiled in your */
/* build of FreeType. This has the following effects: */
/* */
/* - The TrueType driver will provide its own set of glyph names, */
/* if you build it to support postscript names in the TrueType */
/* `post' table. */
/* */
/* - The Type 1 driver will not be able to synthetize a Unicode */
/* - The Type 1 driver will not be able to synthesize a Unicode */
/* charmap out of the glyphs found in the fonts. */
/* */
/* You would normally undefine this configuration macro when building */
@@ -240,12 +261,12 @@ FT_BEGIN_HEADER
/* By default, FreeType 2 is built with the `PSNames' module compiled */
/* in. Among other things, the module is used to convert a glyph name */
/* into a Unicode value. This is especially useful in order to */
/* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
/* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
/* through a big table named the `Adobe Glyph List' (AGL). */
/* */
/* Undefine this macro if you do not want the Adobe Glyph List */
/* compiled in your `PSNames' module. The Type 1 driver will not be */
/* able to synthetize a Unicode charmap out of the glyphs found in the */
/* able to synthesize a Unicode charmap out of the glyphs found in the */
/* fonts. */
/* */
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
@@ -467,9 +488,9 @@ FT_BEGIN_HEADER
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. Note that the */
/* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */
/* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words, */
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* */
/* This macro is only useful for a small number of font files (mostly */
@@ -653,11 +674,12 @@ FT_BEGIN_HEADER
/*
* This variable is defined if either unpatented or native TrueType
* This macro is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
*/
#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
#endif
@@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -54,12 +54,6 @@
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */
/* */
/* IMPORTANT NOTE: We do not define aliases for heap management and */
/* i/o routines (i.e. malloc/free/fopen/fread/...) */
/* since these functions should all be encapsulated */
/* by platform-specific implementations of */
/* `ftsystem.c'. */
/* */
/**********************************************************************/
@@ -124,8 +118,6 @@
#define ft_qsort qsort
#define ft_exit exit /* only used to exit from unhandled exceptions */
/**********************************************************************/
/* */
+165 -18
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -60,8 +60,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* FreeType assumes that structures allocated by the user and passed */
/* as arguments are zeroed out except for the actual data. With */
/* other words, it is recommended to use `calloc' (or variants of it) */
/* as arguments are zeroed out except for the actual data. In other */
/* words, it is recommended to use `calloc' (or variants of it) */
/* instead of `malloc' for allocation. */
/* */
/*************************************************************************/
@@ -191,6 +191,15 @@ FT_BEGIN_HEADER
/* FT_Set_Charmap */
/* FT_Get_Charmap_Index */
/* */
/* FT_FSTYPE_INSTALLABLE_EMBEDDING */
/* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
/* FT_FSTYPE_EDITABLE_EMBEDDING */
/* FT_FSTYPE_NO_SUBSETTING */
/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
/* */
/* FT_Get_FSType_Flags */
/* */
/*************************************************************************/
@@ -606,7 +615,7 @@ FT_BEGIN_HEADER
/* Same as FT_ENCODING_JOHAB. Deprecated. */
/* */
/* <Note> */
/* By default, FreeType automatically synthetizes a Unicode charmap */
/* By default, FreeType automatically synthesizes a Unicode charmap */
/* for PostScript fonts, using their glyph names dictionaries. */
/* However, it also reports the encodings defined explicitly in the */
/* font file, for the cases when they are needed, with the Adobe */
@@ -883,7 +892,7 @@ FT_BEGIN_HEADER
/* scalable formats. */
/* */
/* underline_position :: The position, in font units, of the */
/* underline line for this face. It's the */
/* underline line for this face. It is the */
/* center of the underlining stem. Only */
/* relevant for scalable formats. */
/* */
@@ -1037,6 +1046,27 @@ FT_BEGIN_HEADER
/* exist make FT_Load_Glyph return successfully; in all other cases */
/* you get an `FT_Err_Invalid_Argument' error. */
/* */
/* Note that CID-keyed fonts which are in an SFNT wrapper don't */
/* have this flag set since the glyphs are accessed in the normal */
/* way (using contiguous indices); the `CID-ness' isn't visible to */
/* the application. */
/* */
/* FT_FACE_FLAG_TRICKY :: */
/* Set if the font is `tricky', this is, it always needs the */
/* font format's native hinting engine to get a reasonable result. */
/* A typical example is the Chinese font `mingli.ttf' which uses */
/* TrueType bytecode instructions to move and scale all of its */
/* subglyphs. */
/* */
/* It is not possible to autohint such fonts using */
/* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
/* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */
/* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
/* probably never want this except for demonstration purposes. */
/* */
/* Currently, there are six TrueType fonts in the list of tricky */
/* fonts; they are hard-coded in file `ttobjs.c'. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
@@ -1050,8 +1080,7 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
#define FT_FACE_FLAG_HINTER ( 1L << 11 )
#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
/* */
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
/*************************************************************************
@@ -1162,8 +1191,6 @@ FT_BEGIN_HEADER
#define FT_HAS_FIXED_SIZES( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
/* */
/*************************************************************************
*
@@ -1224,9 +1251,23 @@ FT_BEGIN_HEADER
( face->face_flags & FT_FACE_FLAG_CID_KEYED )
/*************************************************************************
*
* @macro:
* FT_IS_TRICKY( face )
*
* @description:
* A macro that returns true whenever a face represents a `tricky' font.
* See the discussion of @FT_FACE_FLAG_TRICKY for more details.
*
*/
#define FT_IS_TRICKY( face ) \
( face->face_flags & FT_FACE_FLAG_TRICKY )
/*************************************************************************/
/* */
/* <Constant> */
/* <Const> */
/* FT_STYLE_FLAG_XXX */
/* */
/* <Description> */
@@ -1518,10 +1559,10 @@ FT_BEGIN_HEADER
/* */
/* This image can later be converted into a bitmap by calling */
/* @FT_Render_Glyph. This function finds the current renderer for */
/* the native image's format then invokes it. */
/* the native image's format, then invokes it. */
/* */
/* The renderer is in charge of transforming the native image through */
/* the slot's face transformation fields, then convert it into a */
/* the slot's face transformation fields, then converting it into a */
/* bitmap that is returned in `slot->bitmap'. */
/* */
/* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
@@ -1769,7 +1810,7 @@ FT_BEGIN_HEADER
/* `num_params' and `params' is used. They are ignored otherwise. */
/* */
/* Ideally, both the `pathname' and `params' fields should be tagged */
/* as `const'; this is missing for API backwards compatibility. With */
/* as `const'; this is missing for API backwards compatibility. In */
/* other words, applications should treat them as read-only. */
/* */
typedef struct FT_Open_Args_
@@ -2174,7 +2215,8 @@ FT_BEGIN_HEADER
/* A character width or height smaller than 1pt is set to 1pt; if */
/* both resolution values are zero, they are set to 72dpi. */
/* */
/* Don't use this function if you are using the FreeType cache API. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Char_Size( FT_Face face,
FT_F26Dot6 char_width,
@@ -2390,7 +2432,7 @@ FT_BEGIN_HEADER
* 8~pixels packed into each byte of the bitmap data.
*
* Note that this has no effect on the hinting algorithm used. You
* should use @FT_LOAD_TARGET_MONO instead so that the
* should rather use @FT_LOAD_TARGET_MONO so that the
* monochrome-optimized hinting algorithm is used.
*
* FT_LOAD_LINEAR_DESIGN ::
@@ -2409,6 +2451,9 @@ FT_BEGIN_HEADER
* @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
* used at all.
*
* See the description of @FT_FACE_FLAG_TRICKY for a special exception
* (affecting only a handful of Asian fonts).
*
* Besides deciding which hinter to use, you can also decide which
* hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
*/
@@ -2426,11 +2471,14 @@ FT_BEGIN_HEADER
#define FT_LOAD_IGNORE_TRANSFORM 0x800
#define FT_LOAD_MONOCHROME 0x1000
#define FT_LOAD_LINEAR_DESIGN 0x2000
#define FT_LOAD_SBITS_ONLY 0x4000 /* temporary hack! */
#define FT_LOAD_NO_AUTOHINT 0x8000U
/* */
/* used internally only by certain font drivers! */
#define FT_LOAD_ADVANCE_ONLY 0x100
#define FT_LOAD_SBITS_ONLY 0x4000
/**************************************************************************
*
@@ -3156,6 +3204,88 @@ FT_BEGIN_HEADER
FT_Matrix *p_transform );
/*************************************************************************/
/* */
/* <Enum> */
/* FT_FSTYPE_XXX */
/* */
/* <Description> */
/* A list of bit flags used in the `fsType' field of the OS/2 table */
/* in a TrueType or OpenType font and the `FSType' entry in a */
/* PostScript font. These bit flags are returned by */
/* @FT_Get_FSType_Flags; they inform client applications of embedding */
/* and subsetting restrictions associated with a font. */
/* */
/* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
/* more details. */
/* */
/* <Values> */
/* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
/* Fonts with no fsType bit set may be embedded and permanently */
/* installed on the remote system by an application. */
/* */
/* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
/* Fonts that have only this bit set must not be modified, embedded */
/* or exchanged in any manner without first obtaining permission of */
/* the font software copyright owner. */
/* */
/* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
/* If this bit is set, the font may be embedded and temporarily */
/* loaded on the remote system. Documents containing Preview & */
/* Print fonts must be opened `read-only'; no edits can be applied */
/* to the document. */
/* */
/* FT_FSTYPE_EDITABLE_EMBEDDING :: */
/* If this bit is set, the font may be embedded but must only be */
/* installed temporarily on other systems. In contrast to Preview */
/* & Print fonts, documents containing editable fonts may be opened */
/* for reading, editing is permitted, and changes may be saved. */
/* */
/* FT_FSTYPE_NO_SUBSETTING :: */
/* If this bit is set, the font may not be subsetted prior to */
/* embedding. */
/* */
/* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
/* If this bit is set, only bitmaps contained in the font may be */
/* embedded; no outline data may be embedded. If there are no */
/* bitmaps available in the font, then the font is unembeddable. */
/* */
/* <Note> */
/* While the fsType flags can indicate that a font may be embedded, a */
/* license with the font vendor may be separately required to use the */
/* font in this way. */
/* */
#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
#define FT_FSTYPE_NO_SUBSETTING 0x0100
#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_FSType_Flags */
/* */
/* <Description> */
/* Return the fsType flags for a font. */
/* */
/* <Input> */
/* face :: A handle to the source face object. */
/* */
/* <Return> */
/* The fsType flags, @FT_FSTYPE_XXX. */
/* */
/* <Note> */
/* Use this function rather than directly reading the `fs_type' field */
/* in the @PS_FontInfoRec structure which is only guaranteed to */
/* return the correct results for Type~1 fonts. */
/* */
FT_EXPORT( FT_UShort )
FT_Get_FSType_Flags( FT_Face face );
/*************************************************************************/
/* */
/* <Section> */
@@ -3431,6 +3561,12 @@ FT_BEGIN_HEADER
FT_Long c );
/* */
/* The following #if 0 ... #endif is for the documentation formatter, */
/* hiding the internal `FT_MULFIX_INLINED' macro. */
#if 0
/*************************************************************************/
/* */
/* <Function> */
@@ -3464,6 +3600,17 @@ FT_BEGIN_HEADER
FT_MulFix( FT_Long a,
FT_Long b );
/* */
#endif
#ifdef FT_MULFIX_INLINED
#define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b )
#else
FT_EXPORT( FT_Long )
FT_MulFix( FT_Long a,
FT_Long b );
#endif
/*************************************************************************/
/* */
@@ -3611,7 +3758,7 @@ FT_BEGIN_HEADER
*/
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 3
#define FREETYPE_PATCH 7
#define FREETYPE_PATCH 8
/*************************************************************************/
@@ -3695,7 +3842,7 @@ FT_BEGIN_HEADER
/* */
/* <Return> */
/* The old setting value. This will always be false if this is not */
/* a SFNT font, or if the unpatented hinter is not compiled in this */
/* an SFNT font, or if the unpatented hinter is not compiled in this */
/* instance of the library. */
/* */
/* <Since> */
+179
View File
@@ -0,0 +1,179 @@
/***************************************************************************/
/* */
/* ftadvanc.h */
/* */
/* Quick computation of advance widths (specification only). */
/* */
/* Copyright 2008 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 __FTADVANC_H__
#define __FTADVANC_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:
* quick_advance
*
* @title:
* Quick retrieval of advance values
*
* @abstract:
* Retrieve horizontal and vertical advance values without processing
* glyph outlines, if possible.
*
* @description:
* This section contains functions to quickly extract advance values
* without handling glyph outlines, if possible.
*/
/*************************************************************************/
/* */
/* <Const> */
/* FT_ADVANCE_FLAG_FAST_ONLY */
/* */
/* <Description> */
/* A bit-flag to be OR-ed with the `flags' parameter of the */
/* @FT_Get_Advance and @FT_Get_Advances functions. */
/* */
/* If set, it indicates that you want these functions to fail if the */
/* corresponding hinting mode or font driver doesn't allow for very */
/* quick advance computation. */
/* */
/* Typically, glyphs which 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, */
/* and hinting of the glyph outline, are extremely slow by */
/* comparison. */
/* */
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advance */
/* */
/* <Description> */
/* Retrieve the advance value of a given glyph outline in an */
/* @FT_Face. By default, the unhinted advance is returned in font */
/* units. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* gindex :: The glyph index. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* 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. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
/* vertical advance corresponding to a vertical layout. */
/* Otherwise, it is the horizontal advance in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* A scaled advance is returned in 16.16 format but isn't transformed */
/* by the affine transformation specified by @FT_Set_Transform. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
FT_Int32 load_flags,
FT_Fixed *padvance );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advances */
/* */
/* <Description> */
/* Retrieve the advance values of several glyph outlines in an */
/* @FT_Face. By default, the unhinted advances are returned in font */
/* units. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* start :: The first glyph index. */
/* */
/* count :: The number of advance values you want to retrieve. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph. */
/* */
/* <Output> */
/* padvance :: The advances, in either font units or 16.16 format. */
/* This array must contain at least `count' elements. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
/* vertical advances corresponding to a vertical layout. */
/* Otherwise, they are the horizontal advances in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* Scaled advances are returned in 16.16 format but aren't */
/* transformed by the affine transformation specified by */
/* @FT_Set_Transform. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Advances( FT_Face face,
FT_UInt start,
FT_UInt count,
FT_Int32 load_flags,
FT_Fixed *padvances );
/* */
FT_END_HEADER
#endif /* __FTADVANC_H__ */
/* END */
+9 -1
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* Copyright 2002, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -183,6 +183,14 @@ FT_BEGIN_HEADER
* otherwise. It also returns an error if the property is not in the
* font.
*
* A `property' is a either key-value pair within the STARTPROPERTIES
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* `info->props' array within a `FontRec' structure of a PCF font.
*
* Integer properties are always stored as `signed' within PCF fonts;
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* for BDF fonts only.
*
* In case of error, `aproperty->type' is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
+25 -4
View File
@@ -2,10 +2,9 @@
/* */
/* ftbitmap.h */
/* */
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
/* bitmaps into 8bpp format (specification). */
/* FreeType utility functions for bitmaps (specification). */
/* */
/* Copyright 2004, 2005, 2006 by */
/* Copyright 2004, 2005, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -121,7 +120,7 @@ FT_BEGIN_HEADER
/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
/* */
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
@@ -170,6 +169,28 @@ FT_BEGIN_HEADER
FT_Int alignment );
/*************************************************************************/
/* */
/* <Function> */
/* FT_GlyphSlot_Own_Bitmap */
/* */
/* <Description> */
/* Make sure that a glyph slot owns `slot->bitmap'. */
/* */
/* <Input> */
/* slot :: The glyph slot. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function is to be used in combination with */
/* @FT_Bitmap_Embolden. */
/* */
FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/*************************************************************************/
/* */
/* <Function> */
+5 -1
View File
@@ -609,7 +609,8 @@ FT_BEGIN_HEADER
* The source face ID.
*
* cmap_index ::
* The index of the charmap in the source face.
* The index of the charmap in the source face. Any negative value
* means to use the cache @FT_Face's default charmap.
*
* char_code ::
* The character code (in the corresponding charmap).
@@ -832,6 +833,9 @@ FT_BEGIN_HEADER
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
/* Calls to @FT_Set_Char_Size and friends have no effect on cached */
/* glyphs; you should always use the FreeType cache API instead. */
/* */
FT_EXPORT( FT_Error )
FTC_ImageCache_LookupScaler( FTC_ImageCache cache,
FTC_Scaler scaler,
@@ -90,6 +90,7 @@
/* computations */
/* list_processing */
/* outline_processing */
/* quick_advance */
/* bitmap_handling */
/* raster */
/* glyph_stroker */
+7
View File
@@ -22,6 +22,13 @@
#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
/***************************************************************************
*
* @section:
+46 -8
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -219,7 +219,8 @@ FT_BEGIN_HEADER
/* FT_Get_Glyph */
/* */
/* <Description> */
/* A function used to extract a glyph image from a slot. */
/* A function used to extract a glyph image from a slot. Note that */
/* the created @FT_Glyph object must be released with @FT_Done_Glyph. */
/* */
/* <Input> */
/* slot :: A handle to the source glyph slot. */
@@ -427,7 +428,7 @@ FT_BEGIN_HEADER
/* the_glyph :: A pointer to a handle to the target glyph. */
/* */
/* <Input> */
/* render_mode :: An enumeration that describe how the data is */
/* render_mode :: An enumeration that describes how the data is */
/* rendered. */
/* */
/* origin :: A pointer to a vector used to translate the glyph */
@@ -443,12 +444,14 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function does nothing if the glyph format isn't scalable. */
/* */
/* The glyph image is translated with the `origin' vector before */
/* rendering. */
/* */
/* The first parameter is a pointer to an @FT_Glyph handle, that will */
/* be replaced by this function. Typically, you would use (omitting */
/* error handling): */
/* be _replaced_ by this function (with newly allocated data). */
/* Typically, you would use (omitting error handling): */
/* */
/* */
/* { */
@@ -462,12 +465,12 @@ FT_BEGIN_HEADER
/* // extract glyph image */
/* error = FT_Get_Glyph( face->glyph, &glyph ); */
/* */
/* // convert to a bitmap (default render mode + destroy old) */
/* // convert to a bitmap (default render mode + destroying old) */
/* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
/* { */
/* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */
/* 0, 1 ); */
/* if ( error ) // glyph unchanged */
/* if ( error ) // `glyph' unchanged */
/* ... */
/* } */
/* */
@@ -482,7 +485,42 @@ FT_BEGIN_HEADER
/* } */
/* */
/* */
/* This function does nothing if the glyph format isn't scalable. */
/* Here another example, again without error handling: */
/* */
/* */
/* { */
/* FT_Glyph glyphs[MAX_GLYPHS] */
/* */
/* */
/* ... */
/* */
/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
/* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */
/* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */
/* */
/* ... */
/* */
/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
/* { */
/* FT_Glyph bitmap = glyphs[idx]; */
/* */
/* */
/* ... */
/* */
/* // after this call, `bitmap' no longer points into */
/* // the `glyphs' array (and the old value isn't destroyed) */
/* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */
/* */
/* ... */
/* */
/* FT_Done_Glyph( bitmap ); */
/* } */
/* */
/* ... */
/* */
/* for ( idx = 0; i < MAX_GLYPHS; i++ ) */
/* FT_Done_Glyph( glyphs[idx] ); */
/* } */
/* */
FT_EXPORT( FT_Error )
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
+13 -12
View File
@@ -129,29 +129,30 @@ FT_BEGIN_HEADER
/* FT_PIXEL_MODE_GRAY :: */
/* An 8-bit bitmap, generally used to represent anti-aliased glyph */
/* images. Each pixel is stored in one byte. Note that the number */
/* of value `gray' levels is stored in the `num_grays' field of */
/* the @FT_Bitmap structure (it generally is 256). */
/* of `gray' levels is stored in the `num_grays' field of the */
/* @FT_Bitmap structure (it generally is 256). */
/* */
/* FT_PIXEL_MODE_GRAY2 :: */
/* A 2-bit/pixel bitmap, used to represent embedded anti-aliased */
/* bitmaps in font files according to the OpenType specification. */
/* We haven't found a single font using this format, however. */
/* A 2-bit per pixel bitmap, used to represent embedded */
/* anti-aliased bitmaps in font files according to the OpenType */
/* specification. We haven't found a single font using this */
/* format, however. */
/* */
/* FT_PIXEL_MODE_GRAY4 :: */
/* A 4-bit/pixel bitmap, used to represent embedded anti-aliased */
/* A 4-bit per pixel bitmap, representing embedded anti-aliased */
/* bitmaps in font files according to the OpenType specification. */
/* We haven't found a single font using this format, however. */
/* */
/* FT_PIXEL_MODE_LCD :: */
/* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
/* images used for display on LCD displays; the bitmap is three */
/* times wider than the original glyph image. See also */
/* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
/* used for display on LCD displays; the bitmap is three times */
/* wider than the original glyph image. See also */
/* @FT_RENDER_MODE_LCD. */
/* */
/* FT_PIXEL_MODE_LCD_V :: */
/* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
/* images used for display on rotated LCD displays; the bitmap */
/* is three times taller than the original glyph image. See also */
/* An 8-bit bitmap, representing RGB or BGR decimated glyph images */
/* used for display on rotated LCD displays; the bitmap is three */
/* times taller than the original glyph image. See also */
/* @FT_RENDER_MODE_LCD_V. */
/* */
typedef enum FT_Pixel_Mode_
@@ -23,6 +23,12 @@
#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
+1 -1
View File
@@ -412,7 +412,7 @@ FT_BEGIN_HEADER
* FT_Get_TrueType_Engine_Type
*
* @description:
* Return a @FT_TrueTypeEngineType value to indicate which level of
* Return an @FT_TrueTypeEngineType value to indicate which level of
* the TrueType virtual machine a given library instance supports.
*
* @input:
+4 -1
View File
@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
/* <Input> */
/* outline :: A pointer to the source target. */
/* */
/* func_interface :: A table of `emitters', i.e,. function pointers */
/* func_interface :: A table of `emitters', i.e., function pointers */
/* called during decomposition to indicate path */
/* operations. */
/* */
@@ -333,6 +333,9 @@ FT_BEGIN_HEADER
/* situations like acute angles or intersections are sometimes */
/* handled incorrectly. */
/* */
/* If you need `better' metrics values you should call */
/* @FT_Outline_Get_CBox ot @FT_Outline_Get_BBox. */
/* */
/* Example call: */
/* */
/* { */
+3 -3
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* Copyright 2002, 2003, 2004, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -73,11 +73,11 @@ FT_BEGIN_HEADER
* A 16.16 fixed-point number used to scale distance expressed
* in metrics units to device sub-pixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL)
* can be NULL).
*
* ametrics_y_scale ::
* Same as `ametrics_x_scale' but for the vertical direction.
* optional (parameter can be NULL)
* optional (parameter can be NULL).
*
* @return:
* FreeType error code. 0~means success.
+9 -9
View File
@@ -249,7 +249,7 @@ FT_BEGIN_HEADER
* expressed as 16.16 fixed point value.
*
* @note:
* The radius is expressed in the same units that the outline
* The radius is expressed in the same units as the outline
* coordinates.
*/
FT_EXPORT( void )
@@ -305,10 +305,10 @@ FT_BEGIN_HEADER
*
* @note:
* If `opened' is~0 (the default), the outline is treated as a closed
* path, and the stroker will generate two distinct `border' outlines.
* path, and the stroker generates two distinct `border' outlines.
*
* If `opened' is~1, the outline is processed as an open path, and the
* stroker will generate a single `stroke' outline.
* stroker generates a single `stroke' outline.
*
* This function calls @FT_Stroker_Rewind automatically.
*/
@@ -366,7 +366,7 @@ FT_BEGIN_HEADER
*
* @note:
* You should call this function after @FT_Stroker_BeginSubPath.
* If the subpath was not `opened', this function will `draw' a
* If the subpath was not `opened', this function `draws' a
* single line segment to the start position when needed.
*/
FT_EXPORT( FT_Error )
@@ -476,7 +476,7 @@ FT_BEGIN_HEADER
*
* @description:
* Call this function once you have finished parsing your paths
* with the stroker. It will return the number of points and
* with the stroker. It returns the number of points and
* contours necessary to export one of the `border' or `stroke'
* outlines generated by the stroker.
*
@@ -525,8 +525,8 @@ FT_BEGIN_HEADER
* export the corresponding border to your own @FT_Outline
* structure.
*
* Note that this function will append the border points and
* contours to your outline, but will not try to resize its
* Note that this function appends the border points and
* contours to your outline, but does not try to resize its
* arrays.
*
* @input:
@@ -600,8 +600,8 @@ FT_BEGIN_HEADER
* Call this function after @FT_Stroker_GetBorderCounts to
* export the all borders to your own @FT_Outline structure.
*
* Note that this function will append the border points and
* contours to your outline, but will not try to resize its
* Note that this function appends the border points and
* contours to your outline, but does not try to resize its
* arrays.
*
* @input:
+17 -10
View File
@@ -5,7 +5,7 @@
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
/* Copyright 2000-2001, 2003, 2006 by */
/* Copyright 2000-2001, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,7 +23,7 @@
/*************************************************************************/
/*************************************************************************/
/********* *********/
/********* WARNING, THIS IS ALPHA CODE, THIS API *********/
/********* WARNING, THIS IS ALPHA CODE! THIS API *********/
/********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
/********* FREETYPE DEVELOPMENT TEAM *********/
/********* *********/
@@ -34,6 +34,13 @@
/*************************************************************************/
/* 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 */
/* adapted to the particular needs. */
#ifndef __FTSYNTH_H__
#define __FTSYNTH_H__
@@ -50,20 +57,20 @@
FT_BEGIN_HEADER
/* Make sure slot owns slot->bitmap. */
FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/* Do not use this function directly! Copy the code to */
/* your application and modify it to suit your need. */
/* Embolden a glyph by a `reasonable' value (which is highly a matter of */
/* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */
/* For emboldened outlines the metrics are estimates only; if you need */
/* precise values you should call @FT_Outline_Get_CBox. */
FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
/* Slant an outline glyph to the right by about 12 degrees. */
FT_EXPORT( void )
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
/* */
/* */
FT_END_HEADER
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (specification). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by */
/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
#else /* !FT_DEBUG_LEVEL_TRACE */
#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */
#endif /* !FT_DEBUG_LEVEL_TRACE */
@@ -178,7 +178,7 @@ FT_BEGIN_HEADER
#else /* !FT_DEBUG_LEVEL_ERROR */
#define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */
#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */
#endif /* !FT_DEBUG_LEVEL_ERROR */
@@ -201,7 +201,7 @@ FT_BEGIN_HEADER
#else /* !FT_DEBUG_LEVEL_ERROR */
#define FT_ASSERT( condition ) do ; while ( 0 )
#define FT_ASSERT( condition ) do { } while ( 0 )
#endif /* !FT_DEBUG_LEVEL_ERROR */
@@ -91,6 +91,7 @@ FT_BEGIN_HEADER
(*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
FT_Long charcode );
typedef FT_Error
(*FT_Face_GetKerningFunc)( FT_Face face,
FT_UInt left_glyph,
@@ -104,11 +105,11 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FT_Face_GetAdvancesFunc)( FT_Face face,
FT_UInt first,
FT_UInt count,
FT_Bool vertical,
FT_UShort* advances );
(*FT_Face_GetAdvancesFunc)( FT_Face face,
FT_UInt first,
FT_UInt count,
FT_Int32 flags,
FT_Fixed* advances );
/*************************************************************************/
@@ -5,7 +5,7 @@
/* Auxiliary functions and data structures related to PostScript fonts */
/* (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -227,7 +227,11 @@ FT_BEGIN_HEADER
FT_UInt array_max; /* maximal number of elements for */
/* array */
FT_UInt count_offset; /* offset of element count for */
/* arrays */
/* arrays; must not be zero if in */
/* use -- in other words, a */
/* `num_FOO' element must not */
/* start the used structure if we */
/* parse a `FOO' array */
FT_UInt dict; /* where we expect it */
} T1_FieldRec;
@@ -7,7 +7,7 @@
/* Copyright 2003 by */
/* Masatake YAMATO, Redhat K.K. */
/* */
/* Copyright 2003 by */
/* Copyright 2003, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -49,6 +49,13 @@ FT_BEGIN_HEADER
/* The language ID used in Mac fonts. Definitions of values are in */
/* freetype/ttnameid.h. */
/* */
/* format :: */
/* The cmap format. OpenType 1.5 defines the formats 0 (byte */
/* encoding table), 2~(high-byte mapping through table), 4~(segment */
/* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */
/* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */
/* coverage), and 14 (Unicode Variation Sequences). */
/* */
typedef struct TT_CMapInfo_
{
FT_ULong language;
@@ -5,7 +5,7 @@
/* Basic Type1/Type2 type definitions and interface (specification */
/* only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -231,7 +231,9 @@ FT_BEGIN_HEADER
void* psnames;
void* psaux;
CID_FaceInfoRec cid;
#if 0
void* afm_data;
#endif
CID_Subrs subrs;
/* since version 2.1 - interface to PostScript hinter */
@@ -78,6 +78,10 @@ FT_BEGIN_HEADER
FT_Short underline_position;
FT_UShort underline_thickness;
/* since 2.3.8 */
FT_UShort fs_type;
} PS_FontInfoRec;
+185 -84
View File
@@ -835,16 +835,18 @@ FT_BEGIN_HEADER
/* This is new in OpenType 1.3 */
#define TT_NAME_ID_CID_FINDFONT_NAME 20
/* This is new in OpenType 1.5 */
#define TT_NAME_ID_WWS_FAMILY 21
#define TT_NAME_ID_WWS_SUBFAMILY 22
/*************************************************************************/
/* */
/* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table. */
/* */
/* Updated 02-Jul-2000. */
/* Updated 08-Nov-2008. */
/* */
/* General Scripts Area */
/* Bit 0 Basic Latin */
#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
/* Bit 1 C1 Controls and Latin-1 Supplement */
@@ -853,27 +855,44 @@ FT_BEGIN_HEADER
#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
/* Bit 3 Latin Extended-B */
#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
/* Bit 4 IPA Extensions */
/* Bit 4 IPA Extensions */
/* Phonetic Extensions */
/* Phonetic Extensions Supplement */
#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
/* U+1D00-U+1D7F */
/* U+1D80-U+1DBF */
/* Bit 5 Spacing Modifier Letters */
/* Modifier Tone Letters */
#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
/* Bit 6 Combining Diacritical Marks */
/* U+A700-U+A71F */
/* Bit 6 Combining Diacritical Marks */
/* Combining Diacritical Marks Supplement */
#define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */
/* U+1DC0-U+1DFF */
/* Bit 7 Greek and Coptic */
#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
/* Bit 8 is reserved (was: Greek Symbols and Coptic) */
/* Bit 9 Cyrillic + */
/* Cyrillic Supplementary */
/* Bit 8 Coptic */
#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
/* Bit 9 Cyrillic */
/* Cyrillic Supplement */
/* Cyrillic Extended-A */
/* Cyrillic Extended-B */
#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
/* U+0500-U+052F */
/* U+2DE0-U+2DFF */
/* U+A640-U+A69F */
/* Bit 10 Armenian */
#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
/* Bit 11 Hebrew */
#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
/* Bit 12 is reserved (was: Hebrew Extended) */
/* Bit 13 Arabic */
/* Bit 12 Vai */
#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
/* Bit 13 Arabic */
/* Arabic Supplement */
#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
/* Bit 14 is reserved (was: Arabic Extended) */
/* U+0750-U+077F */
/* Bit 14 NKo */
#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
/* Bit 15 Devanagari */
#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
/* Bit 16 Bengali */
@@ -896,20 +915,26 @@ FT_BEGIN_HEADER
#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
/* Bit 25 Lao */
#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
/* Bit 26 Georgian */
/* Bit 26 Georgian */
/* Georgian Supplement */
#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
/* Bit 27 is reserved (was Georgian Extended) */
/* U+2D00-U+2D2F */
/* Bit 27 Balinese */
#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
/* Bit 28 Hangul Jamo */
#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
/* Bit 29 Latin Extended Additional */
/* Latin Extended-C */
/* Latin Extended-D */
#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
/* U+2C60-U+2C7F */
/* U+A720-U+A7FF */
/* Bit 30 Greek Extended */
#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
/* Symbols Area */
/* Bit 31 General Punctuation */
/* Bit 31 General Punctuation */
/* Supplemental Punctuation */
#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
/* U+2E00-U+2E7F */
/* Bit 32 Superscripts And Subscripts */
#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
/* Bit 33 Currency Symbols */
@@ -920,16 +945,18 @@ FT_BEGIN_HEADER
#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
/* Bit 36 Number Forms */
#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
/* Bit 37 Arrows + */
/* Supplemental Arrows-A + */
/* Supplemental Arrows-B */
/* Bit 37 Arrows */
/* Supplemental Arrows-A */
/* Supplemental Arrows-B */
/* Miscellaneous Symbols and Arrows */
#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
/* U+27F0-U+27FF */
/* U+2900-U+297F */
/* Bit 38 Mathematical Operators + */
/* Supplemental Mathematical Operators + */
/* Miscellaneous Mathematical Symbols-A + */
/* Miscellaneous Mathematical Symbols-B */
/* U+2B00-U+2BFF */
/* Bit 38 Mathematical Operators */
/* Supplemental Mathematical Operators */
/* Miscellaneous Mathematical Symbols-A */
/* Miscellaneous Mathematical Symbols-B */
#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
/* U+2A00-U+2AFF */
/* U+27C0-U+27EF */
@@ -952,60 +979,53 @@ FT_BEGIN_HEADER
#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
/* Bit 47 Dingbats */
#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
/* CJK Phonetics and Symbols Area */
/* Bit 48 CJK Symbols and Punctuation */
#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
/* Bit 49 Hiragana */
#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
/* Bit 50 Katakana + */
/* Katakana Phonetic Extensions */
/* Bit 50 Katakana */
/* Katakana Phonetic Extensions */
#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
/* U+31F0-U+31FF */
/* Bit 51 Bopomofo + */
/* Bopomofo Extended */
/* Bit 51 Bopomofo */
/* Bopomofo Extended */
#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
/* U+31A0-U+31BF */
/* Bit 52 Hangul Compatibility Jamo */
#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
/* Bit 53 Kanbun */
#define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */
#define TT_UCR_KANBUN TT_UCR_CJK_MISC
/* Bit 53 Phags-Pa */
#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
#define TT_UCR_PHAGSPA
/* Bit 54 Enclosed CJK Letters and Months */
#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
/* Bit 55 CJK Compatibility */
#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
/* Hangul Syllables Area */
/* Bit 56 Hangul */
/* Bit 56 Hangul Syllables */
#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
/* Surrogates Area */
/* Bit 57 High Surrogates + */
/* High Private Use Surrogates + */
/* Low Surrogates */
/* Bit 57 High Surrogates */
/* High Private Use Surrogates */
/* Low Surrogates */
/* */
/* According to OpenType specs v.1.3+, */
/* setting bit 57 implies that there is */
/* at least one codepoint beyond the */
/* Basic Multilingual Plane that is */
/* supported by this font. So it really */
/* means >= U+10000 */
#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
/* U+DB80-U+DBFF */
/* U+DC00-U+DFFF */
/* According to OpenType specs v.1.3+, setting bit 57 implies that there */
/* is at least one codepoint beyond the Basic Multilingual Plane that is */
/* supported by this font. So it really means: >= U+10000 */
/* Bit 58 is reserved for Unicode SubRanges */
/* CJK Ideographs Area */
/* Bit 59 CJK Unified Ideographs + */
/* CJK Radicals Supplement + */
/* Kangxi Radicals + */
/* Ideographic Description Characters + */
/* CJK Unified Ideographs Extension A */
/* CJK Unified Ideographs Extension A + */
/* CJK Unified Ideographs Extension B + */
/* Kanbun */
#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
/* Bit 58 Phoenician */
#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
/* Bit 59 CJK Unified Ideographs */
/* CJK Radicals Supplement */
/* Kangxi Radicals */
/* Ideographic Description Characters */
/* CJK Unified Ideographs Extension A */
/* CJK Unified Ideographs Extension B */
/* Kanbun */
#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
/* U+2E80-U+2EFF */
/* U+2F00-U+2FDF */
@@ -1013,17 +1033,13 @@ FT_BEGIN_HEADER
/* U+3400-U+4DB5 */
/*U+20000-U+2A6DF*/
/* U+3190-U+319F */
/* Private Use Area */
/* Bit 60 Private Use */
#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
/* Compatibility Area and Specials */
/* Bit 61 CJK Compatibility Ideographs + */
/* CJK Compatibility Ideographs Supplement */
#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+F900-U+FAFF */
/* Bit 61 CJK Strokes */
/* CJK Compatibility Ideographs */
/* CJK Compatibility Ideographs Supplement */
#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
/* U+F900-U+FAFF */
/*U+2F800-U+2FA1F*/
/* Bit 62 Alphabetic Presentation Forms */
#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
@@ -1031,8 +1047,10 @@ FT_BEGIN_HEADER
#define TT_UCR_ARABIC_PRESENTATIONS_A (1L << 31) /* U+FB50-U+FDFF */
/* Bit 64 Combining Half Marks */
#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
/* Bit 65 CJK Compatibility Forms */
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE30-U+FE4F */
/* Bit 65 Vertical forms */
/* CJK Compatibility Forms */
#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
/* U+FE30-U+FE4F */
/* Bit 66 Small Form Variants */
#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
/* Bit 67 Arabic Presentation Forms-B */
@@ -1051,8 +1069,12 @@ FT_BEGIN_HEADER
#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
/* Bit 74 Myanmar */
#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
/* Bit 75 Ethiopic */
/* Bit 75 Ethiopic */
/* Ethiopic Supplement */
/* Ethiopic Extended */
#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
/* U+1380-U+139F */
/* U+2D80-U+2DDF */
/* Bit 76 Cherokee */
#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
/* Bit 77 Unified Canadian Aboriginal Syllabics */
@@ -1061,20 +1083,22 @@ FT_BEGIN_HEADER
#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
/* Bit 79 Runic */
#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
/* Bit 80 Khmer */
/* Bit 80 Khmer */
/* Khmer Symbols */
#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
/* U+19E0-U+19FF */
/* Bit 81 Mongolian */
#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
/* Bit 82 Braille Patterns */
#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
/* Bit 83 Yi Syllables + */
/* Yi Radicals */
/* Bit 83 Yi Syllables */
/* Yi Radicals */
#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
/* U+A490-U+A4CF */
/* Bit 84 Tagalog + */
/* Hanunoo + */
/* Buhid + */
/* Tagbanwa */
/* Bit 84 Tagalog */
/* Hanunoo */
/* Buhid */
/* Tagbanwa */
#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
/* U+1720-U+173F */
/* U+1740-U+175F */
@@ -1085,20 +1109,97 @@ FT_BEGIN_HEADER
#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
/* Bit 87 Deseret */
#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
/* Bit 88 Byzantine Musical Symbols + */
/* Musical Symbols */
/* Bit 88 Byzantine Musical Symbols */
/* Musical Symbols */
/* Ancient Greek Musical Notation */
#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
/*U+1D100-U+1D1FF*/
/*U+1D200-U+1D24F*/
/* Bit 89 Mathematical Alphanumeric Symbols */
#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
/* Bit 90 Private Use (plane 15) + */
/* Private Use (plane 16) */
/* Bit 90 Private Use (plane 15) */
/* Private Use (plane 16) */
#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
/*U+100000-U+10FFFD*/
/* Bit 91 Variation Selectors */
/* Bit 91 Variation Selectors */
/* Variation Selectors Supplement */
#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
/*U+E0100-U+E01EF*/
/* Bit 92 Tags */
#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
/* Bit 93 Limbu */
#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
/* Bit 94 Tai Le */
#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
/* Bit 95 New Tai Lue */
#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
/* Bit 96 Buginese */
#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
/* Bit 97 Glagolitic */
#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
/* Bit 98 Tifinagh */
#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
/* Bit 99 Yijing Hexagram Symbols */
#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
/* Bit 100 Syloti Nagri */
#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
/* Bit 101 Linear B Syllabary */
/* Linear B Ideograms */
/* Aegean Numbers */
#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
/*U+10080-U+100FF*/
/*U+10100-U+1013F*/
/* Bit 102 Ancient Greek Numbers */
#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
/* Bit 103 Ugaritic */
#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
/* Bit 104 Old Persian */
#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
/* Bit 105 Shavian */
#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
/* Bit 106 Osmanya */
#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
/* Bit 107 Cypriot Syllabary */
#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
/* Bit 108 Kharoshthi */
#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
/* Bit 109 Tai Xuan Jing Symbols */
#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
/* Bit 110 Cuneiform */
/* Cuneiform Numbers and Punctuation */
#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
/*U+12400-U+1247F*/
/* Bit 111 Counting Rod Numerals */
#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
/* Bit 112 Sundanese */
#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
/* Bit 113 Lepcha */
#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
/* Bit 114 Ol Chiki */
#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
/* Bit 115 Saurashtra */
#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
/* Bit 116 Kayah Li */
#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
/* Bit 117 Rejang */
#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
/* Bit 118 Cham */
#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
/* Bit 119 Ancient Symbols */
#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
/* Bit 120 Phaistos Disc */
#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
/* Bit 121 Carian */
/* Lycian */
/* Lydian */
#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
/*U+10280-U+1029F*/
/*U+10920-U+1093F*/
/* Bit 122 Domino Tiles */
/* Mahjong Tiles */
#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
/*U+1F000-U+1F02F*/
/* Bit 123-127 Reserved for process-internal usage */
/*************************************************************************/
+8 -1
View File
@@ -4,7 +4,7 @@
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
/* Copyright 1996-2001, 2004, 2005, 2007 by */
/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -41,6 +41,7 @@ FT_BEGIN_HEADER
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
@@ -49,6 +50,7 @@ FT_BEGIN_HEADER
#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
@@ -67,6 +69,7 @@ FT_BEGIN_HEADER
#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
@@ -79,14 +82,18 @@ FT_BEGIN_HEADER
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
#define TTAG_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_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' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' )
#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' )
+32 -27
View File
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK script (body). */
/* */
/* Copyright 2006, 2007 by */
/* Copyright 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -1253,10 +1253,15 @@
else if ( after >= edge_limit )
af_cjk_align_serif_edge( hints, before, edge );
else
edge->pos = before->pos +
FT_MulDiv( edge->fpos - before->fpos,
after->pos - before->pos,
after->fpos - before->fpos );
{
if ( after->fpos == before->fpos )
edge->pos = before->pos;
else
edge->pos = before->pos +
FT_MulDiv( edge->fpos - before->fpos,
after->pos - before->pos,
after->fpos - before->fpos );
}
}
}
}
@@ -1436,29 +1441,29 @@
static const AF_Script_UniRangeRec af_cjk_uniranges[] =
{
#if 0
{ 0x0100, 0xFFFF }, /* why this? */
{ 0x0100UL, 0xFFFFUL }, /* why this? */
#endif
{ 0x2E80, 0x2EFF }, /* CJK Radicals Supplement */
{ 0x2F00, 0x2FDF }, /* Kangxi Radicals */
{ 0x3000, 0x303F }, /* CJK Symbols and Punctuation */
{ 0x3040, 0x309F }, /* Hiragana */
{ 0x30A0, 0x30FF }, /* Katakana */
{ 0x3100, 0x312F }, /* Bopomofo */
{ 0x3130, 0x318F }, /* Hangul Compatibility Jamo */
{ 0x31A0, 0x31BF }, /* Bopomofo Extended */
{ 0x31C0, 0x31EF }, /* CJK Strokes */
{ 0x31F0, 0x31FF }, /* Katakana Phonetic Extensions */
{ 0x3200, 0x32FF }, /* Enclosed CJK Letters and Months */
{ 0x3300, 0x33FF }, /* CJK Compatibility */
{ 0x3400, 0x4DBF }, /* CJK Unified Ideographs Extension A */
{ 0x4DC0, 0x4DFF }, /* Yijing Hexagram Symbols */
{ 0x4E00, 0x9FFF }, /* CJK Unified Ideographs */
{ 0xF900, 0xFAFF }, /* CJK Compatibility Ideographs */
{ 0xFE30, 0xFE4F }, /* CJK Compatibility Forms */
{ 0xFF00, 0xFFEF }, /* Halfwidth and Fullwidth Forms */
{ 0x20000, 0x2A6DF }, /* CJK Unified Ideographs Extension B */
{ 0x2F800, 0x2FA1F }, /* CJK Compatibility Ideographs Supplement */
{ 0, 0 }
{ 0x2E80UL, 0x2EFFUL }, /* CJK Radicals Supplement */
{ 0x2F00UL, 0x2FDFUL }, /* Kangxi Radicals */
{ 0x3000UL, 0x303FUL }, /* CJK Symbols and Punctuation */
{ 0x3040UL, 0x309FUL }, /* Hiragana */
{ 0x30A0UL, 0x30FFUL }, /* Katakana */
{ 0x3100UL, 0x312FUL }, /* Bopomofo */
{ 0x3130UL, 0x318FUL }, /* Hangul Compatibility Jamo */
{ 0x31A0UL, 0x31BFUL }, /* Bopomofo Extended */
{ 0x31C0UL, 0x31EFUL }, /* CJK Strokes */
{ 0x31F0UL, 0x31FFUL }, /* Katakana Phonetic Extensions */
{ 0x3200UL, 0x32FFUL }, /* Enclosed CJK Letters and Months */
{ 0x3300UL, 0x33FFUL }, /* CJK Compatibility */
{ 0x3400UL, 0x4DBFUL }, /* CJK Unified Ideographs Extension A */
{ 0x4DC0UL, 0x4DFFUL }, /* Yijing Hexagram Symbols */
{ 0x4E00UL, 0x9FFFUL }, /* CJK Unified Ideographs */
{ 0xF900UL, 0xFAFFUL }, /* CJK Compatibility Ideographs */
{ 0xFE30UL, 0xFE4FUL }, /* CJK Compatibility Forms */
{ 0xFF00UL, 0xFFEFUL }, /* Halfwidth and Fullwidth Forms */
{ 0x20000UL, 0x2A6DFUL }, /* CJK Unified Ideographs Extension B */
{ 0x2F800UL, 0x2FA1FUL }, /* CJK Compatibility Ideographs Supplement */
{ 0UL, 0UL }
};
+4 -4
View File
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (body). */
/* */
/* Copyright 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -127,7 +127,7 @@
#ifdef AF_DEBUG
#include <stdio.h>
#include FT_CONFIG_STANDARD_LIBRARY_H
static const char*
af_dir_str( AF_Direction dir )
@@ -203,14 +203,14 @@
if ( flags & AF_EDGE_ROUND )
{
memcpy( temp + pos, "round", 5 );
ft_memcpy( temp + pos, "round", 5 );
pos += 5;
}
if ( flags & AF_EDGE_SERIF )
{
if ( pos > 0 )
temp[pos++] = ' ';
memcpy( temp + pos, "serif", 5 );
ft_memcpy( temp + pos, "serif", 5 );
pos += 5;
}
if ( pos == 0 )
+32 -23
View File
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (body). */
/* */
/* Copyright 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -2008,7 +2008,10 @@
if ( before >= edges && before < edge &&
after < edge_limit && after > edge )
{
edge->pos = before->pos +
if ( after->opos == before->opos )
edge->pos = before->pos;
else
edge->pos = before->pos +
FT_MulDiv( edge->opos - before->opos,
after->pos - before->pos,
after->opos - before->opos );
@@ -2124,27 +2127,33 @@
static const AF_Script_UniRangeRec af_latin_uniranges[] =
{
{ 0x0020, 0x007F }, /* Basic Latin (no control characters) */
{ 0x00A0, 0x00FF }, /* Latin-1 Supplement (no control characters) */
{ 0x0100, 0x017F }, /* Latin Extended-A */
{ 0x0180, 0x024F }, /* Latin Extended-B */
{ 0x0250, 0x02AF }, /* IPA Extensions */
{ 0x02B0, 0x02FF }, /* Spacing Modifier Letters */
{ 0x0300, 0x036F }, /* Combining Diacritical Marks */
{ 0x0370, 0x03FF }, /* Greek and Coptic */
{ 0x0400, 0x04FF }, /* Cyrillic */
{ 0x0500, 0x052F }, /* Cyrillic Supplement */
{ 0x1D00, 0x1D7F }, /* Phonetic Extensions */
{ 0x1D80, 0x1DBF }, /* Phonetic Extensions Supplement */
{ 0x1DC0, 0x1DFF }, /* Combining Diacritical Marks Supplement */
{ 0x1E00, 0x1EFF }, /* Latin Extended Additional */
{ 0x1F00, 0x1FFF }, /* Greek Extended */
{ 0x2000, 0x206F }, /* General Punctuation */
{ 0x2070, 0x209F }, /* Superscripts and Subscripts */
{ 0x20A0, 0x20CF }, /* Currency Symbols */
{ 0x2150, 0x218F }, /* Number Forms */
{ 0x2460, 0x24FF }, /* Enclosed Alphanumerics */
{ 0 , 0 }
{ 0x0020 , 0x007F }, /* Basic Latin (no control chars) */
{ 0x00A0 , 0x00FF }, /* Latin-1 Supplement (no control chars) */
{ 0x0100 , 0x017F }, /* Latin Extended-A */
{ 0x0180 , 0x024F }, /* Latin Extended-B */
{ 0x0250 , 0x02AF }, /* IPA Extensions */
{ 0x02B0 , 0x02FF }, /* Spacing Modifier Letters */
{ 0x0300 , 0x036F }, /* Combining Diacritical Marks */
{ 0x0370 , 0x03FF }, /* Greek and Coptic */
{ 0x0400 , 0x04FF }, /* Cyrillic */
{ 0x0500 , 0x052F }, /* Cyrillic Supplement */
{ 0x1D00 , 0x1D7F }, /* Phonetic Extensions */
{ 0x1D80 , 0x1DBF }, /* Phonetic Extensions Supplement */
{ 0x1DC0 , 0x1DFF }, /* Combining Diacritical Marks Supplement */
{ 0x1E00 , 0x1EFF }, /* Latin Extended Additional */
{ 0x1F00 , 0x1FFF }, /* Greek Extended */
{ 0x2000 , 0x206F }, /* General Punctuation */
{ 0x2070 , 0x209F }, /* Superscripts and Subscripts */
{ 0x20A0 , 0x20CF }, /* Currency Symbols */
{ 0x2150 , 0x218F }, /* Number Forms */
{ 0x2460 , 0x24FF }, /* Enclosed Alphanumerics */
{ 0x2C60 , 0x2C7F }, /* Latin Extended-C */
{ 0x2DE0 , 0x2DFF }, /* Cyrillic Extended-A */
{ 0xA640U , 0xA69FU }, /* Cyrillic Extended-B */
{ 0xA720U , 0xA7FFU }, /* Latin Extended-D */
{ 0xFB00U , 0xFB06U }, /* Alphab. Present. Forms (Latin Ligs) */
{ 0x1D400UL, 0x1D7FFUL }, /* Mathematical Alphanumeric Symbols */
{ 0 , 0 }
};
+8 -2
View File
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (body). */
/* */
/* Copyright 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -944,6 +944,9 @@
}
}
}
#if 0
}
#endif
/* now, compute the `serif' segments */
for ( seg1 = segments; seg1 < segment_limit; seg1++ )
@@ -2150,7 +2153,10 @@
if ( before >= edges && before < edge &&
after < edge_limit && after > edge )
{
edge->pos = before->pos +
if ( after->opos == before->opos )
edge->pos = before->pos;
else
edge->pos = before->pos +
FT_MulDiv( edge->opos - before->opos,
after->pos - before->pos,
after->opos - before->opos );
+4 -3
View File
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter types (specification only). */
/* */
/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -58,7 +58,8 @@ FT_BEGIN_HEADER
#ifdef AF_DEBUG
#include <stdio.h>
#include FT_CONFIG_STANDARD_LIBRARY_H
#define AF_LOG( x ) do { if ( _af_debug ) printf x; } while ( 0 )
extern int _af_debug;
@@ -69,7 +70,7 @@ extern void* _af_debug_hints;
#else /* !AF_DEBUG */
#define AF_LOG( x ) do ; while ( 0 ) /* nothing */
#define AF_LOG( x ) do { } while ( 0 ) /* nothing */
#endif /* !AF_DEBUG */
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += AUTOFIT_MODULE
define AUTOFIT_MODULE
$(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Module_Class, autofit_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
endef
+163
View File
@@ -0,0 +1,163 @@
/***************************************************************************/
/* */
/* ftadvanc.c */
/* */
/* Quick computation of advance widths (body). */
/* */
/* Copyright 2008 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. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_ADVANCES_H
#include FT_INTERNAL_OBJECTS_H
static FT_Error
_ft_face_scale_advances( FT_Face face,
FT_Fixed* advances,
FT_UInt count,
FT_Int32 flags )
{
FT_Fixed scale;
FT_UInt nn;
if ( flags & FT_LOAD_NO_SCALE )
return FT_Err_Ok;
if ( face->size == NULL )
return FT_Err_Invalid_Size_Handle;
if ( flags & FT_LOAD_VERTICAL_LAYOUT )
scale = face->size->metrics.y_scale;
else
scale = face->size->metrics.x_scale;
/* this must be the same computation as to get linearHori/VertAdvance */
/* (see `FT_Load_Glyph' implementation in src/base/ftobjs.c */
for ( nn = 0; nn < count; nn++ )
advances[nn] = FT_MulDiv( advances[nn], scale, 64 );
return FT_Err_Ok;
}
/* at the moment, we can perform fast advance retrieval only in */
/* the following cases: */
/* */
/* - unscaled load */
/* - unhinted load */
/* - light-hinted load */
#define LOAD_ADVANCE_FAST_CHECK( flags ) \
( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) || \
FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT )
/* documentation is in ftadvanc.h */
FT_EXPORT_DEF( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
FT_Int32 flags,
FT_Fixed *padvance )
{
FT_Face_GetAdvancesFunc func;
if ( !face )
return FT_Err_Invalid_Face_Handle;
if ( gindex >= (FT_UInt)face->num_glyphs )
return FT_Err_Invalid_Glyph_Index;
func = face->driver->clazz->get_advances;
if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
{
FT_Error error;
error = func( face, gindex, 1, flags, padvance );
if ( !error )
return _ft_face_scale_advances( face, padvance, 1, flags );
if ( error != FT_ERROR_BASE( FT_Err_Unimplemented_Feature ) )
return error;
}
return FT_Get_Advances( face, gindex, 1, flags, padvance );
}
/* documentation is in ftadvanc.h */
FT_EXPORT_DEF( FT_Error )
FT_Get_Advances( FT_Face face,
FT_UInt start,
FT_UInt count,
FT_Int32 flags,
FT_Fixed *padvances )
{
FT_Face_GetAdvancesFunc func;
FT_UInt num, end, nn;
FT_Error error = FT_Err_Ok;
if ( !face )
return FT_Err_Invalid_Face_Handle;
num = (FT_UInt)face->num_glyphs;
end = start + count;
if ( start >= num || end < start || end > num )
return FT_Err_Invalid_Glyph_Index;
if ( count == 0 )
return FT_Err_Ok;
func = face->driver->clazz->get_advances;
if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
{
error = func( face, start, count, flags, padvances );
if ( !error )
goto Exit;
if ( error != FT_ERROR_BASE( FT_Err_Unimplemented_Feature ) )
return error;
}
error = FT_Err_Ok;
if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )
return FT_Err_Unimplemented_Feature;
flags |= FT_LOAD_ADVANCE_ONLY;
for ( nn = 0; nn < count; nn++ )
{
error = FT_Load_Glyph( face, start + nn, flags );
if ( error )
break;
padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
? face->glyph->advance.x
: face->glyph->advance.y;
}
if ( error )
return error;
Exit:
return _ft_face_scale_advances( face, padvances, count, flags );
}
/* END */
+3 -2
View File
@@ -4,7 +4,7 @@
/* */
/* Single object library component (body only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,6 +20,7 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include "ftadvanc.c"
#include "ftcalc.c"
#include "ftdbgmem.c"
#include "ftgloadr.c"
@@ -31,7 +32,7 @@
#include "fttrigon.c"
#include "ftutil.c"
#if defined( __APPLE__ ) && !defined ( DARWIN_NO_CARBON )
#if defined( FT_MACINTOSH ) && !defined ( DARWIN_NO_CARBON )
#include "ftmac.c"
#endif
+57
View File
@@ -0,0 +1,57 @@
/***************************************************************************/
/* */
/* ftbase.h */
/* */
/* The FreeType private functions used in base module (specification). */
/* */
/* Copyright 2008 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
/* */
/* 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 __FTBASE_H__
#define __FTBASE_H__
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
FT_BEGIN_HEADER
/* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */
/* font, and try to load a face specified by the face_index. */
FT_LOCAL_DEF( FT_Error )
open_face_PS_from_sfnt_stream( FT_Library library,
FT_Stream stream,
FT_Long face_index,
FT_Int num_params,
FT_Parameter *params,
FT_Face *aface );
/* Create a new FT_Face given a buffer and a driver name. */
/* From ftmac.c. */
FT_LOCAL_DEF( FT_Error )
open_face_from_buffer( FT_Library library,
FT_Byte* base,
FT_ULong size,
FT_Long face_index,
const char* driver_name,
FT_Face *aface );
FT_END_HEADER
#endif /* __FTBASE_H__ */
/* END */
+32 -3
View File
@@ -2,10 +2,9 @@
/* */
/* ftbitmap.c */
/* */
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
/* bitmaps into 8bpp format (body). */
/* FreeType utility functions for bitmaps (body). */
/* */
/* Copyright 2004, 2005, 2006, 2007 by */
/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -19,6 +18,7 @@
#include <ft2build.h>
#include FT_BITMAP_H
#include FT_IMAGE_H
#include FT_INTERNAL_OBJECTS_H
@@ -388,6 +388,8 @@
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_GRAY2:
case FT_PIXEL_MODE_GRAY4:
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
{
FT_Int pad;
FT_Long old_size;
@@ -482,6 +484,8 @@
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
{
FT_Int width = source->width;
FT_Byte* s = source->buffer;
@@ -603,6 +607,31 @@
}
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot )
{
if ( slot && slot->format == FT_GLYPH_FORMAT_BITMAP &&
!( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
{
FT_Bitmap bitmap;
FT_Error error;
FT_Bitmap_New( &bitmap );
error = FT_Bitmap_Copy( slot->library, &slot->bitmap, &bitmap );
if ( error )
return error;
slot->bitmap = bitmap;
slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
}
return FT_Err_Ok;
}
/* documentation is in ftbitmap.h */
FT_EXPORT_DEF( FT_Error )
+51 -25
View File
@@ -38,6 +38,9 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
#ifdef FT_MULFIX_INLINED
#undef FT_MulFix
#endif
/* we need to define a 64-bits data type here */
@@ -193,15 +196,33 @@
FT_MulFix( FT_Long a,
FT_Long b )
{
#ifdef FT_MULFIX_ASSEMBLER
return FT_MULFIX_ASSEMBLER( a, b );
#else
FT_Int s = 1;
FT_Long c;
if ( a < 0 ) { a = -a; s = -1; }
if ( b < 0 ) { b = -b; s = -s; }
if ( a < 0 )
{
a = -a;
s = -1;
}
if ( b < 0 )
{
b = -b;
s = -s;
}
c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
return ( s > 0 ) ? c : -c ;
return ( s > 0 ) ? c : -c;
#endif /* FT_MULFIX_ASSEMBLER */
}
@@ -413,31 +434,18 @@
FT_MulFix( FT_Long a,
FT_Long b )
{
/* use inline assembly to speed up things a bit */
#ifdef FT_MULFIX_ASSEMBLER
#if defined( __GNUC__ ) && defined( i386 )
return FT_MULFIX_ASSEMBLER( a, b );
FT_Long result;
#elif 0
__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"
"mov %%eax, %0\n"
: "=a"(result), "+d"(b)
: "a"(a)
: "%ecx"
);
return result;
#elif 1
/*
* This code is nonportable. See comment below.
*
* However, on a platform where right-shift of a signed quantity fills
* the leftmost bits by copying the sign bit, it might be faster.
*/
FT_Long sa, sb;
FT_ULong ua, ub;
@@ -446,6 +454,24 @@
if ( a == 0 || b == 0x10000L )
return a;
/*
* This is a clever way of converting a signed number `a' into its
* absolute value (stored back into `a') and its sign. The sign is
* stored in `sa'; 0 means `a' was positive or zero, and -1 means `a'
* was negative. (Similarly for `b' and `sb').
*
* Unfortunately, it doesn't work (at least not portably).
*
* It makes the assumption that right-shift on a negative signed value
* fills the leftmost bits by copying the sign bit. This is wrong.
* According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,
* the result of right-shift of a negative signed value is
* implementation-defined. At least one implementation fills the
* leftmost bits with 0s (i.e., it is exactly the same as an unsigned
* right shift). This means that when `a' is negative, `sa' ends up
* with the value 1 rather than -1. After that, everything else goes
* wrong.
*/
sa = ( a >> ( sizeof ( a ) * 8 - 1 ) );
a = ( a ^ sa ) - sa;
sb = ( b >> ( sizeof ( b ) * 8 - 1 ) );
+3 -4
View File
@@ -4,7 +4,7 @@
/* */
/* Memory debugger (body). */
/* */
/* Copyright 2001, 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -33,8 +33,7 @@
* memory, however.
*/
#include <stdio.h>
#include <stdlib.h>
#include FT_CONFIG_STANDARD_LIBRARY_H
FT_BASE_DEF( const char* ) _ft_debug_file = 0;
FT_BASE_DEF( long ) _ft_debug_lineno = 0;
@@ -990,7 +989,7 @@
#else /* !FT_DEBUG_MEMORY */
/* ANSI C doesn't like empty source files */
const FT_Byte _debug_mem_dummy = 0;
static const FT_Byte _debug_mem_dummy = 0;
#endif /* !FT_DEBUG_MEMORY */
+1 -1
View File
@@ -46,7 +46,7 @@
#include FT_INTERNAL_DEBUG_H
#if defined( FT_DEBUG_LEVEL_ERROR )
#ifdef FT_DEBUG_LEVEL_ERROR
/* documentation is in ftdebug.h */
+3 -3
View File
@@ -55,9 +55,9 @@
#undef FT_USE_MODULE
#ifdef __cplusplus
#define FT_USE_MODULE( x ) extern "C" const FT_Module_Class x;
#define FT_USE_MODULE( type, x ) extern "C" const type x;
#else
#define FT_USE_MODULE( x ) extern const FT_Module_Class x;
#define FT_USE_MODULE( type, x ) extern const type x;
#endif
@@ -65,7 +65,7 @@
#undef FT_USE_MODULE
#define FT_USE_MODULE( x ) (const FT_Module_Class*)&(x),
#define FT_USE_MODULE( type, x ) (const FT_Module_Class*)&(x),
static
const FT_Module_Class* const ft_default_modules[] =
+6 -6
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
/* */
/* Copyright 2006, 2008 by */
/* Copyright 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -266,7 +266,7 @@
#endif /* USE_LEGACY */
FT_EXPORT( FT_Error )
FT_EXPORT_DEF( FT_Error )
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter )
{
@@ -296,13 +296,13 @@
#elif defined( FT_FORCE_LIGHT_LCD_FILTER )
memcpy( library->lcd_weights, light_filter, 5 );
ft_memcpy( library->lcd_weights, light_filter, 5 );
library->lcd_filter_func = _ft_lcd_filter_fir;
library->lcd_extra = 2;
#else
memcpy( library->lcd_weights, default_filter, 5 );
ft_memcpy( library->lcd_weights, default_filter, 5 );
library->lcd_filter_func = _ft_lcd_filter_fir;
library->lcd_extra = 2;
@@ -311,7 +311,7 @@
break;
case FT_LCD_FILTER_LIGHT:
memcpy( library->lcd_weights, light_filter, 5 );
ft_memcpy( library->lcd_weights, light_filter, 5 );
library->lcd_filter_func = _ft_lcd_filter_fir;
library->lcd_extra = 2;
break;
@@ -335,7 +335,7 @@
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
FT_EXPORT( FT_Error )
FT_EXPORT_DEF( FT_Error )
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter )
{
+62 -135
View File
@@ -8,7 +8,8 @@
/* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */
/* classic platforms built by MPW. */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, */
/* 2009 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -67,7 +68,9 @@
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_TRUETYPE_TAGS_H
#include FT_INTERNAL_STREAM_H
#include "ftbase.h"
/* This is for Mac OS X. Without redefinition, OS_INLINE */
/* expands to `static inline' which doesn't survive the */
@@ -77,26 +80,32 @@
#define OS_INLINE static __inline__
#endif
/* The ResourceIndex type was available SDKs on 10.5 */
/* `configure' checks the availability of `ResourceIndex' strictly */
/* and sets HAVE_TYPE_RESOURCE_INDEX 1 or 0 always. If it is */
/* not set (e.g., a build without `configure'), the availability */
/* is guessed from the SDK version. */
#ifndef HAVE_TYPE_RESOURCE_INDEX
typedef short ResourceIndex;
#if !defined( MAC_OS_X_VERSION_10_5 ) || \
( MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 )
#define HAVE_TYPE_RESOURCE_INDEX 0
#else
#define HAVE_TYPE_RESOURCE_INDEX 1
#endif
#endif /* !HAVE_TYPE_RESOURCE_INDEX */
#if ( HAVE_TYPE_RESOURCE_INDEX == 0 )
typedef short ResourceIndex;
#endif
#include <CoreServices/CoreServices.h>
#include <ApplicationServices/ApplicationServices.h>
#include <sys/syslimits.h> /* PATH_MAX */
/* Don't want warnings about our own use of deprecated functions. */
#define FT_DEPRECATED_ATTRIBUTE
#include FT_MAC_H
/* undefine blocking-macros in ftmac.h */
#undef FT_GetFile_From_Mac_Name( a, b, c )
#undef FT_GetFile_From_Mac_ATS_Name( a, b, c )
#undef FT_New_Face_From_FOND( a, b, c, d )
#undef FT_New_Face_From_FSSpec( a, b, c, d )
#undef FT_New_Face_From_FSRef( a, b, c, d )
#ifndef kATSOptionFlagsUnRestrictedScope /* since Mac OS X 10.1 */
#define kATSOptionFlagsUnRestrictedScope kATSOptionFlagsDefault
#endif
@@ -589,8 +598,7 @@ typedef short ResourceIndex;
for (;;)
{
post_data = Get1Resource( FT_MAKE_TAG( 'P', 'O', 'S', 'T' ),
res_id++ );
post_data = Get1Resource( TTAG_POST, res_id++ );
if ( post_data == NULL )
break; /* we are done */
@@ -629,8 +637,7 @@ typedef short ResourceIndex;
for (;;)
{
post_data = Get1Resource( FT_MAKE_TAG( 'P', 'O', 'S', 'T' ),
res_id++ );
post_data = Get1Resource( TTAG_POST, res_id++ );
if ( post_data == NULL )
break; /* we are done */
@@ -682,110 +689,7 @@ typedef short ResourceIndex;
}
/* Finalizer for a memory stream; gets called by FT_Done_Face().
It frees the memory it uses. */
static void
memory_stream_close( FT_Stream stream )
{
FT_Memory memory = stream->memory;
FT_FREE( stream->base );
stream->size = 0;
stream->base = 0;
stream->close = 0;
}
/* Create a new memory stream from a buffer and a size. */
static FT_Error
new_memory_stream( FT_Library library,
FT_Byte* base,
FT_ULong size,
FT_Stream_CloseFunc close,
FT_Stream* astream )
{
FT_Error error;
FT_Memory memory;
FT_Stream stream;
if ( !library )
return FT_Err_Invalid_Library_Handle;
if ( !base )
return FT_Err_Invalid_Argument;
*astream = 0;
memory = library->memory;
if ( FT_NEW( stream ) )
goto Exit;
FT_Stream_OpenMemory( stream, base, size );
stream->close = close;
*astream = stream;
Exit:
return error;
}
/* Create a new FT_Face given a buffer and a driver name. */
static FT_Error
open_face_from_buffer( FT_Library library,
FT_Byte* base,
FT_ULong size,
FT_Long face_index,
const char* driver_name,
FT_Face* aface )
{
FT_Open_Args args;
FT_Error error;
FT_Stream stream;
FT_Memory memory = library->memory;
error = new_memory_stream( library,
base,
size,
memory_stream_close,
&stream );
if ( error )
{
FT_FREE( base );
return error;
}
args.flags = FT_OPEN_STREAM;
args.stream = stream;
if ( driver_name )
{
args.flags = args.flags | FT_OPEN_DRIVER;
args.driver = FT_Get_Module( library, driver_name );
}
/* At this point, face_index has served its purpose; */
/* whoever calls this function has already used it to */
/* locate the correct font data. We should not propagate */
/* this index to FT_Open_Face() (unless it is negative). */
if ( face_index > 0 )
face_index = 0;
error = FT_Open_Face( library, &args, face_index, aface );
if ( error == FT_Err_Ok )
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
else
FT_Stream_Free( stream, 0 );
return error;
}
/* Create a new FT_Face from a file spec to an LWFN file. */
/* Create a new FT_Face from a file path to an LWFN file. */
static FT_Error
FT_New_Face_From_LWFN( FT_Library library,
const UInt8* pathname,
@@ -829,10 +733,10 @@ typedef short ResourceIndex;
size_t sfnt_size;
FT_Error error = FT_Err_Ok;
FT_Memory memory = library->memory;
int is_cff;
int is_cff, is_sfnt_ps;
sfnt = GetResource( FT_MAKE_TAG( 's', 'f', 'n', 't' ), sfnt_id );
sfnt = GetResource( TTAG_sfnt, sfnt_id );
if ( sfnt == NULL )
return FT_Err_Invalid_Handle;
@@ -846,21 +750,45 @@ typedef short ResourceIndex;
ft_memcpy( sfnt_data, *sfnt, sfnt_size );
ReleaseResource( sfnt );
is_cff = sfnt_size > 4 && sfnt_data[0] == 'O' &&
sfnt_data[1] == 'T' &&
sfnt_data[2] == 'T' &&
sfnt_data[3] == 'O';
is_cff = sfnt_size > 4 && !ft_memcmp( sfnt_data, "OTTO", 4 );
is_sfnt_ps = sfnt_size > 4 && !ft_memcmp( sfnt_data, "typ1", 4 );
return open_face_from_buffer( library,
sfnt_data,
sfnt_size,
face_index,
is_cff ? "cff" : "truetype",
aface );
if ( is_sfnt_ps )
{
FT_Stream stream;
if ( FT_NEW( stream ) )
goto Try_OpenType;
FT_Stream_OpenMemory( stream, sfnt_data, sfnt_size );
if ( !open_face_PS_from_sfnt_stream( library,
stream,
face_index,
0, NULL,
aface ) )
{
FT_Stream_Close( stream );
FT_FREE( stream );
FT_FREE( sfnt_data );
goto Exit;
}
FT_FREE( stream );
}
Try_OpenType:
error = open_face_from_buffer( library,
sfnt_data,
sfnt_size,
face_index,
is_cff ? "cff" : "truetype",
aface );
Exit:
return error;
}
/* Create a new FT_Face from a file spec to a suitcase file. */
/* Create a new FT_Face from a file path to a suitcase file. */
static FT_Error
FT_New_Face_From_Suitcase( FT_Library library,
const UInt8* pathname,
@@ -884,8 +812,7 @@ typedef short ResourceIndex;
num_faces_in_res = 0;
for ( res_index = 1; ; ++res_index )
{
fond = Get1IndResource( FT_MAKE_TAG( 'F', 'O', 'N', 'D' ),
res_index );
fond = Get1IndResource( TTAG_FOND, res_index );
if ( ResError() )
break;
@@ -924,7 +851,7 @@ typedef short ResourceIndex;
GetResInfo( fond, &fond_id, &fond_type, fond_name );
if ( ResError() != noErr || fond_type != FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) )
if ( ResError() != noErr || fond_type != TTAG_FOND )
return FT_Err_Invalid_File_Format;
parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index );
@@ -991,7 +918,7 @@ typedef short ResourceIndex;
/* LWFN is a (very) specific file format, check for it explicitly */
file_type = get_file_type_from_path( pathname );
if ( file_type == FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) )
if ( file_type == TTAG_LWFN )
return FT_New_Face_From_LWFN( library, pathname, face_index, aface );
/* Otherwise the file type doesn't matter (there are more than */
+245 -39
View File
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,6 +26,7 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H /* for SFNT_Load_Table_Func */
#include FT_TRUETYPE_TABLES_H
#include FT_TRUETYPE_TAGS_H
#include FT_TRUETYPE_IDS_H
#include FT_OUTLINE_H
@@ -36,8 +37,11 @@
#include FT_SERVICE_KERNING_H
#include FT_SERVICE_TRUETYPE_ENGINE_H
#include "ftbase.h"
#define GRID_FIT_METRICS
FT_BASE_DEF( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
const char* service_id )
@@ -128,13 +132,14 @@
FT_Stream stream;
*astream = 0;
if ( !library )
return FT_Err_Invalid_Library_Handle;
if ( !args )
return FT_Err_Invalid_Argument;
*astream = 0;
memory = library->memory;
if ( FT_NEW( stream ) )
@@ -196,6 +201,12 @@
}
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_objs
@@ -244,7 +255,7 @@
FT_BASE_DEF( void )
ft_glyphslot_free_bitmap( FT_GlyphSlot slot )
{
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
if ( slot->internal && ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
{
FT_Memory memory = FT_FACE_MEMORY( slot->face );
@@ -542,7 +553,7 @@
FT_Driver driver;
FT_GlyphSlot slot;
FT_Library library;
FT_Bool autohint = 0;
FT_Bool autohint = FALSE;
FT_Module hinter;
@@ -586,22 +597,22 @@
*
* - Otherwise, auto-hint for LIGHT hinting mode.
*
* - Exception: The font requires the unpatented
* bytecode interpreter to load properly.
* - Exception: The font is `tricky' and requires
* the native hinter to load properly.
*/
autohint = 0;
if ( hinter &&
( load_flags & FT_LOAD_NO_HINTING ) == 0 &&
( load_flags & FT_LOAD_NO_AUTOHINT ) == 0 &&
FT_DRIVER_IS_SCALABLE( driver ) &&
FT_DRIVER_USES_OUTLINES( driver ) &&
face->internal->transform_matrix.yy > 0 &&
face->internal->transform_matrix.yx == 0 )
if ( hinter &&
!( load_flags & FT_LOAD_NO_HINTING ) &&
!( load_flags & FT_LOAD_NO_AUTOHINT ) &&
FT_DRIVER_IS_SCALABLE( driver ) &&
FT_DRIVER_USES_OUTLINES( driver ) &&
!FT_IS_TRICKY( face ) &&
face->internal->transform_matrix.yy > 0 &&
face->internal->transform_matrix.yx == 0 )
{
if ( ( load_flags & FT_LOAD_FORCE_AUTOHINT ) != 0 ||
!FT_DRIVER_HAS_HINTER( driver ) )
autohint = 1;
if ( ( load_flags & FT_LOAD_FORCE_AUTOHINT ) ||
!FT_DRIVER_HAS_HINTER( driver ) )
autohint = TRUE;
else
{
FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
@@ -609,7 +620,7 @@
if ( mode == FT_RENDER_MODE_LIGHT ||
face->internal->ignore_unpatented_hinter )
autohint = 1;
autohint = TRUE;
}
}
@@ -692,7 +703,7 @@
/* compute the linear advance in 16.16 pixels */
if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 &&
( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
( FT_IS_SCALABLE( face ) ) )
{
FT_Size_Metrics* metrics = &face->size->metrics;
@@ -1110,7 +1121,7 @@
/* there's a Mac-specific extended implementation of FT_New_Face() */
/* in src/base/ftmac.c */
#ifndef FT_MACINTOSH
#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
/* documentation is in freetype.h */
@@ -1133,7 +1144,7 @@
return FT_Open_Face( library, &args, face_index, aface );
}
#endif /* !FT_MACINTOSH */
#endif /* defined( FT_MACINTOSH ) && !defined( DARWIN_NO_CARBON ) */
/* documentation is in freetype.h */
@@ -1160,7 +1171,7 @@
}
#if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS )
#ifdef FT_CONFIG_OPTION_MAC_FONTS
/* The behavior here is very similar to that in base/ftmac.c, but it */
/* is designed to work on non-mac systems, so no mac specific calls. */
@@ -1189,9 +1200,9 @@
/* we don't really have access to it. */
/* Finalizer for a memory stream; gets called by FT_Done_Face().
It frees the memory it uses. */
/* from ftmac.c */
/* Finalizer for a memory stream; gets called by FT_Done_Face(). */
/* It frees the memory it uses. */
/* From ftmac.c. */
static void
memory_stream_close( FT_Stream stream )
{
@@ -1207,7 +1218,7 @@
/* Create a new memory stream from a buffer and a size. */
/* from ftmac.c */
/* From ftmac.c. */
static FT_Error
new_memory_stream( FT_Library library,
FT_Byte* base,
@@ -1244,7 +1255,7 @@
/* Create a new FT_Face given a buffer and a driver name. */
/* from ftmac.c */
static FT_Error
FT_LOCAL_DEF( FT_Error )
open_face_from_buffer( FT_Library library,
FT_Byte* base,
FT_ULong size,
@@ -1277,20 +1288,161 @@
args.driver = FT_Get_Module( library, driver_name );
}
#ifdef FT_MACINTOSH
/* At this point, face_index has served its purpose; */
/* whoever calls this function has already used it to */
/* locate the correct font data. We should not propagate */
/* this index to FT_Open_Face() (unless it is negative). */
if ( face_index > 0 )
face_index = 0;
#endif
error = FT_Open_Face( library, &args, face_index, aface );
if ( error == FT_Err_Ok )
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
else
#ifdef FT_MACINTOSH
FT_Stream_Free( stream, 0 );
#else
{
FT_Stream_Close( stream );
FT_FREE( stream );
}
#endif
return error;
}
/* Look up `TYP1' or `CID ' table from sfnt table directory. */
/* `offset' and `length' must exclude the binary header in tables. */
/* Type 1 and CID-keyed font drivers should recognize sfnt-wrapped */
/* format too. Here, since we can't expect that the TrueType font */
/* driver is loaded unconditially, we must parse the font by */
/* ourselves. We are only interested in the name of the table and */
/* the offset. */
static FT_Error
ft_lookup_PS_in_sfnt_stream( FT_Stream stream,
FT_Long face_index,
FT_ULong* offset,
FT_ULong* length,
FT_Bool* is_sfnt_cid )
{
FT_Error error;
FT_UShort numTables;
FT_Long pstable_index;
FT_ULong tag;
int i;
*offset = 0;
*length = 0;
*is_sfnt_cid = FALSE;
/* TODO: support for sfnt-wrapped PS/CID in TTC format */
/* version check for 'typ1' (should be ignored?) */
if ( FT_READ_ULONG( tag ) )
return error;
if ( tag != TTAG_typ1 )
return FT_Err_Unknown_File_Format;
if ( FT_READ_USHORT( numTables ) )
return error;
if ( FT_STREAM_SKIP( 2 * 3 ) ) /* skip binary search header */
return error;
pstable_index = -1;
*is_sfnt_cid = FALSE;
for ( i = 0; i < numTables; i++ )
{
if ( FT_READ_ULONG( tag ) || FT_STREAM_SKIP( 4 ) ||
FT_READ_ULONG( *offset ) || FT_READ_ULONG( *length ) )
return error;
if ( tag == TTAG_CID )
{
pstable_index++;
*offset += 22;
*length -= 22;
*is_sfnt_cid = TRUE;
if ( face_index < 0 )
return FT_Err_Ok;
}
else if ( tag == TTAG_TYP1 )
{
pstable_index++;
*offset += 24;
*length -= 24;
*is_sfnt_cid = FALSE;
if ( face_index < 0 )
return FT_Err_Ok;
}
if ( face_index >= 0 && pstable_index == face_index )
return FT_Err_Ok;
}
return FT_Err_Table_Missing;
}
FT_LOCAL_DEF( FT_Error )
open_face_PS_from_sfnt_stream( FT_Library library,
FT_Stream stream,
FT_Long face_index,
FT_Int num_params,
FT_Parameter *params,
FT_Face *aface )
{
FT_Error error;
FT_Memory memory = library->memory;
FT_ULong offset, length;
FT_Long pos;
FT_Bool is_sfnt_cid;
FT_Byte* sfnt_ps;
FT_UNUSED( num_params );
FT_UNUSED( params );
pos = FT_Stream_Pos( stream );
error = ft_lookup_PS_in_sfnt_stream( stream,
face_index,
&offset,
&length,
&is_sfnt_cid );
if ( error )
return error;
if ( FT_Stream_Seek( stream, pos + offset ) )
goto Exit;
if ( FT_ALLOC( sfnt_ps, (FT_Long)length ) )
goto Exit;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_ps, length );
if ( error )
goto Exit;
error = open_face_from_buffer( library,
sfnt_ps,
length,
face_index < 0 ? face_index : 0,
is_sfnt_cid ? "cid" : "type1",
aface );
Exit:
FT_Stream_Seek( stream, pos );
return error;
}
#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
/* The resource header says we've got resource_cnt `POST' (type1) */
/* resources in this file. They all need to be coalesced into */
/* one lump which gets passed on to the type1 driver. */
@@ -1445,17 +1597,21 @@
if ( rlen == -1 )
return FT_Err_Cannot_Open_Resource;
error = open_face_PS_from_sfnt_stream( library,
stream,
face_index,
0, NULL,
aface );
if ( !error )
goto Exit;
if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) )
return error;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen );
if ( error )
goto Exit;
is_cff = rlen > 4 && sfnt_data[0] == 'O' &&
sfnt_data[1] == 'T' &&
sfnt_data[2] == 'T' &&
sfnt_data[3] == 'O';
is_cff = rlen > 4 && !ft_memcmp( sfnt_data, "OTTO", 4 );
error = open_face_from_buffer( library,
sfnt_data,
rlen,
@@ -1494,7 +1650,7 @@
error = FT_Raccess_Get_DataOffsets( library, stream,
map_offset, rdara_pos,
FT_MAKE_TAG( 'P', 'O', 'S', 'T' ),
TTAG_POST,
&data_offsets, &count );
if ( !error )
{
@@ -1509,7 +1665,7 @@
error = FT_Raccess_Get_DataOffsets( library, stream,
map_offset, rdara_pos,
FT_MAKE_TAG( 's', 'f', 'n', 't' ),
TTAG_sfnt,
&data_offsets, &count );
if ( !error )
{
@@ -1600,7 +1756,7 @@
FT_Error errors[FT_RACCESS_N_RULES];
FT_Open_Args args2;
FT_Stream stream2;
FT_Stream stream2 = 0;
FT_Raccess_Guess( library, stream,
@@ -1655,7 +1811,7 @@
}
/* Check for some macintosh formats. */
/* Check for some macintosh formats without Carbon framework. */
/* Is this a macbinary file? If so look at the resource fork. */
/* Is this a mac dfont file? */
/* Is this an old style resource fork? (in data) */
@@ -1698,6 +1854,7 @@
face_index, aface, args );
return error;
}
#endif
#endif /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */
@@ -1713,7 +1870,7 @@
FT_Error error;
FT_Driver driver;
FT_Memory memory;
FT_Stream stream;
FT_Stream stream = 0;
FT_Face face = 0;
FT_ListNode node = 0;
FT_Bool external_stream;
@@ -1796,6 +1953,28 @@
if ( !error )
goto Success;
#ifdef FT_CONFIG_OPTION_MAC_FONTS
if ( ft_strcmp( cur[0]->clazz->module_name, "truetype" ) == 0 &&
FT_ERROR_BASE( error ) == FT_Err_Table_Missing )
{
/* TrueType but essential tables are missing */
if ( FT_Stream_Seek( stream, 0 ) )
break;
error = open_face_PS_from_sfnt_stream( library,
stream,
face_index,
num_params,
params,
aface );
if ( !error )
{
FT_Stream_Free( stream, external_stream );
return error;
}
}
#endif
if ( FT_ERROR_BASE( error ) != FT_Err_Unknown_File_Format )
goto Fail3;
}
@@ -3265,11 +3444,11 @@
if ( size == NULL )
return FT_Err_Bad_Argument;
return FT_Err_Invalid_Argument;
face = size->face;
if ( face == NULL || face->driver == NULL )
return FT_Err_Bad_Argument;
return FT_Err_Invalid_Argument;
/* we don't need anything more complex than that; all size objects */
/* are already listed by the face */
@@ -4017,7 +4196,11 @@
faces = &FT_DRIVER(module)->faces_list;
while ( faces->head )
{
FT_Done_Face( FT_FACE( faces->head->data ) );
if ( faces->head )
FT_ERROR(( "FT_Done_Library: failed to free some faces\n" ));
}
}
}
@@ -4195,4 +4378,27 @@
}
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_UShort )
FT_Get_FSType_Flags( FT_Face face )
{
PS_FontInfoRec font_info;
TT_OS2* os2;
/* look at FSType before fsType for Type42 */
if ( !FT_Get_PS_Font_Info( face, &font_info ) &&
font_info.fs_type != 0 )
return font_info.fs_type;
if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, ft_sfnt_os2 ) ) != NULL &&
os2->version != 0xFFFFU )
return os2->fsType;
return 0;
}
/* END */
+2 -1
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (body). */
/* */
/* Copyright 2004, 2006 by */
/* Copyright 2004, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,6 +18,7 @@
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_SERVICE_OPENTYPE_VALIDATE_H
#include FT_OPENTYPE_VALIDATE_H
/* documentation is in ftotval.h */
+50 -12
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType outline management (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,6 +26,7 @@
#include <ft2build.h>
#include FT_OUTLINE_H
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_TRIGONOMETRY_H
@@ -83,21 +84,25 @@
FT_Int last; /* index of last point in contour */
FT_TRACE5(( "FT_Outline_Decompose: Outline %d\n", n ));
last = outline->contours[n];
if ( last < 0 )
goto Invalid_Outline;
limit = outline->points + last;
v_start = outline->points[first];
v_last = outline->points[last];
v_start = outline->points[first];
v_start.x = SCALED( v_start.x );
v_start.y = SCALED( v_start.y );
v_start.x = SCALED( v_start.x ); v_start.y = SCALED( v_start.y );
v_last.x = SCALED( v_last.x ); v_last.y = SCALED( v_last.y );
v_last = outline->points[last];
v_last.x = SCALED( v_last.x );
v_last.y = SCALED( v_last.y );
v_control = v_start;
point = outline->points + first;
tags = outline->tags + first;
tags = outline->tags + first;
tag = FT_CURVE_TAG( tags[0] );
/* A contour cannot start with a cubic control point! */
@@ -128,6 +133,8 @@
tags--;
}
FT_TRACE5(( " move to (%.2f, %.2f)\n",
v_start.x / 64.0, v_start.y / 64.0 ));
error = func_interface->move_to( &v_start, user );
if ( error )
goto Exit;
@@ -148,6 +155,8 @@
vec.x = SCALED( point->x );
vec.y = SCALED( point->y );
FT_TRACE5(( " line to (%.2f, %.2f)\n",
vec.x / 64.0, vec.y / 64.0 ));
error = func_interface->line_to( &vec, user );
if ( error )
goto Exit;
@@ -174,6 +183,10 @@
if ( tag == FT_CURVE_TAG_ON )
{
FT_TRACE5(( " conic to (%.2f, %.2f)"
" with control (%.2f, %.2f)\n",
vec.x / 64.0, vec.y / 64.0,
v_control.x / 64.0, v_control.y / 64.0 ));
error = func_interface->conic_to( &v_control, &vec, user );
if ( error )
goto Exit;
@@ -186,6 +199,10 @@
v_middle.x = ( v_control.x + vec.x ) / 2;
v_middle.y = ( v_control.y + vec.y ) / 2;
FT_TRACE5(( " conic to (%.2f, %.2f)"
" with control (%.2f, %.2f)\n",
v_middle.x / 64.0, v_middle.y / 64.0,
v_control.x / 64.0, v_control.y / 64.0 ));
error = func_interface->conic_to( &v_control, &v_middle, user );
if ( error )
goto Exit;
@@ -194,6 +211,10 @@
goto Do_Conic;
}
FT_TRACE5(( " conic to (%.2f, %.2f)"
" with control (%.2f, %.2f)\n",
v_start.x / 64.0, v_start.y / 64.0,
v_control.x / 64.0, v_control.y / 64.0 ));
error = func_interface->conic_to( &v_control, &v_start, user );
goto Close;
@@ -209,8 +230,11 @@
point += 2;
tags += 2;
vec1.x = SCALED( point[-2].x ); vec1.y = SCALED( point[-2].y );
vec2.x = SCALED( point[-1].x ); vec2.y = SCALED( point[-1].y );
vec1.x = SCALED( point[-2].x );
vec1.y = SCALED( point[-2].y );
vec2.x = SCALED( point[-1].x );
vec2.y = SCALED( point[-1].y );
if ( point <= limit )
{
@@ -220,12 +244,22 @@
vec.x = SCALED( point->x );
vec.y = SCALED( point->y );
FT_TRACE5(( " cubic to (%.2f, %.2f)"
" with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
vec.x / 64.0, vec.y / 64.0,
vec1.x / 64.0, vec1.y / 64.0,
vec2.x / 64.0, vec2.y / 64.0 ));
error = func_interface->cubic_to( &vec1, &vec2, &vec, user );
if ( error )
goto Exit;
continue;
}
FT_TRACE5(( " cubic to (%.2f, %.2f)"
" with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
v_start.x / 64.0, v_start.y / 64.0,
vec1.x / 64.0, vec1.y / 64.0,
vec2.x / 64.0, vec2.y / 64.0 ));
error = func_interface->cubic_to( &vec1, &vec2, &v_start, user );
goto Close;
}
@@ -233,6 +267,8 @@
}
/* close the contour with a line segment */
FT_TRACE5(( " line to (%.2f, %.2f)\n",
v_start.x / 64.0, v_start.y / 64.0 ));
error = func_interface->line_to( &v_start, user );
Close:
@@ -242,9 +278,11 @@
first = last + 1;
}
return 0;
FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
return FT_Err_Ok;
Exit:
FT_TRACE5(( "FT_Outline_Decompose: Error %d\n", error ));
return error;
Invalid_Outline:
@@ -558,7 +596,7 @@
FT_Raster_Params* params )
{
FT_Error error;
FT_Bool update = 0;
FT_Bool update = FALSE;
FT_Renderer renderer;
FT_ListNode node;
@@ -589,7 +627,7 @@
/* format */
renderer = FT_Lookup_Renderer( library, FT_GLYPH_FORMAT_OUTLINE,
&node );
update = 1;
update = TRUE;
}
/* if we changed the current renderer for the glyph image format */
@@ -1007,7 +1045,7 @@
}
}
if ( xmin == 32768 )
if ( xmin == 32768L )
return FT_ORIENTATION_TRUETYPE;
ray_y[0] = ( xmin_ymin * 3 + xmin_ymax ) >> 2;
+2 -2
View File
@@ -5,7 +5,7 @@
/* FreeType API for checking patented TrueType bytecode instructions */
/* (body). */
/* */
/* Copyright 2007 by David Turner. */
/* Copyright 2007, 2008 by David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -260,7 +260,7 @@
FT_Face_SetUnpatentedHinting( FT_Face face,
FT_Bool value )
{
FT_Bool result = 0;
FT_Bool result = FALSE;
#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \
+22 -11
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (body). */
/* */
/* Copyright 2002, 2003, 2004 by */
/* Copyright 2002, 2003, 2004, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -46,6 +46,9 @@
FT_Service_PfrMetrics service;
if ( !face )
return FT_Err_Invalid_Argument;
service = ft_pfr_check( face );
if ( service )
{
@@ -55,14 +58,17 @@
ametrics_x_scale,
ametrics_y_scale );
}
else if ( face )
else
{
FT_Fixed x_scale, y_scale;
/* this is not a PFR font */
*aoutline_resolution = face->units_per_EM;
*ametrics_resolution = face->units_per_EM;
if ( aoutline_resolution )
*aoutline_resolution = face->units_per_EM;
if ( ametrics_resolution )
*ametrics_resolution = face->units_per_EM;
x_scale = y_scale = 0x10000L;
if ( face->size )
@@ -70,11 +76,15 @@
x_scale = face->size->metrics.x_scale;
y_scale = face->size->metrics.y_scale;
}
*ametrics_x_scale = x_scale;
*ametrics_y_scale = y_scale;
if ( ametrics_x_scale )
*ametrics_x_scale = x_scale;
if ( ametrics_y_scale )
*ametrics_y_scale = y_scale;
error = FT_Err_Unknown_File_Format;
}
else
error = FT_Err_Invalid_Argument;
return error;
}
@@ -92,14 +102,15 @@
FT_Service_PfrMetrics service;
if ( !face )
return FT_Err_Invalid_Argument;
service = ft_pfr_check( face );
if ( service )
error = service->get_kerning( face, left, right, avector );
else if ( face )
else
error = FT_Get_Kerning( face, left, right,
FT_KERNING_UNSCALED, avector );
else
error = FT_Err_Invalid_Argument;
return error;
}
+9 -3
View File
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (body). */
/* */
/* Copyright 2004, 2005, 2006, 2007 by */
/* Copyright 2004, 2005, 2006, 2007, 2008 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
@@ -399,7 +399,10 @@
char **result_file_name,
FT_Long *result_offset )
{
FT_Int32 magic = ( 0x00 << 24 | 0x05 << 16 | 0x16 << 8 | 0x07 );
FT_Int32 magic = ( 0x00 << 24 ) |
( 0x05 << 16 ) |
( 0x16 << 8 ) |
0x07;
*result_file_name = NULL;
@@ -418,7 +421,10 @@
char **result_file_name,
FT_Long *result_offset )
{
FT_Int32 magic = (0x00 << 24 | 0x05 << 16 | 0x16 << 8 | 0x00);
FT_Int32 magic = ( 0x00 << 24 ) |
( 0x05 << 16 ) |
( 0x16 << 8 ) |
0x00;
*result_file_name = NULL;
+3 -2
View File
@@ -707,12 +707,13 @@
{
FT_Error error;
FT_Bool frame_accessed = 0;
FT_Byte* cursor = stream->cursor;
FT_Byte* cursor;
if ( !fields || !stream )
return FT_Err_Invalid_Argument;
cursor = stream->cursor;
error = FT_Err_Ok;
do
{
+67 -65
View File
@@ -261,7 +261,7 @@
{
FT_UInt old_max = border->max_points;
FT_UInt new_max = border->num_points + new_points;
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
if ( new_max > old_max )
@@ -279,6 +279,7 @@
border->max_points = cur_max;
}
Exit:
return error;
}
@@ -346,7 +347,7 @@
}
border->start = -1;
border->movable = 0;
border->movable = FALSE;
}
@@ -355,7 +356,7 @@
FT_Vector* to,
FT_Bool movable )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_ASSERT( border->start >= 0 );
@@ -410,7 +411,7 @@
border->num_points += 2;
}
border->movable = 0;
border->movable = FALSE;
return error;
}
@@ -443,7 +444,7 @@
border->num_points += 3;
}
border->movable = 0;
border->movable = FALSE;
return error;
}
@@ -461,7 +462,7 @@
FT_Angle total, angle, step, rotate, next, theta;
FT_Vector a, b, a2, b2;
FT_Fixed length;
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
/* compute start point */
@@ -527,12 +528,12 @@
{
/* close current open path if any ? */
if ( border->start >= 0 )
ft_stroke_border_close( border, 0 );
ft_stroke_border_close( border, FALSE );
border->start = border->num_points;
border->movable = 0;
border->movable = FALSE;
return ft_stroke_border_lineto( border, to, 0 );
return ft_stroke_border_lineto( border, to, FALSE );
}
@@ -547,7 +548,7 @@
border->num_points = 0;
border->max_points = 0;
border->start = -1;
border->valid = 0;
border->valid = FALSE;
}
@@ -556,7 +557,7 @@
{
border->num_points = 0;
border->start = -1;
border->valid = 0;
border->valid = FALSE;
}
@@ -572,7 +573,7 @@
border->num_points = 0;
border->max_points = 0;
border->start = -1;
border->valid = 0;
border->valid = FALSE;
}
@@ -581,7 +582,7 @@
FT_UInt *anum_points,
FT_UInt *anum_contours )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_UInt num_points = 0;
FT_UInt num_contours = 0;
@@ -616,7 +617,7 @@
if ( in_contour != 0 )
goto Fail;
border->valid = 1;
border->valid = TRUE;
Exit:
*anum_points = num_points;
@@ -798,7 +799,7 @@
{
FT_Angle total, rotate;
FT_Fixed radius = stroker->radius;
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_StrokeBorder border = stroker->borders + side;
@@ -813,7 +814,7 @@
radius,
stroker->angle_in + rotate,
total );
border->movable = 0;
border->movable = FALSE;
return error;
}
@@ -824,7 +825,7 @@
FT_Angle angle,
FT_Int side )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
if ( stroker->line_cap == FT_STROKER_LINECAP_ROUND )
@@ -849,7 +850,7 @@
delta.x += stroker->center.x + delta2.x;
delta.y += stroker->center.y + delta2.y;
error = ft_stroke_border_lineto( border, &delta, 0 );
error = ft_stroke_border_lineto( border, &delta, FALSE );
if ( error )
goto Exit;
@@ -859,7 +860,7 @@
delta.x += delta2.x + stroker->center.x;
delta.y += delta2.y + stroker->center.y;
error = ft_stroke_border_lineto( border, &delta, 0 );
error = ft_stroke_border_lineto( border, &delta, FALSE );
}
Exit:
@@ -876,7 +877,7 @@
FT_Angle phi, theta, rotate;
FT_Fixed length, thcos, sigma;
FT_Vector delta;
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
rotate = FT_SIDE_TO_ROTATE( side );
@@ -900,7 +901,7 @@
stroker->angle_out + rotate );
delta.x += stroker->center.x;
delta.y += stroker->center.y;
border->movable = 0;
border->movable = FALSE;
}
else
{
@@ -911,7 +912,7 @@
delta.y += stroker->center.y;
}
error = ft_stroke_border_lineto( border, &delta, 0 );
error = ft_stroke_border_lineto( border, &delta, FALSE );
return error;
}
@@ -928,9 +929,7 @@
if ( stroker->line_join == FT_STROKER_LINEJOIN_ROUND )
{
error = ft_stroker_arcto( stroker, side );
}
else
{
/* this is a mitered or beveled corner */
@@ -943,7 +942,7 @@
rotate = FT_SIDE_TO_ROTATE( side );
miter = FT_BOOL( stroker->line_join == FT_STROKER_LINEJOIN_MITER );
theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );
theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );
if ( theta == FT_ANGLE_PI )
{
theta = rotate;
@@ -959,7 +958,7 @@
sigma = FT_MulFix( stroker->miter_limit, thcos );
if ( sigma >= 0x10000L )
miter = 0;
miter = FALSE;
if ( miter ) /* this is a miter (broken angle) */
{
@@ -983,7 +982,7 @@
delta.x += middle.x;
delta.y += middle.y;
error = ft_stroke_border_lineto( border, &delta, 0 );
error = ft_stroke_border_lineto( border, &delta, FALSE );
if ( error )
goto Exit;
@@ -992,7 +991,7 @@
delta.x += middle.x;
delta.y += middle.y;
error = ft_stroke_border_lineto( border, &delta, 0 );
error = ft_stroke_border_lineto( border, &delta, FALSE );
if ( error )
goto Exit;
@@ -1001,7 +1000,7 @@
delta.x += stroker->center.x;
delta.y += stroker->center.y;
error = ft_stroke_border_lineto( border, &delta, 1 );
error = ft_stroke_border_lineto( border, &delta, TRUE );
}
else /* this is a bevel (intersection) */
@@ -1016,8 +1015,9 @@
delta.x += stroker->center.x;
delta.y += stroker->center.y;
error = ft_stroke_border_lineto( border, &delta, 0 );
if (error) goto Exit;
error = ft_stroke_border_lineto( border, &delta, FALSE );
if ( error )
goto Exit;
/* now add end point */
FT_Vector_From_Polar( &delta, stroker->radius,
@@ -1025,7 +1025,7 @@
delta.x += stroker->center.x;
delta.y += stroker->center.y;
error = ft_stroke_border_lineto( border, &delta, 1 );
error = ft_stroke_border_lineto( border, &delta, TRUE );
}
}
@@ -1037,7 +1037,7 @@
static FT_Error
ft_stroker_process_corner( FT_Stroker stroker )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_Angle turn;
FT_Int inside_side;
@@ -1069,7 +1069,7 @@
/* add two points to the left and right borders corresponding to the */
/* start of the subpath.. */
/* start of the subpath */
static FT_Error
ft_stroker_subpath_start( FT_Stroker stroker,
FT_Angle start_angle )
@@ -1099,7 +1099,7 @@
/* save angle for last cap */
stroker->subpath_angle = start_angle;
stroker->first_point = 0;
stroker->first_point = FALSE;
Exit:
return error;
@@ -1112,7 +1112,7 @@
FT_Stroker_LineTo( FT_Stroker stroker,
FT_Vector* to )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_StrokeBorder border;
FT_Vector delta;
FT_Angle angle;
@@ -1143,7 +1143,7 @@
goto Exit;
}
/* now add a line segment to both the "inside" and "outside" paths */
/* now add a line segment to both the `inside' and `outside' paths */
for ( border = stroker->borders, side = 1; side >= 0; side--, border++ )
{
@@ -1153,7 +1153,7 @@
point.x = to->x + delta.x;
point.y = to->y + delta.y;
error = ft_stroke_border_lineto( border, &point, 1 );
error = ft_stroke_border_lineto( border, &point, TRUE );
if ( error )
goto Exit;
@@ -1176,12 +1176,12 @@
FT_Vector* control,
FT_Vector* to )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_Vector bez_stack[34];
FT_Vector* arc;
FT_Vector* limit = bez_stack + 30;
FT_Angle start_angle;
FT_Bool first_arc = 1;
FT_Bool first_arc = TRUE;
arc = bez_stack;
@@ -1206,7 +1206,7 @@
if ( first_arc )
{
first_arc = 0;
first_arc = FALSE;
start_angle = angle_in;
@@ -1275,12 +1275,12 @@
FT_Vector* control2,
FT_Vector* to )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_Vector bez_stack[37];
FT_Vector* arc;
FT_Vector* limit = bez_stack + 32;
FT_Angle start_angle;
FT_Bool first_arc = 1;
FT_Bool first_arc = TRUE;
arc = bez_stack;
@@ -1308,7 +1308,7 @@
if ( first_arc )
{
first_arc = 0;
first_arc = FALSE;
/* process corner if necessary */
start_angle = angle_in;
@@ -1386,15 +1386,16 @@
{
/* We cannot process the first point, because there is not enough */
/* information regarding its corner/cap. The latter will be processed */
/* in the "end_subpath" routine. */
/* in the `FT_Stroker_EndSubPath' routine. */
/* */
stroker->first_point = 1;
stroker->center = *to;
stroker->subpath_open = open;
stroker->first_point = TRUE;
stroker->center = *to;
stroker->subpath_open = open;
/* record the subpath start point index for each border */
/* record the subpath start point for each border */
stroker->subpath_start = *to;
return 0;
return FT_Err_Ok;
}
@@ -1402,10 +1403,10 @@
ft_stroker_add_reverse_left( FT_Stroker stroker,
FT_Bool open )
{
FT_StrokeBorder right = stroker->borders + 0;
FT_StrokeBorder left = stroker->borders + 1;
FT_StrokeBorder right = stroker->borders + 0;
FT_StrokeBorder left = stroker->borders + 1;
FT_Int new_points;
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_ASSERT( left->start >= 0 );
@@ -1452,8 +1453,8 @@
left->num_points = left->start;
right->num_points += new_points;
right->movable = 0;
left->movable = 0;
right->movable = FALSE;
left->movable = FALSE;
}
Exit:
@@ -1467,7 +1468,8 @@
FT_EXPORT_DEF( FT_Error )
FT_Stroker_EndSubPath( FT_Stroker stroker )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
if ( stroker->subpath_open )
{
@@ -1480,8 +1482,8 @@
if ( error )
goto Exit;
/* add reversed points from "left" to "right" */
error = ft_stroker_add_reverse_left( stroker, 1 );
/* add reversed points from `left' to `right' */
error = ft_stroker_add_reverse_left( stroker, TRUE );
if ( error )
goto Exit;
@@ -1494,7 +1496,7 @@
/* Now end the right subpath accordingly. The left one is */
/* rewind and doesn't need further processing. */
ft_stroke_border_close( right, 0 );
ft_stroke_border_close( right, FALSE );
}
else
{
@@ -1536,8 +1538,8 @@
}
/* then end our two subpaths */
ft_stroke_border_close( stroker->borders + 0, 1 );
ft_stroke_border_close( stroker->borders + 1, 0 );
ft_stroke_border_close( stroker->borders + 0, TRUE );
ft_stroke_border_close( stroker->borders + 1, FALSE );
}
Exit:
@@ -1692,7 +1694,7 @@
v_control = v_start;
point = outline->points + first;
tags = outline->tags + first;
tags = outline->tags + first;
tag = FT_CURVE_TAG( tags[0] );
/* A contour cannot start with a cubic control point! */
@@ -1836,7 +1838,7 @@
first = last + 1;
}
return 0;
return FT_Err_Ok;
Exit:
return error;
@@ -1884,7 +1886,7 @@
FT_UInt num_points, num_contours;
error = FT_Stroker_ParseOutline( stroker, outline, 0 );
error = FT_Stroker_ParseOutline( stroker, outline, FALSE );
if ( error )
goto Fail;
@@ -1967,7 +1969,7 @@
border = FT_STROKER_BORDER_LEFT;
}
error = FT_Stroker_ParseOutline( stroker, outline, 0 );
error = FT_Stroker_ParseOutline( stroker, outline, FALSE );
if ( error )
goto Fail;
+4 -26
View File
@@ -68,36 +68,13 @@
/*************************************************************************/
FT_EXPORT_DEF( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot )
{
if ( slot && slot->format == FT_GLYPH_FORMAT_BITMAP &&
!( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
{
FT_Bitmap bitmap;
FT_Error error;
FT_Bitmap_New( &bitmap );
error = FT_Bitmap_Copy( slot->library, &slot->bitmap, &bitmap );
if ( error )
return error;
slot->bitmap = bitmap;
slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
}
return FT_Err_Ok;
}
/* documentation is in ftsynth.h */
FT_EXPORT_DEF( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot )
{
FT_Library library = slot->library;
FT_Face face = FT_SLOT_FACE( slot );
FT_Face face = slot->face;
FT_Error error;
FT_Pos xstr, ystr;
@@ -123,10 +100,11 @@
}
else if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
{
xstr = FT_PIX_FLOOR( xstr );
/* round to full pixels */
xstr &= ~63;
if ( xstr == 0 )
xstr = 1 << 6;
ystr = FT_PIX_FLOOR( ystr );
ystr &= ~63;
error = FT_GlyphSlot_Own_Bitmap( slot );
if ( error )
+2 -2
View File
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific FreeType low-level system interface (body). */
/* */
/* Copyright 1996-2001, 2002, 2006 by */
/* Copyright 1996-2001, 2002, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -294,7 +294,7 @@
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_done( memory );
#endif
memory->free( memory, memory );
ft_sfree( memory );
}
+11 -6
View File
@@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007 by
# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -21,8 +21,6 @@
# BASE_EXT_OBJ: A list of base layer extensions, i.e., components found
# in `freetype/src/base' which are not compiled within the
# base layer proper.
#
# BASE_H is defined in freetype.mk to simplify the dependency rules.
BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)
@@ -44,7 +42,14 @@ BASE_SRC := $(BASE_DIR)/ftcalc.c \
$(BASE_DIR)/ftrfork.c \
$(BASE_DIR)/ftstream.c \
$(BASE_DIR)/fttrigon.c \
$(BASE_DIR)/ftutil.c
$(BASE_DIR)/ftutil.c \
$(BASE_DIR)/ftadvanc.c
ifneq ($(ftmac_c),)
BASE_SRC += $(BASE_DIR)/$(ftmac_c)
endif
BASE_H := $(BASE_DIR)/ftbase.h
# Base layer `extensions' sources
#
@@ -77,13 +82,13 @@ BASE_SRC_S := $(BASE_DIR)/ftbase.c
# Base layer - single object build
#
$(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H)
$(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H) $(BASE_H)
$(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BASE_SRC_S))
# Multiple objects build + extensions
#
$(OBJ_DIR)/%.$O: $(BASE_DIR)/%.c $(FREETYPE_H)
$(OBJ_DIR)/%.$O: $(BASE_DIR)/%.c $(FREETYPE_H) $(BASE_H)
$(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+9 -4
View File
@@ -2,7 +2,7 @@
FreeType font driver for bdf files
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
Francesco Zappa Nardelli
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -304,10 +304,15 @@ THE SOFTWARE.
FT_CALLBACK_DEF( void )
BDF_Face_Done( FT_Face bdfface ) /* BDF_Face */
{
BDF_Face face = (BDF_Face)bdfface;
FT_Memory memory = FT_FACE_MEMORY( face );
BDF_Face face = (BDF_Face)bdfface;
FT_Memory memory;
if ( !face )
return;
memory = FT_FACE_MEMORY( face );
bdf_free_font( face->bdffont );
FT_FREE( face->en_table );
@@ -610,7 +615,7 @@ THE SOFTWARE.
switch ( req->type )
{
case FT_SIZE_REQUEST_TYPE_NOMINAL:
if ( height == ( bsize->y_ppem + 32 ) >> 6 )
if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
error = BDF_Err_Ok;
break;
+1 -1
View File
@@ -27,7 +27,7 @@
FTMODULE_H_COMMANDS += BDF_DRIVER
define BDF_DRIVER
$(OPEN_DRIVER)bdf_driver_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Driver_ClassRec, bdf_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)bdf $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE)
endef
+4 -3
View File
@@ -3,7 +3,7 @@
#
# Copyright (C) 2001, 2002, 2003 by
# Copyright (C) 2001, 2002, 2003, 2008 by
# Francesco Zappa Nardelli
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -29,7 +29,7 @@
# bdf driver directory
#
BDF_DIR := $(SRC_DIR)/bdf
BDF_DIR := $(SRC_DIR)/bdf
BDF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(BDF_DIR))
@@ -44,7 +44,8 @@ BDF_DRV_SRC := $(BDF_DIR)/bdflib.c \
# bdf driver headers
#
BDF_DRV_H := $(BDF_DIR)/bdf.h \
$(BDF_DIR)/bdfdrivr.h
$(BDF_DIR)/bdfdrivr.h \
$(BDF_DIR)/bdferror.h
# bdf driver object(s)
#
+16 -4
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType CharMap cache (body) */
/* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -288,8 +288,20 @@
FT_Error error;
FT_UInt gindex = 0;
FT_UInt32 hash;
FT_Int no_cmap_change = 0;
if ( cmap_index < 0 )
{
/* Treat a negative cmap index as a special value, meaning that you */
/* don't want to change the FT_Face's character map through this */
/* call. This can be useful if the face requester callback already */
/* sets the face's charmap to the appropriate value. */
no_cmap_change = 1;
cmap_index = 0;
}
if ( !cache )
{
FT_ERROR(( "FTC_CMapCache_Lookup: bad arguments, returning 0!\n" ));
@@ -311,7 +323,7 @@
* Adobe Acrobat Reader Pack, named `KozMinProVI-Regular.otf',
* which contains more than 5 charmaps.
*/
if ( cmap_index >= 16 )
if ( cmap_index >= 16 && !no_cmap_change )
{
FTC_OldCMapDesc desc = (FTC_OldCMapDesc) face_id;
@@ -393,12 +405,12 @@
old = face->charmap;
cmap = face->charmaps[cmap_index];
if ( old != cmap )
if ( old != cmap && !no_cmap_change )
FT_Set_Charmap( face, cmap );
gindex = FT_Get_Char_Index( face, char_code );
if ( old != cmap )
if ( old != cmap && !no_cmap_change )
FT_Set_Charmap( face, old );
}
+3 -3
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache Manager (body). */
/* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -181,7 +181,7 @@
if ( asize == NULL )
return FTC_Err_Bad_Argument;
return FTC_Err_Invalid_Argument;
*asize = NULL;
@@ -306,7 +306,7 @@
if ( aface == NULL )
return FTC_Err_Bad_Argument;
return FTC_Err_Invalid_Argument;
*aface = NULL;
+6 -4
View File
@@ -3,7 +3,7 @@
#
# Copyright 2000, 2001, 2003, 2004, 2006 by
# Copyright 2000, 2001, 2003, 2004, 2006, 2008 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -26,7 +26,7 @@ CACHE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR))
#
CACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \
$(CACHE_DIR)/ftccache.c \
$(CACHE_DIR)/ftccmap.c \
$(CACHE_DIR)/ftccmap.c \
$(CACHE_DIR)/ftcglyph.c \
$(CACHE_DIR)/ftcimage.c \
$(CACHE_DIR)/ftcmanag.c \
@@ -35,12 +35,14 @@ CACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \
# Cache driver headers
#
CACHE_DRV_H := $(CACHE_DIR)/ftccback.h \
CACHE_DRV_H := $(CACHE_DIR)/ftccache.h \
$(CACHE_DIR)/ftccback.h \
$(CACHE_DIR)/ftcerror.h \
$(CACHE_DIR)/ftcglyph.h \
$(CACHE_DIR)/ftcimage.h \
$(CACHE_DIR)/ftcmanag.h \
$(CACHE_DIR)/ftcmru.h
$(CACHE_DIR)/ftcmru.h \
$(CACHE_DIR)/ftcsbits.h
# Cache driver object(s)
+33 -2
View File
@@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -187,6 +187,36 @@
}
FT_CALLBACK_DEF( FT_Error )
cff_get_advances( FT_Face ftface,
FT_UInt start,
FT_UInt count,
FT_Int32 flags,
FT_Fixed* advances )
{
CFF_Face face = (CFF_Face)ftface;
FT_UInt nn;
FT_Error error = CFF_Err_Ok;
FT_GlyphSlot slot = face->root.glyph;
flags |= FT_LOAD_ADVANCE_ONLY;
for ( nn = 0; nn < count; nn++ )
{
error = Load_Glyph( slot, face->root.size, start+nn, flags );
if ( error )
break;
advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
? slot->advance.y
: slot->advance.x;
}
return error;
}
/*
* GLYPH DICT SERVICE
*
@@ -396,6 +426,7 @@
cmap_info->language = 0;
cmap_info->format = 0;
if ( cmap->clazz != &cff_cmap_encoding_class_rec &&
cmap->clazz != &cff_cmap_unicode_class_rec )
@@ -570,7 +601,7 @@
cff_get_kerning,
0, /* FT_Face_AttachFunc */
0, /* FT_Face_GetAdvancesFunc */
cff_get_advances, /* FT_Face_GetAdvancesFunc */
cff_size_request,
File diff suppressed because it is too large Load Diff
+1
View File
@@ -139,6 +139,7 @@ FT_BEGIN_HEADER
FT_Pos nominal_width;
FT_Bool read_width;
FT_Bool width_only;
FT_Int num_hints;
FT_Fixed* buildchar;
FT_Int len_buildchar;
+4 -3
View File
@@ -4,7 +4,7 @@
/* */
/* OpenType and CFF data/program tables loader (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -1355,7 +1355,8 @@
FT_LOCAL_DEF( FT_Error )
cff_font_load( FT_Stream stream,
FT_Int face_index,
CFF_Font font )
CFF_Font font,
FT_Bool pure_cff )
{
static const FT_Frame_Field cff_header_fields[] =
{
@@ -1519,7 +1520,7 @@
/* read the Charset and Encoding tables if available */
if ( font->num_glyphs > 0 )
{
FT_Bool invert = FT_BOOL( dict->cid_registry != 0xFFFFU );
FT_Bool invert = FT_BOOL( dict->cid_registry != 0xFFFFU && pure_cff );
error = cff_charset_load( &font->charset, font->num_glyphs, stream,
+3 -2
View File
@@ -4,7 +4,7 @@
/* */
/* OpenType & CFF data/program tables loader (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -60,7 +60,8 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
cff_font_load( FT_Stream stream,
FT_Int face_index,
CFF_Font font );
CFF_Font font,
FT_Bool pure_cff );
FT_LOCAL( void )
cff_font_done( CFF_Font font );
+18 -12
View File
@@ -101,7 +101,7 @@
/* CFF and Type 1 private dictionaries have slightly different */
/* structures; we need to synthetize a Type 1 dictionary on the fly */
/* structures; we need to synthesize a Type 1 dictionary on the fly */
static void
cff_make_private_dict( CFF_SubFont subfont,
@@ -437,7 +437,7 @@
error = sfnt->init_face( stream, face, face_index, num_params, params );
if ( !error )
{
if ( face->format_tag != 0x4F54544FL ) /* `OTTO'; OpenType/CFF font */
if ( face->format_tag != TTAG_OTTO ) /* `OTTO'; OpenType/CFF font */
{
FT_TRACE2(( "[not a valid OpenType/CFF font]\n" ));
goto Bad_Format;
@@ -465,8 +465,7 @@
pure_cff = 0;
/* load font directory */
error = sfnt->load_face( stream, face,
face_index, num_params, params );
error = sfnt->load_face( stream, face, 0, num_params, params );
if ( error )
goto Exit;
}
@@ -508,13 +507,15 @@
goto Exit;
face->extra.data = cff;
error = cff_font_load( stream, face_index, cff );
error = cff_font_load( stream, face_index, cff, pure_cff );
if ( error )
goto Exit;
cff->pshinter = pshinter;
cff->psnames = (void*)psnames;
cffface->face_index = face_index;
/* Complement the root flags with some interesting information. */
/* Note that this is only necessary for pure CFF and CEF fonts; */
/* SFNT based fonts use the `name' table instead. */
@@ -659,8 +660,7 @@
cffface->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFFU ) >> 16;
cffface->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFFU ) >> 16;
cffface->units_per_EM = dict->units_per_em;
cffface->units_per_EM = (FT_UShort)( dict->units_per_em );
cffface->ascender = (FT_Short)( cffface->bbox.yMax );
cffface->descender = (FT_Short)( cffface->bbox.yMin );
@@ -823,7 +823,7 @@
cffface->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
#endif
if ( dict->cid_registry != 0xFFFFU )
if ( dict->cid_registry != 0xFFFFU && pure_cff )
cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
@@ -832,7 +832,7 @@
/* Compute char maps. */
/* */
/* Try to synthetize a Unicode charmap if there is none available */
/* Try to synthesize a Unicode charmap if there is none available */
/* already. If an OpenType font contains a Unicode "cmap", we */
/* will use it, whatever be in the CFF part of the file. */
{
@@ -919,11 +919,17 @@
FT_LOCAL_DEF( void )
cff_face_done( FT_Face cffface ) /* CFF_Face */
{
CFF_Face face = (CFF_Face)cffface;
FT_Memory memory = cffface->memory;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
CFF_Face face = (CFF_Face)cffface;
FT_Memory memory;
SFNT_Service sfnt;
if ( !face )
return;
memory = cffface->memory;
sfnt = (SFNT_Service)face->sfnt;
if ( sfnt )
sfnt->done_face( face );
+9 -4
View File
@@ -355,6 +355,12 @@
if ( FT_ABS( integer_length ) > 5 )
goto Exit;
/* Remove non-significant digits. */
if ( integer_length < 0 ) {
number /= power_tens[-integer_length];
fraction_length += integer_length;
}
/* Convert into 16.16 format. */
if ( fraction_length > 0 )
{
@@ -406,10 +412,9 @@
cff_parse_fixed_scaled( FT_Byte** d,
FT_Int scaling )
{
return **d ==
30 ? cff_parse_real( d[0], d[1], scaling, NULL )
: (FT_Fixed)FT_MulFix( cff_parse_integer( d[0], d[1] ) << 16,
power_tens[scaling] );
return **d == 30 ? cff_parse_real( d[0], d[1], scaling, NULL )
: ( cff_parse_integer( d[0], d[1] ) *
power_tens[scaling] ) << 16;
}
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += CFF_DRIVER
define CFF_DRIVER
$(OPEN_DRIVER)cff_driver_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Driver_ClassRec, cff_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)cff $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE)
endef
+26 -2
View File
@@ -234,14 +234,38 @@
}
/* by mistake, `expansion_factor' appears both in PS_PrivateRec */
/* and CID_FaceDictRec (both are public header files and can't */
/* changed); we simply copy the value */
FT_CALLBACK_DEF( FT_Error )
parse_expansion_factor( CID_Face face,
CID_Parser* parser )
{
CID_FaceDict dict;
if ( parser->num_dict >= 0 )
{
dict = face->cid.font_dicts + parser->num_dict;
dict->expansion_factor = cid_parser_to_fixed( parser, 0 );
dict->private_dict.expansion_factor = dict->expansion_factor;
}
return CID_Err_Ok;
}
static
const T1_FieldRec cid_field_records[] =
{
#include "cidtoken.h"
T1_FIELD_CALLBACK( "FDArray", parse_fd_array, 0 )
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix, 0 )
T1_FIELD_CALLBACK( "FDArray", parse_fd_array, 0 )
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix, 0 )
T1_FIELD_CALLBACK( "ExpansionFactor", parse_expansion_factor, 0 )
{ 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }
};
+44 -43
View File
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -193,61 +193,61 @@
FT_LOCAL_DEF( void )
cid_face_done( FT_Face cidface ) /* CID_Face */
{
CID_Face face = (CID_Face)cidface;
FT_Memory memory;
CID_Face face = (CID_Face)cidface;
FT_Memory memory;
CID_FaceInfo cid;
PS_FontInfo info;
if ( face )
if ( !face )
return;
cid = &face->cid;
info = &cid->font_info;
memory = cidface->memory;
/* release subrs */
if ( face->subrs )
{
CID_FaceInfo cid = &face->cid;
PS_FontInfo info = &cid->font_info;
FT_Int n;
memory = cidface->memory;
/* release subrs */
if ( face->subrs )
for ( n = 0; n < cid->num_dicts; n++ )
{
FT_Int n;
CID_Subrs subr = face->subrs + n;
for ( n = 0; n < cid->num_dicts; n++ )
if ( subr->code )
{
CID_Subrs subr = face->subrs + n;
if ( subr->code )
{
FT_FREE( subr->code[0] );
FT_FREE( subr->code );
}
FT_FREE( subr->code[0] );
FT_FREE( subr->code );
}
FT_FREE( face->subrs );
}
/* release FontInfo strings */
FT_FREE( info->version );
FT_FREE( info->notice );
FT_FREE( info->full_name );
FT_FREE( info->family_name );
FT_FREE( info->weight );
/* release font dictionaries */
FT_FREE( cid->font_dicts );
cid->num_dicts = 0;
/* release other strings */
FT_FREE( cid->cid_font_name );
FT_FREE( cid->registry );
FT_FREE( cid->ordering );
cidface->family_name = 0;
cidface->style_name = 0;
FT_FREE( face->binary_data );
FT_FREE( face->cid_stream );
FT_FREE( face->subrs );
}
/* release FontInfo strings */
FT_FREE( info->version );
FT_FREE( info->notice );
FT_FREE( info->full_name );
FT_FREE( info->family_name );
FT_FREE( info->weight );
/* release font dictionaries */
FT_FREE( cid->font_dicts );
cid->num_dicts = 0;
/* release other strings */
FT_FREE( cid->cid_font_name );
FT_FREE( cid->registry );
FT_FREE( cid->ordering );
cidface->family_name = 0;
cidface->style_name = 0;
FT_FREE( face->binary_data );
FT_FREE( face->cid_stream );
}
@@ -324,6 +324,7 @@
goto Exit;
/* check the face index */
/* XXX: handle CID fonts with more than a single face */
if ( face_index != 0 )
{
FT_ERROR(( "cid_face_init: invalid face index\n" ));
+5 -2
View File
@@ -4,7 +4,7 @@
/* */
/* CID token definitions (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -48,6 +48,7 @@
T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 )
T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 )
T1_FIELD_NUM ( "FSType", fs_type, 0 )
#undef FT_STRUCTURE
@@ -62,7 +63,6 @@
T1_FIELD_NUM ( "SubrCount", num_subrs, 0 )
T1_FIELD_NUM ( "lenBuildCharArray", len_buildchar, 0 )
T1_FIELD_FIXED( "ForceBoldThreshold", forcebold_threshold, 0 )
T1_FIELD_FIXED( "ExpansionFactor", expansion_factor, 0 )
T1_FIELD_FIXED( "StrokeWidth", stroke_width, 0 )
@@ -92,6 +92,9 @@
T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12, 0 )
T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12, 0 )
T1_FIELD_BOOL ( "ForceBold", force_bold, 0 )
#undef FT_STRUCTURE
#define FT_STRUCTURE FT_BBox
#undef T1CODE
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += TYPE1CID_DRIVER
define TYPE1CID_DRIVER
$(OPEN_DRIVER)t1cid_driver_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Driver_ClassRec, t1cid_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)cid $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE)
endef
+2 -2
View File
@@ -8,7 +8,7 @@
/* parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,7 +25,7 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_DEBUG_H
#include FT_GZIP_H
#include <string.h>
#include FT_CONFIG_STANDARD_LIBRARY_H
#include FT_MODULE_ERRORS_H
+3
View File
@@ -366,6 +366,9 @@ z_streamp z /* for messages */
if (r == Z_DATA_ERROR)
z->msg = (char*)"oversubscribed distance tree";
else if (r == Z_BUF_ERROR) {
#if 0
{
#endif
#ifdef PKZIP_BUG_WORKAROUND
r = Z_OK;
}
+2 -3
View File
@@ -8,7 +8,7 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
/* Copyright 2004, 2005, 2006 by */
/* Copyright 2004, 2005, 2006, 2009 by */
/* Albert Chin-A-Young. */
/* */
/* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */
@@ -27,8 +27,7 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_DEBUG_H
#include FT_LZW_H
#include <string.h>
#include <stdio.h>
#include FT_CONFIG_STANDARD_LIBRARY_H
#include FT_MODULE_ERRORS_H
+1 -1
View File
@@ -21,7 +21,7 @@ UseFreeTypeHeaders ;
if $(FT2_MULTI)
{
_sources = otvbase otvcommn otvgdef otvgpos otvgsub otvjstf otvmod ;
_sources = otvbase otvcommn otvgdef otvgpos otvgsub otvjstf otvmod otvmath ;
}
else
{
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += OTVALID_MODULE
define OTVALID_MODULE
$(OPEN_DRIVER)otv_module_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Module_Class, otv_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)otvalid $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE)
endef
+1
View File
@@ -42,6 +42,7 @@ FT_BEGIN_HEADER
otv_GDEF_validate( FT_Bytes table,
FT_Bytes gsub,
FT_Bytes gpos,
FT_UInt glyph_count,
FT_Validator valid );
FT_LOCAL( void )
+5 -5
View File
@@ -192,12 +192,12 @@ FT_BEGIN_HEADER
valid->func[2] = OTV_FUNC( z ); \
FT_END_STMNT
#define OTV_INIT do ; while ( 0 )
#define OTV_ENTER do ; while ( 0 )
#define OTV_NAME_ENTER( name ) do ; while ( 0 )
#define OTV_EXIT do ; while ( 0 )
#define OTV_INIT do { } while ( 0 )
#define OTV_ENTER do { } while ( 0 )
#define OTV_NAME_ENTER( name ) do { } while ( 0 )
#define OTV_EXIT do { } while ( 0 )
#define OTV_TRACE( s ) do ; while ( 0 )
#define OTV_TRACE( s ) do { } while ( 0 )
#endif /* !FT_DEBUG_LEVEL_TRACE */
+5
View File
@@ -141,10 +141,13 @@
/*************************************************************************/
/*************************************************************************/
/* sets valid->glyph_count */
FT_LOCAL_DEF( void )
otv_GDEF_validate( FT_Bytes table,
FT_Bytes gsub,
FT_Bytes gpos,
FT_UInt glyph_count,
FT_Validator ftvalid )
{
OTV_ValidatorRec validrec;
@@ -183,6 +186,8 @@
else
table_size = 10; /* OpenType < 1.2 */
valid->glyph_count = glyph_count;
OTV_OPTIONAL_OFFSET( GlyphClassDef );
OTV_SIZE_CHECK( GlyphClassDef );
if ( GlyphClassDef )
+3 -1
View File
@@ -4,7 +4,7 @@
/* */
/* OpenType MATH table validation (body). */
/* */
/* Copyright 2007 by */
/* Copyright 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by George Williams. */
@@ -93,6 +93,8 @@
OTV_OPTIONAL_TABLE( Coverage );
OTV_OPTIONAL_TABLE( DeviceTableOffset );
FT_UNUSED( isItalic ); /* only used if tracing is active */
OTV_NAME_ENTER( isItalic ? "MathItalicsCorrectionInfo"
: "MathTopAccentAttachment" );
+2 -2
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType's OpenType validation module implementation (body). */
/* */
/* Copyright 2004, 2005, 2006, 2007 by */
/* Copyright 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -168,7 +168,7 @@
{
ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT );
if ( ft_setjmp( valid.jump_buffer ) == 0 )
otv_GDEF_validate( gdef, gsub, gpos, &valid );
otv_GDEF_validate( gdef, gsub, gpos, face->num_glyphs, &valid );
error = valid.error;
if ( error )
goto Exit;
+1 -1
View File
@@ -27,7 +27,7 @@
FTMODULE_H_COMMANDS += PCF_DRIVER
define PCF_DRIVER
$(OPEN_DRIVER)pcf_driver_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Driver_ClassRec, pcf_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)pcf $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE)
endef
+8 -3
View File
@@ -196,10 +196,15 @@ THE SOFTWARE.
FT_CALLBACK_DEF( void )
PCF_Face_Done( FT_Face pcfface ) /* PCF_Face */
{
PCF_Face face = (PCF_Face)pcfface;
FT_Memory memory = FT_FACE_MEMORY( face );
PCF_Face face = (PCF_Face)pcfface;
FT_Memory memory;
if ( !face )
return;
memory = FT_FACE_MEMORY( face );
FT_FREE( face->encodings );
FT_FREE( face->metrics );
@@ -408,7 +413,7 @@ THE SOFTWARE.
switch ( req->type )
{
case FT_SIZE_REQUEST_TYPE_NOMINAL:
if ( height == ( bsize->y_ppem + 32 ) >> 6 )
if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
error = PCF_Err_Ok;
break;
+3 -3
View File
@@ -2,7 +2,7 @@
FreeType font driver for pcf fonts
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
Francesco Zappa Nardelli
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -48,7 +48,7 @@ THE SOFTWARE.
#define FT_COMPONENT trace_pcfread
#if defined( FT_DEBUG_LEVEL_TRACE )
#ifdef FT_DEBUG_LEVEL_TRACE
static const char* const tableNames[] =
{
"prop", "accl", "mtrcs", "bmps", "imtrcs",
@@ -152,7 +152,7 @@ THE SOFTWARE.
break;
}
#if defined( FT_DEBUG_LEVEL_TRACE )
#ifdef FT_DEBUG_LEVEL_TRACE
{
FT_UInt i, j;
+5 -6
View File
@@ -3,7 +3,7 @@
#
# Copyright (C) 2000, 2001, 2003 by
# Copyright (C) 2000, 2001, 2003, 2008 by
# Francesco Zappa Nardelli
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -35,15 +35,14 @@ PCF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PCF_DIR))
# pcf driver sources (i.e., C files)
#
PCF_DRV_SRC := $(PCF_DIR)/pcfread.c \
$(PCF_DIR)/pcfdrivr.c \
PCF_DRV_SRC := $(PCF_DIR)/pcfdrivr.c \
$(PCF_DIR)/pcfread.c \
$(PCF_DIR)/pcfutil.c
# pcf driver headers
#
PCF_DRV_H := $(PCF_DIR)/pcf.h \
$(PCF_DIR)/pcfdrivr.h \
$(PCF_DIR)/pcfutil.h \
PCF_DRV_H := $(PCF_DRV_SRC:%.c=%.h) \
$(PCF_DIR)/pcf.h \
$(PCF_DIR)/pcferror.h
# pcf driver object(s)
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PFR_DRIVER
define PFR_DRIVER
$(OPEN_DRIVER)pfr_driver_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Driver_ClassRec, pfr_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)pfr $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE)
endef
+9 -2
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR driver interface (body). */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* Copyright 2002, 2003, 2004, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -66,10 +66,16 @@
FT_Pos *anadvance )
{
PFR_Face face = (PFR_Face)pfrface;
FT_Error error = PFR_Err_Bad_Argument;
FT_Error error = PFR_Err_Invalid_Argument;
*anadvance = 0;
if ( !gindex )
goto Exit;
gindex--;
if ( face )
{
PFR_PhyFont phys = &face->phy_font;
@@ -82,6 +88,7 @@
}
}
Exit:
return error;
}
+8 -3
View File
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (body). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -41,10 +41,15 @@
FT_LOCAL_DEF( void )
pfr_face_done( FT_Face pfrface ) /* PFR_Face */
{
PFR_Face face = (PFR_Face)pfrface;
FT_Memory memory = pfrface->driver->root.memory;
PFR_Face face = (PFR_Face)pfrface;
FT_Memory memory;
if ( !face )
return;
memory = pfrface->driver->root.memory;
/* we don't want dangling pointers */
pfrface->family_name = NULL;
pfrface->style_name = NULL;
+7 -2
View File
@@ -4,7 +4,7 @@
/* */
/* AFM parser (body). */
/* */
/* Copyright 2006, 2007 by */
/* Copyright 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -672,7 +672,12 @@
FT_ULong index2 = KERN_INDEX( kp2->index1, kp2->index2 );
return (int)( index1 - index2 );
if ( index1 > index2 )
return 1;
else if ( index1 < index2 )
return -1;
else
return 0;
}
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PSAUX_MODULE
define PSAUX_MODULE
$(OPEN_DRIVER)psaux_module_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Module_Class, psaux_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)psaux $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE)
endef
+12 -5
View File
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -175,11 +175,17 @@
return PSaux_Err_Invalid_Argument;
}
if ( length < 0 )
{
FT_ERROR(( "ps_table_add: invalid length\n" ));
return PSaux_Err_Invalid_Argument;
}
/* grow the base block if needed */
if ( table->cursor + length > table->capacity )
{
FT_Error error;
FT_Offset new_size = table->capacity;
FT_Offset new_size = table->capacity;
FT_Long in_offset;
@@ -376,7 +382,7 @@
/* skip octal escape or ignore backslash */
for ( i = 0; i < 3 && cur < limit; ++i )
{
if ( ! IS_OCTAL_DIGIT( *cur ) )
if ( !IS_OCTAL_DIGIT( *cur ) )
break;
++cur;
@@ -1259,8 +1265,9 @@
old_cursor = parser->cursor;
old_limit = parser->limit;
/* we store the elements count if necessary */
if ( field->type != T1_FIELD_TYPE_BBOX )
/* we store the elements count if necessary; */
/* we further assume that `count_offset' can't be zero */
if ( field->type != T1_FIELD_TYPE_BBOX && field->count_offset != 0 )
*(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) =
(FT_Byte)num_elements;
+8 -9
View File
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (body). */
/* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -354,10 +354,9 @@
( decoder->buildchar == NULL ) );
if ( decoder->len_buildchar > 0 )
memset( &decoder->buildchar[0],
0,
sizeof( decoder->buildchar[0] ) *
decoder->len_buildchar );
ft_memset( &decoder->buildchar[0],
0,
sizeof( decoder->buildchar[0] ) * decoder->len_buildchar );
FT_TRACE4(( "\nStart charstring\n" ));
@@ -777,10 +776,10 @@
idx + blend->num_designs > decoder->face->len_buildchar )
goto Unexpected_OtherSubr;
memcpy( &decoder->buildchar[idx],
blend->weight_vector,
blend->num_designs *
sizeof( blend->weight_vector[ 0 ] ) );
ft_memcpy( &decoder->buildchar[idx],
blend->weight_vector,
blend->num_designs *
sizeof( blend->weight_vector[0] ) );
}
break;
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PSHINTER_MODULE
define PSHINTER_MODULE
$(OPEN_DRIVER)pshinter_module_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Module_Class, pshinter_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)pshinter $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE)
endef
+2 -2
View File
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm (body). */
/* */
/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -898,7 +898,7 @@
#ifdef DEBUG_ZONES
#include <stdio.h>
#include FT_CONFIG_STANDARD_LIBRARY_H
static void
psh_print_zone( PSH_Zone zone )
+1 -1
View File
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PSNAMES_MODULE
define PSNAMES_MODULE
$(OPEN_DRIVER)psnames_module_class$(CLOSE_DRIVER)
$(OPEN_DRIVER) FT_Module_Class, psnames_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE)
endef
+60 -35
View File
@@ -174,18 +174,34 @@
/* sort base glyphs before glyph variants */
if ( unicode1 == unicode2 )
return map1->unicode - map2->unicode;
{
if ( map1->unicode > map2->unicode )
return 1;
else if ( map1->unicode < map2->unicode )
return -1;
else
return 0;
}
else
return unicode1 - unicode2;
{
if ( unicode1 > unicode2 )
return 1;
else if ( unicode1 < unicode2 )
return -1;
else
return 0;
}
}
/* support for old WGL4 fonts */
/* support for extra glyphs not handled (well) in AGL; */
/* we add extra mappings for them if necessary */
#define WGL_EXTRA_LIST_SIZE 8
#define EXTRA_GLYPH_LIST_SIZE 10
static const FT_UInt32 ft_wgl_extra_unicodes[WGL_EXTRA_LIST_SIZE] =
static const FT_UInt32 ft_extra_glyph_unicodes[EXTRA_GLYPH_LIST_SIZE] =
{
/* WGL 4 */
0x0394,
0x03A9,
0x2215,
@@ -193,10 +209,13 @@
0x02C9,
0x03BC,
0x2219,
0x00A0
0x00A0,
/* Romanian */
0x021A,
0x021B
};
static const char ft_wgl_extra_glyph_names[] =
static const char ft_extra_glyph_names[] =
{
'D','e','l','t','a',0,
'O','m','e','g','a',0,
@@ -205,11 +224,13 @@
'm','a','c','r','o','n',0,
'm','u',0,
'p','e','r','i','o','d','c','e','n','t','e','r','e','d',0,
's','p','a','c','e',0
's','p','a','c','e',0,
'T','c','o','m','m','a','a','c','c','e','n','t',0,
't','c','o','m','m','a','a','c','c','e','n','t',0
};
static const FT_Int
ft_wgl_extra_glyph_name_offsets[WGL_EXTRA_LIST_SIZE] =
ft_extra_glyph_name_offsets[EXTRA_GLYPH_LIST_SIZE] =
{
0,
6,
@@ -218,29 +239,31 @@
28,
35,
38,
53
53,
59,
72
};
static void
ps_check_wgl_name( const char* gname,
FT_UInt glyph,
FT_UInt* wgl_glyphs,
FT_UInt *states )
ps_check_extra_glyph_name( const char* gname,
FT_UInt glyph,
FT_UInt* extra_glyphs,
FT_UInt *states )
{
FT_UInt n;
for ( n = 0; n < WGL_EXTRA_LIST_SIZE; n++ )
for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
{
if ( ft_strcmp( ft_wgl_extra_glyph_names +
ft_wgl_extra_glyph_name_offsets[n], gname ) == 0 )
if ( ft_strcmp( ft_extra_glyph_names +
ft_extra_glyph_name_offsets[n], gname ) == 0 )
{
if ( states[n] == 0 )
{
/* mark this WGL extra glyph as a candidate for the cmap */
/* mark this extra glyph as a candidate for the cmap */
states[n] = 1;
wgl_glyphs[n] = glyph;
extra_glyphs[n] = glyph;
}
return;
@@ -250,17 +273,17 @@
static void
ps_check_wgl_unicode( FT_UInt32 uni_char,
FT_UInt *states )
ps_check_extra_glyph_unicode( FT_UInt32 uni_char,
FT_UInt *states )
{
FT_UInt n;
for ( n = 0; n < WGL_EXTRA_LIST_SIZE; n++ )
for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
{
if ( uni_char == ft_wgl_extra_unicodes[n] )
if ( uni_char == ft_extra_glyph_unicodes[n] )
{
/* disable this WGL extra glyph from being added to the cmap */
/* disable this extra glyph from being added to the cmap */
states[n] = 2;
return;
@@ -280,15 +303,15 @@
{
FT_Error error;
FT_UInt wgl_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
FT_UInt wgl_glyphs[WGL_EXTRA_LIST_SIZE];
FT_UInt extra_glyph_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
FT_UInt extra_glyphs[EXTRA_GLYPH_LIST_SIZE];
/* we first allocate the table */
table->num_maps = 0;
table->maps = 0;
if ( !FT_NEW_ARRAY( table->maps, num_glyphs + WGL_EXTRA_LIST_SIZE ) )
if ( !FT_NEW_ARRAY( table->maps, num_glyphs + EXTRA_GLYPH_LIST_SIZE ) )
{
FT_UInt n;
FT_UInt count;
@@ -305,12 +328,14 @@
if ( gname )
{
ps_check_wgl_name( gname, n, wgl_glyphs, wgl_list_states );
ps_check_extra_glyph_name( gname, n,
extra_glyphs, extra_glyph_list_states );
uni_char = ps_unicode_value( gname );
if ( BASE_GLYPH( uni_char ) != 0 )
{
ps_check_wgl_unicode( uni_char, wgl_list_states );
ps_check_extra_glyph_unicode( uni_char,
extra_glyph_list_states );
map->unicode = uni_char;
map->glyph_index = n;
map++;
@@ -321,15 +346,15 @@
}
}
for ( n = 0; n < WGL_EXTRA_LIST_SIZE; n++ )
for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
{
if ( wgl_list_states[n] == 1 )
if ( extra_glyph_list_states[n] == 1 )
{
/* This glyph name has an additional WGL4 representation. */
/* Add it to the cmap. */
/* This glyph name has an additional representation. */
/* Add it to the cmap. */
map->unicode = ft_wgl_extra_unicodes[n];
map->glyph_index = wgl_glyphs[n];
map->unicode = ft_extra_glyph_unicodes[n];
map->glyph_index = extra_glyphs[n];
map++;
}
}
+7 -2
View File
@@ -4,7 +4,7 @@
/* */
/* PostScript glyph names. */
/* */
/* Copyright 2005 by */
/* Copyright 2005, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -561,7 +561,10 @@
* The lookup function to get the Unicode value for a given string
* is defined below the table.
*/
static const unsigned char ft_adobe_glyph_list[54791] =
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
static const unsigned char ft_adobe_glyph_list[54791L] =
{
0, 52, 0,106, 2,167, 3, 63, 4,220, 6,125, 9,143, 10, 23,
11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88,
@@ -4086,5 +4089,7 @@
return 0;
}
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
/* END */
+3 -2
View File
@@ -5,7 +5,7 @@
/* Miscellaneous macros for stand-alone rasterizer (specification */
/* only). */
/* */
/* Copyright 2005 by */
/* Copyright 2005, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -27,7 +27,8 @@
#ifndef __FTMISC_H__
#define __FTMISC_H__
#include <string.h> /* memset */
/* memset */
#include FT_CONFIG_STANDARD_LIBRARY_H
#define FT_BEGIN_HEADER
#define FT_END_HEADER

Some files were not shown because too many files have changed in this diff Show More