Author: korli Date: 2010-08-07 01:01:05 +0200 (Sat, 07 Aug 2010) New Revision: 37947 Changeset: http://dev.haiku-os.org/changeset/37947 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/ftcache.h haiku/trunk/headers/libs/freetype2/freetype/fterrdef.h haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h haiku/trunk/headers/libs/freetype2/freetype/ftlist.h haiku/trunk/headers/libs/freetype2/freetype/ftmodapi.h haiku/trunk/headers/libs/freetype2/freetype/ftrender.h haiku/trunk/headers/libs/freetype2/freetype/ftsystem.h haiku/trunk/headers/libs/freetype2/freetype/internal/ftmemory.h haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h haiku/trunk/headers/libs/freetype2/freetype/ttnameid.h haiku/trunk/headers/libs/freetype2/freetype/tttables.h haiku/trunk/src/libs/freetype2/autofit/afcjk.c haiku/trunk/src/libs/freetype2/autofit/afglobal.c haiku/trunk/src/libs/freetype2/autofit/afhints.c haiku/trunk/src/libs/freetype2/autofit/afhints.h haiku/trunk/src/libs/freetype2/autofit/aflatin.c haiku/trunk/src/libs/freetype2/autofit/aflatin2.c haiku/trunk/src/libs/freetype2/autofit/afpic.c haiku/trunk/src/libs/freetype2/base/ftgloadr.c haiku/trunk/src/libs/freetype2/base/ftglyph.c haiku/trunk/src/libs/freetype2/base/ftgxval.c haiku/trunk/src/libs/freetype2/base/ftinit.c haiku/trunk/src/libs/freetype2/base/ftlcdfil.c haiku/trunk/src/libs/freetype2/base/ftobjs.c haiku/trunk/src/libs/freetype2/base/ftotval.c haiku/trunk/src/libs/freetype2/base/ftoutln.c haiku/trunk/src/libs/freetype2/base/ftpfr.c haiku/trunk/src/libs/freetype2/base/ftrfork.c haiku/trunk/src/libs/freetype2/base/ftstream.c haiku/trunk/src/libs/freetype2/base/ftsystem.c haiku/trunk/src/libs/freetype2/bdf/bdfdrivr.c haiku/trunk/src/libs/freetype2/bdf/bdflib.c haiku/trunk/src/libs/freetype2/cache/ftcbasic.c haiku/trunk/src/libs/freetype2/cache/ftccache.c haiku/trunk/src/libs/freetype2/cache/ftccache.h haiku/trunk/src/libs/freetype2/cache/ftccmap.c haiku/trunk/src/libs/freetype2/cache/ftcimage.c haiku/trunk/src/libs/freetype2/cache/ftcmanag.c haiku/trunk/src/libs/freetype2/cache/ftcmru.h haiku/trunk/src/libs/freetype2/cache/ftcsbits.c haiku/trunk/src/libs/freetype2/cff/cffcmap.c haiku/trunk/src/libs/freetype2/cff/cffdrivr.c haiku/trunk/src/libs/freetype2/cff/cffgload.c haiku/trunk/src/libs/freetype2/cff/cffload.c haiku/trunk/src/libs/freetype2/cff/cffload.h haiku/trunk/src/libs/freetype2/cff/cffobjs.c haiku/trunk/src/libs/freetype2/cff/cffparse.c haiku/trunk/src/libs/freetype2/cff/cffpic.c haiku/trunk/src/libs/freetype2/cff/cfftypes.h haiku/trunk/src/libs/freetype2/cid/cidobjs.c haiku/trunk/src/libs/freetype2/gzip/ftgzip.c haiku/trunk/src/libs/freetype2/lzw/ftlzw.c haiku/trunk/src/libs/freetype2/otvalid/otvmath.c haiku/trunk/src/libs/freetype2/otvalid/otvmod.c haiku/trunk/src/libs/freetype2/pcf/pcfdrivr.c haiku/trunk/src/libs/freetype2/pcf/pcfread.c haiku/trunk/src/libs/freetype2/pfr/pfrdrivr.c haiku/trunk/src/libs/freetype2/pfr/pfrgload.c haiku/trunk/src/libs/freetype2/pfr/pfrload.c haiku/trunk/src/libs/freetype2/pfr/pfrobjs.c haiku/trunk/src/libs/freetype2/pfr/pfrsbit.c haiku/trunk/src/libs/freetype2/psaux/afmparse.c haiku/trunk/src/libs/freetype2/psaux/afmparse.h haiku/trunk/src/libs/freetype2/psaux/psobjs.c haiku/trunk/src/libs/freetype2/psaux/t1decode.c haiku/trunk/src/libs/freetype2/pshinter/pshalgo.c haiku/trunk/src/libs/freetype2/pshinter/pshglob.c haiku/trunk/src/libs/freetype2/pshinter/pshpic.c haiku/trunk/src/libs/freetype2/psnames/psmodule.c haiku/trunk/src/libs/freetype2/psnames/pspic.c haiku/trunk/src/libs/freetype2/raster/ftmisc.h haiku/trunk/src/libs/freetype2/raster/ftraster.c haiku/trunk/src/libs/freetype2/raster/rastpic.c haiku/trunk/src/libs/freetype2/sfnt/sfdriver.c haiku/trunk/src/libs/freetype2/sfnt/sfntpic.c haiku/trunk/src/libs/freetype2/sfnt/sfobjs.c haiku/trunk/src/libs/freetype2/sfnt/ttbdf.c haiku/trunk/src/libs/freetype2/sfnt/ttcmap.c haiku/trunk/src/libs/freetype2/sfnt/ttkern.c haiku/trunk/src/libs/freetype2/sfnt/ttload.c haiku/trunk/src/libs/freetype2/sfnt/ttsbit.c haiku/trunk/src/libs/freetype2/smooth/ftgrays.c haiku/trunk/src/libs/freetype2/smooth/ftsmooth.c haiku/trunk/src/libs/freetype2/smooth/ftspic.c haiku/trunk/src/libs/freetype2/truetype/ttgload.c haiku/trunk/src/libs/freetype2/truetype/ttgxvar.c haiku/trunk/src/libs/freetype2/truetype/ttinterp.c haiku/trunk/src/libs/freetype2/truetype/ttinterp.h haiku/trunk/src/libs/freetype2/truetype/ttpic.c haiku/trunk/src/libs/freetype2/type1/t1afm.c haiku/trunk/src/libs/freetype2/type1/t1objs.c haiku/trunk/src/libs/freetype2/type42/t42objs.c haiku/trunk/src/libs/freetype2/type42/t42parse.c haiku/trunk/src/libs/freetype2/winfonts/winfnt.c Log: merged freetype 2.4.2 Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftconfig.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/config/ftconfig.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/config/ftconfig.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -363,7 +363,7 @@ #endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ -#if defined( i386 ) +#if defined( __i386__ ) #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 /* documentation is in freetype.h */ Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -489,8 +489,7 @@ /*************************************************************************/ /* */ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ - /* a bytecode interpreter in the TrueType driver. Note that there are */ - /* important patent issues related to the use of the interpreter. */ + /* a bytecode interpreter in the TrueType driver. */ /* */ /* By undefining this, you will only compile the code necessary to load */ /* TrueType glyphs without hinting. */ @@ -504,10 +503,13 @@ /* */ /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ /* of the TrueType bytecode interpreter is used that doesn't implement */ - /* any of the patented opcodes and algorithms. Note that the */ - /* TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you define */ - /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, either define */ - /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ + /* any of the patented opcodes and algorithms. The patents related to */ + /* TrueType hinting have expired worldwide since May 2010; this option */ + /* is now deprecated. */ + /* */ + /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */ + /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */ + /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ /* */ /* This macro is only useful for a small number of font files (mostly */ @@ -544,7 +546,7 @@ /* ... */ /* } */ /* */ -#define TT_CONFIG_OPTION_UNPATENTED_HINTING +/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ /*************************************************************************/ @@ -691,6 +693,27 @@ /* + * To detect legacy cache-lookup call from a rogue client (<= 2.1.7), + * we restrict the number of charmaps in a font. The current API of + * FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API + * takes charcode only. To determine the passed value is for cmap_index + * or charcode, the possible cmap_index is restricted not to exceed + * the minimum possible charcode by a rogue client. It is also very + * unlikely that a rogue client is interested in Unicode values 0 to 15. + * + * NOTE: The original threshold was 4 deduced from popular number of + * cmap subtables in UCS-4 TrueType fonts, but now it is not + * irregular for OpenType fonts to have more than 4 subtables, + * because variation selector subtables are available for Apple + * and Microsoft platforms. + */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS +#define FT_MAX_CHARMAP_CACHEABLE 15 +#endif + + + /* * This macro is defined if either unpatented or native TrueType * hinting is requested by the definitions above. */ Modified: haiku/trunk/headers/libs/freetype2/freetype/freetype.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/freetype.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/freetype.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -1952,6 +1952,9 @@ /* Each new face object created with this function also owns a */ /* default @FT_Size object, accessible as `face->size'. */ /* */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Face. */ + /* */ FT_EXPORT( FT_Error ) FT_Open_Face( FT_Library library, const FT_Open_Args* args, @@ -2019,6 +2022,33 @@ /*************************************************************************/ /* */ /* <Function> */ + /* FT_Reference_Face */ + /* */ + /* <Description> */ + /* A counter gets initialized to~1 at the time an @FT_Face structure */ + /* is created. This function increments the counter. @FT_Done_Face */ + /* then only destroys a face if the counter is~1, otherwise it simply */ + /* decrements the counter. */ + /* */ + /* This function helps in managing life-cycles of structures which */ + /* reference @FT_Face objects. */ + /* */ + /* <Input> */ + /* face :: A handle to a target face object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0~means success. */ + /* */ + /* <Since> */ + /* 2.4.2 */ + /* */ + FT_EXPORT( FT_Error ) + FT_Reference_Face( FT_Face face ); + + + /*************************************************************************/ + /* */ + /* <Function> */ /* FT_Done_Face */ /* */ /* <Description> */ @@ -2031,6 +2061,10 @@ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ + /* <Note> */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Face. */ + /* */ FT_EXPORT( FT_Error ) FT_Done_Face( FT_Face face ); @@ -2997,7 +3031,7 @@ * * @return: * The index into the array of character maps within the face to which - * `charmap' belongs. + * `charmap' belongs. If an error occurs, -1 is returned. * */ FT_EXPORT( FT_Int ) @@ -3773,8 +3807,8 @@ * */ #define FREETYPE_MAJOR 2 -#define FREETYPE_MINOR 3 -#define FREETYPE_PATCH 12 +#define FREETYPE_MINOR 4 +#define FREETYPE_PATCH 2 /*************************************************************************/ @@ -3834,6 +3868,9 @@ /* 1~if this is a TrueType font that uses one of the patented */ /* opcodes, 0~otherwise. */ /* */ + /* <Note> */ + /* Since May 2010, TrueType hinting is no longer patented. */ + /* */ /* <Since> */ /* 2.3.5 */ /* */ @@ -3861,6 +3898,9 @@ /* an SFNT font, or if the unpatented hinter is not compiled in this */ /* instance of the library. */ /* */ + /* <Note> */ + /* Since May 2010, TrueType hinting is no longer patented. */ + /* */ /* <Since> */ /* 2.3.5 */ /* */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftcache.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftcache.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/ftcache.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* FreeType Cache subsystem (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -263,10 +263,10 @@ /* reference-counted. A node with a count of~0 might be flushed */ /* out of a full cache whenever a lookup request is performed. */ /* */ - /* If you lookup nodes, you have the ability to `acquire' them, i.e., */ - /* to increment their reference count. This will prevent the node */ - /* from being flushed out of the cache until you explicitly `release' */ - /* it (see @FTC_Node_Unref). */ + /* If you look up nodes, you have the ability to `acquire' them, */ + /* i.e., to increment their reference count. This will prevent the */ + /* node from being flushed out of the cache until you explicitly */ + /* `release' it (see @FTC_Node_Unref). */ /* */ /* See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup. */ /* */ Modified: haiku/trunk/headers/libs/freetype2/freetype/fterrdef.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/fterrdef.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/fterrdef.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* FreeType error codes (specification). */ /* */ -/* Copyright 2002, 2004, 2006, 2007 by */ +/* Copyright 2002, 2004, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -211,7 +211,10 @@ "argument stack underflow" ) FT_ERRORDEF_( Ignore, 0xA2, \ "ignore" ) + FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \ + "no Unicode glyph name found" ) + /* BDF errors */ FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \ @@ -220,19 +223,21 @@ "`FONT' field missing" ) FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ "`SIZE' field missing" ) - FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \ + FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \ + "`FONTBOUNDINGBOX' field missing" ) + FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \ "`CHARS' field missing" ) - FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \ + FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \ "`STARTCHAR' field missing" ) - FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \ + FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \ "`ENCODING' field missing" ) - FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \ + FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \ "`BBX' field missing" ) - FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \ + FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \ "`BBX' too big" ) - FT_ERRORDEF_( Corrupted_Font_Header, 0xB8, \ + FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \ "Font header corrupted or missing fields" ) - FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xB9, \ + FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \ "Font glyphs corrupted or missing fields" ) Modified: haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -5,7 +5,7 @@ /* FreeType API for color filtering of subpixel bitmap glyphs */ /* (specification). */ /* */ -/* Copyright 2006, 2007, 2008 by */ +/* Copyright 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, */ @@ -58,7 +58,7 @@ /**************************************************************************** * - * @func: + * @enum: * FT_LcdFilter * * @description: @@ -161,6 +161,47 @@ FT_Library_SetLcdFilter( FT_Library library, FT_LcdFilter filter ); + + /************************************************************************** + * + * @func: + * FT_Library_SetLcdFilterWeights + * + * @description: + * Use this function to override the filter weights selected by + * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple + * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, + * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and + * FT_LCD_FILTER_LEGACY. + * + * @input: + * library :: + * A handle to the target library instance. + * + * weights :: + * A pointer to an array; the function copies the first five bytes and + * uses them to specify the filter weights. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * Due to *PATENTS* covering subpixel rendering, this function doesn't + * do anything except returning `FT_Err_Unimplemented_Feature' if the + * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not + * defined in your build of the library, which should correspond to all + * default builds of FreeType. + * + * This function must be called after @FT_Library_SetLcdFilter to have + * any effect. + * + * @since: + * 2.4.0 + */ + FT_EXPORT( FT_Error ) + FT_Library_SetLcdFilterWeights( FT_Library library, + unsigned char *weights ); + /* */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftlist.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftlist.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/ftlist.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* Generic list support for FreeType (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2007 by */ +/* Copyright 1996-2001, 2003, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -255,6 +255,10 @@ /* user :: A user-supplied field which is passed as the last */ /* argument to the destructor. */ /* */ + /* <Note> */ + /* This function expects that all nodes added by @FT_List_Add or */ + /* @FT_List_Insert have been dynamically allocated. */ + /* */ FT_EXPORT( void ) FT_List_Finalize( FT_List list, FT_List_Destructor destroy, Modified: haiku/trunk/headers/libs/freetype2/freetype/ftmodapi.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftmodapi.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/ftmodapi.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* FreeType modules public interface (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 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, */ @@ -252,6 +252,33 @@ /*************************************************************************/ /* */ /* <Function> */ + /* FT_Reference_Library */ + /* */ + /* <Description> */ + /* A counter gets initialized to~1 at the time an @FT_Library */ + /* structure is created. This function increments the counter. */ + /* @FT_Done_Library then only destroys a library if the counter is~1, */ + /* otherwise it simply decrements the counter. */ + /* */ + /* This function helps in managing life-cycles of structures which */ + /* reference @FT_Library objects. */ + /* */ + /* <Input> */ + /* library :: A handle to a target library object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0~means success. */ + /* */ + /* <Since> */ + /* 2.4.2 */ + /* */ + FT_EXPORT( FT_Error ) + FT_Reference_Library( FT_Library library ); + + + /*************************************************************************/ + /* */ + /* <Function> */ /* FT_New_Library */ /* */ /* <Description> */ @@ -263,6 +290,9 @@ /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ /* instead of @FT_Init_FreeType to initialize the FreeType library. */ /* */ + /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ + /* library instance. */ + /* */ /* <Input> */ /* memory :: A handle to the original memory object. */ /* */ @@ -272,6 +302,10 @@ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ + /* <Note> */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Library. */ + /* */ FT_EXPORT( FT_Error ) FT_New_Library( FT_Memory memory, FT_Library *alibrary ); @@ -292,6 +326,10 @@ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ + /* <Note> */ + /* See the discussion of reference counters in the description of */ + /* @FT_Reference_Library. */ + /* */ FT_EXPORT( FT_Error ) FT_Done_Library( FT_Library library ); @@ -394,8 +432,8 @@ * * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: * The library implements a bytecode interpreter that covers - * the full instruction set of the TrueType virtual machine. - * See the file `docs/PATENTS' for legal aspects. + * the full instruction set of the TrueType virtual machine (this + * was governed by patents until May 2010, hence the name). * * @since: * 2.2 Modified: haiku/trunk/headers/libs/freetype2/freetype/ftrender.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftrender.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/ftrender.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* FreeType renderer modules public interface (specification). */ /* */ -/* Copyright 1996-2001, 2005, 2006 by */ +/* Copyright 1996-2001, 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -141,10 +141,6 @@ /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ /* This is a pointer to its raster's class. */ /* */ - /* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ - /* This is a pointer to the corresponding raster */ - /* object, if any. */ - /* */ typedef struct FT_Renderer_Class_ { FT_Module_Class root; Modified: haiku/trunk/headers/libs/freetype2/freetype/ftsystem.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftsystem.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/ftsystem.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* FreeType low-level system interface definition (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2005 by */ +/* Copyright 1996-2001, 2002, 2005, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -240,7 +240,8 @@ * * @note: * This function might be called to perform a seek or skip operation - * with a `count' of~0. + * with a `count' of~0. A non-zero return value then indicates an + * error. * */ typedef unsigned long @@ -301,7 +302,7 @@ * The stream's input function. * * close :: - * The stream;s close function. + * The stream's close function. * * memory :: * The memory manager to use to preload frames. This is set Modified: haiku/trunk/headers/libs/freetype2/freetype/internal/ftmemory.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/internal/ftmemory.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/internal/ftmemory.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* The FreeType memory management macros (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,15 +58,27 @@ /* - * C++ refuses to handle statements like p = (void*)anything; where `p' - * is a typed pointer. Since we don't have a `typeof' operator in - * standard C++, we have to use ugly casts. + * C++ refuses to handle statements like p = (void*)anything, with `p' a + * typed pointer. Since we don't have a `typeof' operator in standard + * C++, we have to use a template to emulate it. */ #ifdef __cplusplus -#define FT_ASSIGNP( p, val ) *((void**)&(p)) = (val) + + extern "C++" + template <typename T> inline T* + cplusplus_typeof( T*, + void *v ) + { + return static_cast <T*> ( v ); + } + +#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) ) + #else + #define FT_ASSIGNP( p, val ) (p) = (val) + #endif Modified: haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -311,6 +311,12 @@ /* in the case when the unpatented hinter is compiled within the */ /* library. */ /* */ + /* refcount :: */ + /* A counter initialized to~1 at the time an @FT_Face structure is */ + /* created. @FT_Reference_Face increments this counter, and */ + /* @FT_Done_Face only destroys a face if the counter is~1, */ + /* otherwise it simply decrements it. */ + /* */ typedef struct FT_Face_InternalRec_ { #ifdef FT_CONFIG_OPTION_OLD_INTERNALS @@ -328,6 +334,7 @@ #endif FT_Bool ignore_unpatented_hinter; + FT_UInt refcount; } FT_Face_InternalRec; @@ -805,10 +812,28 @@ /* */ /* debug_hooks :: XXX */ /* */ + /* lcd_filter :: If subpixel rendering is activated, the */ + /* selected LCD filter mode. */ + /* */ + /* lcd_extra :: If subpixel rendering is activated, the number */ + /* of extra pixels needed for the LCD filter. */ + /* */ + /* lcd_weights :: If subpixel rendering is activated, the LCD */ + /* filter weights, if any. */ + /* */ + /* lcd_filter_func :: If subpixel rendering is activated, the LCD */ + /* filtering callback function. */ + /* */ /* pic_container :: Contains global structs and tables, instead */ /* of defining them globallly. */ /* */ - + /* refcount :: A counter initialized to~1 at the time an */ + /* @FT_Library structure is created. */ + /* @FT_Reference_Library increments this counter, */ + /* and @FT_Done_Library only destroys a library */ + /* if the counter is~1, otherwise it simply */ + /* decrements it. */ + /* */ typedef struct FT_LibraryRec_ { FT_Memory memory; /* library's memory manager */ @@ -843,6 +868,8 @@ FT_PIC_Container pic_container; #endif + FT_UInt refcount; + } FT_LibraryRec; Modified: haiku/trunk/headers/libs/freetype2/freetype/ttnameid.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ttnameid.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/ttnameid.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -64,7 +64,7 @@ * MacOS systems (even if they contain a Microsoft charmap as well). * * TT_PLATFORM_ISO :: - * This value was used to specify Unicode charmaps. It is however + * This value was used to specify ISO/IEC 10646 charmaps. It is however * now deprecated. See @TT_ISO_ID_XXX for a list of corresponding * `encoding_id' values. * Modified: haiku/trunk/headers/libs/freetype2/freetype/tttables.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/tttables.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/headers/libs/freetype2/freetype/tttables.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -5,7 +5,7 @@ /* Basic SFNT/TrueType tables definitions and interface */ /* (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -557,13 +557,13 @@ /* */ typedef enum FT_Sfnt_Tag_ { - ft_sfnt_head = 0, - ft_sfnt_maxp = 1, - ft_sfnt_os2 = 2, - ft_sfnt_hhea = 3, - ft_sfnt_vhea = 4, - ft_sfnt_post = 5, - ft_sfnt_pclt = 6, + ft_sfnt_head = 0, /* TT_Header */ + ft_sfnt_maxp = 1, /* TT_MaxProfile */ + ft_sfnt_os2 = 2, /* TT_OS2 */ + ft_sfnt_hhea = 3, /* TT_HoriHeader */ + ft_sfnt_vhea = 4, /* TT_VertHeader */ + ft_sfnt_post = 5, /* TT_Postscript */ + ft_sfnt_pclt = 6, /* TT_PCLT */ sfnt_max /* internal end mark */ @@ -590,6 +590,9 @@ /* error, or if the corresponding table was not found *OR* loaded */ /* from the file. */ /* */ + /* Use a typecast according to `tag' to access the structure */ + /* elements. */ + /* */ /* <Note> */ /* The table is owned by the face object and disappears with it. */ /* */ Modified: haiku/trunk/src/libs/freetype2/autofit/afcjk.c =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/afcjk.c 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/src/libs/freetype2/autofit/afcjk.c 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (body). */ /* */ -/* Copyright 2006, 2007, 2008, 2009 by */ +/* Copyright 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, */ @@ -1371,7 +1371,7 @@ FT_UNUSED( metrics ); - error = af_glyph_hints_reload( hints, outline, 0 ); + error = af_glyph_hints_reload( hints, outline ); if ( error ) goto Exit; Modified: haiku/trunk/src/libs/freetype2/autofit/afglobal.c =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/afglobal.c 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/src/libs/freetype2/autofit/afglobal.c 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter routines to compute global hinting values (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 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, */ @@ -167,8 +167,11 @@ for ( nn = 0; nn < globals->glyph_count; nn++ ) { - if ( gscripts[nn] == AF_SCRIPT_LIST_NONE ) - gscripts[nn] = AF_SCRIPT_LIST_DEFAULT; + if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_LIST_NONE ) + { + gscripts[nn] &= ~AF_SCRIPT_LIST_NONE; + gscripts[nn] |= AF_SCRIPT_LIST_DEFAULT; + } } } @@ -183,7 +186,7 @@ { FT_Error error; FT_Memory memory; - AF_FaceGlobals globals; + AF_FaceGlobals globals = NULL; memory = face->memory; Modified: haiku/trunk/src/libs/freetype2/autofit/afhints.c =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/afhints.c 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/src/libs/freetype2/autofit/afhints.c 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -377,120 +377,6 @@ } - /* compute all inflex points in a given glyph */ - - static void - af_glyph_hints_compute_inflections( AF_GlyphHints hints ) - { - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - - - /* do each contour separately */ - for ( ; contour < contour_limit; contour++ ) - { - AF_Point point = contour[0]; - AF_Point first = point; - AF_Point start = point; - AF_Point end = point; - AF_Point before; - AF_Point after; - FT_Pos in_x, in_y, out_x, out_y; - AF_Angle orient_prev, orient_cur; - FT_Int finished = 0; - - - /* compute first segment in contour */ - first = point; - - start = end = first; - do - { - end = end->next; - if ( end == first ) - goto Skip; - - in_x = end->fx - start->fx; - in_y = end->fy - start->fy; - - } while ( in_x == 0 && in_y == 0 ); - - /* extend the segment start whenever possible */ - before = start; - do - { - do - { - start = before; - before = before->prev; - if ( before == first ) - goto Skip; - - out_x = start->fx - before->fx; - out_y = start->fy - before->fy; - - } while ( out_x == 0 && out_y == 0 ); - - orient_prev = ft_corner_orientation( in_x, in_y, out_x, out_y ); - - } while ( orient_prev == 0 ); - - first = start; - - in_x = out_x; - in_y = out_y; - - /* now process all segments in the contour */ - do - { - /* first, extend current segment's end whenever possible */ - after = end; - do - { - do - { - end = after; - after = after->next; - if ( after == first ) - finished = 1; - - out_x = after->fx - end->fx; - out_y = after->fy - end->fy; - - } while ( out_x == 0 && out_y == 0 ); - - orient_cur = ft_corner_orientation( in_x, in_y, out_x, out_y ); - - } while ( orient_cur == 0 ); - - if ( ( orient_prev + orient_cur ) == 0 ) - { - /* we have an inflection point here */ - do - { - start->flags |= AF_FLAG_INFLECTION; - start = start->next; - - } while ( start != end ); - - start->flags |= AF_FLAG_INFLECTION; - } - - start = end; - end = after; - - orient_prev = orient_cur; - in_x = out_x; - in_y = out_y; - - } while ( !finished ); - - Skip: - ; - } - } - - FT_LOCAL_DEF( void ) af_glyph_hints_init( AF_GlyphHints hints, FT_Memory memory ) @@ -551,8 +437,7 @@ FT_LOCAL_DEF( FT_Error ) af_glyph_hints_reload( AF_GlyphHints hints, - FT_Outline* outline, - FT_Bool get_inflections ) + FT_Outline* outline ) { FT_Error error = AF_Err_Ok; AF_Point points; @@ -639,13 +524,11 @@ { FT_Vector* vec = outline->points; char* tag = outline->tags; - AF_Point first = points; AF_Point end = points + outline->contours[0]; AF_Point prev = end; FT_Int contour_index = 0; - FT_UNUSED( first ); for ( point = points; point < point_limit; point++, vec++, tag++ ) { point->fx = (FT_Short)vec->x; @@ -673,9 +556,8 @@ { if ( ++contour_index < outline->n_contours ) { - first = point + 1; - end = points + outline->contours[contour_index]; - prev = end; + end = points + outline->contours[contour_index]; + prev = end; } } } @@ -752,11 +634,6 @@ } } - /* compute inflection points -- */ - /* disabled due to no longer perceived benefits */ - if ( 0 && get_inflections ) - af_glyph_hints_compute_inflections( hints ); - Exit: return error; } Modified: haiku/trunk/src/libs/freetype2/autofit/afhints.h =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/afhints.h 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/src/libs/freetype2/autofit/afhints.h 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (specification). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 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, */ @@ -286,8 +286,7 @@ FT_LOCAL( FT_Error ) af_glyph_hints_reload( AF_GlyphHints hints, - FT_Outline* outline, - FT_Bool get_inflections ); + FT_Outline* outline ); FT_LOCAL( void ) af_glyph_hints_save( AF_GlyphHints hints, Modified: haiku/trunk/src/libs/freetype2/autofit/aflatin.c =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/aflatin.c 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/src/libs/freetype2/autofit/aflatin.c 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 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, */ @@ -77,7 +77,7 @@ af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy ); - error = af_glyph_hints_reload( hints, &face->glyph->outline, 0 ); + error = af_glyph_hints_reload( hints, &face->glyph->outline ); if ( error ) goto Exit; @@ -2105,7 +2105,7 @@ int dim; - error = af_glyph_hints_reload( hints, outline, 1 ); + error = af_glyph_hints_reload( hints, outline ); if ( error ) goto Exit; Modified: haiku/trunk/src/libs/freetype2/autofit/aflatin2.c =================================================================== --- haiku/trunk/src/libs/freetype2/autofit/aflatin2.c 2010-08-06 22:29:23 UTC (rev 37946) +++ haiku/trunk/src/libs/freetype2/autofit/aflatin2.c 2010-08-06 23:01:05 UTC (rev 37947) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ [... truncated: 5609 lines follow ...]