[FREETYPE]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 26 May 2010 11:30:35 +0000 (11:30 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 26 May 2010 11:30:35 +0000 (11:30 +0000)
Update to 2.3.12, conversion patch already applied

svn path=/trunk/; revision=47363

50 files changed:
reactos/lib/3rdparty/freetype/ChangeLog
reactos/lib/3rdparty/freetype/Jamfile
reactos/lib/3rdparty/freetype/README
reactos/lib/3rdparty/freetype/autogen.sh
reactos/lib/3rdparty/freetype/devel/ftoption.h
reactos/lib/3rdparty/freetype/include/freetype/config/ftconfig.h
reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h
reactos/lib/3rdparty/freetype/include/freetype/freetype.h
reactos/lib/3rdparty/freetype/include/freetype/ftglyph.h
reactos/lib/3rdparty/freetype/include/freetype/ftimage.h
reactos/lib/3rdparty/freetype/include/freetype/ftincrem.h
reactos/lib/3rdparty/freetype/include/freetype/ftoutln.h
reactos/lib/3rdparty/freetype/include/freetype/ftsnames.h
reactos/lib/3rdparty/freetype/src/autofit/aflatin.c
reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c
reactos/lib/3rdparty/freetype/src/base/ftbase.h
reactos/lib/3rdparty/freetype/src/base/ftbbox.c
reactos/lib/3rdparty/freetype/src/base/ftdbgmem.c
reactos/lib/3rdparty/freetype/src/base/ftglyph.c
reactos/lib/3rdparty/freetype/src/base/ftinit.c
reactos/lib/3rdparty/freetype/src/base/ftobjs.c
reactos/lib/3rdparty/freetype/src/base/ftoutln.c
reactos/lib/3rdparty/freetype/src/base/ftpatent.c
reactos/lib/3rdparty/freetype/src/base/ftstroke.c
reactos/lib/3rdparty/freetype/src/base/ftsynth.c
reactos/lib/3rdparty/freetype/src/cache/ftcglyph.c
reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c
reactos/lib/3rdparty/freetype/src/cff/cffgload.c
reactos/lib/3rdparty/freetype/src/cff/cffgload.h
reactos/lib/3rdparty/freetype/src/cff/cffobjs.c
reactos/lib/3rdparty/freetype/src/cff/cffparse.c
reactos/lib/3rdparty/freetype/src/cid/cidgload.c
reactos/lib/3rdparty/freetype/src/cid/cidobjs.c
reactos/lib/3rdparty/freetype/src/cid/cidtoken.h
reactos/lib/3rdparty/freetype/src/lzw/ftlzw.c
reactos/lib/3rdparty/freetype/src/pfr/pfrsbit.c
reactos/lib/3rdparty/freetype/src/psaux/t1decode.c
reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c
reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c
reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c
reactos/lib/3rdparty/freetype/src/sfnt/ttload.c
reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c
reactos/lib/3rdparty/freetype/src/tools/apinames.c
reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c
reactos/lib/3rdparty/freetype/src/truetype/ttgload.c
reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.c
reactos/lib/3rdparty/freetype/src/type1/t1afm.c
reactos/lib/3rdparty/freetype/src/type1/t1gload.c
reactos/lib/3rdparty/freetype/src/type1/t1objs.c
reactos/lib/3rdparty/freetype/src/type1/t1parse.c

index 0407890..83a7d53 100644 (file)
@@ -1,3 +1,461 @@
+2010-02-13  Werner Lemberg  <wl@gnu.org>
+
+       * Version 2.3.12 released.
+       ==========================
+
+
+       Tag sources with `VER-2-3-12'.
+
+       * docs/CHANGES: Updated.
+
+       * docs/VERSION.DLL: Update documentation and bump version number to
+       2.3.12.
+
+       * README, Jamfile (RefDoc),
+       builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
+       builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
+       builds/win32/visualc/freetype.dsp,
+       builds/win32/visualc/freetype.vcproj,
+       builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
+       builds/win32/visualce/freetype.vcproj,
+       builds/win32/visualce/index.html,
+       builds/wince/vc2005-ce/freetype.vcproj,
+       builds/wince/vc2005-ce/index.html,
+       builds/wince/vc2008-ce/freetype.vcproj,
+       builds/wince/vc2008-ce/index.html: s/2.3.11/2.3.12/, s/2311/2312/.
+
+       * include/freetype/freetype.h (FREETYPE_PATCH): Set to 12.
+
+       * builds/unix/configure.raw (version_info): Set to 10:0:4.
+
+2010-02-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Improve autotool version checking to work with beta releases.
+
+       * autogen.sh (check_tool_version): Improve the extraction of version
+       number from "tool --version" output.  Some beta releases of
+       autotools have extra strings before version number.
+
+2010-02-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix overallocating bug in FT_Outline_New_Internal().
+
+       * src/base/ftoutln.c (FT_Outline_New_Internal): The length of
+       FT_Outline->points[] should be numPoints, not 2 * numPoints.
+       Found by Paul Messmer, see
+       http://lists.gnu.org/archive/html/freetype-devel/2010-02/msg00003.html
+
+2010-02-10  Ken Sharp  <ken.sharp@artifex.com>
+
+       Really fix Savannah bug #28678 (part 2).
+
+       Since we consider `sbw' for the horizontal direction only, we still have
+       to synthesize vertical metrics if the user wants to use the vertical
+       writing direction.
+
+       * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
+       (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph):
+       Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is
+       set.
+
+2010-02-10  Ken Sharp  <ken.sharp@artifex.com>
+
+       Really fix Savannah bug #28678 (part 1).
+
+       After long discussion, we now consider the character width vector
+       (wx,wy) returned by the `sbw' Type 1 operator as being part of *one*
+       direction only.  For example, if you are using the horizontal
+       writing direction, you get the horizontal and vertical components of
+       the advance width for this direction.  Note that OpenType and CFF fonts
+       don't have such a vertical component; instead, the GPOS table can be
+       used to generate two-dimensional advance widths (but this isn't
+       handled by FreeType).
+
+       * include/freetype/ftincrem.h (FT_Incremental_MetricsRec): Add
+       `advance_v' field to hold the vertical component of the advance
+       value.
+
+       * src/truetype/ttgload.c (tt_get_metrics), src/cff/cffgload.c
+       (cff_slot_load), src/type1/t1gload.c
+       (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c
+       (cid_load_glyph): Use it.
+
+2010-02-08  Werner Lemberg  <wl@gnu.org>
+
+       * devel/ftoption.h [FT_CONFIG_OPTION_PIC]: Define.
+
+2010-02-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Prevent NULL pointer dereference passed to FT_Module_Requester.
+
+       * src/sfnt/sfdriver.c (sfnt_get_interface): Don't use `module'.
+       * src/psnames/psmodule.c (psnames_get_interface): Ditto.
+
+       * src/cff/cffdrivr.c (cff_get_interface): Check NULL `driver'.
+       * src/truetype/ttdriver.c (tt_get_interface): Ditto.
+
+2010-01-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Fix memory leaks in previous patch.
+
+       * src/sfnt/sfobjs.c (sfnt_load_face): Don't overwrite the strings
+       allocated for face->root.family_name and style_name.
+
+2010-01-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       New parameters for FT_Open_Face() to ignore preferred family names.
+
+       Preferred family names should be used for legacy systems that
+       can hold only a few faces (<= 4) for a family name. Suggested by
+       Andreas Heinrich.
+       http://lists.gnu.org/archive/html/freetype/2010-01/msg00001.html
+
+       * include/freetype/ftsnames.h (FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY,
+       FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY): Define.
+
+       * src/sfnt/sfobjs.h (sfnt_load_face): Check the arguments and
+       ignore preferred family and subfamily names if requested.
+
+2010-01-27  Ken Sharp  <ken.sharp@artifex.com>
+
+       Fix Savannah bug #28678.
+
+       * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
+       (cid_load_glyph): Handle vertical metrics correctly.
+
+       * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle
+       vertical metrics correctly.
+       (T1_Load_Glyph): Don't synthesize vertical metrics.
+
+2010-01-14  Werner Lemberg  <wl@gnu.org>
+
+       Make FT_Set_Transform work if no renderer is available.
+
+       * src/base/ftobjs.c (FT_Load_Glyph): Apply `standard' transformation
+       if no renderer is compiled into the library.
+
+2010-01-14  Werner Lemberg  <wl@gnu.org>
+
+       Fix compilation warning.
+
+       * src/base/ftbase.h: s/LOCAL_DEF/LOCAL/.
+       * src/base/ftobjc.s: Include ftbase.h conditionally.
+
+2010-01-11  Kwang Yul Seo  <skyul@company100.net>
+
+       Provide inline assembly code for RVCT compiler.
+       This is Savannah patch #7059.
+
+       * include/freetype/config/ftconfig.h (FT_MULFIX_ASSEMBLER,
+       FT_MulFix_arm) [__CC_ARM || __ARM_CC]: Define.
+
+2010-01-08  Ken Sharp  <ken.sharp@artifex.com>
+
+       Fix Savannah bug #28521.
+
+       Issue #28226 involved a work-around for a font which used the
+       `setcurrentpoint' operator in an invalid way; this operator is only
+       supposed to be used with the result of OtherSubrs, and the font used
+       it directly.  The supplied patch removed the block of code which
+       checked this usage entirely.
+
+       This turns out to be a Bad Thing.  If `setcurrentpoint' is being
+       used correctly it should reset the flex flag in the decoder.  If we
+       don't do this then the flag never gets reset and we omit any further
+       contours from the glyph (at least until we close the path or
+       similar).
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+       <op_setcurrentpoint>: Handle `flex_state' correctly.
+
+2010-01-05  Werner Lemberg  <wl@gnu.org>
+
+       Apply reports from clang static analyzer.
+
+       * src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c
+       (FT_Stroker_ParseOutline), src/base/ftsynth.c
+       (FT_GlyphSlot_Embolden): Remove dead code.
+
+       * src/base/ftpatent.c (_tt_check_patents_in_table): Initialize
+       `offset_i' and `length_i'.
+
+2010-01-05  Ralph Giles  <giles@ghostscript.com>
+
+       Enable the incremental font interface by default.
+
+       Ghostscript requires the incremental font interface for handling
+       some Postscript documents.  It is moving to using FreeType as its
+       primary renderer; supporting this in the default build makes it
+       Ghostscript to be linked against the system FreeType when one is
+       available.
+
+       * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_INCREMENTAL):
+       Uncomment.
+
+2010-01-05  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #28395.
+
+       * src/truetype/ttdriver.c (Load_Glyph), src/type1/t1gload.c
+       (T1_Loada_Glyph): Don't check `num_glyphs' if incremental interface
+       is used.
+
+2010-01-05  Ken Sharp  <ken.sharp@artifex.com>
+
+       Make Type 1 `seac' operator work with incremental interface.
+       This fixes Savannah bug #28480.
+
+       * src/psaux/t1decode.c (t1operator_seac): Don't check `glyph_names'
+       if incremental interface is used.
+
+2010-01-04  Ken Sharp  <ken.sharp@artifex.com>
+
+       Make incremental interface work with TrueType fonts.
+       This fixes Savannah bug #28478.
+
+       * src/truetype/ttgload.c (load_truetype_glyph): Don't check
+       `glyf_offset' if incremental interface is used.
+
+2009-12-31  Lars Abrahamsson  <wonko@opera.com>
+
+       Make compilation with FT_CONFIG_OPTION_PIC work again.
+
+       * src/base/ftglyph.c (FT_Glyph_To_Bitmap) [FT_CONFIG_OPTION_PIC]:
+       Declare `library' for FT_BITMAP_GLYPH_CLASS_GET.
+
+       * src/base/ftinit.c (ft_destroy_default_module_classes,
+       ft_create_default_module_classes): Use proper casts (needed for C++
+       compilation).
+
+       * src/sfnt/ttcmap.c (tt_cmap13_class_rec): Use FT_DEFINE_TT_CMAP.
+
+2009-12-22  Marc Kleine-Budde  <mkl@pengutronix.de>
+
+       Make freetype-config aware of $SYSROOT.
+       This is Savannah patch #7040.
+
+       * builds/unix/freetype-config.in: Decorate with ${SYSROOT} where
+       appropriate.
+
+2009-12-20  Werner Lemberg  <wl@gnu.org>
+
+       Fix compiler warning.
+       Reported by Sean.
+
+       * src/base/ftdbgmem.c [!FT_DEBUG_MEMORY]: ANSI C doesn't like empty
+       source files; however, some compilers warn about an unused variable
+       declaration.  This is now replaced with a typedef.
+
+2009-12-18  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #28320.
+
+       There exist corrupt, subsetted fonts (embedded in PDF files) which
+       contain a private dict that ends with an unterminated floating point
+       number (no operator following).  We now ignore this error (as
+       acrobat does).
+
+       * src/cff/cffparse.c (cff_parser_run): Don't emit a syntax error for
+       unterminated floating point numbers.
+
+2009-12-16  Werner Lemberg  <wl@gnu.org>
+
+       Really fix compiler warnings.
+       Reported by Sean.
+
+       * src/truetype/ttgxvar.c (GX_PT_POINTS_ARE_WORDS,
+       GX_PT_POINT_RUN_COUNT_MASK): Convert enum values to macros.
+
+2009-12-16  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+       Improve configure.raw to copy some options from CFLAGS to LDFLAGS.
+       The linker of Mac OS X 10.6 is sensitive to the architecture.  If
+       the architectures are specified explicitly for the C compiler, the
+       linker requires the architecture specifications too.
+
+       * builds/unix/configure.raw: Replace `-isysroot' option parser by
+       more generic argument parser.
+
+2009-12-15  Werner Lemberg  <wl@gnu.org>
+
+       Fix compiler warnings.
+       Reported by Sean.
+
+       * src/truetype/ttgxvar.c (ft_var_readpackeddeltas): Fix counter data
+       type.
+
+2009-12-14  Ken Sharp  <ken.sharp@artifex.com>
+
+       Ignore invalid `setcurrentpoint' operations in Type 1 fonts.
+       This fixes Savannah bug #28226.
+
+       At least two wild PostScript files of unknown provenance contain
+       Type 1 fonts, apparently converted from TrueType fonts in earlier
+       PDF versions of the files, which use the `setcurrentpoint' operator
+       inappropriately.
+
+       FreeType currently throws an error in this case, but Ghostscript and
+       Adobe Distiller both accept the fonts and ignore the problem.  This
+       commit #ifdefs out the check so PostScript interpreters using
+       FreeType can render these files.
+
+       The specification says `setcurrentpoint' should only be used to set
+       the point after a `Subr' call, but these fonts use it to set the
+       initial point to (0,0).  Unnecessarily so, as they correctly use an
+       `hsbw' operation which implicitly sets the initial point.
+
+       * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+       <op_setcurrentpoint>: Comment out code.
+
+2009-12-14  Bram Tassyns  <bramt@enfocus.be>
+
+       Fix parsing of /CIDFontVersion.
+       This fixes Savannah bug #28287.
+
+       * src/cid/cidtoken.h: `cid_version' in CID_FaceInfoRec (in
+       t1tables.h) is of type FT_Fixed.
+
+2009-12-14  Werner Lemberg  <wl@gnu.org>
+
+       Trace glyph index in CID module.
+       Suggested in Savannah patch #7023.
+
+       * src/cid/cidgload.c (cid_load_glyph): Add tracing message.
+
+2009-12-03  Werner Lemberg  <wl@gnu.org>
+
+       Fix compiler warnings.
+
+       * src/truetype/ttgload.c (tt_get_metrics): Put `Exit' label into the
+       proper preprocessor conditional.
+       * src/pfr/pfrobjs.c (pfr_slot_load): Pacify gcc.
+
+2009-11-25  John Tytgat  <John.Tytgat@esko.com>
+
+       Better handling of start of `eexec' section.
+       This fixes Savannah bug #28090.
+
+       * src/type1/t1parse.c (T1_Get_Private_Dict): Skip all whitespace
+       characters before start of `eexec' section.
+
+2009-11-20  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #27742.
+
+       * src/base/ftstroke.c (ft_stroker_outside): Avoid silent division by
+       zero, using a threshold for `theta'.
+
+2009-11-20  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #28036.
+
+       * src/type1/t1afm.c (t1_get_index): Fix comparison.
+
+2009-11-16  Werner Lemberg  <wl@gnu.org>
+
+       Fix compiler warnings.
+       Reported by Kevin Blenkinsopp <arqon@promode.org>.
+
+       * src/sfnt/ttload.c (check_table_dir): Use proper data type.
+
+2009-11-15  Werner Lemberg  <wl@gnu.org>
+
+       Really fix FreeDesktop bug #21197.
+       This also fixes Savannah bug #28021.
+
+       * src/autofit/aflatin.c (af_latin_metrics_check_digits),
+       src/autofit/aflatin2.c (af_latin2_metrics_check_digits): Fix loop.
+
+2009-11-15  Werner Lemberg  <wl@gnu.org>
+
+       Add tracing messages for advance values.
+
+       * src/base/ftobjs.c (FT_Load_Glyph), src/truetype/ttgload.c
+       (TT_Get_HMetrics, TT_Get_VMetrics): Do it.
+
+2009-11-08  Werner Lemberg  <wl@gnu.org>
+
+       Fix compiler warning.
+       Reported by Jeremy Manson <jeremy.manson@gmail.com>.
+
+       * src/truetype/ttgload.c (load_truetype_glyph): Initialize `error'.
+
+2009-11-04  Werner Lemberg  <wl@gnu.org>
+
+       Remove compiler warning.
+       Reported by Sean McBride <sean@rogue-research.com>.
+
+       * src/tools/apinames.c (read_header_file)<STATE_TYPE>: Use a cast to
+       `int', as specified in the printf(3) man page.
+
+2009-11-04  Werner Lemberg  <wl@gnu.org>
+
+       Fix Savannah bug #27921.
+
+       * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
+       (cid_face_init), src/type1/t1afm.c (T1_Read_Metrics),
+       src/type1/t1objs.c (T1_Face_Init): Don't use unsigned constant
+       values for rounding if the argument can be negative.
+
+2009-11-03  Bram Tassyns  <bramt@enfocus.be>
+
+       Add basic support for Type1 charstrings in CFF.
+       This fixes Savannah bug #27922.
+
+       * src/cff/cffgload.c (CFF_Operator, cff_argument_counts): Handle
+       `seac', `sbw', and `setcurrentpoint' opcodes.
+       (cff_compute_bias): Add parameter to indicate the charstring type.
+       Update all callers.
+       (cff_operator_seac): Add parameter for side bearing.
+       (cff_decoder_parse_charstrings): Updated for more Type1 support.
+
+2009-11-03  Werner Lemberg  <wl@gnu.org>
+
+       Return correct `linearHoriAdvance' value for embedded TT bitmaps too.
+       Reported by Jeremy Manson <jeremy.manson@gmail.com>.
+
+       src/truetype/ttgload.c (load_truetype_glyph): Add parameter to
+       quickly load the glyph header only.
+       Update all callers.
+       (tt_loader_init): Add parameter to quickly load the `glyf' table
+       only.
+       Update all callers.
+       (TT_Load_Glyph): Compute linear advance values for embedded bitmap
+       glyphs too.
+
+2009-11-03  Werner Lemberg  <wl@gnu.org>
+
+       Improve code readability.
+
+       * src/ttgload.c (load_truetype_glyph): Move metrics calculation
+       to...
+       (tt_get_metrics): This new function.
+
+2009-10-26  Bram Tassyns  <bramt@enfocus.be>
+
+       Fix Savannah bug #27811.
+
+       * src/truetype/ttxgvar.c (ft_var_readpackeddeltas): Fix
+       signed/unsigned mismatch.
+
+2009-10-19  Ning Dong  <flintning@163.com>
+
+       Fix handling of `get' and `put' CFF instructions.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_get,
+       cff_op_put>: Appendix B of Adobe Technote #5177 limits the number of
+       elements for the `get' and `put' operators to 32.
+       * src/cff/cffgload.h (CFF_MAX_TRANS_ELEMENTS): Define.
+       (CFF_Decoder): Use it for `buildchar' and remove `len_buildchar'.
+
+2009-10-18  Werner Lemberg  <wl@gnu.org>
+
+       Fix handling of `dup' CFF instruction.
+       Problem and solution reported by Ning Dong <flintning@163.com>.
+
+       * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_dup>:
+       Increase `args' by 2, not 1.
+
 2009-10-10  Werner Lemberg  <wl@gnu.org>
 
        * Version 2.3.11 released.
 2009-09-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
        [cache] Fix Savannah bug #27441, clean up Redhat bugzilla #513582.
-       Tricky casts in FTC_{CACHE,GCACHE,MRULIST}_LOOKUP_CMP() are removed. 
+       Tricky casts in FTC_{CACHE,GCACHE,MRULIST}_LOOKUP_CMP() are removed.
        Now these functions should be called with FTC_Node or FTC_MruNode
        variable, and the caller should cast them to appropriate pointers to
        concrete data.  These tricky casts can GCC-4.4 optimizer (-O2)
        confused and the crashing binaries are generated.
 
-       * src/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Drop tricky cast. 
+       * src/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Drop tricky cast.
        Now the 4th argument `node' of this function should be typed as
        FTC_MruNode.
 
 
        * include/freetype/internal/tttypes.h: The type
        of TT_BDF->string_size is extended from FT_UInt32
-       to FT_ULong, because BDF specification does not 
+       to FT_ULong, because BDF specification does not
        restrict the length of string.
        * src/sfnt/ttbdf.c: The scratch variable `strings'
        to load TT_BDF->string_size is matched with
        and `rem' are changed to TCoord, because their values
        are set with explicit casts to TCoord.  When ras.area
        is updated by the differential values including
-       `delta', they are explicitly casted to TArea, because
+       `delta', they are explicitly cast to TArea, because
        the type of `delta' is not TArea but TCoord.
        (gray_render_line): The type of `mod' is extended
        from int to TCoord, because (TCoord)dy is added to mod.
 
        * src/base/fttrigon.c (ft_trig_downscale): The FT_Fixed
        variable `val' and unsigned long constant FT_TRIG_SCALE
-       are casted to FT_UInt32, when calculates FT_UInt32.
-       (FT_Vector_Rotate): The long constant 1L is casted to
+       are cast to FT_UInt32, when calculates FT_UInt32.
+       (FT_Vector_Rotate): The long constant 1L is cast to
        FT_Int32 to calculate FT_Int32 `half'.
 
 2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
        `code' is matched to PCF_Encoding->enc.
        (pcf_cmap_char_next): The type of `charcode' is matched
        to PCF_Encoding->enc.  When *acharcode is set by charcode,
-       an overflow is checked and casted to unsigned 32-bit
+       an overflow is checked and cast to unsigned 32-bit
        integer.
 
 2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
        (bdf_cmap_char_next): The type of `charcode' is
        matched with BDF_encoding_el->enc.  When *acharcode
        is set by charcode, an overflow is checked and
-       casted to unsigned 32-bit integer.
+       cast to unsigned 32-bit integer.
 
 2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
        * afmparse.c (afm_parser_read_vals): To call
        AFM_ParserRec.get_index, the length of token
-       `len' is casted to size_t.
+       `len' is cast to size_t.
 
 2009-07-31  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 
        * src/gzip/ftgzip.c (zcalloc, zcfree): Disable all
        zcalloc() & zfree() by zlib in zutil.c, those in
-       ftgzip.c by FT2 are enabled by default.  To use 
+       ftgzip.c by FT2 are enabled by default.  To use
        zlib zcalloc() & zfree(), define USE_ZLIB_ZCALLOC.
        See discussion:
        http://lists.gnu.org/archive/html/freetype-devel/2009-02/msg00000.html
        the check for too large glyph.  Replace the pair of `pitch' and
        `height' by the pair of `width' and `height'.  `pitch' cannot
        be greater than `height'.  The required is checking the product
-       `pitch' * `height' <= FT_ULONG_MAX, but we use cheap checks for 
+       `pitch' * `height' <= FT_ULONG_MAX, but we use cheap checks for
        the realistic case only.
 
 2009-07-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
        Improve configure.raw for cross-building on exe-suffixed systems.
 
        * builds/unix/configure.raw: Fix a bug in sed script to extract
-       native suffix for binary executables, patch by Peter Breitenlohner. 
+       native suffix for binary executables, patch by Peter Breitenlohner.
        http://lists.gnu.org/archive/html/freetype-devel/2009-04/msg00036.html
 
 2009-06-26  Werner Lemberg  <wl@gnu.org>
 2009-04-21  Karl Berry  <karl@gnu.org>
 
        Fix AC_CHECK_FT2.
-    
+
        * builds/unix/freetype2.m4: Only check PATH for freetype-config if
        we did not already find it from a prefix option.
 
 
        Add #error to modules and files that do not support PIC yet.
 
-       When FT_CONFIG_OPTION_PIC is defined the following files will 
+       When FT_CONFIG_OPTION_PIC is defined the following files will
        create #error:
        * src/bdf/bdfdrivr.h
        * src/cache/ftcmanag.c
 
        Position Independent Code (PIC) support in autofit module.
 
-       * include/freetype/internal/autohint.h add macros to init 
+       * include/freetype/internal/autohint.h add macros to init
        instances of FT_AutoHinter_ServiceRec.
 
-       * src/autofit/afmodule.h declare autofit_module_class 
-       using macros from ftmodapi.h, 
+       * src/autofit/afmodule.h declare autofit_module_class
+       using macros from ftmodapi.h,
        when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/autofit/afmodule.c when FT_CONFIG_OPTION_PIC is defined 
-       af_autofitter_service and autofit_module_class structs 
+       * src/autofit/afmodule.c when FT_CONFIG_OPTION_PIC is defined
+       af_autofitter_service and autofit_module_class structs
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        And macros will be used from afpic.h in order to access them.
        * src/autofit/aftypes.h add macros to init and declare
        instances of AF_ScriptClassRec.
 
-       * src/autofit/afcjk.h declare af_cjk_script_class 
-       using macros from aftypes.h, 
+       * src/autofit/afcjk.h declare af_cjk_script_class
+       using macros from aftypes.h,
        when FT_CONFIG_OPTION_PIC is defined init function will be declared.
-       * src/autofit/afcjk.c when FT_CONFIG_OPTION_PIC is defined 
-       af_cjk_script_class struct will have function to init it instead of 
+       * src/autofit/afcjk.c when FT_CONFIG_OPTION_PIC is defined
+       af_cjk_script_class struct will have function to init it instead of
        being allocated in the global scope.
 
-       * src/autofit/afdummy.h declare af_dummy_script_class 
-       using macros from aftypes.h, 
+       * src/autofit/afdummy.h declare af_dummy_script_class
+       using macros from aftypes.h,
        when FT_CONFIG_OPTION_PIC is defined init function will be declared.
-       * src/autofit/afdummy.c when FT_CONFIG_OPTION_PIC is defined 
-       af_dummy_script_class struct will have function to init it instead of 
+       * src/autofit/afdummy.c when FT_CONFIG_OPTION_PIC is defined
+       af_dummy_script_class struct will have function to init it instead of
        being allocated in the global scope.
 
-       * src/autofit/afindic.h declare af_indic_script_class 
-       using macros from aftypes.h, 
+       * src/autofit/afindic.h declare af_indic_script_class
+       using macros from aftypes.h,
        when FT_CONFIG_OPTION_PIC is defined init function will be declared.
-       * src/autofit/afindic.c when FT_CONFIG_OPTION_PIC is defined 
-       af_indic_script_class struct will have function to init it instead of 
+       * src/autofit/afindic.c when FT_CONFIG_OPTION_PIC is defined
+       af_indic_script_class struct will have function to init it instead of
        being allocated in the global scope.
 
-       * src/autofit/aflatin.h declare af_latin_script_class 
-       using macros from aftypes.h, 
+       * src/autofit/aflatin.h declare af_latin_script_class
+       using macros from aftypes.h,
        when FT_CONFIG_OPTION_PIC is defined init function will be declared.
-       * src/autofit/aflatin.c when FT_CONFIG_OPTION_PIC is defined 
-       af_latin_script_class struct will have function to init it instead of 
+       * src/autofit/aflatin.c when FT_CONFIG_OPTION_PIC is defined
+       af_latin_script_class struct will have function to init it instead of
        being allocated in the global scope.
-       Change af_latin_blue_chars to be PIC-compatible by being a two 
+       Change af_latin_blue_chars to be PIC-compatible by being a two
        dimentional array rather than array of pointers.
 
 
-       * src/autofit/aflatin2.h declare af_latin2_script_class 
-       using macros from aftypes.h, 
+       * src/autofit/aflatin2.h declare af_latin2_script_class
+       using macros from aftypes.h,
        when FT_CONFIG_OPTION_PIC is defined init function will be declared.
-       * src/autofit/aflatin2.c when FT_CONFIG_OPTION_PIC is defined 
-       af_latin2_script_class struct will have function to init it instead of 
+       * src/autofit/aflatin2.c when FT_CONFIG_OPTION_PIC is defined
+       af_latin2_script_class struct will have function to init it instead of
        being allocated in the global scope.
-       Change af_latin2_blue_chars to be PIC-compatible by being a two 
+       Change af_latin2_blue_chars to be PIC-compatible by being a two
        dimentional array rather than array of pointers.
 
-       * src/autofit/afglobal.c when FT_CONFIG_OPTION_PIC is defined 
+       * src/autofit/afglobal.c when FT_CONFIG_OPTION_PIC is defined
        af_script_classes array initialization was moved to afpic.c and
        is later refered using macros defeined in afpic.h.
 
        New Files:
        * src/autofit/afpic.h declare struct to hold PIC globals for autofit
        module and macros to access them.
-       * src/autofit/afpic.c implement functions to allocate, destroy and 
+       * src/autofit/afpic.c implement functions to allocate, destroy and
        initialize PIC globals for autofit module.
 
        * src/autofit/autofit.c add new file to build: afpic.c.
 
        Position Independent Code (PIC) support in pshinter module.
 
-       * include/freetype/internal/pshints.h add macros to init 
+       * include/freetype/internal/pshints.h add macros to init
        instances of PSHinter_Interface.
 
-       * src/pshinter/pshmod.h declare pshinter_module_class 
-       using macros from ftmodapi.h, 
+       * src/pshinter/pshmod.h declare pshinter_module_class
+       using macros from ftmodapi.h,
        when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/pshinter/pshmod.c when FT_CONFIG_OPTION_PIC is defined 
-       pshinter_interface and pshinter_module_class structs 
+       * src/pshinter/pshmod.c when FT_CONFIG_OPTION_PIC is defined
+       pshinter_interface and pshinter_module_class structs
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        And macros will be used from pshpic.h in order to access them.
        New Files:
        * src/pshinter/pshpic.h declare struct to hold PIC globals for pshinter
        module and macros to access them.
-       * src/pshinter/pshpic.c implement functions to allocate, destroy and 
+       * src/pshinter/pshpic.c implement functions to allocate, destroy and
        initialize PIC globals for pshinter module.
 
        * src/pshinter/pshinter.c add new file to build: pshpic.c.
 
        Position Independent Code (PIC) support in psnames module.
 
-       * include/freetype/internal/services/svpscmap.h add macros to init 
+       * include/freetype/internal/services/svpscmap.h add macros to init
        instances of FT_Service_PsCMapsRec.
 
-       * src/psnames/psmodule.h declare psnames_module_class 
-       using macros from ftmodapi.h, 
+       * src/psnames/psmodule.h declare psnames_module_class
+       using macros from ftmodapi.h,
        when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/psnames/psmodule.c when FT_CONFIG_OPTION_PIC is defined 
-       pscmaps_interface and pscmaps_services structs 
+       * src/psnames/psmodule.c when FT_CONFIG_OPTION_PIC is defined
+       pscmaps_interface and pscmaps_services structs
        and psnames_module_class array
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        New Files:
        * src/psnames/pspic.h declare struct to hold PIC globals for psnames
        module and macros to access them.
-       * src/psnames/pspic.c implement functions to allocate, destroy and 
+       * src/psnames/pspic.c implement functions to allocate, destroy and
        initialize PIC globals for psnames module.
 
        * src/psnames/psnames.c add new file to build: pspic.c.
 
        Position Independent Code (PIC) support in raster renderer.
 
-       * src/raster/ftrend1.h declare ft_raster1_renderer_class 
-       and ft_raster5_renderer_class 
-       using macros from ftrender.h, 
+       * src/raster/ftrend1.h declare ft_raster1_renderer_class
+       and ft_raster5_renderer_class
+       using macros from ftrender.h,
        when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/smooth/ftrend1.c when FT_CONFIG_OPTION_PIC is defined 
+       * src/smooth/ftrend1.c when FT_CONFIG_OPTION_PIC is defined
        ft_raster1_renderer_class and ft_raster5_renderer_class structs
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
-       Macros will be used from rastpic.h in order to access 
+       Macros will be used from rastpic.h in order to access
        ft_standard_raster from the pic_container (allocated in ftraster.c).
-       In ft_raster1_render when PIC is enabled, the last letter of 
+       In ft_raster1_render when PIC is enabled, the last letter of
        module_name is used to verfy the renderer class rather than the
        class pointer.
 
-       * src/raster/ftraster.c when FT_CONFIG_OPTION_PIC is defined 
+       * src/raster/ftraster.c when FT_CONFIG_OPTION_PIC is defined
        ft_standard_raster struct will have function to init it
        instead of being allocated in the global scope.
 
        New Files:
        * src/raster/rastpic.h declare struct to hold PIC globals for raster
        renderer and macros to access them.
-       * src/raster/rastpic.c implement functions to allocate, destroy and 
+       * src/raster/rastpic.c implement functions to allocate, destroy and
        initialize PIC globals for raster renderer.
 
        * src/raster/raster.c add new file to build: rastpic.c.
 
        Position Independent Code (PIC) support in smooth renderer.
 
-       * src/smooth/ftsmooth.h declare ft_smooth_renderer_class, 
-       ft_smooth_lcd_renderer_class and ft_smooth_lcd_v_renderer_class 
-       using macros from ftrender.h, 
+       * src/smooth/ftsmooth.h declare ft_smooth_renderer_class,
+       ft_smooth_lcd_renderer_class and ft_smooth_lcd_v_renderer_class
+       using macros from ftrender.h,
        when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/smooth/ftsmooth.c when FT_CONFIG_OPTION_PIC is defined 
-       the following structs: 
-       ft_smooth_renderer_class, ft_smooth_lcd_renderer_class 
-       and ft_smooth_lcd_v_renderer_class 
+       * src/smooth/ftsmooth.c when FT_CONFIG_OPTION_PIC is defined
+       the following structs:
+       ft_smooth_renderer_class, ft_smooth_lcd_renderer_class
+       and ft_smooth_lcd_v_renderer_class
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
-       And macros will be used from ftspic.h in order to access 
+       And macros will be used from ftspic.h in order to access
        ft_grays_raster from the pic_container (allocated in ftgrays.c).
 
        * src/smooth/ftgrays.h include FT_CONFIG_CONFIG_H
-       * src/smooth/ftgrays.c when FT_CONFIG_OPTION_PIC is NOT defined 
-       func_interface was moved from gray_convert_glyph_inner function 
+       * src/smooth/ftgrays.c when FT_CONFIG_OPTION_PIC is NOT defined
+       func_interface was moved from gray_convert_glyph_inner function
        to the global scope.
-       When FT_CONFIG_OPTION_PIC is defined 
+       When FT_CONFIG_OPTION_PIC is defined
        func_interface and ft_grays_raster structs
        will have functions to init them
        instead of being allocated in the global scope.
-       And func_interface will be allocated on the stack of 
+       And func_interface will be allocated on the stack of
        gray_convert_glyph_inner.
 
        New Files:
        * src/smooth/ftspic.h declare struct to hold PIC globals for smooth
        renderer and macros to access them.
-       * src/smooth/ftspic.c implement functions to allocate, destroy and 
+       * src/smooth/ftspic.c implement functions to allocate, destroy and
        initialize PIC globals for smooth renderer.
 
        * src/smooth/smooth.c add new file to build: ftspic.c.
 
        Position Independent Code (PIC) support in cff driver.
 
-       * include/freetype/internal/services/svcid.h add macros to init 
+       * include/freetype/internal/services/svcid.h add macros to init
        instances of FT_Service_CIDRec.
-       * include/freetype/internal/services/svpsinfo.h add macros to init 
+       * include/freetype/internal/services/svpsinfo.h add macros to init
        instances of FT_Service_PsInfoRec.
 
        * src/cff/cffcmap.h declare cff_cmap_encoding_class_rec
        and cff_cmap_unicode_class_rec using macros from
        ftobjs.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/cff/cffcmap.c when FT_CONFIG_OPTION_PIC is defined 
-       the following structs: 
+       * src/cff/cffcmap.c when FT_CONFIG_OPTION_PIC is defined
+       the following structs:
        cff_cmap_encoding_class_rec and cff_cmap_unicode_class_rec
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        * src/cff/cffdrivr.h declare cff_driver_class using macros from
        ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/cff/cffdrivr.c when FT_CONFIG_OPTION_PIC is defined 
-       the following structs: 
+       * src/cff/cffdrivr.c when FT_CONFIG_OPTION_PIC is defined
+       the following structs:
        cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name
-       cff_service_get_cmap_info, cff_service_cid_info, cff_driver_class, 
+       cff_service_get_cmap_info, cff_service_cid_info, cff_driver_class,
        and cff_services array
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        * src/cff/cffobjs.c Use macros from cffpic.h in order to access the
        structs allocated in cffcmap.c
 
-       * src/cff/parser.c when FT_CONFIG_OPTION_PIC is defined 
-       implement functions to create and destroy cff_field_handlers array 
+       * src/cff/parser.c when FT_CONFIG_OPTION_PIC is defined
+       implement functions to create and destroy cff_field_handlers array
        instead of being allocated in the global scope.
        And macros will be used from cffpic.h in order to access it
        from the pic_container.
        New Files:
        * src/cff/cffpic.h declare struct to hold PIC globals for cff
        driver and macros to access them.
-       * src/cff/cffpic.c implement functions to allocate, destroy and 
+       * src/cff/cffpic.c implement functions to allocate, destroy and
        initialize PIC globals for cff driver.
 
        * src/cff/cff.c add new file to build: cffpic.c.
 
        Position Independent Code (PIC) support in sfnt driver.
 
-       * include/freetype/internal/services/svbdf.h add macros to init 
+       * include/freetype/internal/services/svbdf.h add macros to init
        instances of FT_Service_BDFRec.
-       * include/freetype/internal/services/svgldict.h add macros to init 
+       * include/freetype/internal/services/svgldict.h add macros to init
        instances of FT_Service_GlyphDictRec.
-       * include/freetype/internal/services/svpostnm.h add macros to init 
+       * include/freetype/internal/services/svpostnm.h add macros to init
        instances of FT_Service_PsFontNameRec.
-       * include/freetype/internal/services/svsfnt.h add macros to init 
+       * include/freetype/internal/services/svsfnt.h add macros to init
        instances of FT_Service_SFNT_TableRec.
-       * include/freetype/internal/services/svttcmap.h add macros to init 
+       * include/freetype/internal/services/svttcmap.h add macros to init
        instances of FT_Service_TTCMapsRec.
-       * include/freetype/internal/sfnt.h add macros to init 
+       * include/freetype/internal/sfnt.h add macros to init
        instances of SFNT_Interface.
 
        * src/sfnt/sfdriver.h declare sfnt_module_class using macros from
        ftmodapi.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/sfnt/sfdriver.c when FT_CONFIG_OPTION_PIC is defined 
-       the following structs: 
+       * src/sfnt/sfdriver.c when FT_CONFIG_OPTION_PIC is defined
+       the following structs:
        sfnt_service_sfnt_table, sfnt_service_glyph_dict, sfnt_service_ps_name
-       tt_service_get_cmap_info, sfnt_service_bdf, sfnt_interface, 
+       tt_service_get_cmap_info, sfnt_service_bdf, sfnt_interface,
        sfnt_module_class, and sfnt_services array
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        And macros will be used from sfntpic.h in order to access them
        from the pic_container.
 
-       * src/sfnt/ttcmap.h add macros to init 
+       * src/sfnt/ttcmap.h add macros to init
        instances of TT_CMap_ClassRec.
-       * src/sfnt/ttcmap.c when FT_CONFIG_OPTION_PIC is defined 
-       the following structs: 
+       * src/sfnt/ttcmap.c when FT_CONFIG_OPTION_PIC is defined
+       the following structs:
        tt_cmap0_class_rec, tt_cmap2_class_rec, tt_cmap4_class_rec
-       tt_cmap6_class_rec, tt_cmap8_class_rec, tt_cmap10_class_rec, 
+       tt_cmap6_class_rec, tt_cmap8_class_rec, tt_cmap10_class_rec,
        tt_cmap12_class_rec, tt_cmap14_class_rec and tt_cmap_classes array
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        New Files:
        * src/sfnt/sfntpic.h declare struct to hold PIC globals for sfnt
        driver and macros to access them.
-       * src/sfnt/sfntpic.c implement functions to allocate, destroy and 
+       * src/sfnt/sfntpic.c implement functions to allocate, destroy and
        initialize PIC globals for sfnt driver.
-       * src/sfnt/ttcmapc.h describing the content of 
+       * src/sfnt/ttcmapc.h describing the content of
        tt_cmap_classes allocated in ttcmap.c
 
        * src/sfnt/sfnt.c add new file to build: sfntpic.c.
 
        Position Independent Code (PIC) support in truetype driver.
 
-       * include/freetype/internal/services/svmm.h add macros to init 
+       * include/freetype/internal/services/svmm.h add macros to init
        instances of FT_Service_MultiMastersRec.
-       * include/freetype/internal/services/svttglyf.h add macros to init 
+       * include/freetype/internal/services/svttglyf.h add macros to init
        instances of FT_Service_TTGlyfRec.
 
        * src/truetype/ttdriver.h declare tt_driver_class using macros from
        ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
        functions will be declared.
-       * src/truetype/ttdriver.c when FT_CONFIG_OPTION_PIC is defined 
-       the following structs: 
+       * src/truetype/ttdriver.c when FT_CONFIG_OPTION_PIC is defined
+       the following structs:
        tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class
-       and tt_services array, 
+       and tt_services array,
        will have functions to init or create and destroy them
        instead of being allocated in the global scope.
        And macros will be used from ttpic.h in order to access them
        from the pic_container.
        * src/truetype/ttobjs.c change trick_names array to be
-       PIC-compatible by being a two dimentional array rather than array 
+       PIC-compatible by being a two dimentional array rather than array
        of pointers.
 
        New Files:
        * src/truetype/ttpic.h declare struct to hold PIC globals for truetype
        driver and macros to access them.
-       * src/truetype/ttpic.c implement functions to allocate, destroy and 
+       * src/truetype/ttpic.c implement functions to allocate, destroy and
        initialize PIC globals for truetype driver.
 
        * src/truetype/truetype.c add new file to build: ttpic.c.
        Position Independent Code (PIC) support and infrastructure in base.
 
        * include/freetype/config/ftoption.h add FT_CONFIG_OPTION_PIC
-       * include/freetype/internal/ftobjs.h Add pic_container member to 
+       * include/freetype/internal/ftobjs.h Add pic_container member to
        FT_LibraryRec.
        Add macros to declare and init instances of FT_CMap_ClassRec.
        Add macros to init instances of FT_Outline_Funcs and FT_Raster_Funcs.
-       Add macros to declare, allocate and initialize modules 
+       Add macros to declare, allocate and initialize modules
        (FT_Module_Class).
-       Add macros to declare, allocate and initialize renderers 
+       Add macros to declare, allocate and initialize renderers
        (FT_Renderer_Class).
        Add macro to init instances of FT_Glyph_Class.
-       Add macros to declare, allocate and initialize drivers 
+       Add macros to declare, allocate and initialize drivers
        (FT_Driver_ClassRec).
-       * include/freetype/internal/ftpic.h new file to declare the 
+       * include/freetype/internal/ftpic.h new file to declare the
        FT_PIC_Container struct and the functions to allocate and detroy it.
-       * include/freetype/internal/ftserv.h add macros to allocate and 
+       * include/freetype/internal/ftserv.h add macros to allocate and
        destory arrays of FT_ServiceDescRec.
-       * include/freetype/internal/internal.h define macro to include 
+       * include/freetype/internal/internal.h define macro to include
        ftpic.h.
 
        New Files:
-       * src/base/ftpic.c implement functions to allocate and destory the 
+       * src/base/ftpic.c implement functions to allocate and destory the
        global pic_container.
-       * src/base/basepic.h declare struct to hold PIC globals for base and 
+       * src/base/basepic.h declare struct to hold PIC globals for base and
        macros to access them.
-       * src/base/basepic.c implement functions to allocate, destroy and 
+       * src/base/basepic.c implement functions to allocate, destroy and
        initialize PIC globals for base.
 
-       * src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement 
-       functions that allocate and destroy ft_default_modules according to 
+       * src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement
+       functions that allocate and destroy ft_default_modules according to
        FT_CONFIG_MODULES_H in the pic_container instead of the global scope
        and use macro from basepic.h to access it.
-       * src/base/ftobjs.c add calls to the functions that allocate and 
-       destroy the global pic_container when the library is created and 
+       * src/base/ftobjs.c add calls to the functions that allocate and
+       destroy the global pic_container when the library is created and
        destroyed.
 
-       * src/base/jamfile add new files to FT2_MULTI build: 
+       * src/base/jamfile add new files to FT2_MULTI build:
        ftpic.c and basepic.c.
-       * src/base/ftbase.c add new files to build: 
+       * src/base/ftbase.c add new files to build:
        ftpic.c and basepic.c.
 
-       * src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined 
+       * src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined
        ft_bitmap_glyph_class and ft_outline_glyph_class will be allocated
        in the pic_container instead of the global scope and use macros from
        basepic.h to access them.
-       * src/base/ftbbox.c allocate bbox_interface stract on the stack 
+       * src/base/ftbbox.c allocate bbox_interface stract on the stack
        instead of the global scope when FT_CONFIG_OPTION_PIC is defined.
        * src/base/ftstroke.c access ft_outline_glyph_class allocated in
        ftglyph.c via macros from basepic.h
        Preparing changes in cff parser later needed for PIC version.
 
        * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c,
-       src/cff/cffparse.c, src/cff/cffparse.h: Add library pointer to 
+       src/cff/cffparse.c, src/cff/cffparse.h: Add library pointer to
        'CFF_ParserRec' set by `cff_parser_init'.
        Route library pointer from 'cff_face_init' to 'cff_subfont_load'
        for `cff_parser_init'.
 
 2006-12-08  Vladimir Volovich  <vvv@vsu.ru>
 
-       * src/tools/apinames (State): Remove final comma in structure -- xlc
-       v5 under AIX 4.3 doesn't like this.
+       * src/tools/apinames.c (State): Remove final comma in structure --
+       xlc v5 under AIX 4.3 doesn't like this.
 
 2006-12-07  David Turner  <david@freetype.org>
 
 
 ----------------------------------------------------------------------------
 
-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, modified,
index ac327b8..d8c1bba 100644 (file)
@@ -194,7 +194,7 @@ rule RefDoc
 
 actions RefDoc
 {
-  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.3.11 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h
+  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.3.12 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h
 }
 
 RefDoc  refdoc ;
index f63c8fc..282791e 100644 (file)
@@ -9,7 +9,7 @@
   is called `libttf'.  They are *not* compatible!
 
 
-  FreeType 2.3.11
+  FreeType 2.3.12
   ===============
 
   Please   read   the  docs/CHANGES   file,   it  contains   IMPORTANT
@@ -26,9 +26,9 @@
 
   and download one of the following files.
 
-    freetype-doc-2.3.11.tar.bz2
-    freetype-doc-2.3.11.tar.gz
-    ftdoc2311.zip
+    freetype-doc-2.3.12.tar.bz2
+    freetype-doc-2.3.12.tar.gz
+    ftdoc2312.zip
 
 
   Bugs
@@ -51,7 +51,7 @@
 
 ----------------------------------------------------------------------
 
-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,
index 16c335f..c28a51c 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright 2005, 2006, 2007, 2008, 2009 by
+# Copyright 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, modified,
@@ -95,10 +95,11 @@ compare_to_minimum_version ()
 check_tool_version ()
 {
   field=$5
+  # assume the output of "[TOOL] --version" is "toolname (GNU toolname foo bar) version"
   if test "$field"x = x; then
-    field=4  # default to 4 for all GNU autotools
+    field=3  # default to 3 for all GNU autotools, after filtering enclosed string
   fi
-  version=`$1 --version | head -1 | cut -d ' ' -f $field`
+  version=`$1 --version | head -1 | sed 's/([^)]*)/()/g' | cut -d ' ' -f $field`
   version_check=`compare_to_minimum_version $version $4`
   if test "$version_check"x = 0x; then
     echo "ERROR: Your version of the \`$2' tool is too old."
index d4fee59..9c6c2fe 100644 (file)
@@ -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 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* 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.                */
@@ -312,8 +313,9 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* 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
 
@@ -396,6 +398,20 @@ FT_BEGIN_HEADER
 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
 
 
+  /*************************************************************************/
+  /*                                                                       */
+  /* Position Independent Code                                             */
+  /*                                                                       */
+  /*   If this macro is set (which is _not_ the default), FreeType2 will   */
+  /*   avoid creating constants that require address fixups.  Instead the  */
+  /*   constants will be moved into a struct and additional intialization  */
+  /*   code will be used.                                                  */
+  /*                                                                       */
+  /*   Setting this macro is needed for systems that prohibit address      */
+  /*   fixups, such as BREW.                                               */
+  /*                                                                       */
+/* #define FT_CONFIG_OPTION_PIC */
+
 
   /*************************************************************************/
   /*************************************************************************/
index 3c0b8b1..43d587e 100644 (file)
@@ -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 @@ FT_BEGIN_HEADER
   /* 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 @@ FT_BEGIN_HEADER
     return a;
   }
 
-#endif /* __arm__ && !__thumb__ */
+#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
 
 #if defined( i386 )
 #define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
index f725089..443c0d8 100644 (file)
@@ -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 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* 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.                */
@@ -312,8 +313,9 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* 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 */
 
@@ -401,7 +403,7 @@ FT_BEGIN_HEADER
   /* 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.                                                  */
   /*                                                                       */
index 9e74f11..942a740 100644 (file)
@@ -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 @@ FT_BEGIN_HEADER
   /*    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 @@ FT_BEGIN_HEADER
   /*                         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 @@ FT_BEGIN_HEADER
   /*    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 @@ FT_BEGIN_HEADER
    */
 #define FREETYPE_MAJOR  2
 #define FREETYPE_MINOR  3
-#define FREETYPE_PATCH  11
+#define FREETYPE_PATCH  12
 
 
   /*************************************************************************/
index cacccf0..0b8f0c0 100644 (file)
@@ -468,7 +468,7 @@ FT_BEGIN_HEADER
   /*        // 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                            */
   /*            ...                                                        */
index 2fcc113..0272e92 100644 (file)
@@ -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_BEGIN_HEADER
   /*    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 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    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 @@ FT_BEGIN_HEADER
   /*                    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_BEGIN_HEADER
   /*    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 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A structure to hold various function pointers used during outline  */
-  /*    decomposition in order to emit segments, conic, and cubic Béziers, */
-  /*    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 @@ FT_BEGIN_HEADER
   /*      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_
index 96abede..aaf689f 100644 (file)
@@ -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,7 +101,10 @@ FT_BEGIN_HEADER
    *     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
@@ -114,6 +117,7 @@ FT_BEGIN_HEADER
     FT_Long  bearing_x;
     FT_Long  bearing_y;
     FT_Long  advance;
+    FT_Long  advance_v;     /* since 2.3.12 */
 
   } FT_Incremental_MetricsRec;
 
index d7d01e8..2829a05 100644 (file)
@@ -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 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <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.                  */
index f20b409..485e4e1 100644 (file)
@@ -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_BEGIN_HEADER
                     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' )
+
   /* */
 
 
index 394fb97..e6882d5 100644 (file)
   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 );
index 5e2ad48..5cbeb29 100644 (file)
   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 );
index 9cae85d..1dc49f3 100644 (file)
@@ -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 @@ 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 )
+  FT_LOCAL( FT_Error )
   open_face_PS_from_sfnt_stream( FT_Library     library,
                                  FT_Stream      stream,
                                  FT_Long        face_index,
@@ -40,7 +40,7 @@ FT_BEGIN_HEADER
 
   /* 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,
index 8136ccc..4b8e911 100644 (file)
@@ -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        */
   /*                                                                       */
   /* <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.                                                         */
   /*                                                                       */
   /*                                                                       */
   /* <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.                                                         */
   /*                                                                       */
index 677f242..160269d 100644 (file)
 #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 */
 
index ef61d45..3505d6d 100644 (file)
     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;
 
 
     const FT_Glyph_Class*     clazz;
 
+#ifdef FT_CONFIG_OPTION_PIC
+    FT_Library                library = FT_GLYPH( glyph )->library;
+#endif
+
 
     /* check argument */
     if ( !the_glyph )
index ef13503..f94f25a 100644 (file)
     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;
     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;
index 421540c..46bcd3b 100644 (file)
@@ -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
 
     }
 
     /* 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;
 
                                      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    &&
index 49ef82e..b69df84 100644 (file)
@@ -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,       */
 
     *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;
index 236d9a6..501cab5 100644 (file)
@@ -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      */
                               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;
 
     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;
 
index 0978b0e..75bcbde 100644 (file)
@@ -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,       */
       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) */
         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++ )
         {
         }
         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--;
index 326d8e7..ba3c633 100644 (file)
@@ -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,       */
 
     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                   */
index 2f462a2..a9ab0c3 100644 (file)
@@ -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 );
   }
 
 
index 217adf2..dad0b65 100644 (file)
   {
     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" );
 
index 40fa20b..9330c05 100644 (file)
@@ -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,       */
     cff_op_closepath,
     cff_op_callothersubr,
     cff_op_pop,
+    cff_op_seac,
+    cff_op_sbw,
+    cff_op_setcurrentpoint,
 
     /* do not remove */
     cff_op_max
     2, /* hsbw */
     0,
     0,
-    0
+    0,
+    5, /* seac */
+    4, /* sbw */
+    2  /* setcurrentpoint */
   };
 
 
   /*    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;
     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;
   }
 
     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;
       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 */
 
   static FT_Error
   cff_operator_seac( CFF_Decoder*  decoder,
+                     FT_Pos        asb,
                      FT_Pos        adx,
                      FT_Pos        ady,
                      FT_Int        bchar,
     FT_Vector     left_bearing, advance;
     FT_Byte*      charstring;
     FT_ULong      charstring_len;
+    FT_Pos        glyph_width;
 
 
     if ( decoder->seac )
       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. */
       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. */
       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;
     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;
 
                 ( (FT_Int32)ip[2] <<  8 ) |
                             ip[3];
           ip    += 4;
-          shift  = 0;
+          if ( charstring_type == 2 )
+            shift = 0;
         }
         if ( decoder->top - stack >= CFF_MAX_OPERANDS )
           goto Stack_Overflow;
             case 0:
               op = cff_op_dotsection;
               break;
+            case 1: /* this is actually the Type1 vstem3 operator */
+              op = cff_op_vstem;
+              break;
+            case 2: /* this is actually the Type1 hstem3 operator */
+              op = cff_op_hstem;
+              break;
             case 3:
               op = cff_op_and;
               break;
             case 5:
               op = cff_op_not;
               break;
+            case 6:
+              op = cff_op_seac;
+              break;
+            case 7:
+              op = cff_op_sbw;
+              break;
             case 8:
               op = cff_op_store;
               break;
             case 30:
               op = cff_op_roll;
               break;
+            case 33:
+              op = cff_op_setcurrentpoint;
+              break;
             case 34:
               op = cff_op_hflex;
               break;
           op = cff_op_hvcurveto;
           break;
         default:
-          ;
+          break;
         }
 
         if ( op == cff_op_unknown )
           }
           break;
 
+        case cff_op_seac:
+            FT_TRACE4(( " seac\n" ));
+
+            error = cff_operator_seac( decoder,
+                                       args[0], args[1], args[2],
+                                       (FT_Int)( args[3] >> 16 ),
+                                       (FT_Int)( args[4] >> 16 ) );
+
+            /* add current outline to the glyph slot */
+            FT_GlyphLoader_Add( builder->loader );
+
+            /* return now! */
+            FT_TRACE4(( "\n" ));
+            return error;
+
         case cff_op_endchar:
           FT_TRACE4(( " endchar\n" ));
 
             /* Save glyph width so that the subglyphs don't overwrite it. */
             FT_Pos  glyph_width = decoder->glyph_width;
 
-
             error = cff_operator_seac( decoder,
-                                       args[-4],
-                                       args[-3],
+                                       0L, args[-4], args[-3],
                                        (FT_Int)( args[-2] >> 16 ),
                                        (FT_Int)( args[-1] >> 16 ) );
 
           FT_TRACE4(( " dup\n" ));
 
           args[1] = args[0];
-          args++;
+          args += 2;
           break;
 
         case cff_op_put:
 
             FT_TRACE4(( " put\n" ));
 
-            if ( idx >= 0 && idx < decoder->len_buildchar )
+            if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )
               decoder->buildchar[idx] = val;
           }
           break;
 
             FT_TRACE4(( " get\n" ));
 
-            if ( idx >= 0 && idx < decoder->len_buildchar )
+            if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )
               val = decoder->buildchar[idx];
 
             args[0] = val;
 
           FT_TRACE4(( " hsbw (invalid op)\n" ));
 
-          decoder->glyph_width = decoder->nominal_width +
-                                   (args[1] >> 16);
-          x    = args[0];
-          y    = 0;
+          decoder->glyph_width = decoder->nominal_width + ( args[1] >> 16 );
+
+          decoder->builder.left_bearing.x = args[0];
+          decoder->builder.left_bearing.y = 0;
+
+          x    = decoder->builder.pos_x + args[0];
+          y    = decoder->builder.pos_y;
+          args = stack;
+          break;
+
+        case cff_op_sbw:
+          /* this is an invalid Type 2 operator; however, there        */
+          /* exist fonts which are incorrectly converted from probably */
+          /* Type 1 to CFF, and some parsers seem to accept it         */
+
+          FT_TRACE4(( " sbw (invalid op)\n" ));
+
+          decoder->glyph_width = decoder->nominal_width + ( args[2] >> 16 );
+
+          decoder->builder.left_bearing.x = args[0];
+          decoder->builder.left_bearing.y = args[1];
+
+          x    = decoder->builder.pos_x + args[0];
+          y    = decoder->builder.pos_y + args[1];
+          args = stack;
+          break;
+
+        case cff_op_setcurrentpoint:
+          /* this is an invalid Type 2 operator; however, there        */
+          /* exist fonts which are incorrectly converted from probably */
+          /* Type 1 to CFF, and some parsers seem to accept it         */
+
+          FT_TRACE4(( " setcurrentpoint (invalid op)\n" ));
+
+          x    = decoder->builder.pos_x + args[0];
+          y    = decoder->builder.pos_y + args[1];
           args = stack;
           break;
 
 
           FT_TRACE4(( " callothersubr (invalid op)\n" ));
 
-          /* don't modify stack; handle the subr as `unknown' so that */
-          /* following `pop' operands use the arguments on stack      */
+          /* subsequent `pop' operands should add the arguments,       */
+          /* this is the implementation described for `unknown' other  */
+          /* subroutines in the Type1 spec.                            */
+          args -= 2 + ( args[-2] >> 16 );
           break;
 
         case cff_op_pop:
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
 
     /* Incremental fonts can optionally override the metrics. */
-    if ( !error                                                              &&
-         face->root.internal->incremental_interface                          &&
+    if ( !error                                                               &&
+         face->root.internal->incremental_interface                           &&
          face->root.internal->incremental_interface->funcs->get_glyph_metrics )
     {
       FT_Incremental_MetricsRec  metrics;
 
 
       metrics.bearing_x = decoder.builder.left_bearing.x;
-      metrics.bearing_y = decoder.builder.left_bearing.y;
+      metrics.bearing_y = 0;
       metrics.advance   = decoder.builder.advance.x;
+      metrics.advance_v = decoder.builder.advance.y;
+
       error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
                 face->root.internal->incremental_interface->object,
                 glyph_index, FALSE, &metrics );
+
       decoder.builder.left_bearing.x = metrics.bearing_x;
-      decoder.builder.left_bearing.y = metrics.bearing_y;
       decoder.builder.advance.x      = metrics.advance;
-      decoder.builder.advance.y      = 0;
+      decoder.builder.advance.y      = metrics.advance_v;
     }
 
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
         if ( has_vertical_info )
           metrics->vertBearingX = metrics->horiBearingX -
                                     metrics->horiAdvance / 2;
-        else
-          ft_synthesize_vertical_metrics( metrics,
-                                          metrics->vertAdvance );
+        else 
+        {
+          if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
+            ft_synthesize_vertical_metrics( metrics,
+                                            metrics->vertAdvance );
+        }
       }
     }
 
index 956817a..38937be 100644 (file)
@@ -28,8 +28,9 @@
 FT_BEGIN_HEADER
 
 
-#define CFF_MAX_OPERANDS     48
-#define CFF_MAX_SUBRS_CALLS  32
+#define CFF_MAX_OPERANDS        48
+#define CFF_MAX_SUBRS_CALLS     32
+#define CFF_MAX_TRANS_ELEMENTS  32
 
 
   /*************************************************************************/
@@ -137,8 +138,7 @@ FT_BEGIN_HEADER
     FT_Bool            read_width;
     FT_Bool            width_only;
     FT_Int             num_hints;
-    FT_Fixed*          buildchar;
-    FT_Int             len_buildchar;
+    FT_Fixed           buildchar[CFF_MAX_TRANS_ELEMENTS];
 
     FT_UInt            num_locals;
     FT_UInt            num_globals;
index e0966e0..bd56c4b 100644 (file)
           cffface->num_glyphs = cff->charstrings_index.count;
 
         /* set global bbox, as well as EM size */
-        cffface->bbox.xMin =   dict->font_bbox.xMin             >> 16;
-        cffface->bbox.yMin =   dict->font_bbox.yMin             >> 16;
-        cffface->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFFU ) >> 16;
-        cffface->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFFU ) >> 16;
+        cffface->bbox.xMin =   dict->font_bbox.xMin            >> 16;
+        cffface->bbox.yMin =   dict->font_bbox.yMin            >> 16;
+        /* no `U' suffix here to 0xFFFF! */
+        cffface->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFF ) >> 16;
+        cffface->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFF ) >> 16;
 
         cffface->units_per_EM = (FT_UShort)( dict->units_per_em );
 
index 947ec9d..01266a1 100644 (file)
           p++;
           for (;;)
           {
+            /* An unterminated floating point number at the */
+            /* end of a dictionary is invalid but harmless. */
             if ( p >= limit )
-              goto Syntax_Error;
+              goto Exit;
             v = p[0] >> 4;
             if ( v == 15 )
               break;
index f59035f..ea61b4e 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    CID-keyed Type1 Glyph Loader (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by       */
+/*  Copyright 1996-2001, 2002, 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,       */
@@ -58,6 +58,8 @@
 #endif
 
 
+    FT_TRACE4(( "cid_load_glyph: glyph index %d\n", glyph_index ));
+
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
 
     /* For incremental fonts get the character data using */
 
 
       metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );
-      metrics.bearing_y = FIXED_TO_INT( decoder->builder.left_bearing.y );
+      metrics.bearing_y = 0;
       metrics.advance   = FIXED_TO_INT( decoder->builder.advance.x );
+      metrics.advance_v = FIXED_TO_INT( decoder->builder.advance.y );
 
       error = inc->funcs->get_glyph_metrics( inc->object,
                                              glyph_index, FALSE, &metrics );
 
       decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );
-      decoder->builder.left_bearing.y = INT_TO_FIXED( metrics.bearing_y );
       decoder->builder.advance.x      = INT_TO_FIXED( metrics.advance );
-      decoder->builder.advance.y      = 0;
+      decoder->builder.advance.y      = INT_TO_FIXED( metrics.advance_v );
     }
 
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
       metrics->horiBearingX = cbox.xMin;
       metrics->horiBearingY = cbox.yMax;
 
-      /* make up vertical ones */
-      ft_synthesize_vertical_metrics( metrics,
-                                      metrics->vertAdvance );
+      if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) 
+      {
+        /* make up vertical ones */
+        ft_synthesize_vertical_metrics( metrics,
+                                        metrics->vertAdvance );
+      }
     }
 
   Exit:
index 9647d87..82678af 100644 (file)
       cidface->num_fixed_sizes = 0;
       cidface->available_sizes = 0;
 
-      cidface->bbox.xMin =   cid->font_bbox.xMin             >> 16;
-      cidface->bbox.yMin =   cid->font_bbox.yMin             >> 16;
-      cidface->bbox.xMax = ( cid->font_bbox.xMax + 0xFFFFU ) >> 16;
-      cidface->bbox.yMax = ( cid->font_bbox.yMax + 0xFFFFU ) >> 16;
+      cidface->bbox.xMin =   cid->font_bbox.xMin            >> 16;
+      cidface->bbox.yMin =   cid->font_bbox.yMin            >> 16;
+      /* no `U' suffix here to 0xFFFF! */
+      cidface->bbox.xMax = ( cid->font_bbox.xMax + 0xFFFF ) >> 16;
+      cidface->bbox.yMax = ( cid->font_bbox.yMax + 0xFFFF ) >> 16;
 
       if ( !cidface->units_per_EM )
         cidface->units_per_EM = 1000;
index 94a3657..904cb09 100644 (file)
@@ -22,7 +22,7 @@
 #define T1CODE        T1_FIELD_LOCATION_CID_INFO
 
   T1_FIELD_KEY   ( "CIDFontName",    cid_font_name, 0 )
-  T1_FIELD_NUM   ( "CIDFontVersion", cid_version,   0 )
+  T1_FIELD_FIXED ( "CIDFontVersion", cid_version,   0 )
   T1_FIELD_NUM   ( "CIDFontType",    cid_font_type, 0 )
   T1_FIELD_STRING( "Registry",       registry,      0 )
   T1_FIELD_STRING( "Ordering",       ordering,      0 )
index 4f601a1..6e57ded 100644 (file)
@@ -8,7 +8,7 @@
 /*  be used to parse compressed PCF fonts, as found with many X11 server   */
 /*  distributions.                                                         */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2009 by                                    */
+/*  Copyright 2004, 2005, 2006, 2009, 2010 by                              */
 /*  Albert Chin-A-Young.                                                   */
 /*                                                                         */
 /*  Based on code in src/gzip/ftgzip.c, Copyright 2004 by                  */
     zip->pos    = 0;
 
     /* check and skip .Z header */
-    {
-      stream = source;
-
-      error = ft_lzw_check_header( source );
-      if ( error )
-        goto Exit;
-    }
+    error = ft_lzw_check_header( source );
+    if ( error )
+      goto Exit;
 
     /* initialize internal lzw variable */
     ft_lzwstate_init( lzw, source );
index 8a38bec..d2f17dc 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType PFR bitmap loader (body).                                   */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2006 by                                          */
+/*  Copyright 2002, 2003, 2006, 2009 by                                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 
     /* get the bitmap metrics */
     {
-      FT_Long   xpos, ypos, advance;
-      FT_UInt   xsize, ysize, format;
+      FT_Long   xpos = 0, ypos = 0, advance = 0;
+      FT_UInt   xsize = 0, ysize = 0, format = 0;
       FT_Byte*  p;
 
 
index b3245a6..31554ff 100644 (file)
@@ -4,7 +4,8 @@
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/*  Copyright 2000-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,       */
 
     /* `glyph_names' is set to 0 for CID fonts which do not */
     /* include an encoding.  How can we deal with these?    */
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+    if ( decoder->glyph_names == 0                   &&
+         !face->root.internal->incremental_interface )
+#else
     if ( decoder->glyph_names == 0 )
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
     {
       FT_ERROR(( "t1operator_seac:"
                  " glyph names table not available in this font\n" ));
         case op_setcurrentpoint:
           FT_TRACE4(( " setcurrentpoint" ));
 
-          /* From the T1 specs, section 6.4:                        */
+          /* From the T1 specification, section 6.4:                */
           /*                                                        */
           /*   The setcurrentpoint command is used only in          */
           /*   conjunction with results from OtherSubrs procedures. */
 
-          /* known_othersubr_result_cnt != 0 is already handled above */
+          /* known_othersubr_result_cnt != 0 is already handled     */
+          /* above.                                                 */
+
+          /* Note, however, that both Ghostscript and Adobe         */
+          /* Distiller handle this situation by silently ignoring   */
+          /* the inappropriate `setcurrentpoint' instruction.  So   */
+          /* we do the same.                                        */
+#if 0
+
           if ( decoder->flex_state != 1 )
           {
             FT_ERROR(( "t1_decoder_parse_charstrings:"
             goto Syntax_Error;
           }
           else
+#endif
             decoder->flex_state = 0;
           break;
 
index 1d157b7..1097efb 100644 (file)
   sfnt_get_interface( FT_Module    module,
                       const char*  module_interface )
   {
-    FT_Library           library = module->library;
-    FT_UNUSED(library);
     FT_UNUSED( module );
 
     return ft_service_list_lookup( FT_SFNT_SERVICES_GET, module_interface );
index cef3cd9..b74b1a9 100644 (file)
@@ -26,6 +26,7 @@
 #include FT_TRUETYPE_IDS_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
+#include FT_SFNT_NAMES_H
 #include "sferrors.h"
 
 #ifdef TT_CONFIG_OPTION_BDF
 #endif
     FT_Bool       has_outline;
     FT_Bool       is_apple_sbit;
+    FT_Bool       ignore_preferred_family = FALSE;
+    FT_Bool       ignore_preferred_subfamily = FALSE;
 
     SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
 
     FT_UNUSED( face_index );
-    FT_UNUSED( num_params );
-    FT_UNUSED( params );
 
+    /* Check parameters */
+    
+    {
+      FT_Int  i;
+
+
+      for ( i = 0; i < num_params; i++ )
+      {
+        if ( params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY )
+          ignore_preferred_family = TRUE;
+        else if ( params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY )
+          ignore_preferred_subfamily = TRUE;
+      }
+    }
 
     /* Load tables */
 
     /* Foundation (WPF).  This flag has been introduced in version   */
     /* 1.5 of the OpenType specification (May 2008).                 */
 
+    face->root.family_name = NULL;
+    face->root.style_name  = NULL;
     if ( face->os2.version != 0xFFFFU && face->os2.fsSelection & 256 )
     {
-      GET_NAME( PREFERRED_FAMILY, &face->root.family_name );
+      if ( !ignore_preferred_family )
+        GET_NAME( PREFERRED_FAMILY, &face->root.family_name );
       if ( !face->root.family_name )
         GET_NAME( FONT_FAMILY, &face->root.family_name );
 
-      GET_NAME( PREFERRED_SUBFAMILY, &face->root.style_name );
+      if ( !ignore_preferred_subfamily )
+        GET_NAME( PREFERRED_SUBFAMILY, &face->root.style_name );
       if ( !face->root.style_name )
         GET_NAME( FONT_SUBFAMILY, &face->root.style_name );
     }
     else
     {
       GET_NAME( WWS_FAMILY, &face->root.family_name );
-      if ( !face->root.family_name )
+      if ( !face->root.family_name && !ignore_preferred_family )
         GET_NAME( PREFERRED_FAMILY, &face->root.family_name );
       if ( !face->root.family_name )
         GET_NAME( FONT_FAMILY, &face->root.family_name );
 
       GET_NAME( WWS_SUBFAMILY, &face->root.style_name );
-      if ( !face->root.style_name )
+      if ( !face->root.style_name && !ignore_preferred_subfamily )
         GET_NAME( PREFERRED_SUBFAMILY, &face->root.style_name );
       if ( !face->root.style_name )
         GET_NAME( FONT_SUBFAMILY, &face->root.style_name );
index 26ea83c..b283f6d 100644 (file)
   }
 
 
-  FT_CALLBACK_TABLE_DEF
-  const TT_CMap_ClassRec  tt_cmap13_class_rec =
-  {
-    {
+  FT_DEFINE_TT_CMAP(tt_cmap13_class_rec,
       sizeof ( TT_CMap13Rec ),
 
       (FT_CMap_InitFunc)     tt_cmap13_init,
       (FT_CMap_CharNextFunc) tt_cmap13_char_next,
 
       NULL, NULL, NULL, NULL, NULL
-    },
+    ,
     13,
     (TT_CMap_ValidateFunc)   tt_cmap13_validate,
     (TT_CMap_Info_GetFunc)   tt_cmap13_get_info
-  };
+  )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_13 */
 
index f08f640..3ad33bd 100644 (file)
   check_table_dir( SFNT_Header  sfnt,
                    FT_Stream    stream )
   {
-    FT_Error  error;
-    FT_UInt   nn, valid_entries = 0;
-    FT_UInt   has_head = 0, has_sing = 0, has_meta = 0;
-    FT_ULong  offset = sfnt->offset + 12;
+    FT_Error   error;
+    FT_UShort  nn, valid_entries = 0;
+    FT_UInt    has_head = 0, has_sing = 0, has_meta = 0;
+    FT_ULong   offset = sfnt->offset + 12;
 
     static const FT_Frame_Field  table_dir_entry_fields[] =
     {
index 4a4d375..846e454 100644 (file)
   /*                                                                       */
   /* <Description>                                                         */
   /*    Walk over an outline's structure to decompose it into individual   */
-  /*    segments and Bzier arcs.  This function is also able to emit      */
+  /*    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.                                    */
   /*                                                                       */
index 19aec50..7f191e1 100644 (file)
@@ -10,7 +10,7 @@
  * accepted if you are using GCC for compilation (and probably by
  * other compilers too).
  *
- * Author: David Turner, 2005, 2006, 2008
+ * Author: David Turner, 2005, 2006, 2008, 2009
  *
  * This code is explicitly placed into the public domain.
  *
@@ -265,7 +265,7 @@ read_header_file( FILE*  file, int  verbose )
           if ( p > name )
           {
             if ( verbose )
-              fprintf( stderr, ">>> %.*s\n", p-name, name );
+              fprintf( stderr, ">>> %.*s\n", (int)(p - name), name );
 
             names_add( name, p );
           }
index dca009a..d723b57 100644 (file)
@@ -4,7 +4,8 @@
 /*                                                                         */
 /*    TrueType font driver implementation (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,       */
     if ( !size )
       return TT_Err_Invalid_Size_Handle;
 
-    if ( !face || glyph_index >= (FT_UInt)face->num_glyphs )
+    if ( !face )
+      return TT_Err_Invalid_Argument;
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+    if ( glyph_index >= (FT_UInt)face->num_glyphs &&
+         !face->internal->incremental_interface   )
+#else
+    if ( glyph_index >= (FT_UInt)face->num_glyphs )
+#endif
       return TT_Err_Invalid_Argument;
 
     if ( load_flags & FT_LOAD_NO_HINTING )
   tt_get_interface( FT_Module    driver,    /* TT_Driver */
                     const char*  tt_interface )
   {
-    FT_Library           library = driver->library;
     FT_Module_Interface  result;
     FT_Module            sfntd;
     SFNT_Service         sfnt;
-    FT_UNUSED(library);
 
     result = ft_service_list_lookup( FT_TT_SERVICES_GET, tt_interface );
     if ( result != NULL )
       return result;
 
+    if ( !driver )
+      return NULL;
+
     /* only return the default interface from the SFNT module */
     sfntd = FT_Get_Module( driver->library, "sfnt" );
     if ( sfntd )
index 28ddb99..57ea0ba 100644 (file)
@@ -4,7 +4,8 @@
 /*                                                                         */
 /*    TrueType 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,       */
@@ -69,7 +70,7 @@
   /* `check' is true, take care of monospaced fonts by returning the       */
   /* advance width maximum.                                                */
   /*                                                                       */
-  FT_LOCAL_DEF(void)
+  FT_LOCAL_DEF( void )
   TT_Get_HMetrics( TT_Face     face,
                    FT_UInt     idx,
                    FT_Bool     check,
@@ -80,6 +81,9 @@
 
     if ( check && face->postscript.isFixedPitch )
       *aw = face->horizontal.advance_Width_Max;
+
+    FT_TRACE5(( "  advance width (font units): %d\n", *aw ));
+    FT_TRACE5(( "  left side bearing (font units): %d\n", *lsb ));
   }
 
 
   /* The monospace `check' is probably not meaningful here, but we leave   */
   /* it in for a consistent interface.                                     */
   /*                                                                       */
-  FT_LOCAL_DEF(void)
+  FT_LOCAL_DEF( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
                    FT_Bool     check,
 
 #endif
 
+    FT_TRACE5(( "  advance height (font units): %d\n", *ah ));
+    FT_TRACE5(( "  top side bearing (font units): %d\n", *tsb ));
+  }
+
+
+  static void
+  tt_get_metrics( TT_Loader  loader,
+                  FT_UInt    glyph_index )
+  {
+    TT_Face  face = (TT_Face)loader->face;
+
+    FT_Short   left_bearing = 0, top_bearing = 0;
+    FT_UShort  advance_width = 0, advance_height = 0;
+
+
+    TT_Get_HMetrics( face, glyph_index,
+                     (FT_Bool)!( loader->load_flags &
+                                 FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ),
+                     &left_bearing,
+                     &advance_width );
+    TT_Get_VMetrics( face, glyph_index,
+                     (FT_Bool)!( loader->load_flags &
+                                 FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ),
+                     &top_bearing,
+                     &advance_height );
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+
+    /* If this is an incrementally loaded font check whether there are */
+    /* overriding metrics for this glyph.                              */
+    if ( face->root.internal->incremental_interface                           &&
+         face->root.internal->incremental_interface->funcs->get_glyph_metrics )
+    {
+      FT_Incremental_MetricsRec  metrics;
+      FT_Error                   error;
+
+
+      metrics.bearing_x = left_bearing;
+      metrics.bearing_y = 0;
+      metrics.advance   = advance_width;
+      metrics.advance_v = 0;
+
+      error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
+                face->root.internal->incremental_interface->object,
+                glyph_index, FALSE, &metrics );
+      if ( error )
+        goto Exit;
+
+      left_bearing  = (FT_Short)metrics.bearing_x;
+      advance_width = (FT_UShort)metrics.advance;
+
+#if 0
+
+      /* GWW: Do I do the same for vertical metrics? */
+      metrics.bearing_x = 0;
+      metrics.bearing_y = top_bearing;
+      metrics.advance   = advance_height;
+
+      error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
+                face->root.internal->incremental_interface->object,
+                glyph_index, TRUE, &metrics );
+      if ( error )
+        goto Exit;
+
+      top_bearing    = (FT_Short)metrics.bearing_y;
+      advance_height = (FT_UShort)metrics.advance;
+
+#endif /* 0 */
+
+    }
+
+  Exit:
+
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+
+    loader->left_bearing = left_bearing;
+    loader->advance      = advance_width;
+    loader->top_bearing  = top_bearing;
+    loader->vadvance     = advance_height;
+
+    if ( !loader->linear_def )
+    {
+      loader->linear_def = 1;
+      loader->linear     = advance_width;
+    }
   }
 
 
   static FT_Error
   load_truetype_glyph( TT_Loader  loader,
                        FT_UInt    glyph_index,
-                       FT_UInt    recurse_count )
+                       FT_UInt    recurse_count,
+                       FT_Bool    header_only )
   {
-    FT_Error        error;
+    FT_Error        error        = TT_Err_Ok;
     FT_Fixed        x_scale, y_scale;
     FT_ULong        offset;
     TT_Face         face         = (TT_Face)loader->face;
       y_scale = 0x10000L;
     }
 
-    /* get metrics, horizontal and vertical */
-    {
-      FT_Short   left_bearing = 0, top_bearing = 0;
-      FT_UShort  advance_width = 0, advance_height = 0;
-
-
-      TT_Get_HMetrics( face, glyph_index,
-                       (FT_Bool)!( loader->load_flags &
-                                   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ),
-                       &left_bearing,
-                       &advance_width );
-      TT_Get_VMetrics( face, glyph_index,
-                       (FT_Bool)!( loader->load_flags &
-                                   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ),
-                       &top_bearing,
-                       &advance_height );
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
-
-      /* If this is an incrementally loaded font see if there are */
-      /* overriding metrics for this glyph.                       */
-      if ( face->root.internal->incremental_interface &&
-           face->root.internal->incremental_interface->funcs->get_glyph_metrics )
-      {
-        FT_Incremental_MetricsRec  metrics;
-
-
-        metrics.bearing_x = left_bearing;
-        metrics.bearing_y = 0;
-        metrics.advance = advance_width;
-        error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
-                  face->root.internal->incremental_interface->object,
-                  glyph_index, FALSE, &metrics );
-        if ( error )
-          goto Exit;
-        left_bearing  = (FT_Short)metrics.bearing_x;
-        advance_width = (FT_UShort)metrics.advance;
-
-#if 0
-
-        /* GWW: Do I do the same for vertical metrics? */
-        metrics.bearing_x = 0;
-        metrics.bearing_y = top_bearing;
-        metrics.advance = advance_height;
-        error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
-                  face->root.internal->incremental_interface->object,
-                  glyph_index, TRUE, &metrics );
-        if ( error )
-          goto Exit;
-        top_bearing  = (FT_Short)metrics.bearing_y;
-        advance_height = (FT_UShort)metrics.advance;
-
-#endif /* 0 */
-
-      }
-
-#endif /* FT_CONFIG_OPTION_INCREMENTAL */
-
-      loader->left_bearing = left_bearing;
-      loader->advance      = advance_width;
-      loader->top_bearing  = top_bearing;
-      loader->vadvance     = advance_height;
-
-      if ( !loader->linear_def )
-      {
-        loader->linear_def = 1;
-        loader->linear     = advance_width;
-      }
-    }
+    tt_get_metrics( loader, glyph_index );
 
     /* Set `offset' to the start of the glyph relative to the start of */
     /* the `glyf' table, and `byte_len' to the length of the glyph in  */
 
     if ( loader->byte_len > 0 )
     {
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+      /* for the incremental interface, `glyf_offset' is always zero */
+      if ( !loader->glyf_offset                        &&
+           !face->root.internal->incremental_interface )
+#else
       if ( !loader->glyf_offset )
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
       {
         FT_TRACE2(( "no `glyf' table but non-zero `loca' entry\n" ));
         error = TT_Err_Invalid_Table;
 
       opened_frame = 1;
 
-      /* read first glyph header */
+      /* read glyph header first */
       error = face->read_glyph_header( loader );
-      if ( error )
+      if ( error || header_only )
         goto Exit;
     }
 
       loader->bbox.yMin = 0;
       loader->bbox.yMax = 0;
 
+      if ( header_only )
+        goto Exit;
+
       TT_LOADER_SET_PP( loader );
 
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
           num_base_points = gloader->base.outline.n_points;
 
           error = load_truetype_glyph( loader, subglyph->index,
-                                       recurse_count + 1 );
+                                       recurse_count + 1, FALSE );
           if ( error )
             goto Exit;
 
       /* scale the metrics */
       if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )
       {
-        top     = FT_MulFix( top, y_scale );
+        top     = FT_MulFix( top,     y_scale );
         advance = FT_MulFix( advance, y_scale );
       }
 
       glyph->metrics.vertAdvance  = (FT_Pos)metrics.vertAdvance  << 6;
 
       glyph->format = FT_GLYPH_FORMAT_BITMAP;
+
       if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
       {
         glyph->bitmap_left = metrics.vertBearingX;
   tt_loader_init( TT_Loader     loader,
                   TT_Size       size,
                   TT_GlyphSlot  glyph,
-                  FT_Int32      load_flags )
+                  FT_Int32      load_flags,
+                  FT_Bool       glyf_table_only )
   {
     TT_Face    face;
     FT_Stream  stream;
 #ifdef TT_USE_BYTECODE_INTERPRETER
 
     /* load execution context */
-    if ( IS_HINTED( load_flags ) )
+    if ( IS_HINTED( load_flags ) && !glyf_table_only )
     {
       TT_ExecContext  exec;
       FT_Bool         grayscale;
     }
 
     /* get face's glyph loader */
+    if ( !glyf_table_only )
     {
       FT_GlyphLoader  gloader = glyph->internal->loader;
 
     {
       error = load_sbit_image( size, glyph, glyph_index, load_flags );
       if ( !error )
+      {
+        FT_Face  root = &face->root;
+
+
+        if ( FT_IS_SCALABLE( root ) )
+        {
+          /* for the bbox we need the header only */
+          (void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );
+          (void)load_truetype_glyph( &loader, glyph_index, 0, TRUE );
+          glyph->linearHoriAdvance = loader.linear;
+          glyph->linearVertAdvance = loader.top_bearing + loader.bbox.yMax -
+                                       loader.vadvance;
+          if ( face->postscript.isFixedPitch                             &&
+               ( load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) == 0 )
+            glyph->linearHoriAdvance = face->horizontal.advance_Width_Max;
+        }
+
         return TT_Err_Ok;
+      }
     }
 
 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
     if ( load_flags & FT_LOAD_SBITS_ONLY )
       return TT_Err_Invalid_Argument;
 
-    error = tt_loader_init( &loader, size, glyph, load_flags );
+    error = tt_loader_init( &loader, size, glyph, load_flags, FALSE );
     if ( error )
       return error;
 
     glyph->outline.flags = 0;
 
     /* main loading loop */
-    error = load_truetype_glyph( &loader, glyph_index, 0 );
+    error = load_truetype_glyph( &loader, glyph_index, 0, FALSE );
     if ( !error )
     {
       if ( glyph->format == FT_GLYPH_FORMAT_COMPOSITE )
index 1456a8c..ef25aaf 100644 (file)
 #define ALL_POINTS  (FT_UShort*)( -1 )
 
 
-  enum
-  {
-    GX_PT_POINTS_ARE_WORDS     = 0x80,
-    GX_PT_POINT_RUN_COUNT_MASK = 0x7F
-  };
+#define GX_PT_POINTS_ARE_WORDS      0x80
+#define GX_PT_POINT_RUN_COUNT_MASK  0x7F
 
 
   /*************************************************************************/
                            FT_Offset  delta_cnt )
   {
     FT_Short  *deltas;
-    FT_Int     runcnt;
+    FT_UInt    runcnt;
     FT_Offset  i;
-    FT_Offset  j;
+    FT_UInt    j;
     FT_Memory  memory = stream->memory;
     FT_Error   error = TT_Err_Ok;
 
index 16dc471..ef34390 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM support for Type 1 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,       */
@@ -58,7 +58,7 @@
 
 
     /* PS string/name length must be < 16-bit */
-    if ( ( len - 0xFFFFU ) > 0 )
+    if ( len > 0xFFFFU )
       return 0;
 
     for ( n = 0; n < type1->num_glyphs; n++ )
     {
       t1_font->font_bbox = fi->FontBBox;
 
-      t1_face->bbox.xMin =   fi->FontBBox.xMin             >> 16;
-      t1_face->bbox.yMin =   fi->FontBBox.yMin             >> 16;
-      t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFFU ) >> 16;
-      t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFFU ) >> 16;
+      t1_face->bbox.xMin =   fi->FontBBox.xMin            >> 16;
+      t1_face->bbox.yMin =   fi->FontBBox.yMin            >> 16;
+      /* no `U' suffix here to 0xFFFF! */
+      t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFF ) >> 16;
+      t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFF ) >> 16;
 
-      t1_face->ascender  = (FT_Short)( ( fi->Ascender  + 0x8000U ) >> 16 );
-      t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000U ) >> 16 );
+      /* no `U' suffix here to 0x8000! */
+      t1_face->ascender  = (FT_Short)( ( fi->Ascender  + 0x8000 ) >> 16 );
+      t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 );
 
       if ( fi->NumKernPair )
       {
index 1658615..f3fad4f 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 Glyph Loader (body).                                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by       */
+/*  Copyright 1996-2001, 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,       */
 
 
       metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );
-      metrics.bearing_y = FIXED_TO_INT( decoder->builder.left_bearing.y );
+      metrics.bearing_y = 0;
       metrics.advance   = FIXED_TO_INT( decoder->builder.advance.x );
+      metrics.advance_v = FIXED_TO_INT( decoder->builder.advance.y );
 
       error = inc->funcs->get_glyph_metrics( inc->object,
                                              glyph_index, FALSE, &metrics );
 
       decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );
-      decoder->builder.left_bearing.y = INT_TO_FIXED( metrics.bearing_y );
       decoder->builder.advance.x      = INT_TO_FIXED( metrics.advance );
-      decoder->builder.advance.y      = 0;
+      decoder->builder.advance.y      = INT_TO_FIXED( metrics.advance_v );
     }
 
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
 #endif
 
 
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+    if ( glyph_index >= (FT_UInt)face->root.num_glyphs &&
+         !face->root.internal->incremental_interface   )
+#else
     if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
     {
       error = T1_Err_Invalid_Argument;
       goto Exit;
           FIXED_TO_INT( decoder.builder.advance.x );
         glyph->root.internal->glyph_transformed = 0;
 
-        /* make up vertical ones */
-        metrics->vertAdvance = ( face->type1.font_bbox.yMax -
-                                 face->type1.font_bbox.yMin ) >> 16;
-        glyph->root.linearVertAdvance = metrics->vertAdvance;
+        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) 
+        {
+          /* make up vertical ones */
+          metrics->vertAdvance = ( face->type1.font_bbox.yMax -
+                                   face->type1.font_bbox.yMin ) >> 16;
+          glyph->root.linearVertAdvance = metrics->vertAdvance;
+        }
+        else
+        {
+          metrics->vertAdvance =
+            FIXED_TO_INT( decoder.builder.advance.y );
+          glyph->root.linearVertAdvance =
+            FIXED_TO_INT( decoder.builder.advance.y );
+        }
 
         glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
 
         metrics->horiBearingX = cbox.xMin;
         metrics->horiBearingY = cbox.yMax;
 
-        /* make up vertical ones */
-        ft_synthesize_vertical_metrics( metrics,
-                                        metrics->vertAdvance );
+        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) 
+        {
+          /* make up vertical ones */
+          ft_synthesize_vertical_metrics( metrics,
+                                          metrics->vertAdvance );
+        }
       }
 
       /* Set control data to the glyph charstrings.  Note that this is */
index e9357e6..b1de687 100644 (file)
       root->num_fixed_sizes = 0;
       root->available_sizes = 0;
 
-      root->bbox.xMin =   type1->font_bbox.xMin             >> 16;
-      root->bbox.yMin =   type1->font_bbox.yMin             >> 16;
-      root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFFU ) >> 16;
-      root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFFU ) >> 16;
+      root->bbox.xMin =   type1->font_bbox.xMin            >> 16;
+      root->bbox.yMin =   type1->font_bbox.yMin            >> 16;
+      /* no `U' suffix here to 0xFFFF! */
+      root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFF ) >> 16;
+      root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFF ) >> 16;
 
       /* Set units_per_EM if we didn't set it in parse_font_matrix. */
       if ( !root->units_per_EM )
index 1bef56b..2a76227 100644 (file)
 
       T1_Skip_PS_Token( parser );
       cur = parser->root.cursor;
-      if ( *cur == '\r' )
-      {
-        cur++;
-        if ( *cur == '\n' )
-          cur++;
-      }
-      else if ( *cur == '\n' )
-        cur++;
-      else
+
+      /* according to the Type1 spec, the first cipher byte must not be  */
+      /* an ASCII whitespace character code (blank, tab, carriage return */
+      /* or line feed).  We have seen Type 1 fonts with two line feed    */
+      /* characters...  So skip now all whitespace character codes.      */
+      while ( cur < limit       &&
+              ( *cur == ' '  ||
+                *cur == '\t' || 
+                *cur == '\r' ||
+                *cur == '\n' ) )
+        ++cur;
+      if ( cur >= limit )
       {
         FT_ERROR(( "T1_Get_Private_Dict:"
                    " `eexec' not properly terminated\n" ));