Author: korli Date: 2010-02-21 21:08:50 +0100 (Sun, 21 Feb 2010) New Revision: 35566 Changeset: http://dev.haiku-os.org/changeset/35566/haiku Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftconfig.h haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h haiku/trunk/headers/libs/freetype2/freetype/freetype.h haiku/trunk/headers/libs/freetype2/freetype/ftglyph.h haiku/trunk/headers/libs/freetype2/freetype/ftimage.h haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h haiku/trunk/headers/libs/freetype2/freetype/ftsnames.h haiku/trunk/src/libs/freetype2/autofit/aflatin.c haiku/trunk/src/libs/freetype2/autofit/aflatin2.c haiku/trunk/src/libs/freetype2/base/ftbase.h haiku/trunk/src/libs/freetype2/base/ftbbox.c haiku/trunk/src/libs/freetype2/base/ftdbgmem.c haiku/trunk/src/libs/freetype2/base/ftglyph.c haiku/trunk/src/libs/freetype2/base/ftinit.c haiku/trunk/src/libs/freetype2/base/ftobjs.c haiku/trunk/src/libs/freetype2/base/ftoutln.c haiku/trunk/src/libs/freetype2/base/ftpatent.c haiku/trunk/src/libs/freetype2/base/ftstroke.c haiku/trunk/src/libs/freetype2/base/ftsynth.c haiku/trunk/src/libs/freetype2/cache/ftcglyph.c haiku/trunk/src/libs/freetype2/cff/cffdrivr.c haiku/trunk/src/libs/freetype2/cff/cffgload.c haiku/trunk/src/libs/freetype2/cff/cffgload.h haiku/trunk/src/libs/freetype2/cff/cffobjs.c haiku/trunk/src/libs/freetype2/cff/cffparse.c haiku/trunk/src/libs/freetype2/cid/cidgload.c haiku/trunk/src/libs/freetype2/cid/cidobjs.c haiku/trunk/src/libs/freetype2/cid/cidtoken.h haiku/trunk/src/libs/freetype2/lzw/ftlzw.c haiku/trunk/src/libs/freetype2/pfr/pfrsbit.c haiku/trunk/src/libs/freetype2/psaux/t1decode.c haiku/trunk/src/libs/freetype2/psnames/psmodule.c haiku/trunk/src/libs/freetype2/sfnt/sfdriver.c haiku/trunk/src/libs/freetype2/sfnt/sfobjs.c haiku/trunk/src/libs/freetype2/sfnt/ttcmap.c haiku/trunk/src/libs/freetype2/sfnt/ttload.c haiku/trunk/src/libs/freetype2/truetype/ttdriver.c haiku/trunk/src/libs/freetype2/truetype/ttgload.c haiku/trunk/src/libs/freetype2/truetype/ttgxvar.c haiku/trunk/src/libs/freetype2/type1/t1afm.c haiku/trunk/src/libs/freetype2/type1/t1gload.c haiku/trunk/src/libs/freetype2/type1/t1objs.c haiku/trunk/src/libs/freetype2/type1/t1parse.c Log: merged freetype 2.3.12 Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftconfig.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/config/ftconfig.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/config/ftconfig.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,7 @@ /* */ /* ANSI-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -35,7 +35,6 @@ /* */ /*************************************************************************/ - #ifndef __FTCONFIG_H__ #define __FTCONFIG_H__ @@ -306,9 +305,38 @@ /* Provide assembler fragments for performance-critical functions. */ /* These must be defined `static __inline__' with GCC. */ +#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ +#define FT_MULFIX_ASSEMBLER FT_MulFix_arm + + /* documentation is in freetype.h */ + + static __inline FT_Int32 + FT_MulFix_arm( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 t, t2; + + + __asm + { + smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ + mov a, t, asr #31 /* a = (hi >> 31) */ + add a, a, #0x8000 /* a += 0x8000 */ + adds t2, t2, a /* t2 += a */ + adc t, t, #0 /* t += carry */ + mov a, t2, lsr #16 /* a = t2 >> 16 */ + orr a, a, t, lsl #16 /* a |= t << 16 */ + } + return a; + } + +#endif /* __CC_ARM || __ARMCC__ */ + + #ifdef __GNUC__ -#if defined( __arm__ ) && !defined( __thumb__ ) +#if defined( __arm__ ) && !defined( __thumb__ ) && \ + !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) #define FT_MULFIX_ASSEMBLER FT_MulFix_arm /* documentation is in freetype.h */ @@ -333,7 +361,7 @@ return a; } -#endif /* __arm__ && !__thumb__ */ +#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ #if defined( i386 ) #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,8 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -85,9 +86,9 @@ /* */ /* This macro has no impact on the FreeType API, only on its */ /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ - /* FT_Render_Glyph still generates a bitmap that is 3 times larger than */ - /* the original size; the difference will be that each triplet of */ - /* subpixels has R=G=B. */ + /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */ + /* the original size in case this macro isn't defined; however, each */ + /* triplet of subpixels has R=G=B. */ /* */ /* This is done to allow FreeType clients to run unmodified, forcing */ /* them to display normal gray-level anti-aliased glyphs. */ @@ -313,10 +314,11 @@ /* */ /* Allow the use of FT_Incremental_Interface to load typefaces that */ /* contain no glyph data, but supply it via a callback function. */ - /* This allows FreeType to be used with the PostScript language, using */ - /* the GhostScript interpreter. */ + /* This is required by clients supporting document formats which */ + /* supply font data incrementally as the document is parsed, such */ + /* as the Ghostscript interpreter for the PostScript language. */ /* */ -/* #define FT_CONFIG_OPTION_INCREMENTAL */ +#define FT_CONFIG_OPTION_INCREMENTAL /*************************************************************************/ @@ -402,7 +404,7 @@ /* Position Independent Code */ /* */ /* If this macro is set (which is _not_ the default), FreeType2 will */ - /* avoid creating constants that require address fixups. Instead the */ + /* avoid creating constants that require address fixups. Instead the */ /* constants will be moved into a struct and additional intialization */ /* code will be used. */ /* */ Modified: haiku/trunk/headers/libs/freetype2/freetype/freetype.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/freetype.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/freetype.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,8 @@ /* */ /* FreeType high-level API and common types (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -231,6 +232,10 @@ /* vertAdvance :: */ /* Advance height for vertical layout. */ /* */ + /* <Note> */ + /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */ + /* dimensions of the hinted glyph (in case hinting is applicable). */ + /* */ typedef struct FT_Glyph_Metrics_ { FT_Pos width; @@ -1477,8 +1482,13 @@ /* important to perform correct WYSIWYG layout. */ /* Only relevant for outline glyphs. */ /* */ - /* advance :: This is the transformed advance width for the */ - /* glyph (in 26.6 fractional pixel format). */ + /* advance :: This shorthand is, depending on */ + /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */ + /* advance width for the glyph (in 26.6 */ + /* fractional pixel format). As specified with */ + /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */ + /* `horiAdvance' or the `vertAdvance' value of */ + /* `metrics' field. */ /* */ /* format :: This field indicates the format of the image */ /* contained in the glyph slot. Typically */ @@ -1743,7 +1753,8 @@ /* data :: A pointer to the parameter data. */ /* */ /* <Note> */ - /* The ID and function of parameters are driver-specific. */ + /* The ID and function of parameters are driver-specific. See the */ + /* various FT_PARAM_TAG_XXX flags for more information. */ /* */ typedef struct FT_Parameter_ { @@ -3763,7 +3774,7 @@ */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 3 -#define FREETYPE_PATCH 11 +#define FREETYPE_PATCH 12 /*************************************************************************/ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftglyph.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftglyph.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/ftglyph.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -468,7 +468,7 @@ /* // 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, */ + /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */ /* 0, 1 ); */ /* if ( error ) // `glyph' unchanged */ /* ... */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftimage.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftimage.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/ftimage.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -5,7 +5,8 @@ /* FreeType glyph image formats and default raster interface */ /* (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -51,10 +52,9 @@ /* FT_Pos */ /* */ /* <Description> */ - /* The type FT_Pos is a 32-bit integer used to store vectorial */ - /* coordinates. Depending on the context, these can represent */ - /* distances in integer font units, or 16.16, or 26.6 fixed float */ - /* pixel coordinates. */ + /* The type FT_Pos is used to store vectorial coordinates. Depending */ + /* on the context, these can represent distances in integer font */ + /* units, or 16.16, or 26.6 fixed float pixel coordinates. */ /* */ typedef signed long FT_Pos; @@ -99,6 +99,20 @@ /* */ /* yMax :: The vertical maximum (top-most). */ /* */ + /* <Note> */ + /* The bounding box is specified with the coordinates of the lower */ + /* left and the upper right corner. In PostScript, those values are */ + /* often called (llx,lly) and (urx,ury), respectively. */ + /* */ + /* If `yMin' is negative, this value gives the glyph's descender. */ + /* Otherwise, the glyph doesn't descend below the baseline. */ + /* Similarly, if `ymax' is positive, this value gives the glyph's */ + /* ascender. */ + /* */ + /* `xMin' gives the horizontal distance from the glyph's origin to */ + /* the left edge of the glyph's bounding box. If `xMin' is negative, */ + /* the glyph extends to the left of the origin. */ + /* */ typedef struct FT_BBox_ { FT_Pos xMin, yMin; @@ -254,6 +268,9 @@ /* flow. In all cases, the pitch is an offset to add */ /* to a bitmap pointer in order to go down one row. */ /* */ + /* For the B/W rasterizer, `pitch' is always an even */ + /* number. */ + /* */ /* buffer :: A typeless pointer to the bitmap buffer. This */ /* value should be aligned on 32-bit boundaries in */ /* most cases. */ @@ -563,8 +580,8 @@ /* FT_Outline_ConicToFunc */ /* */ /* <Description> */ - /* A function pointer type use to describe the signature of a `conic */ - /* to' function during outline walking/decomposition. */ + /* A function pointer type used to describe the signature of a `conic */ + /* to' function during outline walking or decomposition. */ /* */ /* A `conic to' is emitted to indicate a second-order Bézier arc in */ /* the outline. */ @@ -596,7 +613,7 @@ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `cubic */ - /* to' function during outline walking/decomposition. */ + /* to' function during outline walking or decomposition. */ /* */ /* A `cubic to' is emitted to indicate a third-order Bézier arc. */ /* */ @@ -629,8 +646,7 @@ /* */ /* <Description> */ /* A structure to hold various function pointers used during outline */ - /* decomposition in order to emit segments, conic, and cubic Béziers, */ - /* as well as `move to' and `close to' operations. */ + /* decomposition in order to emit segments, conic, and cubic Béziers. */ /* */ /* <Fields> */ /* move_to :: The `move to' emitter. */ @@ -657,7 +673,7 @@ /* y' = (x << shift) - delta */ /* } */ /* */ - /* Set the value of `shift' and `delta' to~0 to get the original */ + /* Set the values of `shift' and `delta' to~0 to get the original */ /* point coordinates. */ /* */ typedef struct FT_Outline_Funcs_ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,7 @@ /* */ /* FreeType incremental loading (specification). */ /* */ -/* Copyright 2002, 2003, 2006, 2007, 2008 by */ +/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -101,8 +101,11 @@ * Top bearing, in font units. * * advance :: - * Glyph advance, in font units. + * Horizontal component of glyph advance, in font units. * + * advance_v :: + * Vertical component of glyph advance, in font units. + * * @note: * These correspond to horizontal or vertical metrics depending on the * value of the `vertical' argument to the function @@ -114,6 +117,7 @@ FT_Long bearing_x; FT_Long bearing_y; FT_Long advance; + FT_Long advance_v; /* since 2.3.12 */ } FT_Incremental_MetricsRec; Modified: haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -5,7 +5,7 @@ /* Support for the FT_Outline type used to store glyph shapes of */ /* most scalable font formats (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -85,9 +85,8 @@ /* */ /* <Description> */ /* Walk over an outline's structure to decompose it into individual */ - /* segments and Bézier arcs. This function is also able to emit */ - /* `move to' and `close to' operations to indicate the start and end */ - /* of new contours in the outline. */ + /* segments and Bézier arcs. This function also emits `move to' */ + /* operations to indicate the start of new contours in the outline. */ /* */ /* <Input> */ /* outline :: A pointer to the source target. */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftsnames.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftsnames.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/headers/libs/freetype2/freetype/ftsnames.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -7,7 +7,7 @@ /* */ /* This is _not_ used to retrieve glyph names! */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -160,6 +160,35 @@ FT_SfntName *aname ); + /*************************************************************************** + * + * @constant: + * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY + * + * @description: + * A constant used as the tag of @FT_Parameter structures to make + * FT_Open_Face() ignore preferred family subfamily names in `name' + * table since OpenType version 1.4. For backwards compatibility with + * legacy systems which has 4-face-per-family restriction. + * + */ +#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) + + + /*************************************************************************** + * + * @constant: + * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY + * + * @description: + * A constant used as the tag of @FT_Parameter structures to make + * FT_Open_Face() ignore preferred subfamily names in `name' table since + * OpenType version 1.4. For backwards compatibility with legacy + * systems which has 4-face-per-family restriction. + * + */ +#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) + /* */ Modified: haiku/trunk/src/libs/freetype2/autofit/aflatin.c =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/aflatin.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/autofit/aflatin.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -402,16 +402,16 @@ af_latin_metrics_check_digits( AF_LatinMetrics metrics, FT_Face face ) { - FT_UInt i; - FT_Bool started = 0, same_width = 1; + FT_UInt i; + FT_Bool started = 0, same_width = 1; + FT_Fixed advance, old_advance = 0; /* check whether all ASCII digits have the same advance width; */ /* digit `0' is 0x30 in all supported charmaps */ for ( i = 0x30; i <= 0x39; i++ ) { - FT_UInt glyph_index; - FT_Fixed advance, old_advance = 0; + FT_UInt glyph_index; glyph_index = FT_Get_Char_Index( face, i ); Modified: haiku/trunk/src/libs/freetype2/autofit/aflatin2.c =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/aflatin2.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/autofit/aflatin2.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -407,16 +407,16 @@ af_latin2_metrics_check_digits( AF_LatinMetrics metrics, FT_Face face ) { - FT_UInt i; - FT_Bool started = 0, same_width = 1; + FT_UInt i; + FT_Bool started = 0, same_width = 1; + FT_Fixed advance, old_advance = 0; /* check whether all ASCII digits have the same advance width; */ /* digit `0' is 0x30 in all supported charmaps */ for ( i = 0x30; i <= 0x39; i++ ) { - FT_UInt glyph_index; - FT_Fixed advance, old_advance; + FT_UInt glyph_index; glyph_index = FT_Get_Char_Index( face, i ); Modified: haiku/trunk/src/libs/freetype2/base/ftbase.h =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftbase.h 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftbase.h 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,7 @@ /* */ /* The FreeType private functions used in base module (specification). */ /* */ -/* Copyright 2008 by */ +/* Copyright 2008, 2010 by */ /* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -29,7 +29,7 @@ /* 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 ) + FT_LOCAL( FT_Error ) open_face_PS_from_sfnt_stream( FT_Library library, FT_Stream stream, FT_Long face_index, @@ -40,7 +40,7 @@ /* Create a new FT_Face given a buffer and a driver name. */ /* From ftmac.c. */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL( FT_Error ) open_face_from_buffer( FT_Library library, FT_Byte* base, FT_ULong size, Modified: haiku/trunk/src/libs/freetype2/base/ftbbox.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftbbox.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftbbox.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,7 @@ /* */ /* FreeType bbox computation (body). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2006 by */ +/* Copyright 1996-2001, 2002, 2004, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -140,7 +140,7 @@ /* */ /* <Description> */ /* This function is used as a `conic_to' emitter during */ - /* FT_Raster_Decompose(). It checks a conic Bezier curve with the */ + /* FT_Outline_Decompose(). It checks a conic Bezier curve with the */ /* current bounding box, and computes its extrema if necessary to */ /* update it. */ /* */ @@ -507,7 +507,7 @@ /* */ /* <Description> */ /* This function is used as a `cubic_to' emitter during */ - /* FT_Raster_Decompose(). It checks a cubic Bezier curve with the */ + /* FT_Outline_Decompose(). It checks a cubic Bezier curve with the */ /* current bounding box, and computes its extrema if necessary to */ /* update it. */ /* */ Modified: haiku/trunk/src/libs/freetype2/base/ftdbgmem.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftdbgmem.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftdbgmem.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -989,7 +989,7 @@ #else /* !FT_DEBUG_MEMORY */ /* ANSI C doesn't like empty source files */ - static const FT_Byte _debug_mem_dummy = 0; + typedef int _debug_mem_dummy; #endif /* !FT_DEBUG_MEMORY */ Modified: haiku/trunk/src/libs/freetype2/base/ftglyph.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftglyph.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftglyph.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -372,7 +372,7 @@ if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) clazz = FT_BITMAP_GLYPH_CLASS_GET; - /* it it is an outline too */ + /* if it is an outline */ else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) clazz = FT_OUTLINE_GLYPH_CLASS_GET; @@ -515,7 +515,11 @@ const FT_Glyph_Class* clazz; +#ifdef FT_CONFIG_OPTION_PIC + FT_Library library = FT_GLYPH( glyph )->library; +#endif + /* check argument */ if ( !the_glyph ) goto Bad; Modified: haiku/trunk/src/libs/freetype2/base/ftinit.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftinit.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftinit.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -115,7 +115,7 @@ FT_Module_Class** classes; FT_Memory memory; FT_UInt i; - BasePIC* pic_container = library->pic_container.base; + BasePIC* pic_container = (BasePIC*)library->pic_container.base; if ( !pic_container->default_module_classes ) return; @@ -145,7 +145,7 @@ FT_Module_Class** classes; FT_Module_Class* clazz; FT_UInt i; - BasePIC* pic_container = library->pic_container.base; + BasePIC* pic_container = (BasePIC*)library->pic_container.base; memory = library->memory; pic_container->default_module_classes = 0; Modified: haiku/trunk/src/libs/freetype2/base/ftobjs.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftobjs.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftobjs.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,8 @@ /* */ /* The FreeType private base classes (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -37,7 +38,9 @@ #include FT_SERVICE_KERNING_H #include FT_SERVICE_TRUETYPE_ENGINE_H +#ifdef FT_CONFIG_OPTION_MAC_FONTS #include "ftbase.h" +#endif #define GRID_FIT_METRICS @@ -708,8 +711,8 @@ } /* compute the linear advance in 16.16 pixels */ - if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 && - ( FT_IS_SCALABLE( face ) ) ) + if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 && + ( FT_IS_SCALABLE( face ) ) ) { FT_Size_Metrics* metrics = &face->size->metrics; @@ -739,11 +742,30 @@ renderer, slot, &internal->transform_matrix, &internal->transform_delta ); + else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) + { + /* apply `standard' transformation if no renderer is available */ + if ( &internal->transform_matrix ) + FT_Outline_Transform( &slot->outline, + &internal->transform_matrix ); + + if ( &internal->transform_delta ) + FT_Outline_Translate( &slot->outline, + internal->transform_delta.x, + internal->transform_delta.y ); + } + /* transform advance */ FT_Vector_Transform( &slot->advance, &internal->transform_matrix ); } } + FT_TRACE5(( " x advance: %d\n" , slot->advance.x )); + FT_TRACE5(( " y advance: %d\n" , slot->advance.y )); + + FT_TRACE5(( " linear x advance: %d\n" , slot->linearHoriAdvance )); + FT_TRACE5(( " linear y advance: %d\n" , slot->linearVertAdvance )); + /* do we need to render the image now? */ if ( !error && slot->format != FT_GLYPH_FORMAT_BITMAP && Modified: haiku/trunk/src/libs/freetype2/base/ftoutln.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftoutln.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftoutln.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,7 @@ /* */ /* FreeType outline management (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -304,9 +304,9 @@ *anoutline = null_outline; - if ( FT_NEW_ARRAY( anoutline->points, numPoints * 2L ) || - FT_NEW_ARRAY( anoutline->tags, numPoints ) || - FT_NEW_ARRAY( anoutline->contours, numContours ) ) + if ( FT_NEW_ARRAY( anoutline->points, numPoints ) || + FT_NEW_ARRAY( anoutline->tags, numPoints ) || + FT_NEW_ARRAY( anoutline->contours, numContours ) ) goto Fail; anoutline->n_points = (FT_UShort)numPoints; Modified: haiku/trunk/src/libs/freetype2/base/ftpatent.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftpatent.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftpatent.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -5,7 +5,7 @@ /* FreeType API for checking patented TrueType bytecode instructions */ /* (body). */ /* */ -/* Copyright 2007, 2008 by David Turner. */ +/* Copyright 2007, 2008, 2010 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 */ @@ -114,7 +114,7 @@ FT_ULong tag ) { FT_Stream stream = face->stream; - FT_Error error = FT_Err_Ok; + FT_Error error = FT_Err_Ok; FT_Service_SFNT_Table service; FT_Bool result = FALSE; @@ -124,13 +124,14 @@ if ( service ) { FT_UInt i = 0; - FT_ULong tag_i = 0, offset_i, length_i; + FT_ULong tag_i = 0, offset_i = 0, length_i = 0; + for ( i = 0; !error && tag_i != tag ; i++ ) error = service->table_info( face, i, &tag_i, &offset_i, &length_i ); - if ( error || + if ( error || FT_STREAM_SEEK( offset_i ) ) goto Exit; Modified: haiku/trunk/src/libs/freetype2/base/ftstroke.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftstroke.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftstroke.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,7 @@ /* */ /* FreeType path stroker (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -979,7 +979,8 @@ thcos = FT_Cos( theta ); sigma = FT_MulFix( stroker->miter_limit, thcos ); - if ( sigma >= 0x10000L ) + /* FT_Sin(x) = 0 for x <= 57 */ + if ( sigma >= 0x10000L || ft_pos_abs( theta ) <= 57 ) miter = FALSE; if ( miter ) /* this is a miter (broken angle) */ @@ -1360,7 +1361,7 @@ phi1 = (angle_mid + angle_in ) / 2; phi2 = (angle_mid + angle_out ) / 2; length1 = FT_DivFix( stroker->radius, FT_Cos( theta1 ) ); - length2 = FT_DivFix( stroker->radius, FT_Cos(theta2) ); + length2 = FT_DivFix( stroker->radius, FT_Cos( theta2 ) ); for ( side = 0; side <= 1; side++ ) { @@ -1735,13 +1736,10 @@ } else { - /* if both first and last points are conic, */ - /* start at their middle and record its position */ - /* for closure */ + /* if both first and last points are conic, */ + /* start at their middle */ v_start.x = ( v_start.x + v_last.x ) / 2; v_start.y = ( v_start.y + v_last.y ) / 2; - - v_last = v_start; } point--; tags--; Modified: haiku/trunk/src/libs/freetype2/base/ftsynth.c =================================================================== --- haiku/trunk/src/libs/freetype2/base/ftsynth.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/base/ftsynth.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,7 @@ /* */ /* FreeType synthesizing code for emboldening and slanting (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -100,8 +100,8 @@ if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { - error = FT_Outline_Embolden( &slot->outline, xstr ); /* ignore error */ + (void)FT_Outline_Embolden( &slot->outline, xstr ); /* this is more than enough for most glyphs; if you need accurate */ /* values, you have to call FT_Outline_Get_CBox */ Modified: haiku/trunk/src/libs/freetype2/cache/ftcglyph.c =================================================================== --- haiku/trunk/src/libs/freetype2/cache/ftcglyph.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/cache/ftcglyph.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -71,8 +71,8 @@ FT_UNUSED( cache ); - return FT_BOOL( gnode->family == gquery->family && - gnode->gindex == gquery->gindex ); + return FT_BOOL( gnode->family == gquery->family && + gnode->gindex == gquery->gindex ); } Modified: haiku/trunk/src/libs/freetype2/cff/cffdrivr.c =================================================================== --- haiku/trunk/src/libs/freetype2/cff/cffdrivr.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/cff/cffdrivr.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -621,14 +621,15 @@ { FT_Module sfnt; FT_Module_Interface result; - FT_Library library = driver->library; - FT_UNUSED(library); result = ft_service_list_lookup( FT_CFF_SERVICES_GET, module_interface ); if ( result != NULL ) return result; + if ( !driver ) + return NULL; + /* we pass our request to the `sfnt' module */ sfnt = FT_Get_Module( driver->library, "sfnt" ); Modified: haiku/trunk/src/libs/freetype2/cff/cffgload.c =================================================================== --- haiku/trunk/src/libs/freetype2/cff/cffgload.c 2010-02-21 20:03:52 UTC (rev 35565) +++ haiku/trunk/src/libs/freetype2/cff/cffgload.c 2010-02-21 20:08:50 UTC (rev 35566) @@ -4,7 +4,8 @@ /* */ /* OpenType Glyph Loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ +/* 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -113,6 +114,9 @@ cff_op_closepath, cff_op_callothersubr, cff_op_pop, + cff_op_seac, + cff_op_sbw, + cff_op_setcurrentpoint, /* do not remove */ cff_op_max @@ -201,7 +205,10 @@ 2, /* hsbw */ 0, 0, - 0 + 0, + 5, /* seac */ + 4, /* sbw */ + 2 /* setcurrentpoint */ }; @@ -319,17 +326,23 @@ /* subroutines. */ /* */ /* <Input> */ - /* num_subrs :: The number of glyph subroutines. */ + /* in_charstring_type :: The `CharstringType' value of the top DICT */ + /* dictionary. */ /* */ + /* num_subrs :: The number of glyph subroutines. */ + /* */ /* <Return> */ /* The bias value. */ static FT_Int - cff_compute_bias( FT_UInt num_subrs ) + cff_compute_bias( FT_Int in_charstring_type, + FT_UInt num_subrs ) { FT_Int result; - if ( num_subrs < 1240 ) + if ( in_charstring_type == 1 ) + result = 0; + else if ( num_subrs < 1240 ) result = 107; else if ( num_subrs < 33900U ) result = 1131; @@ -380,9 +393,12 @@ cff_builder_init( &decoder->builder, face, size, slot, hinting ); /* initialize Type2 decoder */ + decoder->cff = cff; decoder->num_globals = cff->num_global_subrs; decoder->globals = cff->global_subrs; - decoder->globals_bias = cff_compute_bias( decoder->num_globals ); + decoder->globals_bias = cff_compute_bias( + cff->top_font.font_dict.charstring_type, + decoder->num_globals ); decoder->hint_mode = hint_mode; } @@ -434,7 +450,9 @@ decoder->num_locals = sub->num_local_subrs; decoder->locals = sub->local_subrs; - decoder->locals_bias = cff_compute_bias( decoder->num_locals ); + decoder->locals_bias = cff_compute_bias( + decoder->cff->top_font.font_dict.charstring_type, + decoder->num_locals ); decoder->glyph_width = sub->private_dict.default_width; decoder->nominal_width = sub->private_dict.nominal_width; @@ -677,7 +695,7 @@ data.length = length; face->root.internal->incremental_interface->funcs->free_glyph_data( - face->root.internal->incremental_interface->object,&data ); + face->root.internal->incremental_interface->object, &data ); } else #endif /* FT_CONFIG_OPTION_INCREMENTAL */ @@ -693,6 +711,7 @@ static FT_Error cff_operator_seac( CFF_Decoder* decoder, + FT_Pos asb, FT_Pos adx, FT_Pos ady, FT_Int bchar, @@ -705,6 +724,7 @@ FT_Vector left_bearing, advance; FT_Byte* charstring; FT_ULong charstring_len; + FT_Pos glyph_width; if ( decoder->seac ) @@ -713,6 +733,9 @@ return CFF_Err_Syntax_Error; } + adx += decoder->builder.left_bearing.x; + ady += decoder->builder.left_bearing.y; + #ifdef FT_CONFIG_OPTION_INCREMENTAL /* Incremental fonts don't necessarily have valid charsets. */ /* They use the character code, not the glyph index, in this case. */ @@ -795,16 +818,17 @@ cff_free_glyph_data( face, &charstring, charstring_len ); } - /* Save the left bearing and width of the base character */ - /* as they will be erased by the next load. */ + /* Save the left bearing, advance and glyph width of the base */ + /* character as they will be erased by the next load. */ left_bearing = builder->left_bearing; advance = builder->advance; + glyph_width = decoder->glyph_width; builder->left_bearing.x = 0; builder->left_bearing.y = 0; - builder->pos_x = adx; + builder->pos_x = adx - asb; builder->pos_y = ady; /* Now load `achar' on top of the base outline. */ @@ -824,10 +848,11 @@ cff_free_glyph_data( face, &charstring, charstring_len ); } - /* Restore the left side bearing and advance width */ - /* of the base character. */ + /* Restore the left side bearing, advance and glyph width */ + /* of the base character. */ builder->left_bearing = left_bearing; builder->advance = advance; + decoder->glyph_width = glyph_width; builder->pos_x = 0; builder->pos_y = 0; @@ -869,6 +894,8 @@ FT_Pos x, y; FT_Fixed seed; FT_Fixed* stack; + FT_Int charstring_type = + decoder->cff->top_font.font_dict.charstring_type; T2_Hints_Funcs hinter; [... truncated: 1296 lines follow ...]